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 [38/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/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkInputFormat.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkInputFormat.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkInputFormat.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkInputFormat.java Thu Oct 27 15:24:51 2011
@@ -55,12 +55,14 @@ public class ChunkInputFormat extends In
           while (!entry.getKey().getColumnFamily().equals(FileDataIngest.CHUNK_CF)) {
             currentK.add(entry);
             peekingScannerIterator.next();
-            if (!peekingScannerIterator.hasNext()) return true;
+            if (!peekingScannerIterator.hasNext())
+              return true;
             entry = peekingScannerIterator.peek();
           }
           currentKey = entry.getKey();
           ((ChunkInputStream) currentV).setSource(peekingScannerIterator);
-          if (log.isTraceEnabled()) log.trace("Processing key/value pair: " + DefaultFormatter.formatEntry(entry, true));
+          if (log.isTraceEnabled())
+            log.trace("Processing key/value pair: " + DefaultFormatter.formatEntry(entry, true));
           return true;
         }
         return false;

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkInputStream.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkInputStream.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkInputStream.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkInputStream.java Thu Oct 27 15:24:51 2011
@@ -52,7 +52,8 @@ public class ChunkInputStream extends In
   }
   
   public void setSource(PeekingIterator<Entry<Key,Value>> in) {
-    if (source != null) throw new RuntimeException("setting new source without closing old one");
+    if (source != null)
+      throw new RuntimeException("setting new source without closing old one");
     this.source = in;
     currentVis = new TreeSet<Text>();
     count = pos = 0;
@@ -68,7 +69,8 @@ public class ChunkInputStream extends In
     buf = entry.getValue().get();
     while (!currentKey.getColumnFamily().equals(FileDataIngest.CHUNK_CF)) {
       log.debug("skipping key: " + currentKey.toString());
-      if (!source.hasNext()) return;
+      if (!source.hasNext())
+        return;
       entry = source.next();
       currentKey = entry.getKey();
       buf = entry.getValue().get();
@@ -83,8 +85,10 @@ public class ChunkInputStream extends In
   
   private int fill() throws IOException {
     if (source == null || !source.hasNext()) {
-      if (gotEndMarker) return count = pos = 0;
-      else throw new IOException("no end chunk marker but source has no data");
+      if (gotEndMarker)
+        return count = pos = 0;
+      else
+        throw new IOException("no end chunk marker but source has no data");
     }
     
     Entry<Key,Value> entry = source.peek();
@@ -93,7 +97,8 @@ public class ChunkInputStream extends In
     
     // check that we're still on the same row
     if (!thisKey.equals(currentKey, PartialKey.ROW)) {
-      if (gotEndMarker) return -1;
+      if (gotEndMarker)
+        return -1;
       else {
         String currentRow = currentKey.getRow().toString();
         clear();
@@ -119,7 +124,8 @@ public class ChunkInputStream extends In
     }
     
     // add the visibility to the list if it's not there
-    if (!currentVis.contains(thisKey.getColumnVisibility())) currentVis.add(thisKey.getColumnVisibility());
+    if (!currentVis.contains(thisKey.getColumnVisibility()))
+      currentVis.add(thisKey.getColumnVisibility());
     
     // check to see if it is an identical chunk with a different visibility
     if (thisKey.getColumnQualifier().equals(currentKey.getColumnQualifier())) {
@@ -156,17 +162,20 @@ public class ChunkInputStream extends In
   }
   
   public Set<Text> getVisibilities() {
-    if (source != null) throw new RuntimeException("don't get visibilities before chunks have been completely read");
+    if (source != null)
+      throw new RuntimeException("don't get visibilities before chunks have been completely read");
     return currentVis;
   }
   
   public int read() throws IOException {
-    if (source == null) return -1;
+    if (source == null)
+      return -1;
     log.debug("pos: " + pos + " count: " + count);
     if (pos >= count) {
       if (fill() <= 0) {
         log.debug("done reading input stream at key: " + (currentKey == null ? "null" : currentKey.toString()));
-        if (source != null && source.hasNext()) log.debug("next key: " + source.peek().getKey());
+        if (source != null && source.hasNext())
+          log.debug("next key: " + source.peek().getKey());
         clear();
         return -1;
       }
@@ -192,7 +201,8 @@ public class ChunkInputStream extends In
       if (avail <= 0) {
         if (fill() <= 0) {
           log.debug("done reading input stream at key: " + (currentKey == null ? "null" : currentKey.toString()));
-          if (source != null && source.hasNext()) log.debug("next key: " + source.peek().getKey());
+          if (source != null && source.hasNext())
+            log.debug("next key: " + source.peek().getKey());
           clear();
           log.debug("filled " + total + " bytes");
           return total == 0 ? -1 : total;

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/FileDataIngest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/FileDataIngest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/FileDataIngest.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/FileDataIngest.java Thu Oct 27 15:24:51 2011
@@ -60,7 +60,8 @@ public class FileDataIngest {
   }
   
   public String insertFileData(String filename, BatchWriter bw) throws MutationsRejectedException, IOException {
-    if (chunkSize == 0) return "";
+    if (chunkSize == 0)
+      return "";
     md5digest.reset();
     String uid = hexString(md5digest.digest(filename.getBytes()));
     
@@ -83,7 +84,8 @@ public class FileDataIngest {
     Mutation m = new Mutation(row);
     m.put(REFS_CF, KeyUtil.buildNullSepText(uid, REFS_ORIG_FILE), cv, new Value(filename.getBytes()));
     String fext = getExt(filename);
-    if (fext != null) m.put(REFS_CF, KeyUtil.buildNullSepText(uid, REFS_FILE_EXT), cv, new Value(fext.getBytes()));
+    if (fext != null)
+      m.put(REFS_CF, KeyUtil.buildNullSepText(uid, REFS_FILE_EXT), cv, new Value(fext.getBytes()));
     bw.addMutation(m);
     
     // read through file again, writing chunks to accumulo
@@ -93,15 +95,18 @@ public class FileDataIngest {
     while (numRead >= 0) {
       while (numRead < buf.length) {
         int moreRead = fis.read(buf, numRead, buf.length - numRead);
-        if (moreRead > 0) numRead += moreRead;
-        else if (moreRead < 0) break;
+        if (moreRead > 0)
+          numRead += moreRead;
+        else if (moreRead < 0)
+          break;
       }
       m = new Mutation(row);
       Text chunkCQ = new Text(chunkSizeBytes);
       chunkCQ.append(intToBytes(chunkCount), 0, 4);
       m.put(CHUNK_CF, chunkCQ, cv, new Value(buf, 0, numRead));
       bw.addMutation(m);
-      if (chunkCount == Integer.MAX_VALUE) throw new RuntimeException("too many chunks for file " + filename + ", try raising chunk size");
+      if (chunkCount == Integer.MAX_VALUE)
+        throw new RuntimeException("too many chunks for file " + filename + ", try raising chunk size");
       chunkCount++;
       numRead = fis.read(buf);
     }
@@ -115,7 +120,8 @@ public class FileDataIngest {
   }
   
   public static int bytesToInt(byte[] b, int offset) {
-    if (b.length <= offset + 3) throw new NumberFormatException("couldn't pull integer from bytes at offset " + offset);
+    if (b.length <= offset + 3)
+      throw new NumberFormatException("couldn't pull integer from bytes at offset " + offset);
     int i = (((b[offset] & 255) << 24) + ((b[offset + 1] & 255) << 16) + ((b[offset + 2] & 255) << 8) + ((b[offset + 3] & 255) << 0));
     return i;
   }
@@ -130,7 +136,8 @@ public class FileDataIngest {
   }
   
   private static String getExt(String filename) {
-    if (filename.indexOf(".") == -1) return null;
+    if (filename.indexOf(".") == -1)
+      return null;
     return filename.substring(filename.lastIndexOf(".") + 1);
   }
   
@@ -158,7 +165,8 @@ public class FileDataIngest {
     int chunkSize = Integer.parseInt(args[6]);
     
     Connector conn = new ZooKeeperInstance(instance, zooKeepers).getConnector(user, pass.getBytes());
-    if (!conn.tableOperations().exists(dataTable)) conn.tableOperations().create(dataTable);
+    if (!conn.tableOperations().exists(dataTable))
+      conn.tableOperations().create(dataTable);
     BatchWriter bw = conn.createBatchWriter(dataTable, 50000000, 300000l, 4);
     FileDataIngest fdi = new FileDataIngest(chunkSize, colvis);
     for (int i = 7; i < args.length; i++) {

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/VisibilityCombiner.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/VisibilityCombiner.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/VisibilityCombiner.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/VisibilityCombiner.java Thu Oct 27 15:24:51 2011
@@ -25,7 +25,8 @@ public class VisibilityCombiner {
   private TreeSet<String> visibilities = new TreeSet<String>();
   
   void add(ByteSequence cv) {
-    if (cv.length() == 0) return;
+    if (cv.length() == 0)
+      return;
     
     int depth = 0;
     int offset = 0;
@@ -37,7 +38,8 @@ public class VisibilityCombiner {
           break;
         case ')':
           depth--;
-          if (depth < 0) throw new IllegalArgumentException("Invalid vis " + cv);
+          if (depth < 0)
+            throw new IllegalArgumentException("Invalid vis " + cv);
           break;
         case '|':
           if (depth == 0) {
@@ -51,7 +53,8 @@ public class VisibilityCombiner {
     
     insert(cv.subSequence(offset, cv.length()));
     
-    if (depth != 0) throw new IllegalArgumentException("Invalid vis " + cv);
+    if (depth != 0)
+      throw new IllegalArgumentException("Invalid vis " + cv);
     
   }
   
@@ -62,7 +65,8 @@ public class VisibilityCombiner {
     
     String cvs = cv.toString();
     
-    if (cvs.charAt(0) != '(') cvs = "(" + cvs + ")";
+    if (cvs.charAt(0) != '(')
+      cvs = "(" + cvs + ")";
     else {
       int depth = 0;
       int depthZeroCloses = 0;
@@ -73,12 +77,14 @@ public class VisibilityCombiner {
             break;
           case ')':
             depth--;
-            if (depth == 0) depthZeroCloses++;
+            if (depth == 0)
+              depthZeroCloses++;
             break;
         }
       }
       
-      if (depthZeroCloses > 1) cvs = "(" + cvs + ")";
+      if (depthZeroCloses > 1)
+        cvs = "(" + cvs + ")";
     }
     
     visibilities.add(cvs);

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/InsertWithBatchWriter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/InsertWithBatchWriter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/InsertWithBatchWriter.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/InsertWithBatchWriter.java Thu Oct 27 15:24:51 2011
@@ -50,7 +50,8 @@ public class InsertWithBatchWriter {
     
     BatchWriter bw = null;
     
-    if (!connector.tableOperations().exists(tableName)) connector.tableOperations().create(tableName);
+    if (!connector.tableOperations().exists(tableName))
+      connector.tableOperations().create(tableName);
     bw = mtbw.getBatchWriter(tableName);
     
     Text colf = new Text("colfam");
@@ -61,7 +62,8 @@ public class InsertWithBatchWriter {
         m.put(colf, new Text(String.format("colqual_%d", j)), new Value((String.format("value_%d_%d", i, j)).getBytes()));
       }
       bw.addMutation(m);
-      if (i % 100 == 0) System.out.println(i);
+      if (i % 100 == 0)
+        System.out.println(i);
     }
     
     mtbw.close();

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/InsertWithOutputFormat.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/InsertWithOutputFormat.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/InsertWithOutputFormat.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/InsertWithOutputFormat.java Thu Oct 27 15:24:51 2011
@@ -63,7 +63,8 @@ public class InsertWithOutputFormat exte
         m.put(colf, new Text(String.format("colqual_%d", j)), new Value((String.format("value_%d_%d", i, j)).getBytes()));
       }
       rw.write(tableName, m); // repeat until done
-      if (i % 100 == 0) System.out.println(i);
+      if (i % 100 == 0)
+        System.out.println(i);
     }
     
     rw.close(context); // close when done

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/ReadData.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/ReadData.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/ReadData.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/helloworld/ReadData.java Thu Oct 27 15:24:51 2011
@@ -50,9 +50,11 @@ public class ReadData {
     
     Scanner scan = connector.createScanner(tableName, Constants.NO_AUTHS);
     Key start = null;
-    if (args.length > 5) start = new Key(new Text(args[5]));
+    if (args.length > 5)
+      start = new Key(new Text(args[5]));
     Key end = null;
-    if (args.length > 6) end = new Key(new Text(args[6]));
+    if (args.length > 6)
+      end = new Key(new Text(args[6]));
     scan.setRange(new Range(start, end));
     Iterator<Entry<Key,Value>> iter = scan.iterator();
     

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/isolation/InterferenceTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/isolation/InterferenceTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/isolation/InterferenceTest.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/isolation/InterferenceTest.java Thu Oct 27 15:24:51 2011
@@ -107,12 +107,15 @@ public class InterferenceTest {
         HashSet<String> values = new HashSet<String>();
         
         for (Entry<Key,Value> entry : scanner) {
-          if (row == null) row = entry.getKey().getRowData();
+          if (row == null)
+            row = entry.getKey().getRowData();
           
           if (!row.equals(entry.getKey().getRowData())) {
-            if (count != NUM_COLUMNS) System.err.println("ERROR Did not see " + NUM_COLUMNS + " columns in row " + row);
+            if (count != NUM_COLUMNS)
+              System.err.println("ERROR Did not see " + NUM_COLUMNS + " columns in row " + row);
             
-            if (values.size() > 1) System.err.println("ERROR Columns in row " + row + " had multiple values " + values);
+            if (values.size() > 1)
+              System.err.println("ERROR Columns in row " + row + " had multiple values " + values);
             
             row = entry.getKey().getRowData();
             count = 0;
@@ -124,9 +127,11 @@ public class InterferenceTest {
           values.add(entry.getValue().toString());
         }
         
-        if (count > 0 && count != NUM_COLUMNS) System.err.println("ERROR Did not see " + NUM_COLUMNS + " columns in row " + row);
+        if (count > 0 && count != NUM_COLUMNS)
+          System.err.println("ERROR Did not see " + NUM_COLUMNS + " columns in row " + row);
         
-        if (values.size() > 1) System.err.println("ERROR Columns in row " + row + " had multiple values " + values);
+        if (values.size() > 1)
+          System.err.println("ERROR Columns in row " + row + " had multiple values " + values);
       }
     }
     
@@ -148,14 +153,18 @@ public class InterferenceTest {
     
     String table = args[4];
     iterations = Long.parseLong(args[5]);
-    if (iterations < 1) iterations = Long.MAX_VALUE;
-    if (!conn.tableOperations().exists(table)) conn.tableOperations().create(table);
+    if (iterations < 1)
+      iterations = Long.MAX_VALUE;
+    if (!conn.tableOperations().exists(table))
+      conn.tableOperations().create(table);
     
     Thread writer = new Thread(new Writer(conn.createBatchWriter(table, 10000000, 60000l, 3)));
     writer.start();
     Reader r;
-    if (Boolean.parseBoolean(args[6])) r = new Reader(new IsolatedScanner(conn.createScanner(table, Constants.NO_AUTHS)));
-    else r = new Reader(conn.createScanner(table, Constants.NO_AUTHS));
+    if (Boolean.parseBoolean(args[6]))
+      r = new Reader(new IsolatedScanner(conn.createScanner(table, Constants.NO_AUTHS)));
+    else
+      r = new Reader(conn.createScanner(table, Constants.NO_AUTHS));
     Thread reader;
     reader = new Thread(r);
     reader.start();

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RegexExample.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RegexExample.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RegexExample.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RegexExample.java Thu Oct 27 15:24:51 2011
@@ -72,6 +72,7 @@ public class RegexExample extends Config
   
   public static void main(String[] args) throws Exception {
     int res = ToolRunner.run(CachedConfiguration.getInstance(), new RegexExample(), args);
-    if (res != 0) System.exit(res);
+    if (res != 0)
+      System.exit(res);
   }
 }

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RowHash.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RowHash.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RowHash.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/RowHash.java Thu Oct 27 15:24:51 2011
@@ -65,7 +65,8 @@ public class RowHash extends Configured 
     int idx = col.indexOf(":");
     Text cf = new Text(idx < 0 ? col : col.substring(0, idx));
     Text cq = idx < 0 ? null : new Text(col.substring(idx + 1));
-    if (cf.getLength() > 0) AccumuloInputFormat.fetchColumns(job, Collections.singleton(new Pair<Text,Text>(cf, cq)));
+    if (cf.getLength() > 0)
+      AccumuloInputFormat.fetchColumns(job, Collections.singleton(new Pair<Text,Text>(cf, cq)));
     
     // AccumuloInputFormat.setLogLevel(job, Level.TRACE);
     
@@ -86,6 +87,7 @@ public class RowHash extends Configured 
   
   public static void main(String[] args) throws Exception {
     int res = ToolRunner.run(CachedConfiguration.getInstance(), new RowHash(), args);
-    if (res != 0) System.exit(res);
+    if (res != 0)
+      System.exit(res);
   }
 }

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TableToFile.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TableToFile.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TableToFile.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TableToFile.java Thu Oct 27 15:24:51 2011
@@ -84,9 +84,11 @@ public class TableToFile extends Configu
       int idx = col.indexOf(":");
       Text cf = new Text(idx < 0 ? col : col.substring(0, idx));
       Text cq = idx < 0 ? null : new Text(col.substring(idx + 1));
-      if (cf.getLength() > 0) columnsToFetch.add(new Pair<Text,Text>(cf, cq));
+      if (cf.getLength() > 0)
+        columnsToFetch.add(new Pair<Text,Text>(cf, cq));
     }
-    if (!columnsToFetch.isEmpty()) AccumuloInputFormat.fetchColumns(job, columnsToFetch);
+    if (!columnsToFetch.isEmpty())
+      AccumuloInputFormat.fetchColumns(job, columnsToFetch);
     
     job.setMapperClass(TTFMapper.class);
     job.setMapOutputKeyClass(NullWritable.class);
@@ -109,6 +111,7 @@ public class TableToFile extends Configu
    */
   public static void main(String[] args) throws Exception {
     int res = ToolRunner.run(CachedConfiguration.getInstance(), new TableToFile(), args);
-    if (res != 0) System.exit(res);
+    if (res != 0)
+      System.exit(res);
   }
 }

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TeraSortIngest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TeraSortIngest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TeraSortIngest.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/TeraSortIngest.java Thu Oct 27 15:24:51 2011
@@ -301,7 +301,8 @@ public class TeraSortIngest extends Conf
         valuelen -= 10;
       }
       
-      if (valuelen > 0) value.append(filler[(base + valuelen) % 26], 0, valuelen);
+      if (valuelen > 0)
+        value.append(filler[(base + valuelen) % 26], 0, valuelen);
     }
     
     public void map(LongWritable row, NullWritable ignored, Context context) throws IOException, InterruptedException {
@@ -367,7 +368,8 @@ public class TeraSortIngest extends Conf
     conf.setInt("cloudgen.maxvaluelength", Integer.parseInt(args[4]));
     conf.set("cloudgen.tablename", args[5]);
     
-    if (args.length > 10) conf.setInt(NUMSPLITS, Integer.parseInt(args[10]));
+    if (args.length > 10)
+      conf.setInt(NUMSPLITS, Integer.parseInt(args[10]));
     
     job.waitForCompletion(true);
     return job.isSuccessful() ? 0 : 1;

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/bulk/BulkIngestExample.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/bulk/BulkIngestExample.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/bulk/BulkIngestExample.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/bulk/BulkIngestExample.java Thu Oct 27 15:24:51 2011
@@ -147,7 +147,8 @@ public class BulkIngestExample extends C
     } catch (Exception e) {
       throw new RuntimeException(e);
     } finally {
-      if (out != null) out.close();
+      if (out != null)
+        out.close();
     }
     
     return 0;

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/bulk/VerifyIngest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/bulk/VerifyIngest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/bulk/VerifyIngest.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/mapreduce/bulk/VerifyIngest.java Thu Oct 27 15:24:51 2011
@@ -84,7 +84,8 @@ public class VerifyIngest {
       
     }
     
-    if (ok) System.out.println("OK");
+    if (ok)
+      System.out.println("OK");
     
     System.exit(ok ? 0 : 1);
   }

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java Thu Oct 27 15:24:51 2011
@@ -57,7 +57,8 @@ public class ContinuousQuery {
     String pass = args[5];
     int numTerms = Integer.parseInt(args[6]);
     long iterations = Long.MAX_VALUE;
-    if (args.length >= 7) iterations = Long.parseLong(args[7]);
+    if (args.length >= 7)
+      iterations = Long.parseLong(args[7]);
     
     ZooKeeperInstance zki = new ZooKeeperInstance(instance, zooKeepers);
     Connector conn = zki.getConnector(user, pass.getBytes());
@@ -101,7 +102,8 @@ public class ContinuousQuery {
     for (Entry<Key,Value> entry : scanner) {
       Key key = entry.getKey();
       
-      if (currentRow == null) currentRow = key.getRow();
+      if (currentRow == null)
+        currentRow = key.getRow();
       
       if (!currentRow.equals(key.getRow())) {
         selectRandomWords(words, ret, rand, numTerms);

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/Index.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/Index.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/Index.java (original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/Index.java Thu Oct 27 15:24:51 2011
@@ -58,7 +58,8 @@ public class Index {
       }
     }
     
-    if (m.size() > 0) bw.addMutation(m);
+    if (m.size() > 0)
+      bw.addMutation(m);
   }
   
   private static void index(int numPartitions, File src, String splitRegex, BatchWriter bw) throws Exception {

Modified: incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/dirlist/CountTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/dirlist/CountTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/dirlist/CountTest.java (original)
+++ incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/dirlist/CountTest.java Thu Oct 27 15:24:51 2011
@@ -84,7 +84,8 @@ public class CountTest extends TestCase 
     
     @Override
     public Value put(Key key, Value value) {
-      if (!this.containsKey(key)) return super.put(key, value);
+      if (!this.containsKey(key))
+        return super.put(key, value);
       agg.reset();
       agg.collect(value);
       agg.collect(this.get(key));

Modified: incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/filedata/ChunkCombinerTest.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/filedata/ChunkCombinerTest.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/filedata/ChunkCombinerTest.java (original)
+++ incubator/accumulo/trunk/src/examples/src/test/java/org/apache/accumulo/examples/filedata/ChunkCombinerTest.java Thu Oct 27 15:24:51 2011
@@ -55,8 +55,10 @@ public class ChunkCombinerTest extends T
       this.map = map;
       iter = map.entrySet().iterator();
       this.range = new Range();
-      if (iter.hasNext()) entry = iter.next();
-      else entry = null;
+      if (iter.hasNext())
+        entry = iter.next();
+      else
+        entry = null;
     }
     
     @Override
@@ -83,7 +85,8 @@ public class ChunkCombinerTest extends T
           entry = null;
           continue;
         }
-        if (range.afterEndKey((Key) entry.getKey())) entry = null;
+        if (range.afterEndKey((Key) entry.getKey()))
+          entry = null;
         break;
       }
     }
@@ -244,8 +247,10 @@ public class ChunkCombinerTest extends T
       assertFalse("already contains " + iter.getTopKey(), seen.containsKey(iter.getTopKey()));
       seen.put(new Key(iter.getTopKey()), new Value(iter.getTopValue()));
       
-      if (reseek) iter.seek(new Range(iter.getTopKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL), true, null, true), cols, true);
-      else iter.next();
+      if (reseek)
+        iter.seek(new Range(iter.getTopKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL), true, null, true), cols, true);
+      else
+        iter.next();
     }
     
     assertEquals(result, seen);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/Accumulo.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/Accumulo.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/Accumulo.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/Accumulo.java Thu Oct 27 15:24:51 2011
@@ -49,7 +49,8 @@ public class Accumulo {
   private static Integer dataVersion = null;
   
   public static synchronized int getAccumuloPersistentVersion() {
-    if (dataVersion != null) return dataVersion;
+    if (dataVersion != null)
+      return dataVersion;
     
     Configuration conf = CachedConfiguration.getInstance();
     try {
@@ -80,14 +81,18 @@ public class Accumulo {
     
     System.setProperty("org.apache.accumulo.core.application", application);
     
-    if (System.getenv("ACCUMULO_LOG_DIR") != null) System.setProperty("org.apache.accumulo.core.dir.log", System.getenv("ACCUMULO_LOG_DIR"));
-    else System.setProperty("org.apache.accumulo.core.dir.log", System.getenv("ACCUMULO_HOME") + "/logs/");
+    if (System.getenv("ACCUMULO_LOG_DIR") != null)
+      System.setProperty("org.apache.accumulo.core.dir.log", System.getenv("ACCUMULO_LOG_DIR"));
+    else
+      System.setProperty("org.apache.accumulo.core.dir.log", System.getenv("ACCUMULO_HOME") + "/logs/");
     
     String localhost = InetAddress.getLocalHost().getHostName();
     System.setProperty("org.apache.accumulo.core.ip.localhost.hostname", localhost);
     
-    if (System.getenv("ACCUMULO_LOG_HOST") != null) System.setProperty("org.apache.accumulo.core.host.log", System.getenv("ACCUMULO_LOG_HOST"));
-    else System.setProperty("org.apache.accumulo.core.host.log", localhost);
+    if (System.getenv("ACCUMULO_LOG_HOST") != null)
+      System.setProperty("org.apache.accumulo.core.host.log", System.getenv("ACCUMULO_LOG_HOST"));
+    else
+      System.setProperty("org.apache.accumulo.core.host.log", localhost);
     
     // Use a specific log config, if it exists
     String logConfig = String.format("%s/conf/%s_logger.xml", System.getenv("ACCUMULO_HOME"), application);
@@ -150,7 +155,8 @@ public class Accumulo {
     while (true) {
       try {
         DistributedFileSystem dfs = (DistributedFileSystem) FileSystem.get(CachedConfiguration.getInstance());
-        if (!dfs.setSafeMode(SafeModeAction.SAFEMODE_GET)) break;
+        if (!dfs.setSafeMode(SafeModeAction.SAFEMODE_GET))
+          break;
         log.warn("Waiting for the NameNode to leave safemode");
         sleep = 1000;
       } catch (IOException ex) {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java Thu Oct 27 15:24:51 2011
@@ -154,7 +154,8 @@ public class BulkImporter {
             if (tabletsToAssignMapFileTo.size() == 0) {
               List<KeyExtent> empty = Collections.emptyList();
               completeFailures.put(mapFile, empty);
-            } else assignments.put(mapFile, tabletsToAssignMapFileTo);
+            } else
+              assignments.put(mapFile, tabletsToAssignMapFileTo);
           }
         };
         threadPool.submit(new TraceRunnable(new LoggingRunnable(log, getAssignments)));
@@ -214,7 +215,8 @@ public class BulkImporter {
             }
           }
           
-          if (tabletsToAssignMapFileTo.size() > 0) assignments.put(entry.getKey(), tabletsToAssignMapFileTo);
+          if (tabletsToAssignMapFileTo.size() > 0)
+            assignments.put(entry.getKey(), tabletsToAssignMapFileTo);
         }
         
         assignmentStats.attemptingAssignments(assignments);
@@ -227,7 +229,8 @@ public class BulkImporter {
           assignmentFailures.get(entry.getKey()).addAll(entry.getValue());
           
           Integer fc = failureCount.get(entry.getKey());
-          if (fc == null) fc = 0;
+          if (fc == null)
+            fc = 0;
           
           failureCount.put(entry.getKey(), fc + 1);
         }
@@ -236,7 +239,8 @@ public class BulkImporter {
         Iterator<Entry<Path,List<KeyExtent>>> afIter = assignmentFailures.entrySet().iterator();
         while (afIter.hasNext()) {
           Entry<Path,List<KeyExtent>> entry = afIter.next();
-          if (entry.getValue().size() == 0) afIter.remove();
+          if (entry.getValue().size() == 0)
+            afIter.remove();
         }
         
         Set<Entry<Path,Integer>> failureIter = failureCount.entrySet();
@@ -256,7 +260,8 @@ public class BulkImporter {
       printReport();
       return assignmentStats;
     } finally {
-      if (client != null) ServerClient.close(client);
+      if (client != null)
+        ServerClient.close(client);
       locator.invalidateCache();
     }
   }
@@ -264,7 +269,8 @@ public class BulkImporter {
   private void printReport() {
     long totalTime = 0;
     for (Timers t : Timers.values()) {
-      if (t == Timers.TOTAL) continue;
+      if (t == Timers.TOTAL)
+        continue;
       
       totalTime += timer.get(t);
     }
@@ -289,7 +295,8 @@ public class BulkImporter {
     
     Set<Entry<Path,List<KeyExtent>>> es = completeFailures.entrySet();
     
-    if (completeFailures.size() == 0) return Collections.emptySet();
+    if (completeFailures.size() == 0)
+      return Collections.emptySet();
     
     log.error("The following map files failed completely, saving this info to : " + new Path(failureDir, "failures.seq"));
     
@@ -640,7 +647,8 @@ public class BulkImporter {
       throws Exception {
     locator.invalidateCache(failed);
     Text start = failed.getPrevEndRow();
-    if (start != null) start = Range.followingPrefix(start);
+    if (start != null)
+      start = Range.followingPrefix(start);
     return findOverlappingTablets(acuConf, fs, locator, file, start, failed.getEndRow());
   }
   
@@ -653,16 +661,20 @@ public class BulkImporter {
     FileSKVIterator reader = FileOperations.getInstance().openReader(file.toString(), true, fs, fs.getConf(), acuConf);
     try {
       Text row = startRow;
-      if (row == null) row = new Text();
+      if (row == null)
+        row = new Text();
       while (true) {
         reader.seek(new Range(row, null), columnFamilies, false);
-        if (!reader.hasTop()) break;
+        if (!reader.hasTop())
+          break;
         row = reader.getTopKey().getRow();
         TabletLocation tabletLocation = locator.locateTablet(row, false, true);
         result.add(tabletLocation);
         row = tabletLocation.tablet_extent.getEndRow();
-        if (row != null && (endRow == null || row.compareTo(endRow) < 0)) row = Range.followingPrefix(row);
-        else break;
+        if (row != null && (endRow == null || row.compareTo(endRow) < 0))
+          row = Range.followingPrefix(row);
+        else
+          break;
       }
     } finally {
       reader.close();
@@ -738,11 +750,14 @@ public class BulkImporter {
       
       for (Entry<KeyExtent,Integer> entry : counts.entrySet()) {
         totalAssignments += entry.getValue();
-        if (entry.getValue() > 0) tabletsImportedTo++;
+        if (entry.getValue() > 0)
+          tabletsImportedTo++;
         
-        if (entry.getValue() < min) min = entry.getValue();
+        if (entry.getValue() < min)
+          min = entry.getValue();
         
-        if (entry.getValue() > max) max = entry.getValue();
+        if (entry.getValue() > max)
+          max = entry.getValue();
       }
       
       double stddev = 0;

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java Thu Oct 27 15:24:51 2011
@@ -63,7 +63,8 @@ public class ClientServiceHandler implem
   
   protected String checkTableId(String tableName, TableOperation operation) throws ThriftTableOperationException {
     final String tableId = Tables.getNameToIdMap(HdfsZooInstance.getInstance()).get(tableName);
-    if (tableId == null) throw new ThriftTableOperationException(null, tableName, operation, TableOperationExceptionType.NOTFOUND, null);
+    if (tableId == null)
+      throw new ThriftTableOperationException(null, tableName, operation, TableOperationExceptionType.NOTFOUND, null);
     return tableId;
   }
   
@@ -215,7 +216,8 @@ public class ClientServiceHandler implem
     Map<String,String> result = new HashMap<String,String>();
     for (Entry<String,String> entry : conf) {
       // TODO: do we need to send any instance information?
-      if (!entry.getKey().equals(Property.INSTANCE_SECRET.getKey())) result.put(entry.getKey(), entry.getValue());
+      if (!entry.getKey().equals(Property.INSTANCE_SECRET.getKey()))
+        result.put(entry.getKey(), entry.getValue());
     }
     return result;
   }
@@ -244,8 +246,8 @@ public class ClientServiceHandler implem
   public List<String> bulkImportFiles(TInfo tinfo, final AuthInfo credentials, final long tid, final String tableId, final List<String> files,
       final String errorDir, final boolean setTime) throws ThriftSecurityException, ThriftTableOperationException, TException {
     try {
-      if (!authenticator.hasSystemPermission(credentials, credentials.getUser(), SystemPermission.SYSTEM)) throw new AccumuloSecurityException(
-          credentials.getUser(), SecurityErrorCode.PERMISSION_DENIED);
+      if (!authenticator.hasSystemPermission(credentials, credentials.getUser(), SystemPermission.SYSTEM))
+        throw new AccumuloSecurityException(credentials.getUser(), SecurityErrorCode.PERMISSION_DENIED);
       return transactionWatcher.run(Constants.BULK_ARBITRATOR_TYPE, tid, new Callable<List<String>>() {
         public List<String> call() throws Exception {
           return BulkImporter.bulkLoad(ServerConfiguration.getSystemConfiguration(), HdfsZooInstance.getInstance(), credentials, tid, tableId, files, errorDir,

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java Thu Oct 27 15:24:51 2011
@@ -66,7 +66,8 @@ public class HdfsZooInstance implements 
   private static HdfsZooInstance cachedHdfsZooInstance = null;
   
   public static synchronized Instance getInstance() {
-    if (cachedHdfsZooInstance == null) cachedHdfsZooInstance = new HdfsZooInstance();
+    if (cachedHdfsZooInstance == null)
+      cachedHdfsZooInstance = new HdfsZooInstance();
     return cachedHdfsZooInstance;
   }
   
@@ -111,7 +112,8 @@ public class HdfsZooInstance implements 
   
   @Override
   public String getInstanceID() {
-    if (instanceId == null) _getInstanceID();
+    if (instanceId == null)
+      _getInstanceID();
     return instanceId;
   }
   
@@ -158,7 +160,8 @@ public class HdfsZooInstance implements 
   
   @Override
   public AccumuloConfiguration getConfiguration() {
-    if (conf == null) conf = ServerConfiguration.getSystemConfiguration();
+    if (conf == null)
+      conf = ServerConfiguration.getSystemConfiguration();
     return conf;
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java Thu Oct 27 15:24:51 2011
@@ -39,7 +39,8 @@ class TableConfWatcher implements Watche
   @Override
   public void process(WatchedEvent event) {
     String path = event.getPath();
-    if (log.isTraceEnabled()) log.trace("WatchEvent : " + path + " " + event.getState() + " " + event.getType());
+    if (log.isTraceEnabled())
+      log.trace("WatchEvent : " + path + " " + event.getState() + " " + event.getType());
     
     String tablesPrefix = ZooUtil.getRoot(instanceId) + Constants.ZTABLES + "/";
     
@@ -51,8 +52,8 @@ class TableConfWatcher implements Watche
         tableId = path.substring(tablesPrefix.length());
         if (tableId.contains("/")) {
           tableId = tableId.substring(0, tableId.indexOf('/'));
-          if (path.startsWith(tablesPrefix + tableId + Constants.ZTABLE_CONF + "/")) key = path
-              .substring((tablesPrefix + tableId + Constants.ZTABLE_CONF + "/").length());
+          if (path.startsWith(tablesPrefix + tableId + Constants.ZTABLE_CONF + "/"))
+            key = path.substring((tablesPrefix + tableId + Constants.ZTABLE_CONF + "/").length());
         }
       }
       
@@ -64,8 +65,10 @@ class TableConfWatcher implements Watche
     
     switch (event.getType()) {
       case NodeDataChanged:
-        if (log.isTraceEnabled()) log.trace("EventNodeDataChanged " + event.getPath());
-        if (key != null) ServerConfiguration.getTableConfiguration(instanceId, tableId).propertyChanged(key);
+        if (log.isTraceEnabled())
+          log.trace("EventNodeDataChanged " + event.getPath());
+        if (key != null)
+          ServerConfiguration.getTableConfiguration(instanceId, tableId).propertyChanged(key);
         break;
       case NodeChildrenChanged:
         ServerConfiguration.getTableConfiguration(instanceId, tableId).propertiesChanged(key);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java Thu Oct 27 15:24:51 2011
@@ -58,10 +58,11 @@ public class TableConfiguration extends 
    */
   private static ZooCache getTablePropCache() {
     Instance inst = HdfsZooInstance.getInstance();
-    if (tablePropCache == null) synchronized (TableConfiguration.class) {
-      if (tablePropCache == null) tablePropCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), new TableConfWatcher(
-          inst.getInstanceID()));
-    }
+    if (tablePropCache == null)
+      synchronized (TableConfiguration.class) {
+        if (tablePropCache == null)
+          tablePropCache = new ZooCache(inst.getZooKeepers(), inst.getZooKeepersSessionTimeOut(), new TableConfWatcher(inst.getInstanceID()));
+      }
     return tablePropCache;
   }
   
@@ -107,7 +108,8 @@ public class TableConfiguration extends 
     String value = get(key);
     
     if (value == null || !property.getType().isValidFormat(value)) {
-      if (value != null) log.error("Using default value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
+      if (value != null)
+        log.error("Using default value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
       value = parent.get(property);
     }
     return value;
@@ -117,12 +119,14 @@ public class TableConfiguration extends 
     String zPath = ZooUtil.getRoot(instanceId) + Constants.ZTABLES + "/" + table + Constants.ZTABLE_CONF + "/" + key;
     byte[] v = getTablePropCache().get(zPath);
     String value = null;
-    if (v != null) value = new String(v);
+    if (v != null)
+      value = new String(v);
     return value;
   }
   
   public static void invalidateCache() {
-    if (tablePropCache != null) tablePropCache.clear();
+    if (tablePropCache != null)
+      tablePropCache.clear();
   }
   
   @Override
@@ -136,7 +140,8 @@ public class TableConfiguration extends 
     if (children != null) {
       for (String child : children) {
         String value = get(child);
-        if (child != null && value != null) entries.put(child, value);
+        if (child != null && value != null)
+          entries.put(child, value);
       }
     }
     

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java Thu Oct 27 15:24:51 2011
@@ -80,7 +80,8 @@ public class ZooConfiguration extends Ac
     }
     
     if (value == null || !property.getType().isValidFormat(value)) {
-      if (value != null) log.error("Using parent value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
+      if (value != null)
+        log.error("Using parent value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
       value = parent.get(property);
     }
     return value;
@@ -107,7 +108,8 @@ public class ZooConfiguration extends Ac
     String zPath = ZooUtil.getRoot(instanceId) + Constants.ZCONFIG + "/" + key;
     byte[] v = propCache.get(zPath);
     String value = null;
-    if (v != null) value = new String(v);
+    if (v != null)
+      value = new String(v);
     return value;
   }
   
@@ -122,7 +124,8 @@ public class ZooConfiguration extends Ac
     if (children != null) {
       for (String child : children) {
         String value = get(child);
-        if (child != null && value != null) entries.put(child, value);
+        if (child != null && value != null)
+          entries.put(child, value);
       }
     }
     

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/constraints/ConstraintChecker.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/constraints/ConstraintChecker.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/constraints/ConstraintChecker.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/constraints/ConstraintChecker.java Thu Oct 27 15:24:51 2011
@@ -53,7 +53,8 @@ public class ConstraintChecker {
       if (violationCodes != null) {
         for (Short vcode : violationCodes) {
           ConstraintViolationSummary cvs = new ConstraintViolationSummary(constraint.getClass().getName(), vcode, constraint.getViolationDescription(vcode), 1);
-          if (violations == null) violations = new Violations();
+          if (violations == null)
+            violations = new Violations();
           violations.add(cvs);
         }
       } else if (throwable != null) {
@@ -80,7 +81,8 @@ public class ConstraintChecker {
         }
         
         ConstraintViolationSummary cvs = new ConstraintViolationSummary(constraint.getClass().getName(), vcode, "CONSTRAINT FAILED : " + msg, 1);
-        if (violations == null) violations = new Violations();
+        if (violations == null)
+          violations = new Violations();
         violations.add(cvs);
       }
     }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java Thu Oct 27 15:24:51 2011
@@ -63,9 +63,11 @@ public class MetadataConstraints impleme
   
   private static boolean isValidColumn(ColumnUpdate cu) {
     
-    if (validColumnFams.contains(new Text(cu.getColumnFamily()))) return true;
+    if (validColumnFams.contains(new Text(cu.getColumnFamily())))
+      return true;
     
-    if (validColumnQuals.contains(new ColumnFQ(cu))) return true;
+    if (validColumnQuals.contains(new ColumnFQ(cu)))
+      return true;
     
     return false;
   }
@@ -82,44 +84,55 @@ public class MetadataConstraints impleme
     byte[] row = mutation.getRow();
     
     // always allow rows that fall within reserved area
-    if (row.length > 0 && row[0] == '~') return null;
+    if (row.length > 0 && row[0] == '~')
+      return null;
     
     for (byte b : row) {
       if (b == ';') {
         containsSemiC = true;
       }
       
-      if (b == ';' || b == '<') break;
+      if (b == ';' || b == '<')
+        break;
       
       if (!validTableNameChars[0xff & b]) {
-        if (violations == null) violations = new ArrayList<Short>();
-        if (!violations.contains((short) 4)) violations.add((short) 4);
+        if (violations == null)
+          violations = new ArrayList<Short>();
+        if (!violations.contains((short) 4))
+          violations.add((short) 4);
       }
     }
     
     if (!containsSemiC) {
       // see if last row char is <
       if (row.length == 0 || row[row.length - 1] != '<') {
-        if (violations == null) violations = new ArrayList<Short>();
-        if (!violations.contains((short) 4)) violations.add((short) 4);
+        if (violations == null)
+          violations = new ArrayList<Short>();
+        if (!violations.contains((short) 4))
+          violations.add((short) 4);
       }
     } else {
       if (row.length == 0) {
-        if (violations == null) violations = new ArrayList<Short>();
-        if (!violations.contains((short) 4)) violations.add((short) 4);
+        if (violations == null)
+          violations = new ArrayList<Short>();
+        if (!violations.contains((short) 4))
+          violations.add((short) 4);
       }
     }
     
     if (row.length > 0 && row[0] == '!') {
       if (row.length < 3 || row[1] != '0' || (row[2] != '<' && row[2] != ';')) {
-        if (violations == null) violations = new ArrayList<Short>();
-        if (!violations.contains((short) 4)) violations.add((short) 4);
+        if (violations == null)
+          violations = new ArrayList<Short>();
+        if (!violations.contains((short) 4))
+          violations.add((short) 4);
       }
     }
     
     // ensure row is not less than Constants.METADATA_TABLE_ID
     if (new Text(row).compareTo(new Text(Constants.METADATA_TABLE_ID)) < 0) {
-      if (violations == null) violations = new ArrayList<Short>();
+      if (violations == null)
+        violations = new ArrayList<Short>();
       violations.add((short) 5);
     }
     
@@ -128,14 +141,16 @@ public class MetadataConstraints impleme
       
       if (columnUpdate.isDeleted()) {
         if (!isValidColumn(columnUpdate)) {
-          if (violations == null) violations = new ArrayList<Short>();
+          if (violations == null)
+            violations = new ArrayList<Short>();
           violations.add((short) 2);
         }
         continue;
       }
       
       if (columnUpdate.getValue().length == 0 && !columnFamily.equals(Constants.METADATA_SCANFILE_COLUMN_FAMILY)) {
-        if (violations == null) violations = new ArrayList<Short>();
+        if (violations == null)
+          violations = new ArrayList<Short>();
         violations.add((short) 6);
       }
       
@@ -144,21 +159,25 @@ public class MetadataConstraints impleme
           DataFileValue dfv = new DataFileValue(columnUpdate.getValue());
           
           if (dfv.getSize() < 0 || dfv.getNumEntries() < 0) {
-            if (violations == null) violations = new ArrayList<Short>();
+            if (violations == null)
+              violations = new ArrayList<Short>();
             violations.add((short) 1);
           }
         } catch (NumberFormatException nfe) {
-          if (violations == null) violations = new ArrayList<Short>();
+          if (violations == null)
+            violations = new ArrayList<Short>();
           violations.add((short) 1);
         } catch (ArrayIndexOutOfBoundsException aiooe) {
-          if (violations == null) violations = new ArrayList<Short>();
+          if (violations == null)
+            violations = new ArrayList<Short>();
           violations.add((short) 1);
         }
       } else if (columnFamily.equals(Constants.METADATA_SCANFILE_COLUMN_FAMILY)) {
         
       } else {
         if (!isValidColumn(columnUpdate)) {
-          if (violations == null) violations = new ArrayList<Short>();
+          if (violations == null)
+            violations = new ArrayList<Short>();
           violations.add((short) 2);
         } else if (new ColumnFQ(columnUpdate).equals(Constants.METADATA_PREV_ROW_COLUMN) && columnUpdate.getValue().length > 0
             && (violations == null || !violations.contains((short) 4))) {
@@ -169,7 +188,8 @@ public class MetadataConstraints impleme
           boolean prevEndRowLessThanEndRow = per == null || ke.getEndRow() == null || per.compareTo(ke.getEndRow()) < 0;
           
           if (!prevEndRowLessThanEndRow) {
-            if (violations == null) violations = new ArrayList<Short>();
+            if (violations == null)
+              violations = new ArrayList<Short>();
             violations.add((short) 3);
           }
         } else if (new ColumnFQ(columnUpdate).equals(Constants.METADATA_LOCK_COLUMN)) {
@@ -191,7 +211,8 @@ public class MetadataConstraints impleme
           }
           
           if (!lockHeld) {
-            if (violations == null) violations = new ArrayList<Short>();
+            if (violations == null)
+              violations = new ArrayList<Short>();
             violations.add((short) 7);
           }
         }
@@ -227,7 +248,8 @@ public class MetadataConstraints impleme
   }
   
   protected void finalize() {
-    if (zooCache != null) zooCache.clear();
+    if (zooCache != null)
+      zooCache.clear();
   }
   
 }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/fate/Fate.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/fate/Fate.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/fate/Fate.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/fate/Fate.java Thu Oct 27 15:24:51 2011
@@ -69,7 +69,8 @@ public class Fate<T> {
               if (deferTime == 0) {
                 prevOp = op;
                 op = op.call(tid, environment);
-              } else continue;
+              } else
+                continue;
               
             } catch (Exception e) {
               transitionToFailed(tid, op, e);
@@ -79,7 +80,8 @@ public class Fate<T> {
             if (op == null) {
               // transaction is finished
               String ret = prevOp.getReturn();
-              if (ret != null) store.setProperty(tid, RETURN_PROP, ret);
+              if (ret != null)
+                store.setProperty(tid, RETURN_PROP, ret);
               store.setStatus(tid, TStatus.SUCCESSFUL);
               doCleanUp(tid);
             } else {
@@ -95,7 +97,8 @@ public class Fate<T> {
           }
         } finally {
           store.unreserve(tid, deferTime);
-          if (span != null) span.stop();
+          if (span != null)
+            span.stop();
         }
         
       }
@@ -173,7 +176,8 @@ public class Fate<T> {
           }
         }
         
-        if (autoCleanUp) store.setProperty(tid, AUTO_CLEAN_PROP, new Boolean(autoCleanUp));
+        if (autoCleanUp)
+          store.setProperty(tid, AUTO_CLEAN_PROP, new Boolean(autoCleanUp));
         
         store.setProperty(tid, DEBUG_PROP, repo.getClass().getName());
         
@@ -215,8 +219,8 @@ public class Fate<T> {
   public String getReturn(long tid) {
     store.reserve(tid);
     try {
-      if (store.getStatus(tid) != TStatus.SUCCESSFUL) throw new IllegalStateException("Tried to get exception when transaction " + String.format("%016x", tid)
-          + " not in successful state");
+      if (store.getStatus(tid) != TStatus.SUCCESSFUL)
+        throw new IllegalStateException("Tried to get exception when transaction " + String.format("%016x", tid) + " not in successful state");
       return (String) store.getProperty(tid, RETURN_PROP);
     } finally {
       store.unreserve(tid, 0);
@@ -227,8 +231,8 @@ public class Fate<T> {
   public Exception getException(long tid) {
     store.reserve(tid);
     try {
-      if (store.getStatus(tid) != TStatus.FAILED) throw new IllegalStateException("Tried to get exception when transaction " + String.format("%016x", tid)
-          + " not in failed state");
+      if (store.getStatus(tid) != TStatus.FAILED)
+        throw new IllegalStateException("Tried to get exception when transaction " + String.format("%016x", tid) + " not in failed state");
       return (Exception) store.getProperty(tid, EXCEPTION_PROP);
     } finally {
       store.unreserve(tid, 0);

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/fate/ZooStore.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/fate/ZooStore.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/fate/ZooStore.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/fate/ZooStore.java Thu Oct 27 15:24:51 2011
@@ -130,11 +130,15 @@ public class ZooStore<T> implements TSto
           
           synchronized (this) {
             if (defered.containsKey(tid)) {
-              if (defered.get(tid) < System.currentTimeMillis()) defered.remove(tid);
-              else continue;
+              if (defered.get(tid) < System.currentTimeMillis())
+                defered.remove(tid);
+              else
+                continue;
             }
-            if (!reserved.contains(tid)) reserved.add(tid);
-            else continue;
+            if (!reserved.contains(tid))
+              reserved.add(tid);
+            else
+              continue;
           }
           
           // have reserved id, status should not change
@@ -160,8 +164,10 @@ public class ZooStore<T> implements TSto
             if (defered.size() > 0) {
               Long minTime = Collections.min(defered.values());
               long waitTime = minTime - System.currentTimeMillis();
-              if (waitTime > 0) this.wait(Math.min(waitTime, 5000));
-            } else this.wait(5000);
+              if (waitTime > 0)
+                this.wait(Math.min(waitTime, 5000));
+            } else
+              this.wait(5000);
           }
         }
       }
@@ -190,23 +196,28 @@ public class ZooStore<T> implements TSto
   
   private void unreserve(long tid) {
     synchronized (this) {
-      if (!reserved.remove(tid)) throw new IllegalStateException("Tried to unreserve id that was not reserved " + String.format("%016x", tid));
+      if (!reserved.remove(tid))
+        throw new IllegalStateException("Tried to unreserve id that was not reserved " + String.format("%016x", tid));
       
       // do not want this unreserve to unesc wake up threads in reserve()... this leads to infinite loop when tx is stuck in NEW...
       // only do this when something external has called reserve(tid)...
-      if (reservationsWaiting > 0) this.notifyAll();
+      if (reservationsWaiting > 0)
+        this.notifyAll();
     }
   }
   
   @Override
   public void unreserve(long tid, long deferTime) {
     
-    if (deferTime < 0) throw new IllegalArgumentException("deferTime < 0 : " + deferTime);
+    if (deferTime < 0)
+      throw new IllegalArgumentException("deferTime < 0 : " + deferTime);
     
     synchronized (this) {
-      if (!reserved.remove(tid)) throw new IllegalStateException("Tried to unreserve id that was not reserved " + String.format("%016x", tid));
+      if (!reserved.remove(tid))
+        throw new IllegalStateException("Tried to unreserve id that was not reserved " + String.format("%016x", tid));
       
-      if (deferTime > 0) defered.put(tid, System.currentTimeMillis() + deferTime);
+      if (deferTime > 0)
+        defered.put(tid, System.currentTimeMillis() + deferTime);
       
       this.notifyAll();
     }
@@ -215,7 +226,8 @@ public class ZooStore<T> implements TSto
   
   private void verifyReserved(long tid) {
     synchronized (this) {
-      if (!reserved.contains(tid)) throw new IllegalStateException("Tried to operate on unreserved transaction " + String.format("%016x", tid));
+      if (!reserved.contains(tid))
+        throw new IllegalStateException("Tried to operate on unreserved transaction " + String.format("%016x", tid));
     }
   }
   
@@ -227,7 +239,8 @@ public class ZooStore<T> implements TSto
     try {
       String txpath = getTXPath(tid);
       String top = findTop(txpath);
-      if (top == null) return null;
+      if (top == null)
+        return null;
       
       byte[] ser = zk.getData(txpath + "/" + top, null);
       return (Repo<T>) deserialize(ser);
@@ -244,9 +257,11 @@ public class ZooStore<T> implements TSto
     String max = "";
     
     for (String child : ops)
-      if (child.startsWith("repo_") && child.compareTo(max) > 0) max = child;
+      if (child.startsWith("repo_") && child.compareTo(max) > 0)
+        max = child;
     
-    if (max.equals("")) return null;
+    if (max.equals(""))
+      return null;
     
     return max;
   }
@@ -277,7 +292,8 @@ public class ZooStore<T> implements TSto
     try {
       String txpath = getTXPath(tid);
       String top = findTop(txpath);
-      if (top == null) throw new IllegalStateException("Tried to pop when empty " + tid);
+      if (top == null)
+        throw new IllegalStateException("Tried to pop when empty " + tid);
       zk.recursiveDelete(txpath + "/" + top, NodeMissingPolicy.SKIP);
     } catch (Exception e) {
       throw new RuntimeException(e);
@@ -309,7 +325,8 @@ public class ZooStore<T> implements TSto
       }
       
       TStatus status = _getStatus(tid);
-      if (expected.contains(status)) return status;
+      if (expected.contains(status))
+        return status;
       
       synchronized (this) {
         if (events == statusChangeEvents) {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java Thu Oct 27 15:24:51 2011
@@ -178,7 +178,8 @@ public class GarbageCollectWriteAheadLog
     while (iterator.hasNext()) {
       for (String filename : iterator.next().logSet) {
         filename = filename.split("/", 2)[1];
-        if (fileToServerMap.remove(filename) != null) status.currentLog.inUse++;
+        if (fileToServerMap.remove(filename) != null)
+          status.currentLog.inUse++;
         count++;
       }
     }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java Thu Oct 27 15:24:51 2011
@@ -141,7 +141,8 @@ public class SimpleGarbageCollector impl
       fs = TraceFileSystem.wrap(FileUtil.getFileSystem(CachedConfiguration.getInstance(), ServerConfiguration.getSiteConfiguration()));
       ;
       commandLine = new BasicParser().parse(opts, args);
-      if (commandLine.getArgs().length != 0) throw new ParseException("Extraneous arguments");
+      if (commandLine.getArgs().length != 0)
+        throw new ParseException("Extraneous arguments");
       
       safemode = commandLine.hasOption(optSafeMode.getOpt());
       offline = commandLine.hasOption(optOffline.getOpt());
@@ -198,7 +199,8 @@ public class SimpleGarbageCollector impl
     Sampler sampler = new CountSampler(100);
     
     while (true) {
-      if (sampler.next()) Trace.on("gc");
+      if (sampler.next())
+        Trace.on("gc");
       
       Span gcSpan = Trace.start("loop");
       tStart = System.currentTimeMillis();
@@ -224,11 +226,12 @@ public class SimpleGarbageCollector impl
         
         // STEP 3: delete files
         if (safemode) {
-          if (verbose) System.out.println("SAFEMODE: There are " + candidates.size() + " data file candidates marked for deletion.\n"
-              + "          Examine the log files to identify them.\n" + "          They can be removed by executing: bin/accumulo gc --offline\n"
-              + "WARNING:  Do not run the garbage collector in offline mode unless you are positive\n"
-              + "          that the accumulo METADATA table is in a clean state, or that accumulo\n"
-              + "          has not yet been run, in the case of an upgrade.");
+          if (verbose)
+            System.out.println("SAFEMODE: There are " + candidates.size() + " data file candidates marked for deletion.\n"
+                + "          Examine the log files to identify them.\n" + "          They can be removed by executing: bin/accumulo gc --offline\n"
+                + "WARNING:  Do not run the garbage collector in offline mode unless you are positive\n"
+                + "          that the accumulo METADATA table is in a clean state, or that accumulo\n"
+                + "          has not yet been run, in the case of an upgrade.");
           log.info("SAFEMODE: Listing all data file candidates for deletion");
           for (String s : candidates)
             log.info("SAFEMODE: " + s);
@@ -257,7 +260,8 @@ public class SimpleGarbageCollector impl
       tStop = System.currentTimeMillis();
       log.info(String.format("Collect cycle took %.2f seconds", ((tStop - tStart) / 1000.0)));
       
-      if (offline) break;
+      if (offline)
+        break;
       
       if (candidateMemExceeded) {
         log.info("Gathering of candidates was interrupted due to memory shortage. Bypassing cycle delay to collect the remaining candidates.");
@@ -314,9 +318,11 @@ public class SimpleGarbageCollector impl
       // then null is returned
       FileStatus[] tabletDirs = fs.listStatus(new Path(ServerConstants.getTablesDir() + "/" + delTableId));
       
-      if (tabletDirs == null) continue;
+      if (tabletDirs == null)
+        continue;
       
-      if (tabletDirs.length == 0) fs.delete(new Path(ServerConstants.getTablesDir() + "/" + delTableId), false);
+      if (tabletDirs.length == 0)
+        fs.delete(new Path(ServerConstants.getTablesDir() + "/" + delTableId), false);
     }
   }
   
@@ -450,7 +456,8 @@ public class SimpleGarbageCollector impl
           }
         }
         
-        if (count > 0) log.debug("Folder has bulk processing flag: " + blipPath);
+        if (count > 0)
+          log.debug("Folder has bulk processing flag: " + blipPath);
         
       }
     }
@@ -482,15 +489,19 @@ public class SimpleGarbageCollector impl
           
           // WARNING: This line is EXTREMELY IMPORTANT.
           // You MUST REMOVE candidates that are still in use
-          if (candidates.remove(delete)) log.debug("Candidate was still in use in the METADATA table: " + delete);
+          if (candidates.remove(delete))
+            log.debug("Candidate was still in use in the METADATA table: " + delete);
           
           String path = delete.substring(0, delete.lastIndexOf('/'));
-          if (candidates.remove(path)) log.debug("Candidate was still in use in the METADATA table: " + path);
+          if (candidates.remove(path))
+            log.debug("Candidate was still in use in the METADATA table: " + path);
         } else if (Constants.METADATA_DIRECTORY_COLUMN.hasColumns(entry.getKey())) {
           String table = new String(KeyExtent.tableOfMetadataRow(entry.getKey().getRow()));
           String delete = "/" + table + entry.getValue().toString();
-          if (candidates.remove(delete)) log.debug("Candidate was still in use in the METADATA table: " + delete);
-        } else throw new AccumuloException("Scanner over metadata table returned unexpected column : " + entry.getKey());
+          if (candidates.remove(delete))
+            log.debug("Candidate was still in use in the METADATA table: " + delete);
+        } else
+          throw new AccumuloException("Scanner over metadata table returned unexpected column : " + entry.getKey());
       }
     }
   }
@@ -581,7 +592,8 @@ public class SimpleGarbageCollector impl
                 String tableId = parts[1];
                 TableManager.getInstance().updateTableStateCache(tableId);
                 TableState tableState = TableManager.getInstance().getTableState(tableId);
-                if (tableState != null && tableState != TableState.DELETING) log.warn("File doesn't exist: " + p);
+                if (tableState != null && tableState != TableState.DELETING)
+                  log.warn("File doesn't exist: " + p);
               } else {
                 log.warn("Very strange path name: " + delete);
               }
@@ -624,7 +636,8 @@ public class SimpleGarbageCollector impl
   private boolean isDir(String delete) {
     int slashCount = 0;
     for (int i = 0; i < delete.length(); i++)
-      if (delete.charAt(i) == '/') slashCount++;
+      if (delete.charAt(i) == '/')
+        slashCount++;
     return slashCount == 2;
   }
   

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogArchiver.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogArchiver.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogArchiver.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogArchiver.java Thu Oct 27 15:24:51 2011
@@ -45,7 +45,8 @@ public class LogArchiver {
   private final boolean archive;
   
   static Path archiveName(String fullPath) {
-    if (isArchive(fullPath)) return new Path(fullPath);
+    if (isArchive(fullPath))
+      return new Path(fullPath);
     return new Path(fullPath + ".archiving");
   }
   
@@ -54,7 +55,8 @@ public class LogArchiver {
   }
   
   static public String origName(String archiving) {
-    if (!isArchive(archiving)) throw new IllegalArgumentException(archiving);
+    if (!isArchive(archiving))
+      throw new IllegalArgumentException(archiving);
     return archiving.substring(0, archiving.length() - ".archiving".length());
   }
   
@@ -136,7 +138,8 @@ public class LogArchiver {
   public void archive(final String fullName) throws IOException {
     final Path fullPath = new Path(fullName);
     final String name = fullPath.getName();
-    if (archiving.contains(name)) return;
+    if (archiving.contains(name))
+      return;
     archiving.add(name);
     
     if (!archive) {
@@ -144,8 +147,10 @@ public class LogArchiver {
         @Override
         public void run() {
           try {
-            if (src.delete(fullPath, true)) log.info(fullPath + " deleted");
-            else log.error("Unable to delete " + fullPath);
+            if (src.delete(fullPath, true))
+              log.info(fullPath + " deleted");
+            else
+              log.error("Unable to delete " + fullPath);
           } catch (Exception ex) {
             log.error("Error trying to delete " + fullPath + ": " + ex);
           } finally {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogFileKey.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogFileKey.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogFileKey.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogFileKey.java Thu Oct 27 15:24:51 2011
@@ -135,8 +135,10 @@ public class LogFileKey implements Writa
   }
   
   private static int sign(long l) {
-    if (l < 0) return -1;
-    if (l > 0) return 1;
+    if (l < 0)
+      return -1;
+    if (l > 0)
+      return 1;
     return 0;
   }
   
@@ -145,7 +147,8 @@ public class LogFileKey implements Writa
     if (eventType(this.event) != eventType(o.event)) {
       return eventType(this.event) - eventType(o.event);
     }
-    if (this.event == OPEN) return 0;
+    if (this.event == OPEN)
+      return 0;
     if (this.tid != o.tid) {
       return this.tid - o.tid;
     }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogFileValue.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogFileValue.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogFileValue.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogFileValue.java Thu Oct 27 15:24:51 2011
@@ -63,7 +63,8 @@ public class LogFileValue implements Wri
   }
   
   public static String format(LogFileValue lfv, int maxMutations) {
-    if (lfv.mutations.length == 0) return "";
+    if (lfv.mutations.length == 0)
+      return "";
     StringBuilder builder = new StringBuilder();
     builder.append(lfv.mutations.length + " mutations:\n");
     for (int i = 0; i < lfv.mutations.length; i++) {

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogReader.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogReader.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogReader.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogReader.java Thu Oct 27 15:24:51 2011
@@ -73,8 +73,10 @@ public class LogReader {
       usage();
       return;
     }
-    if (cl.hasOption(rowOpt.getOpt())) row = new Text(cl.getOptionValue(rowOpt.getOpt()));
-    if (cl.hasOption(maxOpt.getOpt())) max = Integer.parseInt(cl.getOptionValue(maxOpt.getOpt()));
+    if (cl.hasOption(rowOpt.getOpt()))
+      row = new Text(cl.getOptionValue(rowOpt.getOpt()));
+    if (cl.hasOption(maxOpt.getOpt()))
+      max = Integer.parseInt(cl.getOptionValue(maxOpt.getOpt()));
     
     for (String file : files) {
       
@@ -122,7 +124,8 @@ public class LogReader {
           }
         }
         
-        if (!found) return;
+        if (!found)
+          return;
       } else {
         return;
       }

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/logger/LogService.java Thu Oct 27 15:24:51 2011
@@ -107,7 +107,8 @@ public class LogService implements Mutat
   }
   
   synchronized private void closedCheck() throws LoggerClosedException {
-    if (!shutdownState.equals(ShutdownState.REGISTERED)) throw new LoggerClosedException();
+    if (!shutdownState.equals(ShutdownState.REGISTERED))
+      throw new LoggerClosedException();
   }
   
   private List<FileLock> fileLocks = new ArrayList<FileLock>();
@@ -147,8 +148,10 @@ public class LogService implements Mutat
     }
     final Set<String> rootDirs = new HashSet<String>();
     for (String root : ServerConfiguration.getSystemConfiguration().get(Property.LOGGER_DIR).split(",")) {
-      if (!root.startsWith("/")) root = System.getenv("ACCUMULO_HOME") + "/" + root;
-      else if (root.equals("")) root = System.getProperty("org.apache.accumulo.core.dir.log");
+      if (!root.startsWith("/"))
+        root = System.getenv("ACCUMULO_HOME") + "/" + root;
+      else if (root.equals(""))
+        root = System.getProperty("org.apache.accumulo.core.dir.log");
       else if (root == null || root.isEmpty()) {
         String msg = "Write-ahead log directory not set!";
         LOG.fatal(msg);
@@ -162,12 +165,14 @@ public class LogService implements Mutat
       rootFile.mkdirs();
       FileOutputStream lockOutputStream = new FileOutputStream(root + "/.lock");
       FileLock fileLock = lockOutputStream.getChannel().tryLock();
-      if (fileLock == null) throw new IOException("Failed to acquire lock file");
+      if (fileLock == null)
+        throw new IOException("Failed to acquire lock file");
       fileLocks.add(fileLock);
       
       try {
         File test = new File(root, "test_writable");
-        if (!test.mkdir()) throw new RuntimeException("Unable to write to write-ahead log directory " + root);
+        if (!test.mkdir())
+          throw new RuntimeException("Unable to write to write-ahead log directory " + root);
         test.delete();
       } catch (Throwable t) {
         LOG.fatal("Unable to write to write-ahead log directory", t);



Mime
View raw message