incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1189806 [46/46] - in /incubator/accumulo: branches/1.3/contrib/ branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/ branches/1.3/src/core/src/main/java/org/apache/accumulo/core/client/admin/ branches/1.3/src/core/src/main/...
Date Thu, 27 Oct 2011 15:25:17 GMT
Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/TabletOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/TabletOperations.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/TabletOperations.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/TabletOperations.java Thu Oct 27 15:24:51 2011
@@ -41,13 +41,16 @@ public class TabletOperations {
         if (endRow == null) {
           lowDirectory = Constants.DEFAULT_TABLET_LOCATION;
           Path lowDirectoryPath = new Path(tableDir + lowDirectory);
-          if (fs.exists(lowDirectoryPath) || fs.mkdirs(lowDirectoryPath)) return lowDirectory;
+          if (fs.exists(lowDirectoryPath) || fs.mkdirs(lowDirectoryPath))
+            return lowDirectory;
           log.warn("Failed to create " + lowDirectoryPath + " for unknown reason");
         } else {
           lowDirectory = "/t-" + namer.getNextName();
           Path lowDirectoryPath = new Path(tableDir + lowDirectory);
-          if (fs.exists(lowDirectoryPath)) throw new IllegalStateException("Dir exist when it should not " + lowDirectoryPath);
-          if (fs.mkdirs(lowDirectoryPath)) return lowDirectory;
+          if (fs.exists(lowDirectoryPath))
+            throw new IllegalStateException("Dir exist when it should not " + lowDirectoryPath);
+          if (fs.mkdirs(lowDirectoryPath))
+            return lowDirectory;
         }
       } catch (IOException e) {
         log.warn(e);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java Thu Oct 27 15:24:51 2011
@@ -96,8 +96,8 @@ public class VerifyTabletAssignments {
     try {
       cl = new BasicParser().parse(opts, args);
       
-      if (cl.hasOption(zooKeeperInstance.getOpt()) && cl.getOptionValues(zooKeeperInstance.getOpt()).length != 2) throw new MissingArgumentException(
-          zooKeeperInstance);
+      if (cl.hasOption(zooKeeperInstance.getOpt()) && cl.getOptionValues(zooKeeperInstance.getOpt()).length != 2)
+        throw new MissingArgumentException(zooKeeperInstance);
       
       user = cl.getOptionValue(usernameOption.getOpt());
       passw = cl.getOptionValue(passwOption.getOpt());
@@ -109,13 +109,15 @@ public class VerifyTabletAssignments {
         instance = HdfsZooInstance.getInstance();
       }
       
-      if (passw == null) passw = reader.readLine("Enter current password for '" + user + "'@'" + instance.getInstanceName() + "': ", '*');
+      if (passw == null)
+        passw = reader.readLine("Enter current password for '" + user + "'@'" + instance.getInstanceName() + "': ", '*');
       if (passw == null) {
         reader.printNewline();
         return;
       } // user canceled
       
-      if (cl.getArgs().length != 0) throw new ParseException("Unrecognized arguments: " + cl.getArgList());
+      if (cl.getArgs().length != 0)
+        throw new ParseException("Unrecognized arguments: " + cl.getArgList());
       
     } catch (ParseException e) {
       PrintWriter pw = new PrintWriter(System.err);
@@ -134,8 +136,10 @@ public class VerifyTabletAssignments {
   private static void checkTable(final String user, final String pass, String table, HashSet<KeyExtent> check, boolean verbose) throws AccumuloException,
       AccumuloSecurityException, TableNotFoundException, InterruptedException {
     
-    if (check == null) System.out.println("Checking table " + table);
-    else System.out.println("Checking table " + table + " again, failures " + check.size());
+    if (check == null)
+      System.out.println("Checking table " + table);
+    else
+      System.out.println("Checking table " + table + " again, failures " + check.size());
     
     Map<KeyExtent,String> locations = new TreeMap<KeyExtent,String>();
     SortedSet<KeyExtent> tablets = new TreeSet<KeyExtent>();
@@ -146,8 +150,10 @@ public class VerifyTabletAssignments {
     final HashSet<KeyExtent> failures = new HashSet<KeyExtent>();
     
     for (KeyExtent keyExtent : tablets)
-      if (!locations.containsKey(keyExtent)) System.out.println(" Tablet " + keyExtent + " has no location");
-      else if (verbose) System.out.println(" Tablet " + keyExtent + " is located at " + locations.get(keyExtent));
+      if (!locations.containsKey(keyExtent))
+        System.out.println(" Tablet " + keyExtent + " has no location");
+      else if (verbose)
+        System.out.println(" Tablet " + keyExtent + " is located at " + locations.get(keyExtent));
     
     Map<String,List<KeyExtent>> extentsPerServer = new TreeMap<String,List<KeyExtent>>();
     
@@ -158,7 +164,8 @@ public class VerifyTabletAssignments {
         extentsPerServer.put(entry.getValue(), extentList);
       }
       
-      if (check == null || check.contains(entry.getKey())) extentList.add(entry.getKey());
+      if (check == null || check.contains(entry.getKey()))
+        extentList.add(entry.getKey());
     }
     
     ExecutorService tp = Executors.newFixedThreadPool(20);
@@ -186,7 +193,8 @@ public class VerifyTabletAssignments {
     
     while (!tp.awaitTermination(1, TimeUnit.HOURS)) {}
     
-    if (failures.size() > 0) checkTable(user, pass, table, failures, verbose);
+    if (failures.size() > 0)
+      checkTable(user, pass, table, failures, verbose);
   }
   
   private static void checkFailures(String server, HashSet<KeyExtent> failures, MultiScanResult scanResult) {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/ZooZap.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/ZooZap.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/ZooZap.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/ZooZap.java Thu Oct 27 15:24:51 2011
@@ -33,7 +33,8 @@ public class ZooZap {
    * @param args
    */
   private static void message(String msg) {
-    if (verbose) System.out.println(msg);
+    if (verbose)
+      System.out.println(msg);
   }
   
   public static void main(String[] args) {
@@ -81,7 +82,8 @@ public class ZooZap {
         for (String child : children) {
           message("Deleting " + tserversPath + "/" + child + " from zookeeper");
           
-          if (zapMaster) ZooReaderWriter.getInstance().recursiveDelete(tserversPath + "/" + child, NodeMissingPolicy.SKIP);
+          if (zapMaster)
+            ZooReaderWriter.getInstance().recursiveDelete(tserversPath + "/" + child, NodeMissingPolicy.SKIP);
           else {
             String path = tserversPath + "/" + child;
             if (zoo.getChildren(path).size() > 0) {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/getSlaves.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/getSlaves.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/getSlaves.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/getSlaves.java Thu Oct 27 15:24:51 2011
@@ -41,7 +41,8 @@ public class getSlaves {
       all.append(new String(buffer, 0, n));
     for (String slave : all.toString().split("\n")) {
       slave = slave.trim();
-      if (slave.length() > 0 && slave.indexOf("#") < 0) result.add(slave);
+      if (slave.length() > 0 && slave.indexOf("#") < 0)
+        result.add(slave);
     }
     return result;
   }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/time/BaseRelativeTime.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/time/BaseRelativeTime.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/time/BaseRelativeTime.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/time/BaseRelativeTime.java Thu Oct 27 15:24:51 2011
@@ -41,7 +41,8 @@ public class BaseRelativeTime implements
   synchronized public long currentTime() {
     long localNow = local.currentTime();
     long result = localNow + diff;
-    if (result < lastReportedTime) return lastReportedTime;
+    if (result < lastReportedTime)
+      return lastReportedTime;
     lastReportedTime = result;
     return result;
   }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/time/SimpleTimer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/time/SimpleTimer.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/time/SimpleTimer.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/util/time/SimpleTimer.java Thu Oct 27 15:24:51 2011
@@ -30,7 +30,8 @@ public class SimpleTimer {
   private Timer timer;
   
   public static synchronized SimpleTimer getInstance() {
-    if (instance == null) instance = new SimpleTimer();
+    if (instance == null)
+      instance = new SimpleTimer();
     return instance;
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/DistributedReadWriteLock.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/DistributedReadWriteLock.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/DistributedReadWriteLock.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/DistributedReadWriteLock.java Thu Oct 27 15:24:51 2011
@@ -44,7 +44,8 @@ public class DistributedReadWriteLock im
     }
     
     public ParsedLock(byte[] lockData) {
-      if (lockData == null || lockData.length < 1) throw new IllegalArgumentException();
+      if (lockData == null || lockData.length < 1)
+        throw new IllegalArgumentException();
       
       int split = -1;
       for (int i = 0; i < lockData.length; i++) {
@@ -54,7 +55,8 @@ public class DistributedReadWriteLock im
         }
       }
       
-      if (split == -1) throw new IllegalArgumentException();
+      if (split == -1)
+        throw new IllegalArgumentException();
       
       this.type = LockType.valueOf(new String(lockData, 0, split));
       this.userData = Arrays.copyOfRange(lockData, split + 1, lockData.length);
@@ -121,7 +123,8 @@ public class DistributedReadWriteLock im
     public void lock() {
       while (true) {
         try {
-          if (tryLock(1, TimeUnit.DAYS)) return;
+          if (tryLock(1, TimeUnit.DAYS))
+            return;
         } catch (InterruptedException ex) {
           // ignored
         }
@@ -131,7 +134,8 @@ public class DistributedReadWriteLock im
     @Override
     public void lockInterruptibly() throws InterruptedException {
       while (!Thread.currentThread().isInterrupted()) {
-        if (tryLock(100, TimeUnit.MILLISECONDS)) return;
+        if (tryLock(100, TimeUnit.MILLISECONDS))
+          return;
       }
     }
     
@@ -144,8 +148,10 @@ public class DistributedReadWriteLock im
       SortedMap<Long,byte[]> entries = qlock.getEarlierEntries(entry);
       for (Entry<Long,byte[]> entry : entries.entrySet()) {
         ParsedLock parsed = new ParsedLock(entry.getValue());
-        if (entry.getKey().equals(this.entry)) return true;
-        if (parsed.type == LockType.WRITE) return false;
+        if (entry.getKey().equals(this.entry))
+          return true;
+        if (parsed.type == LockType.WRITE)
+          return false;
       }
       throw new IllegalStateException("Did not find our own lock in the queue: " + this.entry + " userData " + new String(this.userData) + " lockType "
           + lockType());
@@ -156,7 +162,8 @@ public class DistributedReadWriteLock im
       long now = System.currentTimeMillis();
       long returnTime = now + TimeUnit.MILLISECONDS.convert(time, unit);
       while (returnTime > now) {
-        if (tryLock()) return true;
+        if (tryLock())
+          return true;
         // TODO: do something better than poll
         UtilWaitThread.sleep(100);
         now = System.currentTimeMillis();
@@ -166,7 +173,8 @@ public class DistributedReadWriteLock im
     
     @Override
     public void unlock() {
-      if (entry == -1) return;
+      if (entry == -1)
+        return;
       log.debug("Removing lock entry " + entry + " userData " + new String(this.userData) + " lockType " + lockType());
       qlock.removeEntry(entry);
       entry = -1;
@@ -201,9 +209,11 @@ public class DistributedReadWriteLock im
       }
       SortedMap<Long,byte[]> entries = qlock.getEarlierEntries(entry);
       Iterator<Entry<Long,byte[]>> iterator = entries.entrySet().iterator();
-      if (!iterator.hasNext()) throw new IllegalStateException("Did not find our own lock in the queue: " + this.entry + " userData "
-          + new String(this.userData) + " lockType " + lockType());
-      if (iterator.next().getKey().equals(entry)) return true;
+      if (!iterator.hasNext())
+        throw new IllegalStateException("Did not find our own lock in the queue: " + this.entry + " userData " + new String(this.userData) + " lockType "
+            + lockType());
+      if (iterator.next().getKey().equals(entry))
+        return true;
       return false;
     }
   }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/TransactionWatcher.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/TransactionWatcher.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/TransactionWatcher.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/TransactionWatcher.java Thu Oct 27 15:24:51 2011
@@ -78,7 +78,8 @@ public class TransactionWatcher {
         throw new Exception("Transaction " + tid + " of type " + ztxBulk + " is no longer active");
       }
       AtomicInteger count = counts.get(tid);
-      if (count == null) counts.put(tid, count = new AtomicInteger());
+      if (count == null)
+        counts.put(tid, count = new AtomicInteger());
       count.incrementAndGet();
     }
     try {
@@ -89,7 +90,8 @@ public class TransactionWatcher {
         if (count == null) {
           log.error("unexpected missing count for transaction" + tid);
         } else {
-          if (count.decrementAndGet() == 0) counts.remove(tid);
+          if (count.decrementAndGet() == 0)
+            counts.remove(tid);
         }
       }
     }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooLock.java Thu Oct 27 15:24:51 2011
@@ -177,7 +177,8 @@ public class ZooLock implements Watcher 
       
     });
     
-    if (stat == null) lockAsync(myLock, lw);
+    if (stat == null)
+      lockAsync(myLock, lw);
   }
   
   public synchronized void lockAsync(final AsyncLockWatcher lw, byte data[]) {
@@ -311,7 +312,8 @@ public class ZooLock implements Watcher 
     Collections.sort(children);
     
     String lockNode = children.get(0);
-    if (!lid.node.equals(lockNode)) return false;
+    if (!lid.node.equals(lockNode))
+      return false;
     
     Stat stat = zk.exists(lid.path + "/" + lid.node, false);
     return stat != null && stat.getEphemeralOwner() == lid.eid;
@@ -329,7 +331,8 @@ public class ZooLock implements Watcher 
     Collections.sort(children);
     
     String lockNode = children.get(0);
-    if (!lid.node.equals(lockNode)) return false;
+    if (!lid.node.equals(lockNode))
+      return false;
     
     Stat stat = new Stat();
     return zc.get(lid.path + "/" + lid.node, stat) != null && stat.getEphemeralOwner() == lid.eid;
@@ -388,7 +391,8 @@ public class ZooLock implements Watcher 
     String lockNode = children.get(0);
     
     Stat stat = new Stat();
-    if (zc.get(path + "/" + lockNode, stat) != null) return stat.getEphemeralOwner();
+    if (zc.get(path + "/" + lockNode, stat) != null)
+      return stat.getEphemeralOwner();
     return 0;
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooQueueLock.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooQueueLock.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooQueueLock.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooQueueLock.java Thu Oct 27 15:24:51 2011
@@ -86,7 +86,8 @@ public class ZooQueueLock implements Que
         try {
           byte[] data = zoo.getData(path + "/" + name, null);
           long order = Long.parseLong(name.substring(PREFIX.length()));
-          if (order <= entry) result.put(order, data);
+          if (order <= entry)
+            result.put(order, data);
         } catch (KeeperException.NoNodeException ex) {
           // ignored
         }
@@ -123,11 +124,13 @@ public class ZooQueueLock implements Que
     Lock readLock2 = rlocker.readLock();
     readLock2.lock();
     Lock writeLock = wlocker.writeLock();
-    if (writeLock.tryLock(100, TimeUnit.MILLISECONDS)) throw new RuntimeException("Write lock achieved during read lock!");
+    if (writeLock.tryLock(100, TimeUnit.MILLISECONDS))
+      throw new RuntimeException("Write lock achieved during read lock!");
     readLock.unlock();
     readLock2.unlock();
     writeLock.lock();
-    if (readLock.tryLock(100, TimeUnit.MILLISECONDS)) throw new RuntimeException("Read lock achieved during write lock!");
+    if (readLock.tryLock(100, TimeUnit.MILLISECONDS))
+      throw new RuntimeException("Read lock achieved during write lock!");
     Lock writeLock2 = DistributedReadWriteLock.recoverLock(lock, "wlocker".getBytes());
     writeLock2.unlock();
     readLock.lock();

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReaderWriter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReaderWriter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReaderWriter.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReaderWriter.java Thu Oct 27 15:24:51 2011
@@ -47,7 +47,7 @@ public class ZooReaderWriter extends Zoo
   private static ZooReaderWriter instance = null;
   private static IZooReaderWriter retryingInstance = null;
   private final String auth;
-
+  
   @Override
   public ZooKeeper getZooKeeper() {
     SecurityManager sm = System.getSecurityManager();
@@ -130,7 +130,8 @@ public class ZooReaderWriter extends Zoo
       Stat stat = new Stat();
       byte[] data = getZooKeeper().getData(zPath, false, stat);
       data = mutator.mutate(data);
-      if (data == null) return data;
+      if (data == null)
+        return data;
       try {
         getZooKeeper().setData(zPath, data, stat.getVersion());
         return data;
@@ -156,22 +157,22 @@ public class ZooReaderWriter extends Zoo
    */
   public static synchronized IZooReaderWriter getRetryingInstance() {
     
-    if(retryingInstance == null){
+    if (retryingInstance == null) {
       final IZooReaderWriter inst = getInstance();
       
       InvocationHandler ih = new InvocationHandler() {
         @Override
         public Object invoke(Object obj, Method method, Object[] args) throws Throwable {
           long retryTime = 250;
-          while(true){
+          while (true) {
             try {
               return method.invoke(inst, args);
             } catch (InvocationTargetException e) {
-              if(e.getCause() instanceof KeeperException.ConnectionLossException){
-                Logger.getLogger(ZooReaderWriter.class).warn("Error connecting to zookeeper, will retry in "+retryTime, e.getCause());
+              if (e.getCause() instanceof KeeperException.ConnectionLossException) {
+                Logger.getLogger(ZooReaderWriter.class).warn("Error connecting to zookeeper, will retry in " + retryTime, e.getCause());
                 UtilWaitThread.sleep(retryTime);
                 retryTime = Math.min(5000, retryTime + 250);
-              }else{
+              } else {
                 throw e.getCause();
               }
             }
@@ -179,7 +180,7 @@ public class ZooReaderWriter extends Zoo
         }
       };
       
-      retryingInstance = (IZooReaderWriter) Proxy.newProxyInstance(ZooReaderWriter.class.getClassLoader(),new Class[] {IZooReaderWriter.class}, ih);
+      retryingInstance = (IZooReaderWriter) Proxy.newProxyInstance(ZooReaderWriter.class.getClassLoader(), new Class[] {IZooReaderWriter.class}, ih);
     }
     
     return retryingInstance;
@@ -192,9 +193,12 @@ public class ZooReaderWriter extends Zoo
   
   @Override
   public void mkdirs(String path) throws KeeperException, InterruptedException {
-    if (path.equals("")) return;
-    if (!path.startsWith("/")) throw new IllegalArgumentException(path + "does not start with /");
-    if (getZooKeeper().exists(path, false) != null) return;
+    if (path.equals(""))
+      return;
+    if (!path.startsWith("/"))
+      throw new IllegalArgumentException(path + "does not start with /");
+    if (getZooKeeper().exists(path, false) != null)
+      return;
     String parent = path.substring(0, path.lastIndexOf("/"));
     mkdirs(parent);
     putPersistentData(path, new byte[] {}, NodeExistsPolicy.SKIP);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReservation.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReservation.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReservation.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/zookeeper/ZooReservation.java Thu Oct 27 15:24:51 2011
@@ -27,7 +27,8 @@ import org.apache.zookeeper.data.Stat;
 public class ZooReservation {
   
   public static boolean attempt(IZooReaderWriter zk, String path, String reservationID, String debugInfo) throws KeeperException, InterruptedException {
-    if (reservationID.contains(":")) throw new IllegalArgumentException();
+    if (reservationID.contains(":"))
+      throw new IllegalArgumentException();
     
     while (true) {
       try {

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/logger/LogFileTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/logger/LogFileTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/logger/LogFileTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/logger/LogFileTest.java Thu Oct 27 15:24:51 2011
@@ -68,12 +68,13 @@ public class LogFileTest {
   }
   
   static void assertEqualsMutations(Mutation[] a, Mutation[] b) {
-    if (a.length == b.length) for (int i = 0; i < a.length; i++) {
-      assertEquals(a[i], b[i]);
-      Collection<ColumnUpdate> au = a[i].getUpdates();
-      Collection<ColumnUpdate> bu = a[i].getUpdates();
-      assertEquals(au, bu);
-    }
+    if (a.length == b.length)
+      for (int i = 0; i < a.length; i++) {
+        assertEquals(a[i], b[i]);
+        Collection<ColumnUpdate> au = a[i].getUpdates();
+        Collection<ColumnUpdate> bu = a[i].getUpdates();
+        assertEquals(au, bu);
+      }
   }
   
   @Test

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/logger/TestLogWriter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/logger/TestLogWriter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/logger/TestLogWriter.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/logger/TestLogWriter.java Thu Oct 27 15:24:51 2011
@@ -110,7 +110,8 @@ public class TestLogWriter {
     writer.startCopy(null, CREDENTIALS, logFile.name, "mylog", false);
     for (int i = 0; i < 100; i++) {
       UtilWaitThread.sleep(100);
-      if (fs.exists(mylog)) break;
+      if (fs.exists(mylog))
+        break;
     }
     assertTrue(fs.exists(mylog));
     Mutation m = new Mutation(new Text("row1"));

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java Thu Oct 27 15:24:51 2011
@@ -58,7 +58,8 @@ public class DefaultLoadBalancerTest {
       for (KeyExtent extent : extents) {
         String table = extent.getTableId().toString();
         TableInfo info = result.tableMap.get(table);
-        if (info == null) result.tableMap.put(table, info = new TableInfo());
+        if (info == null)
+          result.tableMap.put(table, info = new TableInfo());
         info.onlineTablets++;
         info.recs = info.onlineTablets;
         info.ingestRate = 123.;
@@ -191,9 +192,11 @@ public class DefaultLoadBalancerTest {
     while (true) {
       List<TabletMigration> migrationsOut = new ArrayList<TabletMigration>();
       balancer.balance(getAssignments(servers), migrations, migrationsOut);
-      if (migrationsOut.size() == 0) break;
+      if (migrationsOut.size() == 0)
+        break;
       for (TabletMigration migration : migrationsOut) {
-        if (servers.get(migration.oldServer).extents.remove(migration.tablet)) moved++;
+        if (servers.get(migration.oldServer).extents.remove(migration.tablet))
+          moved++;
         servers.get(migration.newServer).extents.add(migration.tablet);
       }
     }
@@ -233,9 +236,11 @@ public class DefaultLoadBalancerTest {
     while (true) {
       List<TabletMigration> migrationsOut = new ArrayList<TabletMigration>();
       balancer.balance(getAssignments(servers), migrations, migrationsOut);
-      if (migrationsOut.size() == 0) break;
+      if (migrationsOut.size() == 0)
+        break;
       for (TabletMigration migration : migrationsOut) {
-        if (servers.get(migration.oldServer).extents.remove(migration.tablet)) moved++;
+        if (servers.get(migration.oldServer).extents.remove(migration.tablet))
+          moved++;
         servers.get(migration.newServer).extents.add(migration.tablet);
       }
     }
@@ -248,15 +253,18 @@ public class DefaultLoadBalancerTest {
     int average = metadataTable.size() / servers.size();
     for (FakeTServer server : servers.values()) {
       int diff = server.extents.size() - average;
-      if (diff < 0) fail("average number of tablets is " + average + " but a server has " + server.extents.size());
-      if (diff > 1) fail("average number of tablets is " + average + " but a server has " + server.extents.size());
+      if (diff < 0)
+        fail("average number of tablets is " + average + " but a server has " + server.extents.size());
+      if (diff > 1)
+        fail("average number of tablets is " + average + " but a server has " + server.extents.size());
     }
     
     for (FakeTServer server : servers.values()) {
       Map<String,Integer> counts = new HashMap<String,Integer>();
       for (KeyExtent extent : server.extents) {
         String t = extent.getTableId().toString();
-        if (counts.get(t) == null) counts.put(t, 0);
+        if (counts.get(t) == null)
+          counts.put(t, 0);
         counts.put(t, counts.get(t) + 1);
       }
       for (Entry<String,Integer> entry : counts.entrySet()) {
@@ -270,7 +278,8 @@ public class DefaultLoadBalancerTest {
   }
   
   private static Text toText(String value) {
-    if (value != null) return new Text(value);
+    if (value != null)
+      return new Text(value);
     return null;
   }
   

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/SimpleLoggerBalancerTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/SimpleLoggerBalancerTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/SimpleLoggerBalancerTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/SimpleLoggerBalancerTest.java Thu Oct 27 15:24:51 2011
@@ -53,7 +53,8 @@ public class SimpleLoggerBalancerTest {
     
     @Override
     public int compareTo(LoggerUser o) {
-      if (o instanceof MockServer) return name.compareTo(((MockServer) o).name);
+      if (o instanceof MockServer)
+        return name.compareTo(((MockServer) o).name);
       return -1;
     }
     
@@ -75,7 +76,8 @@ public class SimpleLoggerBalancerTest {
       if (adjustments != null) {
         Set<String> newLoggers = new HashSet<String>(adjustments);
         for (String logger : user.loggers) {
-          if (newLoggers.size() >= numberOfLoggers) break;
+          if (newLoggers.size() >= numberOfLoggers)
+            break;
           newLoggers.add(logger);
         }
         user.loggers = newLoggers;
@@ -84,7 +86,8 @@ public class SimpleLoggerBalancerTest {
     Map<String,Integer> result = new HashMap<String,Integer>();
     for (LoggerUser server : tservers) {
       for (String logger : server.getLoggers()) {
-        if (!result.containsKey(logger)) result.put(logger, 0);
+        if (!result.containsKey(logger))
+          result.put(logger, 0);
         result.put(logger, result.get(logger) + 1);
       }
     }

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java Thu Oct 27 15:24:51 2011
@@ -150,7 +150,8 @@ public class TableLoadBalancerTest {
     movedByTable.put("t2", new Integer(0));
     movedByTable.put("t3", new Integer(0));
     for (TabletMigration migration : migrationsOut) {
-      if (migration.oldServer.equals(svr)) count++;
+      if (migration.oldServer.equals(svr))
+        count++;
       String key = migration.tablet.getTableId().toString();
       movedByTable.put(key, movedByTable.get(key) + 1);
     }

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/state/RootTabletStateStoreTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/state/RootTabletStateStoreTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/state/RootTabletStateStoreTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/master/state/RootTabletStateStoreTest.java Thu Oct 27 15:24:51 2011
@@ -52,7 +52,8 @@ public class RootTabletStateStoreTest {
     
     Node find(String name) {
       for (Node node : children)
-        if (node.name.equals(name)) return node;
+        if (node.name.equals(name))
+          return node;
       return null;
     }
   };
@@ -62,9 +63,11 @@ public class RootTabletStateStoreTest {
     Node root = new Node("/");
     
     private Node recurse(Node root, String[] path, int depth) {
-      if (depth == path.length) return root;
+      if (depth == path.length)
+        return root;
       Node child = root.find(path[depth]);
-      if (child == null) return null;
+      if (child == null)
+        return null;
       return recurse(child, path, depth + 1);
     }
     
@@ -76,7 +79,8 @@ public class RootTabletStateStoreTest {
     @Override
     public List<String> getChildren(String path) throws DistributedStoreException {
       Node node = navigate(path);
-      if (node == null) return Collections.emptyList();
+      if (node == null)
+        return Collections.emptyList();
       List<String> children = new ArrayList<String>(node.children.size());
       for (Node child : node.children)
         children.add(child.name);
@@ -94,7 +98,8 @@ public class RootTabletStateStoreTest {
     }
     
     private Node recurseCreate(Node root, String[] path, int index) {
-      if (path.length == index) return root;
+      if (path.length == index)
+        return root;
       Node node = root.find(path[index]);
       if (node == null) {
         node = new Node(path[index]);
@@ -108,15 +113,18 @@ public class RootTabletStateStoreTest {
       String[] parts = path.split("/");
       String[] parentPath = Arrays.copyOf(parts, parts.length - 1);
       Node parent = recurse(root, parentPath, 1);
-      if (parent == null) return;
+      if (parent == null)
+        return;
       Node child = parent.find(parts[parts.length - 1]);
-      if (child != null) parent.children.remove(child);
+      if (child != null)
+        parent.children.remove(child);
     }
     
     @Override
     public byte[] get(String path) throws DistributedStoreException {
       Node node = navigate(path);
-      if (node != null) return node.value;
+      if (node != null)
+        return node.value;
       return null;
     }
   }

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/tabletserver/log/MultiReaderTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/tabletserver/log/MultiReaderTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/tabletserver/log/MultiReaderTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/tabletserver/log/MultiReaderTest.java Thu Oct 27 15:24:51 2011
@@ -55,7 +55,8 @@ public class MultiReaderTest {
     writer.close();
     writer = new Writer(conf, fs, "manyMaps/even", IntWritable.class, BytesWritable.class);
     for (int i = 0; i < 1000; i += 2) {
-      if (i == 10) continue;
+      if (i == 10)
+        continue;
       writer.append(new IntWritable(i), value);
     }
     writer.close();
@@ -63,7 +64,8 @@ public class MultiReaderTest {
   
   @After
   public void tearDown() throws Exception {
-    if (fs != null) fs.delete(new Path("manyMaps"), true);
+    if (fs != null)
+      fs.delete(new Path("manyMaps"), true);
   }
   
   private void scan(MultiReader reader, int start) throws IOException {
@@ -71,7 +73,8 @@ public class MultiReaderTest {
     BytesWritable value = new BytesWritable();
     
     for (int i = start + 1; i < 1000; i++) {
-      if (i == 10) continue;
+      if (i == 10)
+        continue;
       assertTrue(reader.next(key, value));
       assertEquals(i, key.get());
     }
@@ -94,7 +97,8 @@ public class MultiReaderTest {
     BytesWritable value = new BytesWritable();
     
     for (int i = 0; i < 1000; i++) {
-      if (i == 10) continue;
+      if (i == 10)
+        continue;
       assertTrue(reader.next(key, value));
       assertEquals(i, key.get());
     }

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/test/iterator/RegExTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/test/iterator/RegExTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/test/iterator/RegExTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/test/iterator/RegExTest.java Thu Oct 27 15:24:51 2011
@@ -62,7 +62,8 @@ public class RegExTest {
   }
   
   private void check(String regex, String val) throws Exception {
-    if (regex != null && !val.matches(regex)) throw new Exception(" " + val + " does not match " + regex);
+    if (regex != null && !val.matches(regex))
+      throw new Exception(" " + val + " does not match " + regex);
   }
   
   private void check(String regex, Text val) throws Exception {
@@ -119,10 +120,14 @@ public class RegExTest {
   
   private void setRegexs(ScannerBase scanner, String rowRegEx, String cfRegEx, String cqRegEx, String valRegEx) {
     IteratorSetting regex = new IteratorSetting(50, "regex", RegExFilter.class);
-    if (rowRegEx != null) regex.addOption(RegExFilter.ROW_REGEX, rowRegEx);
-    if (cfRegEx != null) regex.addOption(RegExFilter.COLF_REGEX, cfRegEx);
-    if (cqRegEx != null) regex.addOption(RegExFilter.COLQ_REGEX, cqRegEx);
-    if (valRegEx != null) regex.addOption(RegExFilter.VALUE_REGEX, valRegEx);
+    if (rowRegEx != null)
+      regex.addOption(RegExFilter.ROW_REGEX, rowRegEx);
+    if (cfRegEx != null)
+      regex.addOption(RegExFilter.COLF_REGEX, cfRegEx);
+    if (cqRegEx != null)
+      regex.addOption(RegExFilter.COLQ_REGEX, cqRegEx);
+    if (valRegEx != null)
+      regex.addOption(RegExFilter.VALUE_REGEX, valRegEx);
     scanner.addScanIterator(regex);
   }
   

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/test/randomwalk/FrameworkTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/test/randomwalk/FrameworkTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/test/randomwalk/FrameworkTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/test/randomwalk/FrameworkTest.java Thu Oct 27 15:24:51 2011
@@ -72,7 +72,8 @@ public class FrameworkTest extends TestC
     
     // don't run test if accumulo home is not set
     String acuHome = System.getenv("ACCUMULO_HOME");
-    if (acuHome == null) return;
+    if (acuHome == null)
+      return;
     
     String confDir = acuHome + "/test/system/randomwalk/conf/";
     Framework.setConfigDir(confDir);
@@ -88,7 +89,8 @@ public class FrameworkTest extends TestC
     
     // don't run test if accumulo home is not set
     String acuHome = System.getenv("ACCUMULO_HOME");
-    if (acuHome == null) return;
+    if (acuHome == null)
+      return;
     
     Framework framework = Framework.getInstance();
     String confDir = acuHome + "/test/system/randomwalk/conf/";

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java Thu Oct 27 15:24:51 2011
@@ -107,7 +107,8 @@ public class CloneTest extends TestCase 
     HashSet<String> files = new HashSet<String>();
     
     for (Entry<Key,Value> entry : scanner) {
-      if (entry.getKey().getColumnFamily().equals(Constants.METADATA_DATAFILE_COLUMN_FAMILY)) files.add(entry.getKey().getColumnQualifier().toString());
+      if (entry.getKey().getColumnFamily().equals(Constants.METADATA_DATAFILE_COLUMN_FAMILY))
+        files.add(entry.getKey().getColumnQualifier().toString());
     }
     
     assertEquals(1, files.size());

Modified: incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/zookeeper/TransactionWatcherTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/zookeeper/TransactionWatcherTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/zookeeper/TransactionWatcherTest.java (original)
+++ incubator/accumulo/trunk/src/server/src/test/java/org/apache/accumulo/server/zookeeper/TransactionWatcherTest.java Thu Oct 27 15:24:51 2011
@@ -34,8 +34,10 @@ public class TransactionWatcherTest {
     
     public synchronized void start(String txType, Long txid) throws Exception {
       List<Long> txids = map.get(txType);
-      if (txids == null) txids = new ArrayList<Long>();
-      if (txids.contains(txid)) throw new Exception("transaction already started");
+      if (txids == null)
+        txids = new ArrayList<Long>();
+      if (txids.contains(txid))
+        throw new Exception("transaction already started");
       txids.add(txid);
       map.put(txType, txids);
     }
@@ -52,7 +54,8 @@ public class TransactionWatcherTest {
     @Override
     synchronized public boolean transactionAlive(String txType, long tid) throws Exception {
       List<Long> txids = map.get(txType);
-      if (txids == null) return false;
+      if (txids == null)
+        return false;
       return txids.contains(tid);
     }
     

Modified: incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/TestMain.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/TestMain.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/TestMain.java (original)
+++ incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/TestMain.java Thu Oct 27 15:24:51 2011
@@ -19,8 +19,10 @@ package org.apache.accumulo.start;
 public class TestMain {
   public static void main(String[] args) {
     if (args.length > 0) {
-      if (args[0].equals("success")) System.exit(0);
-      if (args[0].equals("throw")) throw new RuntimeException("This is an exception");
+      if (args[0].equals("success"))
+        System.exit(0);
+      if (args[0].equals("throw"))
+        throw new RuntimeException("This is an exception");
     }
     System.exit(-1);
   }

Modified: incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java (original)
+++ incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloClassLoader.java Thu Oct 27 15:24:51 2011
@@ -128,7 +128,8 @@ public class AccumuloClassLoader {
        * if not it must be the build-server in which case I use a hack to get unittests working
        */
       String userDir = System.getProperty("user.dir");
-      if (userDir == null) throw new RuntimeException("Property user.dir is not set");
+      if (userDir == null)
+        throw new RuntimeException("Property user.dir is not set");
       int index = userDir.indexOf("accumulo/");
       if (index >= 0) {
         String acuhome = userDir.substring(0, index + "accumulo/".length());
@@ -148,7 +149,8 @@ public class AccumuloClassLoader {
   private static ArrayList<URL> findDynamicURLs() throws IOException {
     StringBuilder cp = new StringBuilder(getAccumuloDynamicClasspathStrings());
     String envJars = System.getenv("ACCUMULO_XTRAJARS");
-    if (null != envJars && !envJars.equals("")) cp = cp.append(",").append(envJars);
+    if (null != envJars && !envJars.equals(""))
+      cp = cp.append(",").append(envJars);
     String[] cps = replaceEnvVars(cp.toString(), System.getenv()).split(",");
     ArrayList<URL> urls = new ArrayList<URL>();
     for (String classpath : cps) {
@@ -163,13 +165,15 @@ public class AccumuloClassLoader {
     Set<File> dirs = new HashSet<File>();
     StringBuilder cp = new StringBuilder(getAccumuloDynamicClasspathStrings());
     String envJars = System.getenv("ACCUMULO_XTRAJARS");
-    if (null != envJars && !envJars.equals("")) cp = cp.append(",").append(envJars);
+    if (null != envJars && !envJars.equals(""))
+      cp = cp.append(",").append(envJars);
     String[] cps = replaceEnvVars(cp.toString(), System.getenv()).split(",");
     ArrayList<URL> urls = new ArrayList<URL>();
     for (String classpath : cps) {
       if (!classpath.startsWith("#")) {
         classpath = classpath.trim();
-        if (classpath.length() == 0) continue;
+        if (classpath.length() == 0)
+          continue;
         
         classpath = replaceEnvVars(classpath, System.getenv());
         
@@ -185,7 +189,8 @@ public class AccumuloClassLoader {
           // Then treat this URI as a File.
           // This checks to see if the url string is a dir if it expand and get all jars in that directory
           final File extDir = new File(classpath);
-          if (extDir.isDirectory()) urls.add(extDir.toURI().toURL());
+          if (extDir.isDirectory())
+            urls.add(extDir.toURI().toURL());
           else {
             urls.add(extDir.getAbsoluteFile().getParentFile().toURI().toURL());
           }
@@ -198,7 +203,8 @@ public class AccumuloClassLoader {
     for (URL url : urls) {
       try {
         File f = new File(url.toURI());
-        if (!f.isDirectory()) f = f.getParentFile();
+        if (!f.isDirectory())
+          f = f.getParentFile();
         dirs.add(f);
       } catch (URISyntaxException e) {
         log.error("Unable to find directory for " + url + ", cannot create URI from it");
@@ -209,7 +215,8 @@ public class AccumuloClassLoader {
   
   private static ArrayList<URL> findAccumuloURLs() throws IOException {
     String cp = getAccumuloClasspathStrings();
-    if (cp == null) return new ArrayList<URL>();
+    if (cp == null)
+      return new ArrayList<URL>();
     String[] cps = replaceEnvVars(cp, System.getenv()).split(",");
     ArrayList<URL> urls = new ArrayList<URL>();
     for (String classpath : cps) {
@@ -222,7 +229,8 @@ public class AccumuloClassLoader {
   
   private static void addUrl(String classpath, ArrayList<URL> urls) throws MalformedURLException {
     classpath = classpath.trim();
-    if (classpath.length() == 0) return;
+    if (classpath.length() == 0)
+      return;
     
     classpath = replaceEnvVars(classpath, System.getenv());
     
@@ -238,7 +246,8 @@ public class AccumuloClassLoader {
       // Then treat this URI as a File.
       // This checks to see if the url string is a dir if it expand and get all jars in that directory
       final File extDir = new File(classpath);
-      if (extDir.isDirectory()) urls.add(extDir.toURI().toURL());
+      if (extDir.isDirectory())
+        urls.add(extDir.toURI().toURL());
       else {
         if (extDir.getParentFile() != null) {
           File[] extJars = extDir.getParentFile().listFiles(new FilenameFilter() {
@@ -279,18 +288,20 @@ public class AccumuloClassLoader {
   }
   
   public static String getAccumuloClasspathStrings() throws IllegalStateException {
-    return getAccumuloString(CLASSPATH_PROPERTY_NAME, ACCUMULO_CLASSPATH_VALUE);    
+    return getAccumuloString(CLASSPATH_PROPERTY_NAME, ACCUMULO_CLASSPATH_VALUE);
   }
   
   /**
-   * Looks for the site configuration file for Accumulo and if it has a property for propertyName return it otherwise returns defaultValue
-   * Should throw an exception if the default configuration can not be read;
+   * Looks for the site configuration file for Accumulo and if it has a property for propertyName return it otherwise returns defaultValue Should throw an
+   * exception if the default configuration can not be read;
    * 
-   * @param propertyName Name of the property to pull
-   * @param defaultValue Value to default to if not found.
+   * @param propertyName
+   *          Name of the property to pull
+   * @param defaultValue
+   *          Value to default to if not found.
    * @return site or default class path String
    */
-
+  
   private static String getAccumuloString(String propertyName, String defaultValue) {
     try {
       DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
@@ -302,7 +313,8 @@ public class AccumuloClassLoader {
       } catch (Exception e) {
         /* we don't care because this is optional and we can use defaults */
       }
-      if (site_classpath_string != null) return site_classpath_string;
+      if (site_classpath_string != null)
+        return site_classpath_string;
       return defaultValue;
     } catch (Exception e) {
       throw new IllegalStateException("ClassPath Strings Lookup failed", e);
@@ -310,12 +322,12 @@ public class AccumuloClassLoader {
   }
   
   /**
-   * Parses and XML Document for a property node for a <name> with the value propertyName if it finds one the function return that property's value for
-   * its <value> node. If not found the function will return null
+   * Parses and XML Document for a property node for a <name> with the value propertyName if it finds one the function return that property's value for its
+   * <value> node. If not found the function will return null
    * 
    * @param d
    *          XMLDocument to search through
-   * @param propertyName 
+   * @param propertyName
    */
   private static String getAccumuloClassPathStrings(Document d, String propertyName) {
     NodeList pnodes = d.getElementsByTagName("property");
@@ -377,7 +389,8 @@ public class AccumuloClassLoader {
             monitor = null;
           }
           
-          if (null == parent) parent = getAccumuloClassLoader();
+          if (null == parent)
+            parent = getAccumuloClassLoader();
           
           // Find the dynamic classpath items
           final ArrayList<URL> dynamicURLs = findDynamicURLs();

Modified: incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloFilesystemAlterationMonitor.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloFilesystemAlterationMonitor.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloFilesystemAlterationMonitor.java (original)
+++ incubator/accumulo/trunk/src/start/src/main/java/org/apache/accumulo/start/classloader/AccumuloFilesystemAlterationMonitor.java Thu Oct 27 15:24:51 2011
@@ -121,7 +121,8 @@ public final class AccumuloFilesystemAlt
         observer.checkAndNotify();
       }
       
-      if (!running) break;
+      if (!running)
+        break;
       try {
         Thread.sleep(delay);
       } catch (final InterruptedException e) {}

Modified: incubator/accumulo/trunk/src/start/src/test/java/org/apache/accumulo/start/Test.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/start/src/test/java/org/apache/accumulo/start/Test.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/start/src/test/java/org/apache/accumulo/start/Test.java (original)
+++ incubator/accumulo/trunk/src/start/src/test/java/org/apache/accumulo/start/Test.java Thu Oct 27 15:24:51 2011
@@ -57,13 +57,15 @@ public class Test extends TestCase {
   @Override
   public void setUp() {
     String aHome = System.getenv("ACCUMULO_HOME");
-    if (aHome == null) fail("ACCUMULO_HOME must be set");
+    if (aHome == null)
+      fail("ACCUMULO_HOME must be set");
     
     String dynamicExpr = AccumuloClassLoader.getAccumuloDynamicClasspathStrings().split(";", 2)[0];
     File f = new File(dynamicExpr.replace("$ACCUMULO_HOME", aHome));
     
     tmpDir = f.getParentFile();
-    if (!tmpDir.exists()) tmpDir.mkdirs();
+    if (!tmpDir.exists())
+      tmpDir.mkdirs();
     destJar = new File(tmpDir, "Test.jar");
     if (destJar.exists()) {
       destJar.delete();
@@ -126,7 +128,8 @@ public class Test extends TestCase {
     Logger.getRootLogger().setLevel(Level.ERROR);
     
     // Copy JarA to the dir
-    if (log.isDebugEnabled()) log.debug("Test with Jar A");
+    if (log.isDebugEnabled())
+      log.debug("Test with Jar A");
     copyJar(jarA);
     // Load the TestObject class from the new classloader.
     test.Test a = create();
@@ -134,7 +137,8 @@ public class Test extends TestCase {
     assertTrue(a.add() == 1);
     assertTrue(a.add() == 2);
     // Copy jarB and wait to reload
-    if (log.isDebugEnabled()) log.debug("Test with Jar B");
+    if (log.isDebugEnabled())
+      log.debug("Test with Jar B");
     copyJar(jarB);
     test.Test b = create();
     assertEquals(a.hello(), "Hello from testA");
@@ -143,7 +147,8 @@ public class Test extends TestCase {
     assertTrue(b.add() == 2);
     assertTrue(a.add() == 3);
     assertTrue(a.add() == 4);
-    if (log.isDebugEnabled()) log.debug("Test with Jar C");
+    if (log.isDebugEnabled())
+      log.debug("Test with Jar C");
     copyJar(jarC);
     test.Test c = create();
     assertEquals(a.hello(), "Hello from testA");
@@ -156,7 +161,8 @@ public class Test extends TestCase {
     assertTrue(a.add() == 5);
     assertTrue(a.add() == 6);
     
-    if (log.isDebugEnabled()) log.debug("Deleting jar");
+    if (log.isDebugEnabled())
+      log.debug("Deleting jar");
     assertTrue(destJar.delete());
     // give the class loader time to remove the classes from the deleted jar
     Thread.sleep(1500);
@@ -165,7 +171,8 @@ public class Test extends TestCase {
       assertTrue(false);
     } catch (ClassNotFoundException cnfe) {}
     
-    if (log.isDebugEnabled()) log.debug("Test with Jar C");
+    if (log.isDebugEnabled())
+      log.debug("Test with Jar C");
     copyJar(jarC);
     test.Test e = create();
     assertEquals(e.hello(), "Hello from testC");
@@ -178,10 +185,8 @@ public class Test extends TestCase {
     File oldConf = new File(SITE_CONF);
     boolean exists = oldConf.exists();
     String siteBkp = SITE_CONF + ".bkp";
-    if (exists)
-    {
-      if (oldConf.exists())
-      {
+    if (exists) {
+      if (oldConf.exists()) {
         oldConf.renameTo(new File(siteBkp));
       }
       oldConf = new File(siteBkp);
@@ -195,9 +200,9 @@ public class Test extends TestCase {
       DocumentBuilder db = dbf.newDocumentBuilder();
       Document d;
       if (exists)
-    	  d = db.parse(siteBkp);
+        d = db.parse(siteBkp);
       else
-    	  d = db.parse(new File(SITE_CONF+".example"));
+        d = db.parse(new File(SITE_CONF + ".example"));
       
       NodeList pnodes = d.getElementsByTagName("property");
       for (int i = pnodes.getLength() - 1; i >= 0; i--) {
@@ -206,10 +211,10 @@ public class Test extends TestCase {
         if (cname != null && cname.getTextContent().compareTo(AccumuloClassLoader.DYNAMIC_CLASSPATH_PROPERTY_NAME) == 0) {
           Node cvalue = current_property.getElementsByTagName("value").item(0);
           if (cvalue != null) {
-            cvalue.setTextContent(randomFolder+"/.*");
+            cvalue.setTextContent(randomFolder + "/.*");
           } else {
             cvalue = d.createElement("value");
-            cvalue.setTextContent(randomFolder+"/.*");
+            cvalue.setTextContent(randomFolder + "/.*");
             current_property.appendChild(cvalue);
           }
           break;

Modified: incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/Trace.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/Trace.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/Trace.java (original)
+++ incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/Trace.java Thu Oct 27 15:24:51 2011
@@ -80,7 +80,8 @@ public class Trace {
   
   // Wrap the runnable in a new span, if tracing
   public static Runnable wrap(Runnable runnable) {
-    if (isTracing()) return new TraceRunnable(Trace.currentTrace(), runnable);
+    if (isTracing())
+      return new TraceRunnable(Trace.currentTrace(), runnable);
     return runnable;
   }
   

Modified: incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/Tracer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/Tracer.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/Tracer.java (original)
+++ incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/Tracer.java Thu Oct 27 15:24:51 2011
@@ -60,7 +60,8 @@ public class Tracer {
   
   public Span start(String description) {
     Span parent = currentTrace.get();
-    if (parent == null) return NULL_SPAN;
+    if (parent == null)
+      return NULL_SPAN;
     return push(parent.child(description));
   }
   
@@ -125,7 +126,8 @@ public class Tracer {
     if (span != null) {
       deliver(span);
       currentTrace.set(span.parent());
-    } else currentTrace.set(null);
+    } else
+      currentTrace.set(null);
   }
   
   public Span continueTrace(String description, long traceId, long parentId) {

Modified: incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/impl/MilliSpan.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/impl/MilliSpan.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/impl/MilliSpan.java (original)
+++ incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/impl/MilliSpan.java Thu Oct 27 15:24:51 2011
@@ -51,12 +51,14 @@ public class MilliSpan implements Span {
   }
   
   public synchronized void start() {
-    if (start > 0) throw new IllegalStateException("Span for " + description + " has already been started");
+    if (start > 0)
+      throw new IllegalStateException("Span for " + description + " has already been started");
     start = System.currentTimeMillis();
   }
   
   public synchronized void stop() {
-    if (start == 0) throw new IllegalStateException("Span for " + description + " has not been started");
+    if (start == 0)
+      throw new IllegalStateException("Span for " + description + " has not been started");
     stop = System.currentTimeMillis();
     Tracer.getInstance().pop(this);
   }
@@ -70,8 +72,10 @@ public class MilliSpan implements Span {
   }
   
   public synchronized long accumulatedMillis() {
-    if (start == 0) return 0;
-    if (stop > 0) return stop - start;
+    if (start == 0)
+      return 0;
+    if (stop > 0)
+      return stop - start;
     return currentTimeMillis() - start;
   }
   
@@ -98,7 +102,8 @@ public class MilliSpan implements Span {
   
   @Override
   public long parentId() {
-    if (parent == null) return -1;
+    if (parent == null)
+      return -1;
     return parent.spanId();
   }
   
@@ -119,13 +124,15 @@ public class MilliSpan implements Span {
   
   @Override
   public void data(String key, String value) {
-    if (traceInfo == null) traceInfo = new HashMap<String,String>();
+    if (traceInfo == null)
+      traceInfo = new HashMap<String,String>();
     traceInfo.put(key, value);
   }
   
   @Override
   public Map<String,String> getData() {
-    if (traceInfo == null) return Collections.emptyMap();
+    if (traceInfo == null)
+      return Collections.emptyMap();
     return Collections.unmodifiableMap(traceInfo);
   }
 }
\ No newline at end of file

Modified: incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/AsyncSpanReceiver.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/AsyncSpanReceiver.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/AsyncSpanReceiver.java (original)
+++ incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/AsyncSpanReceiver.java Thu Oct 27 15:24:51 2011
@@ -97,7 +97,8 @@ public abstract class AsyncSpanReceiver<
           log.error(ex, ex);
         }
       }
-      if (!sent) break;
+      if (!sent)
+        break;
     }
   }
   

Modified: incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/LogSpans.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/LogSpans.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/LogSpans.java (original)
+++ incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/LogSpans.java Thu Oct 27 15:24:51 2011
@@ -39,7 +39,8 @@ public class LogSpans implements SpanRec
     }
     
     static public Level toLevel(int val) {
-      if (val == Level.DEBUG_INT + 150) return Level.DEBUG;
+      if (val == Level.DEBUG_INT + 150)
+        return Level.DEBUG;
       return Level.toLevel(val);
     }
   }
@@ -48,7 +49,8 @@ public class LogSpans implements SpanRec
   
   public static String format(long traceId, long spanId, long parentId, long start, long stop, String description, Map<String,String> data) {
     String parentStr = "";
-    if (parentId > 0) parentStr = " parent:" + parentId;
+    if (parentId > 0)
+      parentStr = " parent:" + parentId;
     String startStr = fmt.format(new Date(start));
     return String.format("%20s:%x id:%d%s start:%s ms:%d", description, traceId, spanId, parentStr, startStr, stop - start);
   }

Modified: incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/ZooSpanClient.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/ZooSpanClient.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/ZooSpanClient.java (original)
+++ incubator/accumulo/trunk/src/trace/src/main/java/cloudtrace/instrument/receivers/ZooSpanClient.java Thu Oct 27 15:24:51 2011
@@ -61,7 +61,8 @@ public class ZooSpanClient extends SendS
       }
     });
     for (int i = 0; i < TOTAL_TIME_WAIT_CONNECT_MS; i += TIME_WAIT_CONNECT_CHECK_MS) {
-      if (zoo.getState().equals(States.CONNECTED)) break;
+      if (zoo.getState().equals(States.CONNECTED))
+        break;
       try {
         Thread.sleep(TIME_WAIT_CONNECT_CHECK_MS);
       } catch (InterruptedException ex) {

Modified: incubator/accumulo/trunk/src/trace/src/test/java/cloudtrace/instrument/CountSamplerTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/trace/src/test/java/cloudtrace/instrument/CountSamplerTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/trace/src/test/java/cloudtrace/instrument/CountSamplerTest.java (original)
+++ incubator/accumulo/trunk/src/trace/src/test/java/cloudtrace/instrument/CountSamplerTest.java Thu Oct 27 15:24:51 2011
@@ -29,8 +29,10 @@ public class CountSamplerTest {
     int halfCount = 0;
     int hundredCount = 0;
     for (int i = 0; i < 200; i++) {
-      if (half.next()) halfCount++;
-      if (hundred.next()) hundredCount++;
+      if (half.next())
+        halfCount++;
+      if (hundred.next())
+        hundredCount++;
     }
     Assert.assertEquals(2, hundredCount);
     Assert.assertEquals(100, halfCount);

Modified: incubator/accumulo/trunk/src/trace/src/test/java/cloudtrace/instrument/TracerTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/trace/src/test/java/cloudtrace/instrument/TracerTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/trace/src/test/java/cloudtrace/instrument/TracerTest.java (original)
+++ incubator/accumulo/trunk/src/trace/src/test/java/cloudtrace/instrument/TracerTest.java Thu Oct 27 15:24:51 2011
@@ -74,7 +74,8 @@ public class TracerTest {
     @Override
     public void span(long traceId, long spanId, long parentId, long start, long stop, String description, Map<String,String> data) {
       SpanStruct span = new SpanStruct(traceId, spanId, parentId, start, stop, description, data);
-      if (!traces.containsKey(traceId)) traces.put(traceId, new ArrayList<SpanStruct>());
+      if (!traces.containsKey(traceId))
+        traces.put(traceId, new ArrayList<SpanStruct>());
       traces.get(traceId).add(span);
     }
     



Mime
View raw message