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 [33/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/core/src/main/java/org/apache/accumulo/core/data/Key.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Key.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Key.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Key.java Thu Oct 27 15:24:51 2011
@@ -51,16 +51,19 @@ public class Key implements WritableComp
   
   @Override
   public boolean equals(Object o) {
-    if (o instanceof Key) return this.equals((Key) o, PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL);
+    if (o instanceof Key)
+      return this.equals((Key) o, PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME_DEL);
     return false;
   }
   
   private static final byte EMPTY_BYTES[] = new byte[0];
   
   private byte[] copyIfNeeded(byte ba[], int off, int len, boolean copyData) {
-    if (len == 0) return EMPTY_BYTES;
+    if (len == 0)
+      return EMPTY_BYTES;
     
-    if (!copyData && ba.length == len && off == 0) return ba;
+    if (!copyData && ba.length == len && off == 0)
+      return ba;
     
     byte[] copy = new byte[len];
     System.arraycopy(ba, off, copy, 0, len);
@@ -388,30 +391,40 @@ public class Key implements WritableComp
   public int compareTo(Key other, PartialKey part) {
     // check for matching row
     int result = WritableComparator.compareBytes(row, 0, row.length, other.row, 0, other.row.length);
-    if (result != 0 || part.equals(PartialKey.ROW)) return result;
+    if (result != 0 || part.equals(PartialKey.ROW))
+      return result;
     
     // check for matching column family
     result = WritableComparator.compareBytes(colFamily, 0, colFamily.length, other.colFamily, 0, other.colFamily.length);
-    if (result != 0 || part.equals(PartialKey.ROW_COLFAM)) return result;
+    if (result != 0 || part.equals(PartialKey.ROW_COLFAM))
+      return result;
     
     // check for matching column qualifier
     result = WritableComparator.compareBytes(colQualifier, 0, colQualifier.length, other.colQualifier, 0, other.colQualifier.length);
-    if (result != 0 || part.equals(PartialKey.ROW_COLFAM_COLQUAL)) return result;
+    if (result != 0 || part.equals(PartialKey.ROW_COLFAM_COLQUAL))
+      return result;
     
     // check for matching column visibility
     result = WritableComparator.compareBytes(colVisibility, 0, colVisibility.length, other.colVisibility, 0, other.colVisibility.length);
-    if (result != 0 || part.equals(PartialKey.ROW_COLFAM_COLQUAL_COLVIS)) return result;
+    if (result != 0 || part.equals(PartialKey.ROW_COLFAM_COLQUAL_COLVIS))
+      return result;
     
     // check for matching timestamp
-    if (timestamp < other.timestamp) result = 1;
-    else if (timestamp > other.timestamp) result = -1;
-    else result = 0;
+    if (timestamp < other.timestamp)
+      result = 1;
+    else if (timestamp > other.timestamp)
+      result = -1;
+    else
+      result = 0;
     
-    if (result != 0 || part.equals(PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME)) return result;
+    if (result != 0 || part.equals(PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME))
+      return result;
     
     // check for matching deleted flag
-    if (deleted) result = other.deleted ? 0 : -1;
-    else result = other.deleted ? 1 : 0;
+    if (deleted)
+      result = other.deleted ? 0 : -1;
+    else
+      result = other.deleted ? 1 : 0;
     
     return result;
   }
@@ -437,8 +450,10 @@ public class Key implements WritableComp
     
     for (int i = 0; i < plen; i++) {
       int c = 0xff & ba[offset + i];
-      if (c >= 32 && c <= 126) sb.append((char) c);
-      else sb.append("%" + String.format("%02x;", c));
+      if (c >= 32 && c <= 126)
+        sb.append((char) c);
+      else
+        sb.append("%" + String.format("%02x;", c));
     }
     
     if (len > maxLen) {
@@ -476,13 +491,16 @@ public class Key implements WritableComp
   }
   
   private static boolean isEqual(byte a1[], byte a2[]) {
-    if (a1 == a2) return true;
+    if (a1 == a2)
+      return true;
     
     int last = a1.length;
     
-    if (last != a2.length) return false;
+    if (last != a2.length)
+      return false;
     
-    if (last == 0) return true;
+    if (last == 0)
+      return true;
     
     // since sorted data is usually compared in accumulo,
     // the prefixes will normally be the same... so compare
@@ -498,7 +516,8 @@ public class Key implements WritableComp
     
     if (a1[last] == a2[last]) {
       for (int i = 0; i < last; i++)
-        if (a1[i] != a2[i]) return false;
+        if (a1[i] != a2[i])
+          return false;
     } else {
       return false;
     }
@@ -516,7 +535,8 @@ public class Key implements WritableComp
     
     List<TKeyValue> tkvl = Arrays.asList(new TKeyValue[param.size()]);
     
-    if (param.size() > 0) tkvl.set(0, new TKeyValue(param.get(0).key.toThrift(), ByteBuffer.wrap(param.get(0).value)));
+    if (param.size() > 0)
+      tkvl.set(0, new TKeyValue(param.get(0).key.toThrift(), ByteBuffer.wrap(param.get(0).value)));
     
     for (int i = param.size() - 1; i > 0; i--) {
       Key prevKey = param.get(i - 1).key;
@@ -531,21 +551,25 @@ public class Key implements WritableComp
       }
       
       if (isEqual(prevKey.colFamily, key.colFamily)) {
-        if (newKey == null) newKey = key.toThrift();
+        if (newKey == null)
+          newKey = key.toThrift();
         newKey.colFamily = null;
       }
       
       if (isEqual(prevKey.colQualifier, key.colQualifier)) {
-        if (newKey == null) newKey = key.toThrift();
+        if (newKey == null)
+          newKey = key.toThrift();
         newKey.colQualifier = null;
       }
       
       if (isEqual(prevKey.colVisibility, key.colVisibility)) {
-        if (newKey == null) newKey = key.toThrift();
+        if (newKey == null)
+          newKey = key.toThrift();
         newKey.colVisibility = null;
       }
       
-      if (newKey == null) newKey = key.toThrift();
+      if (newKey == null)
+        newKey = key.toThrift();
       
       tkvl.set(i, new TKeyValue(newKey, ByteBuffer.wrap(kv.value)));
     }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/KeyExtent.java Thu Oct 27 15:24:51 2011
@@ -74,9 +74,11 @@ public class KeyExtent implements Writab
   
   private void check() {
     
-    if (getTableId() == null) throw new IllegalArgumentException("null table id not allowed");
+    if (getTableId() == null)
+      throw new IllegalArgumentException("null table id not allowed");
     
-    if (getEndRow() == null || getPrevEndRow() == null) return;
+    if (getEndRow() == null || getPrevEndRow() == null)
+      return;
     
     if (getPrevEndRow().compareTo(getEndRow()) >= 0) {
       throw new IllegalArgumentException("prevEndRow (" + getPrevEndRow() + ") >= endRow (" + getEndRow() + ")");
@@ -157,7 +159,8 @@ public class KeyExtent implements Writab
     decodeMetadataRow(flattenedExtent);
     
     this.setPrevEndRow(null, false, false);
-    if (prevEndRow != null) this.setPrevEndRow(prevEndRow, false, true);
+    if (prevEndRow != null)
+      this.setPrevEndRow(prevEndRow, false, true);
     
     check();
   }
@@ -168,7 +171,8 @@ public class KeyExtent implements Writab
    */
   public void setTableId(Text tId) {
     
-    if (tId == null) throw new IllegalArgumentException("null table name not allowed");
+    if (tId == null)
+      throw new IllegalArgumentException("null table name not allowed");
     
     this.textTableId = dedupeTableId(tId);
     
@@ -184,12 +188,17 @@ public class KeyExtent implements Writab
   }
   
   private void setEndRow(Text endRow, boolean check, boolean copy) {
-    if (endRow != null) if (copy) this.textEndRow = new Text(endRow);
-    else this.textEndRow = endRow;
-    else this.textEndRow = null;
+    if (endRow != null)
+      if (copy)
+        this.textEndRow = new Text(endRow);
+      else
+        this.textEndRow = endRow;
+    else
+      this.textEndRow = null;
     
     hashCode = 0;
-    if (check) check();
+    if (check)
+      check();
   }
   
   /**
@@ -217,12 +226,17 @@ public class KeyExtent implements Writab
   }
   
   private void setPrevEndRow(Text prevEndRow, boolean check, boolean copy) {
-    if (prevEndRow != null) if (copy) this.textPrevEndRow = new Text(prevEndRow);
-    else this.textPrevEndRow = prevEndRow;
-    else this.textPrevEndRow = null;
+    if (prevEndRow != null)
+      if (copy)
+        this.textPrevEndRow = new Text(prevEndRow);
+      else
+        this.textPrevEndRow = prevEndRow;
+    else
+      this.textPrevEndRow = null;
     
     hashCode = 0;
-    if (check) check();
+    if (check)
+      check();
   }
   
   /**
@@ -297,9 +311,12 @@ public class KeyExtent implements Writab
    */
   
   public static Collection<KeyExtent> getKeyExtentsForRange(Text startRow, Text endRow, Set<KeyExtent> kes) {
-    if (kes == null) return Collections.emptyList();
-    if (startRow == null) startRow = new Text();
-    if (endRow == null) endRow = new Text();
+    if (kes == null)
+      return Collections.emptyList();
+    if (startRow == null)
+      startRow = new Text();
+    if (endRow == null)
+      endRow = new Text();
     Collection<KeyExtent> keys = new ArrayList<KeyExtent>();
     for (KeyExtent ckes : kes) {
       if (ckes.getPrevEndRow() == null) {
@@ -369,7 +386,8 @@ public class KeyExtent implements Writab
   }
   
   public static Value encodePrevEndRow(Text per) {
-    if (per == null) return new Value(new byte[] {0});
+    if (per == null)
+      return new Value(new byte[] {0});
     byte[] b = new byte[per.getLength() + 1];
     b[0] = 1;
     System.arraycopy(per.getBytes(), 0, b, 1, per.getLength());
@@ -389,21 +407,27 @@ public class KeyExtent implements Writab
   public int compareTo(KeyExtent other) {
     
     int result = getTableId().compareTo(other.getTableId());
-    if (result != 0) return result;
+    if (result != 0)
+      return result;
     
     if (this.getEndRow() == null) {
-      if (other.getEndRow() != null) return 1;
+      if (other.getEndRow() != null)
+        return 1;
     } else {
-      if (other.getEndRow() == null) return -1;
+      if (other.getEndRow() == null)
+        return -1;
       
       result = getEndRow().compareTo(other.getEndRow());
-      if (result != 0) return result;
+      if (result != 0)
+        return result;
     }
     if (this.getPrevEndRow() == null) {
-      if (other.getPrevEndRow() == null) return 0;
+      if (other.getPrevEndRow() == null)
+        return 0;
       return -1;
     }
-    if (other.getPrevEndRow() == null) return 1;
+    if (other.getPrevEndRow() == null)
+      return 1;
     return this.getPrevEndRow().compareTo(other.getPrevEndRow());
   }
   
@@ -411,7 +435,8 @@ public class KeyExtent implements Writab
   
   @Override
   public int hashCode() {
-    if (hashCode != 0) return hashCode;
+    if (hashCode != 0)
+      return hashCode;
     
     int prevEndRowHash = 0;
     int endRowHash = 0;
@@ -428,15 +453,18 @@ public class KeyExtent implements Writab
   }
   
   private boolean equals(Text t1, Text t2) {
-    if (t1 == null || t2 == null) return t1 == t2;
+    if (t1 == null || t2 == null)
+      return t1 == t2;
     
     return t1.equals(t2);
   }
   
   @Override
   public boolean equals(Object o) {
-    if (o == this) return true;
-    if (!(o instanceof KeyExtent)) return false;
+    if (o == this)
+      return true;
+    if (!(o instanceof KeyExtent))
+      return false;
     KeyExtent oke = (KeyExtent) o;
     return textTableId.equals(oke.textTableId) && equals(textEndRow, oke.textEndRow) && equals(textPrevEndRow, oke.textPrevEndRow);
   }
@@ -447,11 +475,15 @@ public class KeyExtent implements Writab
     String prevEndRowString;
     String tableIdString = getTableId().toString().replaceAll(";", "\\\\;").replaceAll("\\\\", "\\\\\\\\");
     
-    if (getEndRow() == null) endRowString = "<";
-    else endRowString = ";" + TextUtil.truncate(getEndRow()).toString().replaceAll(";", "\\\\;").replaceAll("\\\\", "\\\\\\\\");
-    
-    if (getPrevEndRow() == null) prevEndRowString = "<";
-    else prevEndRowString = ";" + TextUtil.truncate(getPrevEndRow()).toString().replaceAll(";", "\\\\;").replaceAll("\\\\", "\\\\\\\\");
+    if (getEndRow() == null)
+      endRowString = "<";
+    else
+      endRowString = ";" + TextUtil.truncate(getEndRow()).toString().replaceAll(";", "\\\\;").replaceAll("\\\\", "\\\\\\\\");
+    
+    if (getPrevEndRow() == null)
+      prevEndRowString = "<";
+    else
+      prevEndRowString = ";" + TextUtil.truncate(getPrevEndRow()).toString().replaceAll(";", "\\\\;").replaceAll("\\\\", "\\\\\\\\");
     
     return tableIdString + endRowString + prevEndRowString;
   }
@@ -545,7 +577,8 @@ public class KeyExtent implements Writab
       
       @Override
       public byte[] getBytes() {
-        if (bsrow.isBackedByArray() && bsrow.offset() == 0) return bsrow.getBackingArray();
+        if (bsrow.isBackedByArray() && bsrow.offset() == 0)
+          return bsrow.getBackingArray();
         
         return bsrow.toArray();
       }
@@ -632,7 +665,8 @@ public class KeyExtent implements Writab
       return null;
     }
     
-    if (extent.getPrevEndRow().compareTo(first.getPrevEndRow()) >= 0) return first;
+    if (extent.getPrevEndRow().compareTo(first.getPrevEndRow()) >= 0)
+      return first;
     return null;
   }
   
@@ -655,7 +689,8 @@ public class KeyExtent implements Writab
   
   // Some duplication with TabletLocatorImpl
   public static Set<KeyExtent> findOverlapping(KeyExtent nke, SortedSet<KeyExtent> extents) {
-    if (nke == null || extents == null || extents.isEmpty()) return Collections.emptySet();
+    if (nke == null || extents == null || extents.isEmpty())
+      return Collections.emptySet();
     
     SortedSet<KeyExtent> start;
     
@@ -686,7 +721,8 @@ public class KeyExtent implements Writab
   
   // Specialization of findOverlapping(KeyExtent, SortedSet<KeyExtent> to work with SortedMap
   public static Set<KeyExtent> findOverlapping(KeyExtent nke, SortedMap<KeyExtent,? extends Object> extents) {
-    if (nke == null || extents == null || extents.isEmpty()) return Collections.emptySet();
+    if (nke == null || extents == null || extents.isEmpty())
+      return Collections.emptySet();
     
     SortedMap<KeyExtent,? extends Object> start;
     

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Mutation.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Mutation.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Mutation.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Mutation.java Thu Oct 27 15:24:51 2011
@@ -85,8 +85,10 @@ public class Mutation implements Writabl
     
     void add(boolean b) {
       reserve(1);
-      if (b) data[offset++] = 1;
-      else data[offset++] = 0;
+      if (b)
+        data[offset++] = 1;
+      else
+        data[offset++] = 0;
     }
     
     void add(long v) {
@@ -214,7 +216,8 @@ public class Mutation implements Writabl
   
   private void put(Text cf, Text cq, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val) {
     
-    if (buffer == null) throw new IllegalStateException("Can not add to mutation after serializing it");
+    if (buffer == null)
+      throw new IllegalStateException("Can not add to mutation after serializing it");
     
     put(cf);
     put(cq);
@@ -226,7 +229,8 @@ public class Mutation implements Writabl
     if (val.length < VALUE_SIZE_COPY_CUTOFF) {
       put(val);
     } else {
-      if (values == null) values = new ArrayList<byte[]>();
+      if (values == null)
+        values = new ArrayList<byte[]>();
       byte copy[] = new byte[val.length];
       System.arraycopy(val, 0, copy, 0, val.length);
       values.add(copy);
@@ -326,7 +330,8 @@ public class Mutation implements Writabl
   
   private byte[] readBytes(SimpleReader in) {
     int len = in.readInt();
-    if (len == 0) return EMPTY_BYTES;
+    if (len == 0)
+      return EMPTY_BYTES;
     
     byte bytes[] = new byte[len];
     in.readBytes(bytes);
@@ -381,7 +386,8 @@ public class Mutation implements Writabl
   private int cachedValLens = -1;
   
   long getValueLengths() {
-    if (values == null) return 0;
+    if (values == null)
+      return 0;
     
     if (cachedValLens == -1) {
       int tmpCVL = 0;
@@ -452,7 +458,8 @@ public class Mutation implements Writabl
     out.write(data);
     out.writeInt(entries);
     
-    if (values == null) out.writeBoolean(false);
+    if (values == null)
+      out.writeBoolean(false);
     else {
       out.writeBoolean(true);
       out.writeInt(values.size());
@@ -467,7 +474,8 @@ public class Mutation implements Writabl
   
   @Override
   public boolean equals(Object o) {
-    if (o instanceof Mutation) return equals((Mutation) o);
+    if (o instanceof Mutation)
+      return equals((Mutation) o);
     return false;
   }
   
@@ -479,11 +487,13 @@ public class Mutation implements Writabl
   public boolean equals(Mutation m) {
     serialize();
     if (Arrays.equals(row, m.row) && entries == m.entries && Arrays.equals(data, m.data)) {
-      if (values == null && m.values == null) return true;
+      if (values == null && m.values == null)
+        return true;
       
       if (values != null && m.values != null && values.size() == m.values.size()) {
         for (int i = 0; i < values.size(); i++) {
-          if (!Arrays.equals(values.get(i), m.values.get(i))) return false;
+          if (!Arrays.equals(values.get(i), m.values.get(i)))
+            return false;
         }
         
         return true;

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/PartialKey.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/PartialKey.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/PartialKey.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/PartialKey.java Thu Oct 27 15:24:51 2011
@@ -31,7 +31,8 @@ public enum PartialKey {
   
   public static PartialKey getByDepth(int depth) {
     for (PartialKey d : PartialKey.values())
-      if (depth == d.depth) return d;
+      if (depth == d.depth)
+        return d;
     throw new IllegalArgumentException("Invalid legacy depth " + depth);
   }
   

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Range.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Range.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Range.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/data/Range.java Thu Oct 27 15:24:51 2011
@@ -167,9 +167,11 @@ public class Range implements WritableCo
   }
   
   public Range(Key start, Key stop, boolean startKeyInclusive, boolean stopKeyInclusive, boolean infiniteStartKey, boolean infiniteStopKey) {
-    if (infiniteStartKey && start != null) throw new IllegalArgumentException();
+    if (infiniteStartKey && start != null)
+      throw new IllegalArgumentException();
     
-    if (infiniteStopKey && stop != null) throw new IllegalArgumentException();
+    if (infiniteStopKey && stop != null)
+      throw new IllegalArgumentException();
     
     this.start = start;
     this.stop = stop;
@@ -196,7 +198,8 @@ public class Range implements WritableCo
       return false;
     }
     
-    if (startKeyInclusive) return key.compareTo(start) < 0;
+    if (startKeyInclusive)
+      return key.compareTo(start) < 0;
     return key.compareTo(start) <= 0;
   }
   
@@ -208,9 +211,11 @@ public class Range implements WritableCo
   }
   
   public boolean afterEndKey(Key key) {
-    if (infiniteStopKey) return false;
+    if (infiniteStopKey)
+      return false;
     
-    if (stopKeyInclusive) return stop.compareTo(key) < 0;
+    if (stopKeyInclusive)
+      return stop.compareTo(key) < 0;
     return stop.compareTo(key) <= 0;
   }
   
@@ -224,7 +229,8 @@ public class Range implements WritableCo
   
   @Override
   public boolean equals(Object o) {
-    if (o instanceof Range) return equals((Range) o);
+    if (o instanceof Range)
+      return equals((Range) o);
     return false;
   }
   
@@ -236,24 +242,39 @@ public class Range implements WritableCo
   public int compareTo(Range o) {
     int comp;
     
-    if (infiniteStartKey) if (o.infiniteStartKey) comp = 0;
-    else comp = -1;
-    else if (o.infiniteStartKey) comp = 1;
+    if (infiniteStartKey)
+      if (o.infiniteStartKey)
+        comp = 0;
+      else
+        comp = -1;
+    else if (o.infiniteStartKey)
+      comp = 1;
     else {
       comp = start.compareTo(o.start);
-      if (comp == 0) if (startKeyInclusive && !o.startKeyInclusive) comp = -1;
-      else if (!startKeyInclusive && o.startKeyInclusive) comp = 1;
+      if (comp == 0)
+        if (startKeyInclusive && !o.startKeyInclusive)
+          comp = -1;
+        else if (!startKeyInclusive && o.startKeyInclusive)
+          comp = 1;
       
     }
     
-    if (comp == 0) if (infiniteStopKey) if (o.infiniteStopKey) comp = 0;
-    else comp = 1;
-    else if (o.infiniteStopKey) comp = -1;
-    else {
-      comp = stop.compareTo(o.stop);
-      if (comp == 0) if (stopKeyInclusive && !o.stopKeyInclusive) comp = 1;
-      else if (!stopKeyInclusive && o.stopKeyInclusive) comp = -1;
-    }
+    if (comp == 0)
+      if (infiniteStopKey)
+        if (o.infiniteStopKey)
+          comp = 0;
+        else
+          comp = 1;
+      else if (o.infiniteStopKey)
+        comp = -1;
+      else {
+        comp = stop.compareTo(o.stop);
+        if (comp == 0)
+          if (stopKeyInclusive && !o.stopKeyInclusive)
+            comp = 1;
+          else if (!stopKeyInclusive && o.stopKeyInclusive)
+            comp = -1;
+      }
     
     return comp;
   }
@@ -263,7 +284,8 @@ public class Range implements WritableCo
   }
   
   public static List<Range> mergeOverlapping(Collection<Range> ranges) {
-    if (ranges.size() == 0) return Collections.emptyList();
+    if (ranges.size() == 0)
+      return Collections.emptyList();
     
     List<Range> ral = new ArrayList<Range>(ranges);
     Collections.sort(ral);
@@ -336,7 +358,8 @@ public class Range implements WritableCo
       }
     } else if (afterEndKey(range.getStartKey())
         || (getEndKey() != null && range.getStartKey().equals(getEndKey()) && !(range.isStartKeyInclusive() && isEndKeyInclusive()))) {
-      if (returnNullIfDisjoint) return null;
+      if (returnNullIfDisjoint)
+        return null;
       throw new IllegalArgumentException("Range " + range + " does not overlap " + this);
     } else if (beforeStartKey(range.getStartKey())) {
       sk = getStartKey();
@@ -350,7 +373,8 @@ public class Range implements WritableCo
       }
     } else if (beforeStartKey(range.getEndKey())
         || (getStartKey() != null && range.getEndKey().equals(getStartKey()) && !(range.isEndKeyInclusive() && isStartKeyInclusive()))) {
-      if (returnNullIfDisjoint) return null;
+      if (returnNullIfDisjoint)
+        return null;
       throw new IllegalArgumentException("Range " + range + " does not overlap " + this);
     } else if (afterEndKey(range.getEndKey())) {
       ek = getEndKey();
@@ -377,8 +401,10 @@ public class Range implements WritableCo
       ByteSequence mincf = new ArrayByteSequence(min.columnFamily);
       ByteSequence mincq;
       
-      if (min.columnQualifier != null) mincq = new ArrayByteSequence(min.columnQualifier);
-      else mincq = new ArrayByteSequence(new byte[0]);
+      if (min.columnQualifier != null)
+        mincq = new ArrayByteSequence(min.columnQualifier);
+      else
+        mincq = new ArrayByteSequence(new byte[0]);
       
       int cmp = cf.compareTo(mincf);
       
@@ -399,7 +425,8 @@ public class Range implements WritableCo
       
       ByteSequence maxcf = new ArrayByteSequence(max.columnFamily);
       ByteSequence maxcq = null;
-      if (max.columnQualifier != null) maxcq = new ArrayByteSequence(max.columnQualifier);
+      if (max.columnQualifier != null)
+        maxcq = new ArrayByteSequence(max.columnQualifier);
       
       boolean set = false;
       
@@ -417,8 +444,10 @@ public class Range implements WritableCo
       
       if (set) {
         eki = false;
-        if (maxcq == null) ek = new Key(row.toArray(), maxcf.toArray(), new byte[0], new byte[0], 0, false).followingKey(PartialKey.ROW_COLFAM);
-        else ek = new Key(row.toArray(), maxcf.toArray(), maxcq.toArray(), new byte[0], 0, false).followingKey(PartialKey.ROW_COLFAM_COLQUAL);
+        if (maxcq == null)
+          ek = new Key(row.toArray(), maxcf.toArray(), new byte[0], new byte[0], 0, false).followingKey(PartialKey.ROW_COLFAM);
+        else
+          ek = new Key(row.toArray(), maxcf.toArray(), maxcq.toArray(), new byte[0], 0, false).followingKey(PartialKey.ROW_COLFAM_COLQUAL);
       }
     }
     
@@ -454,8 +483,10 @@ public class Range implements WritableCo
   public void write(DataOutput out) throws IOException {
     out.writeBoolean(infiniteStartKey);
     out.writeBoolean(infiniteStopKey);
-    if (!infiniteStartKey) start.write(out);
-    if (!infiniteStopKey) stop.write(out);
+    if (!infiniteStartKey)
+      start.write(out);
+    if (!infiniteStopKey)
+      stop.write(out);
     out.writeBoolean(startKeyInclusive);
     out.writeBoolean(stopKeyInclusive);
   }
@@ -562,7 +593,8 @@ public class Range implements WritableCo
     int changeIndex = prefix.getLength() - 1;
     while (changeIndex >= 0 && prefixBytes[changeIndex] == (byte) 0xff)
       changeIndex--;
-    if (changeIndex < 0) return null;
+    if (changeIndex < 0)
+      return null;
     
     // copy prefix bytes into new array
     byte[] newBytes = new byte[changeIndex + 1];

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/BloomFilterLayer.java Thu Oct 27 15:24:51 2011
@@ -140,13 +140,15 @@ public class BloomFilterLayer {
     public synchronized void append(org.apache.accumulo.core.data.Key key, Value val) throws IOException {
       writer.append(key, val);
       Key bloomKey = transformer.transform(key);
-      if (bloomKey.getBytes().length > 0) bloomFilter.add(bloomKey);
+      if (bloomKey.getBytes().length > 0)
+        bloomFilter.add(bloomKey);
     }
     
     @Override
     public synchronized void close() throws IOException {
       
-      if (closed) return;
+      if (closed)
+        return;
       
       DataOutputStream out = writer.createMetaStore(BLOOM_FILE_NAME);
       out.writeUTF(transformer.getClass().getCanonicalName());
@@ -199,7 +201,8 @@ public class BloomFilterLayer {
         public void run() {
           
           // no need to load the bloom filter if the map file is closed
-          if (closed) return;
+          if (closed)
+            return;
           String ClassName = null;
           DataInputStream in = null;
           
@@ -208,7 +211,8 @@ public class BloomFilterLayer {
             DynamicBloomFilter tmpBloomFilter = new DynamicBloomFilter();
             
             // check for closed again after open but before reading the bloom filter in
-            if (closed) return;
+            if (closed)
+              return;
             
             /**
              * Load classname for keyFunctor
@@ -228,8 +232,10 @@ public class BloomFilterLayer {
           } catch (NoSuchMetaStoreException nsme) {
             // file does not have a bloom filter, ignore it
           } catch (IOException ioe) {
-            if (!closed) LOG.warn("Can't open BloomFilter", ioe);
-            else LOG.debug("Can't open BloomFilter, file closed : " + ioe.getMessage());
+            if (!closed)
+              LOG.warn("Can't open BloomFilter", ioe);
+            else
+              LOG.debug("Can't open BloomFilter, file closed : " + ioe.getMessage());
             
             bloomFilter = null;
           } catch (ClassNotFoundException e) {
@@ -242,8 +248,10 @@ public class BloomFilterLayer {
             LOG.error("Illegal acess exception", e);
             bloomFilter = null;
           } catch (NullPointerException npe) {
-            if (!closed) throw npe;
-            else LOG.debug("Can't open BloomFilter, NPE after closed ", npe);
+            if (!closed)
+              throw npe;
+            else
+              LOG.debug("Can't open BloomFilter, NPE after closed ", npe);
             
           } finally {
             if (in != null) {
@@ -295,12 +303,14 @@ public class BloomFilterLayer {
     boolean probablyHasKey(Range range) throws IOException {
       if (bloomFilter == null) {
         initiateLoad(maxLoadThreads);
-        if (bloomFilter == null) return true;
+        if (bloomFilter == null)
+          return true;
       }
       
       Key bloomKey = transformer.transform(range);
       
-      if (bloomKey == null || bloomKey.getBytes().length == 0) return true;
+      if (bloomKey == null || bloomKey.getBytes().length == 0)
+        return true;
       
       return bloomFilter.membershipTest(bloomKey);
     }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/FileOperations.java Thu Oct 27 15:24:51 2011
@@ -100,8 +100,10 @@ class DispatchingFileFactory extends Fil
   public FileSKVIterator openReader(String file, Range range, Set<ByteSequence> columnFamilies, boolean inclusive, FileSystem fs, Configuration conf,
       AccumuloConfiguration tableConf, BlockCache dataCache, BlockCache indexCache) throws IOException {
     
-    if (!tableConf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) indexCache = null;
-    if (!tableConf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) dataCache = null;
+    if (!tableConf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED))
+      indexCache = null;
+    if (!tableConf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED))
+      dataCache = null;
     
     return findFileFactory(file).openReader(file, range, columnFamilies, inclusive, fs, conf, tableConf, dataCache, indexCache);
   }
@@ -110,8 +112,10 @@ class DispatchingFileFactory extends Fil
   public FileSKVIterator openReader(String file, boolean seekToBeginning, FileSystem fs, Configuration conf, AccumuloConfiguration acuconf,
       BlockCache dataCache, BlockCache indexCache) throws IOException {
     
-    if (!acuconf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) indexCache = null;
-    if (!acuconf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) dataCache = null;
+    if (!acuconf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED))
+      indexCache = null;
+    if (!acuconf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED))
+      dataCache = null;
     
     FileSKVIterator iter = findFileFactory(file).openReader(file, seekToBeginning, fs, conf, acuconf, dataCache, indexCache);
     if (acuconf.getBoolean(Property.TABLE_BLOOM_ENABLED)) {
@@ -124,8 +128,10 @@ class DispatchingFileFactory extends Fil
   public FileSKVIterator openIndex(String file, FileSystem fs, Configuration conf, AccumuloConfiguration acuconf, BlockCache dCache, BlockCache iCache)
       throws IOException {
     
-    if (!acuconf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED)) iCache = null;
-    if (!acuconf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED)) dCache = null;
+    if (!acuconf.getBoolean(Property.TABLE_INDEXCACHE_ENABLED))
+      iCache = null;
+    if (!acuconf.getBoolean(Property.TABLE_BLOCKCACHE_ENABLED))
+      dCache = null;
     
     return findFileFactory(file).openIndex(file, fs, conf, acuconf, dCache, iCache);
   }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/FileUtil.java Thu Oct 27 15:24:51 2011
@@ -91,7 +91,8 @@ public class FileUtil {
       fs.mkdirs(new Path(tmpDir));
       
       // try to reserve the tmp dir
-      if (!fs.createNewFile(new Path(tmpDir + "/__reserve"))) tmpDir = null;
+      if (!fs.createNewFile(new Path(tmpDir + "/__reserve")))
+        tmpDir = null;
     }
     
     return tmpDir;
@@ -101,7 +102,8 @@ public class FileUtil {
       Collection<String> mapFiles, int maxFiles, String tmpDir, int pass) throws IOException {
     ArrayList<String> paths = new ArrayList<String>(mapFiles);
     
-    if (paths.size() <= maxFiles) return paths;
+    if (paths.size() <= maxFiles)
+      return paths;
     
     String newDir = String.format("%s/pass_%04d", tmpDir, pass);
     fs.mkdirs(new Path(newDir));
@@ -142,29 +144,34 @@ public class FileUtil {
           boolean gtPrevEndRow = prevEndRow == null || key.compareRow(prevEndRow) > 0;
           boolean lteEndRow = endRow == null || key.compareRow(endRow) <= 0;
           
-          if (gtPrevEndRow && lteEndRow) writer.append(key, new LongWritable(0));
+          if (gtPrevEndRow && lteEndRow)
+            writer.append(key, new LongWritable(0));
           
-          if (!lteEndRow) break;
+          if (!lteEndRow)
+            break;
           
           mmfi.next();
         }
       } finally {
         try {
-          if (reader != null) reader.close();
+          if (reader != null)
+            reader.close();
         } catch (IOException e) {
           log.error(e, e);
         }
         
         for (SortedKeyValueIterator<Key,Value> r : iters)
           try {
-            if (r != null) ((FileSKVIterator) r).close();
+            if (r != null)
+              ((FileSKVIterator) r).close();
           } catch (IOException e) {
             // continue closing
             log.error(e, e);
           }
         
         try {
-          if (writer != null) writer.close();
+          if (writer != null)
+            writer.close();
         } catch (IOException e) {
           log.error(e, e);
           throw e;
@@ -203,7 +210,8 @@ public class FileUtil {
         log.debug("Finished reducing indexes for " + endRow + " " + prevEndRow + " in " + String.format("%6.2f secs", (t2 - t1) / 1000.0));
       }
       
-      if (prevEndRow == null) prevEndRow = new Text();
+      if (prevEndRow == null)
+        prevEndRow = new Text();
       
       long numKeys = 0;
       
@@ -264,7 +272,8 @@ public class FileUtil {
     
     try {
       if (mapFiles.size() > maxToOpen) {
-        if (!useIndex) throw new IOException("Cannot find mid point using data files, too many " + mapFiles.size());
+        if (!useIndex)
+          throw new IOException("Cannot find mid point using data files, too many " + mapFiles.size());
         tmpDir = createTmpDir(acuConf, fs);
         
         log.debug("Too many indexes (" + mapFiles.size() + ") to open at once for " + endRow + " " + prevEndRow + ", reducing in tmpDir = " + tmpDir);
@@ -276,7 +285,8 @@ public class FileUtil {
         log.debug("Finished reducing indexes for " + endRow + " " + prevEndRow + " in " + String.format("%6.2f secs", (t2 - t1) / 1000.0));
       }
       
-      if (prevEndRow == null) prevEndRow = new Text();
+      if (prevEndRow == null)
+        prevEndRow = new Text();
       
       long t1 = System.currentTimeMillis();
       
@@ -315,7 +325,8 @@ public class FileUtil {
           keyBeforeMidPointPosition = keysRead - 1;
         }
         
-        if (lastKey == null) lastKey = new Key();
+        if (lastKey == null)
+          lastKey = new Key();
         
         lastKey.set(mmfi.getTopKey());
         
@@ -325,7 +336,8 @@ public class FileUtil {
         mmfi.next();
       }
       
-      if (keyBeforeMidPoint != null) ret.put(keyBeforeMidPointPosition / (double) numKeys, keyBeforeMidPoint);
+      if (keyBeforeMidPoint != null)
+        ret.put(keyBeforeMidPointPosition / (double) numKeys, keyBeforeMidPoint);
       
       long t2 = System.currentTimeMillis();
       
@@ -351,7 +363,8 @@ public class FileUtil {
     // close all of the index sequence files
     for (FileSKVIterator r : readers) {
       try {
-        if (r != null) r.close();
+        if (r != null)
+          r.close();
       } catch (IOException e) {
         // okay, try to close the rest anyway
         log.error(e, e);
@@ -360,8 +373,10 @@ public class FileUtil {
     
     if (tmpDir != null) {
       String tmpPrefix = acuConf.get(Property.INSTANCE_DFS_DIR) + "/tmp";
-      if (tmpDir.startsWith(tmpPrefix)) fs.delete(new Path(tmpDir), true);
-      else log.error("Did not delete tmp dir because it wasn't a tmp dir " + tmpDir);
+      if (tmpDir.startsWith(tmpPrefix))
+        fs.delete(new Path(tmpDir), true);
+      else
+        log.error("Did not delete tmp dir because it wasn't a tmp dir " + tmpDir);
     }
   }
   
@@ -374,28 +389,35 @@ public class FileUtil {
     for (String path : mapFiles) {
       FileSKVIterator reader = null;
       try {
-        if (useIndex) reader = FileOperations.getInstance().openIndex(path, fs, conf, acuConf);
-        else reader = FileOperations.getInstance().openReader(path, new Range(prevEndRow, false, null, true), LocalityGroupUtil.EMPTY_CF_SET, false, fs, conf,
-            acuConf);
+        if (useIndex)
+          reader = FileOperations.getInstance().openIndex(path, fs, conf, acuConf);
+        else
+          reader = FileOperations.getInstance().openReader(path, new Range(prevEndRow, false, null, true), LocalityGroupUtil.EMPTY_CF_SET, false, fs, conf,
+              acuConf);
         
         while (reader.hasTop()) {
           Key key = reader.getTopKey();
-          if (endRow != null && key.compareRow(endRow) > 0) break;
-          else if (prevEndRow == null || key.compareRow(prevEndRow) > 0) numKeys++;
+          if (endRow != null && key.compareRow(endRow) > 0)
+            break;
+          else if (prevEndRow == null || key.compareRow(prevEndRow) > 0)
+            numKeys++;
           
           reader.next();
         }
       } finally {
         try {
-          if (reader != null) reader.close();
+          if (reader != null)
+            reader.close();
         } catch (IOException e) {
           log.error(e, e);
         }
       }
       
-      if (useIndex) readers.add(FileOperations.getInstance().openIndex(path, fs, conf, acuConf));
-      else readers.add(FileOperations.getInstance().openReader(path, new Range(prevEndRow, false, null, true), LocalityGroupUtil.EMPTY_CF_SET, false, fs, conf,
-          acuConf));
+      if (useIndex)
+        readers.add(FileOperations.getInstance().openIndex(path, fs, conf, acuConf));
+      else
+        readers.add(FileOperations.getInstance().openReader(path, new Range(prevEndRow, false, null, true), LocalityGroupUtil.EMPTY_CF_SET, false, fs, conf,
+            acuConf));
       
     }
     return numKeys;
@@ -451,15 +473,17 @@ public class FileUtil {
       
       try {
         if (!reader.hasTop())
-        // file is empty, so there is no last key
-        continue;
+          // file is empty, so there is no last key
+          continue;
         
         Key key = reader.getLastKey();
         
-        if (lastKey == null || key.compareTo(lastKey) > 0) lastKey = key;
+        if (lastKey == null || key.compareTo(lastKey) > 0)
+          lastKey = key;
       } finally {
         try {
-          if (reader != null) reader.close();
+          if (reader != null)
+            reader.close();
         } catch (IOException e) {
           log.error(e, e);
         }
@@ -497,13 +521,15 @@ public class FileUtil {
         key.getRow(row);
         
         for (Entry<KeyExtent,MLong> entry : counts.entrySet())
-          if (entry.getKey().contains(row)) entry.getValue().l++;
+          if (entry.getKey().contains(row))
+            entry.getValue().l++;
         
         index.next();
       }
     } finally {
       try {
-        if (index != null) index.close();
+        if (index != null)
+          index.close();
       } catch (IOException e) {
         // continue with next file
         log.error(e, e);
@@ -513,7 +539,8 @@ public class FileUtil {
     Map<KeyExtent,Long> results = new TreeMap<KeyExtent,Long>();
     for (KeyExtent keyExtent : extents) {
       double numEntries = counts.get(keyExtent).l;
-      if (numEntries == 0) numEntries = 1;
+      if (numEntries == 0)
+        numEntries = 1;
       long estSize = (long) ((numEntries / totalIndexEntries) * fileSize);
       results.put(keyExtent, estSize);
     }
@@ -522,11 +549,13 @@ public class FileUtil {
   
   public static FileSystem getFileSystem(Configuration conf, AccumuloConfiguration acuconf) throws IOException {
     String uri = acuconf.get(Property.INSTANCE_DFS_URI);
-    if ("".equals(uri)) return FileSystem.get(conf);
-    else try {
-      return FileSystem.get(new URI(uri), conf);
-    } catch (URISyntaxException e) {
-      throw new IOException(e);
-    }
+    if ("".equals(uri))
+      return FileSystem.get(conf);
+    else
+      try {
+        return FileSystem.get(new URI(uri), conf);
+      } catch (URISyntaxException e) {
+        throw new IOException(e);
+      }
   }
 }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlock.java Thu Oct 27 15:24:51 2011
@@ -83,7 +83,8 @@ public class CachedBlock implements Heap
   }
   
   public int compareTo(CachedBlock that) {
-    if (this.accessTime == that.accessTime) return 0;
+    if (this.accessTime == that.accessTime)
+      return 0;
     return this.accessTime < that.accessTime ? 1 : -1;
   }
   

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlockQueue.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlockQueue.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlockQueue.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/CachedBlockQueue.java Thu Oct 27 15:24:51 2011
@@ -48,7 +48,8 @@ public class CachedBlockQueue implements
    */
   public CachedBlockQueue(long maxSize, long blockSize) {
     int initialSize = (int) Math.ceil(maxSize / (double) blockSize);
-    if (initialSize == 0) initialSize++;
+    if (initialSize == 0)
+      initialSize++;
     queue = new PriorityQueue<CachedBlock>(initialSize);
     heapSize = 0;
     this.maxSize = maxSize;

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java Thu Oct 27 15:24:51 2011
@@ -184,14 +184,22 @@ public class ClassSize {
             } else {// Is simple primitive
               String name = fieldClass.getName();
               
-              if (name.equals("int") || name.equals("I")) primitives += SizeConstants.SIZEOF_INT;
-              else if (name.equals("long") || name.equals("J")) primitives += SizeConstants.SIZEOF_LONG;
-              else if (name.equals("boolean") || name.equals("Z")) primitives += SizeConstants.SIZEOF_BOOLEAN;
-              else if (name.equals("short") || name.equals("S")) primitives += SizeConstants.SIZEOF_SHORT;
-              else if (name.equals("byte") || name.equals("B")) primitives += SizeConstants.SIZEOF_BYTE;
-              else if (name.equals("char") || name.equals("C")) primitives += SizeConstants.SIZEOF_CHAR;
-              else if (name.equals("float") || name.equals("F")) primitives += SizeConstants.SIZEOF_FLOAT;
-              else if (name.equals("double") || name.equals("D")) primitives += SizeConstants.SIZEOF_DOUBLE;
+              if (name.equals("int") || name.equals("I"))
+                primitives += SizeConstants.SIZEOF_INT;
+              else if (name.equals("long") || name.equals("J"))
+                primitives += SizeConstants.SIZEOF_LONG;
+              else if (name.equals("boolean") || name.equals("Z"))
+                primitives += SizeConstants.SIZEOF_BOOLEAN;
+              else if (name.equals("short") || name.equals("S"))
+                primitives += SizeConstants.SIZEOF_SHORT;
+              else if (name.equals("byte") || name.equals("B"))
+                primitives += SizeConstants.SIZEOF_BYTE;
+              else if (name.equals("char") || name.equals("C"))
+                primitives += SizeConstants.SIZEOF_CHAR;
+              else if (name.equals("float") || name.equals("F"))
+                primitives += SizeConstants.SIZEOF_FLOAT;
+              else if (name.equals("double") || name.equals("D"))
+                primitives += SizeConstants.SIZEOF_DOUBLE;
             }
             if (debug) {
               if (LOG.isDebugEnabled()) {

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java Thu Oct 27 15:24:51 2011
@@ -321,7 +321,8 @@ public class LruBlockCache implements Bl
   void evict() {
     
     // Ensure only one eviction at a time
-    if (!evictionLock.tryLock()) return;
+    if (!evictionLock.tryLock())
+      return;
     
     try {
       evictionInProgress = true;
@@ -330,7 +331,8 @@ public class LruBlockCache implements Bl
       
       LOG.debug("Block cache LRU eviction started.  Attempting to free " + bytesToFree + " bytes");
       
-      if (bytesToFree <= 0) return;
+      if (bytesToFree <= 0)
+        return;
       
       // Instantiate priority buckets
       BlockBucket bucketSingle = new BlockBucket(bytesToFree, blockSize, singleSize());
@@ -431,7 +433,8 @@ public class LruBlockCache implements Bl
     }
     
     public int compareTo(BlockBucket that) {
-      if (this.overflow() == that.overflow()) return 0;
+      if (this.overflow() == that.overflow())
+        return 0;
       return this.overflow() > that.overflow() ? 1 : -1;
     }
   }
@@ -515,7 +518,8 @@ public class LruBlockCache implements Bl
           } catch (InterruptedException e) {}
         }
         LruBlockCache cache = this.cache.get();
-        if (cache == null) break;
+        if (cache == null)
+          break;
         cache.evict();
       }
     }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java Thu Oct 27 15:24:51 2011
@@ -67,7 +67,8 @@ public class SimpleBlockCache implements
   public synchronized byte[] getBlock(String blockName) {
     processQueue(); // clear out some crap.
     Ref ref = cache.get(blockName);
-    if (ref == null) return null;
+    if (ref == null)
+      return null;
     return ref.get();
   }
   

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/impl/CachableBlockFile.java Thu Oct 27 15:24:51 2011
@@ -240,7 +240,8 @@ public class CachableBlockFile {
     }
     
     private synchronized BCFile.Reader getBCFile() throws IOException {
-      if (closed) throw new IllegalStateException("File " + fileName + " is closed");
+      if (closed)
+        throw new IllegalStateException("File " + fileName + " is closed");
       
       if (_bc == null) {
         // lazily open file if needed
@@ -275,7 +276,8 @@ public class CachableBlockFile {
     
     public void cacheMetaBlock(String blockName, byte[] b) {
       
-      if (_iCache == null) return;
+      if (_iCache == null)
+        return;
       
       String _lookup = fileName + "M" + blockName;
       try {
@@ -382,11 +384,13 @@ public class CachableBlockFile {
     }
     
     public synchronized void close() throws IOException {
-      if (closed) return;
+      if (closed)
+        return;
       
       closed = true;
       
-      if (_bc != null) _bc.close();
+      if (_bc != null)
+        _bc.close();
       
       if (fin != null) {
         fin.close();

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java Thu Oct 27 15:24:51 2011
@@ -48,7 +48,8 @@ public class RowFunctor implements KeyFu
       return false;
     }
     
-    if (range.getStartKey().equals(range.getEndKey(), keyDepth)) return true;
+    if (range.getStartKey().equals(range.getEndKey(), keyDepth))
+      return true;
     
     // include everything but the deleted flag in the comparison...
     return range.getStartKey().followingKey(keyDepth).equals(range.getEndKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME) && !range.isEndKeyInclusive();

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java Thu Oct 27 15:24:51 2011
@@ -81,13 +81,15 @@ public class MapFileOperations extends F
     
     @Override
     public Key getTopKey() {
-      if (!hasTop) throw new IllegalStateException();
+      if (!hasTop)
+        throw new IllegalStateException();
       return reader.getTopKey();
     }
     
     @Override
     public Value getTopValue() {
-      if (!hasTop) throw new IllegalStateException();
+      if (!hasTop)
+        throw new IllegalStateException();
       return reader.getTopValue();
     }
     
@@ -103,7 +105,8 @@ public class MapFileOperations extends F
     
     @Override
     public void next() throws IOException {
-      if (!hasTop) throw new IllegalStateException();
+      if (!hasTop)
+        throw new IllegalStateException();
       reader.next();
       hasTop = reader.hasTop() && !range.afterEndKey(reader.getTopKey());
     }
@@ -135,7 +138,8 @@ public class MapFileOperations extends F
   public FileSKVIterator openReader(String file, boolean seekToBeginning, FileSystem fs, Configuration conf, AccumuloConfiguration acuconf) throws IOException {
     FileSKVIterator iter = new FileCFSkippingIterator(new RangeIterator(MapFileUtil.openMapFile(acuconf, fs, file, conf)));
     
-    if (seekToBeginning) iter.seek(new Range(new Key(), null), new ArrayList<ByteSequence>(), false);
+    if (seekToBeginning)
+      iter.seek(new Range(new Key(), null), new ArrayList<ByteSequence>(), false);
     
     return iter;
   }
@@ -164,7 +168,8 @@ public class MapFileOperations extends F
       
       @Override
       public void startDefaultLocalityGroup() throws IOException {
-        if (secondCall) throw new IllegalStateException("Start default locality group called twice");
+        if (secondCall)
+          throw new IllegalStateException("Start default locality group called twice");
         
         secondCall = true;
       }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileUtil.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileUtil.java Thu Oct 27 15:24:51 2011
@@ -97,9 +97,11 @@ public class MapFileUtil {
       newConf.setInt("io.seqfile.compress.blocksize", tbs);
     }
     
-    if (fs.exists(new Path(dirname))) log.error("Map file " + dirname + " already exists", new Exception());
+    if (fs.exists(new Path(dirname)))
+      log.error("Map file " + dirname + " already exists", new Exception());
     
-    if (newConf != null) conf = newConf;
+    if (newConf != null)
+      conf = newConf;
     
     mfw = new MyMapFile.Writer(conf, fs, dirname, Key.class, Value.class, MySequenceFile.CompressionType.BLOCK);
     

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MyMapFile.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MyMapFile.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MyMapFile.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MyMapFile.java Thu Oct 27 15:24:51 2011
@@ -239,7 +239,8 @@ public class MyMapFile {
     
     private void checkKey(WritableComparable key) throws IOException {
       // check that keys are well-ordered
-      if (size != 0 && comparator.compare(lastKey, key) > 0) throw new IOException("key out of order: " + key + " after " + lastKey);
+      if (size != 0 && comparator.compare(lastKey, key) > 0)
+        throw new IOException("key out of order: " + key + " after " + lastKey);
       
       // update lastKey with a copy of key by writing and reading
       outBuf.reset();
@@ -354,15 +355,19 @@ public class MyMapFile {
       this.data = createDataFileReader(fs, dataFile, conf);
       this.firstPosition = data.getPosition();
       
-      if (comparator == null) this.comparator = WritableComparator.get(data.getKeyClass());
-      else this.comparator = comparator;
+      if (comparator == null)
+        this.comparator = WritableComparator.get(data.getKeyClass());
+      else
+        this.comparator = comparator;
       
       this.myIndexKey = new MapFileIndexKey(dirName + "/" + INDEX_FILE_NAME, fs);
       
       // open the index
       indexInfo = indexCache.get(myIndexKey);
-      if (indexInfo == null) this.index = new MySequenceFile.Reader(fs, indexFile, conf);
-      else this.index = null;
+      if (indexInfo == null)
+        this.index = new MySequenceFile.Reader(fs, indexFile, conf);
+      else
+        this.index = null;
     }
     
     /**
@@ -413,7 +418,8 @@ public class MyMapFile {
       indexInfo = indexCache.get(myIndexKey);
       if (indexInfo != null) {
         MapFileIndexKey temp = indexInfo.myKey.get();
-        if (temp != null) myIndexKey = temp;
+        if (temp != null)
+          myIndexKey = temp;
         return;
       }
       
@@ -431,10 +437,12 @@ public class MyMapFile {
         while (true) {
           WritableComparable k = comparator.newKey();
           
-          if (!index.next(k, position)) break;
+          if (!index.next(k, position))
+            break;
           
           // check order to make sure comparator is compatible
-          if (lastKey != null && comparator.compare(lastKey, k) > 0) throw new IOException("key out of order: " + k + " after " + lastKey);
+          if (lastKey != null && comparator.compare(lastKey, k) > 0)
+            throw new IOException("key out of order: " + k + " after " + lastKey);
           lastKey = k;
           
           if (skip > 0) {
@@ -578,16 +586,18 @@ public class MyMapFile {
       } else {
         seekIndex = binarySearch(key);
         if (seekIndex < 0) // decode insertion point
-        seekIndex = -seekIndex - 2;
+          seekIndex = -seekIndex - 2;
         
         if (seekIndex == -1) // belongs before first entry
-        seekPosition = firstPosition; // use beginning of file
-        else seekPosition = indexInfo.positions[seekIndex]; // else use index
+          seekPosition = firstPosition; // use beginning of file
+        else
+          seekPosition = indexInfo.positions[seekIndex]; // else use index
         seekLocation = 3;
         data.seek(seekPosition);
       }
       
-      if (nextKey == null) nextKey = comparator.newKey();
+      if (nextKey == null)
+        nextKey = comparator.newKey();
       
       long startTime = System.currentTimeMillis();
       
@@ -609,15 +619,17 @@ public class MyMapFile {
         if (c <= 0) { // at or beyond desired
           MyMapFile.mapFileSeekScans.addStat(scans);
           long timeSpent = System.currentTimeMillis() - startTime;
-          if (timeSpent > 200) log.debug("long seek time: " + timeSpent + " seek location: " + seekLocation + " seek scans: " + scans + " seeking key " + key
-              + " from " + lastKey + " previous " + previousKey);
+          if (timeSpent > 200)
+            log.debug("long seek time: " + timeSpent + " seek location: " + seekLocation + " seek scans: " + scans + " seeking key " + key + " from " + lastKey
+                + " previous " + previousKey);
           MyMapFile.mapFileSeekTimeStat.addStat(timeSpent);
           return c;
         }
       }
       long timeSpent = System.currentTimeMillis() - startTime;
-      if (timeSpent > 100) log.debug("long seek time (2): " + timeSpent + " seek location: " + seekLocation + " seek scans: " + scans + " seeking key " + key
-          + " from " + lastKey + " previous " + previousKey);
+      if (timeSpent > 100)
+        log.debug("long seek time (2): " + timeSpent + " seek location: " + seekLocation + " seek scans: " + scans + " seeking key " + key + " from " + lastKey
+            + " previous " + previousKey);
       MyMapFile.mapFileSeekTimeStat.addStat(timeSpent);
       MyMapFile.mapFileSeekScans.addStat(scans);
       return 1;
@@ -632,9 +644,12 @@ public class MyMapFile {
         WritableComparable midVal = indexInfo.keys[mid];
         int cmp = comparator.compare(midVal, key);
         
-        if (cmp < 0) low = mid + 1;
-        else if (cmp > 0) high = mid - 1;
-        else return mid; // key found
+        if (cmp < 0)
+          low = mid + 1;
+        else if (cmp > 0)
+          high = mid - 1;
+        else
+          return mid; // key found
       }
       return -(low + 1); // key not found.
     }
@@ -750,7 +765,8 @@ public class MyMapFile {
     
     @Override
     public Value getTopValue() {
-      if (topKey != null) return topValue;
+      if (topKey != null)
+        return topValue;
       return null;
     }
     
@@ -766,13 +782,16 @@ public class MyMapFile {
     
     @Override
     public void next() throws IOException {
-      if (interruptFlag != null && interruptCheckCount++ % 100 == 0 && interruptFlag.get()) throw new IterationInterruptedException();
+      if (interruptFlag != null && interruptCheckCount++ % 100 == 0 && interruptFlag.get())
+        throw new IterationInterruptedException();
       
       Key temp = previousKey;
       previousKey = topKey;
       topKey = temp;
-      if (topKey == null) topKey = (Key) comparator.newKey();
-      if (topValue == null) topValue = new Value();
+      if (topKey == null)
+        topKey = (Key) comparator.newKey();
+      if (topValue == null)
+        topValue = new Value();
       if (!next(topKey, topValue)) {
         topKey = null;
         // try to learn the last key
@@ -790,9 +809,11 @@ public class MyMapFile {
         throw new IllegalArgumentException("I do not know how to filter column families");
       }
       
-      if (range == null) throw new IllegalArgumentException("Cannot seek to null range");
+      if (range == null)
+        throw new IllegalArgumentException("Cannot seek to null range");
       
-      if (interruptFlag != null && interruptFlag.get()) throw new IterationInterruptedException();
+      if (interruptFlag != null && interruptFlag.get())
+        throw new IterationInterruptedException();
       
       Key key = range.getStartKey();
       if (key == null) {
@@ -813,7 +834,8 @@ public class MyMapFile {
       } else {
         // seek in the map file
         previousKey = null;
-        if (topValue == null) topValue = new Value();
+        if (topValue == null)
+          topValue = new Value();
         topKey = (Key) getClosest(key, topValue, false, topKey);
         if (topKey == null) {
           // we seeked past the end of the map file
@@ -835,7 +857,8 @@ public class MyMapFile {
     @Override
     public synchronized Key getFirstKey() throws IOException {
       readIndex();
-      if (indexInfo.keys.length == 0) return null;
+      if (indexInfo.keys.length == 0)
+        return null;
       return (Key) indexInfo.keys[0];
     }
     
@@ -849,7 +872,8 @@ public class MyMapFile {
     @Override
     public DataInputStream getMetaStore(String name) throws IOException {
       Path path = new Path(this.dirName, name);
-      if (!fs.exists(path)) throw new NoSuchMetaStoreException("name = " + name);
+      if (!fs.exists(path))
+        throw new NoSuchMetaStoreException("name = " + name);
       return fs.open(path);
     }
     
@@ -938,7 +962,8 @@ public class MyMapFile {
       }
       Writable key = ReflectionUtils.newInstance(keyClass, conf);
       Writable value = ReflectionUtils.newInstance(valueClass, conf);
-      if (!dryrun) indexWriter = MySequenceFile.createWriter(fs, conf, index, keyClass, LongWritable.class);
+      if (!dryrun)
+        indexWriter = MySequenceFile.createWriter(fs, conf, index, keyClass, LongWritable.class);
       long currentPos = 0L;
       long lastPos = 0L;
       
@@ -965,12 +990,14 @@ public class MyMapFile {
           // write an index entry at position 0 and whenever the position changes
           if (cnt == 0 || position.get() != lastPos) {
             position.set(lastPos);
-            if (!dryrun) indexWriter.append(key, position);
+            if (!dryrun)
+              indexWriter.append(key, position);
           }
         } else {
           if (cnt % indexInterval == 0) {
             position.set(currentPos);
-            if (!dryrun) indexWriter.append(key, position);
+            if (!dryrun)
+              indexWriter.append(key, position);
           }
           long pos = dataReader.getPosition();
           if (pos != currentPos) {
@@ -985,8 +1012,10 @@ public class MyMapFile {
       // truncated data file. swallow it.
       log.error("Exception when trying to fix map file " + dir, t);
     } finally {
-      if (dataReader != null) dataReader.close();
-      if (indexWriter != null) indexWriter.close();
+      if (dataReader != null)
+        dataReader.close();
+      if (indexWriter != null)
+        indexWriter.close();
     }
     return cnt;
   }

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MySequenceFile.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MySequenceFile.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MySequenceFile.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/map/MySequenceFile.java Thu Oct 27 15:24:51 2011
@@ -740,7 +740,8 @@ public class MySequenceFile {
     
     public void readFields(DataInput in) throws IOException {
       int sz = in.readInt();
-      if (sz < 0) throw new IOException("Invalid size: " + sz + " for file metadata object");
+      if (sz < 0)
+        throw new IOException("Invalid size: " + sz + " for file metadata object");
       this.theMetadata = new TreeMap<Text,Text>();
       for (int i = 0; i < sz; i++) {
         Text key = new Text();
@@ -752,7 +753,8 @@ public class MySequenceFile {
     }
     
     public boolean equals(Metadata other) {
-      if (other == null) return false;
+      if (other == null)
+        return false;
       if (this.theMetadata.size() != other.theMetadata.size()) {
         return false;
       }
@@ -776,7 +778,8 @@ public class MySequenceFile {
     
     @Override
     public boolean equals(Object other) {
-      if (other instanceof Metadata) return equals((Metadata) other);
+      if (other instanceof Metadata)
+        return equals((Metadata) other);
       return false;
     }
     
@@ -993,15 +996,18 @@ public class MySequenceFile {
     /** Append a key/value pair. */
     
     public synchronized void append(Object key, Object val) throws IOException {
-      if (key.getClass() != keyClass) throw new IOException("wrong key class: " + key.getClass().getName() + " is not " + keyClass);
-      if (val.getClass() != valClass) throw new IOException("wrong value class: " + val.getClass().getName() + " is not " + valClass);
+      if (key.getClass() != keyClass)
+        throw new IOException("wrong key class: " + key.getClass().getName() + " is not " + keyClass);
+      if (val.getClass() != valClass)
+        throw new IOException("wrong value class: " + val.getClass().getName() + " is not " + valClass);
       
       buffer.reset();
       
       // Append the 'key'
       keySerializer.serialize(key);
       int keyLength = buffer.getLength();
-      if (keyLength < 0) throw new IOException("negative length keys not allowed: " + key);
+      if (keyLength < 0)
+        throw new IOException("negative length keys not allowed: " + key);
       
       // Append the 'value'
       if (compress) {
@@ -1021,7 +1027,8 @@ public class MySequenceFile {
     }
     
     public synchronized void appendRaw(byte[] keyData, int keyOffset, int keyLength, ValueBytes val) throws IOException {
-      if (keyLength < 0) throw new IOException("negative length keys not allowed: " + keyLength);
+      if (keyLength < 0)
+        throw new IOException("negative length keys not allowed: " + keyLength);
       
       int valLength = val.getSize();
       
@@ -1101,15 +1108,18 @@ public class MySequenceFile {
     /** Append a key/value pair. */
     
     public synchronized void append(Object key, Object val) throws IOException {
-      if (key.getClass() != keyClass) throw new IOException("wrong key class: " + key.getClass().getName() + " is not " + keyClass);
-      if (val.getClass() != valClass) throw new IOException("wrong value class: " + val.getClass().getName() + " is not " + valClass);
+      if (key.getClass() != keyClass)
+        throw new IOException("wrong key class: " + key.getClass().getName() + " is not " + keyClass);
+      if (val.getClass() != valClass)
+        throw new IOException("wrong value class: " + val.getClass().getName() + " is not " + valClass);
       
       buffer.reset();
       
       // Append the 'key'
       keySerializer.serialize(key);
       int keyLength = buffer.getLength();
-      if (keyLength < 0) throw new IOException("negative length keys not allowed: " + key);
+      if (keyLength < 0)
+        throw new IOException("negative length keys not allowed: " + key);
       
       // Compress 'value' and append it
       deflateFilter.resetState();
@@ -1127,7 +1137,8 @@ public class MySequenceFile {
     /** Append a key/value pair. */
     public synchronized void appendRaw(byte[] keyData, int keyOffset, int keyLength, ValueBytes val) throws IOException {
       
-      if (keyLength < 0) throw new IOException("negative length keys not allowed: " + keyLength);
+      if (keyLength < 0)
+        throw new IOException("negative length keys not allowed: " + keyLength);
       
       int valLength = val.getSize();
       
@@ -1264,14 +1275,17 @@ public class MySequenceFile {
     /** Append a key/value pair. */
     
     public synchronized void append(Object key, Object val) throws IOException {
-      if (key.getClass() != keyClass) throw new IOException("wrong key class: " + key + " is not " + keyClass);
-      if (val.getClass() != valClass) throw new IOException("wrong value class: " + val + " is not " + valClass);
+      if (key.getClass() != keyClass)
+        throw new IOException("wrong key class: " + key + " is not " + keyClass);
+      if (val.getClass() != valClass)
+        throw new IOException("wrong value class: " + val + " is not " + valClass);
       
       // Save key/value into respective buffers
       int oldKeyLength = keyBuffer.getLength();
       keySerializer.serialize(key);
       int keyLength = keyBuffer.getLength() - oldKeyLength;
-      if (keyLength < 0) throw new IOException("negative length keys not allowed: " + key);
+      if (keyLength < 0)
+        throw new IOException("negative length keys not allowed: " + key);
       WritableUtils.writeVInt(keyLenBuffer, keyLength);
       
       int oldValLength = valBuffer.getLength();
@@ -1292,7 +1306,8 @@ public class MySequenceFile {
     /** Append a key/value pair. */
     public synchronized void appendRaw(byte[] keyData, int keyOffset, int keyLength, ValueBytes val) throws IOException {
       
-      if (keyLength < 0) throw new IOException("negative length keys not allowed");
+      if (keyLength < 0)
+        throw new IOException("negative length keys not allowed");
       
       int valLength = val.getSize();
       
@@ -1408,12 +1423,13 @@ public class MySequenceFile {
       byte[] versionBlock = new byte[VERSION.length];
       in.readFully(versionBlock);
       
-      if ((versionBlock[0] != VERSION[0]) || (versionBlock[1] != VERSION[1]) || (versionBlock[2] != VERSION[2])) throw new IOException(file
-          + " not a MySequenceFile");
+      if ((versionBlock[0] != VERSION[0]) || (versionBlock[1] != VERSION[1]) || (versionBlock[2] != VERSION[2]))
+        throw new IOException(file + " not a MySequenceFile");
       
       // Set 'version'
       version = versionBlock[3];
-      if (version > VERSION[3]) throw new VersionMismatchException(VERSION[3], version);
+      if (version > VERSION[3])
+        throw new VersionMismatchException(VERSION[3], version);
       
       if (version < BLOCK_COMPRESS_VERSION) {
         Text className = new Text();
@@ -1630,7 +1646,7 @@ public class MySequenceFile {
         in.readInt();
         in.readFully(syncCheck); // read syncCheck
         if (!Arrays.equals(sync, syncCheck)) // check it
-        throw new IOException("File is corrupt!");
+          throw new IOException("File is corrupt!");
       }
       syncSeen = true;
       
@@ -1775,19 +1791,22 @@ public class MySequenceFile {
      * Read the next key in the file into <code>key</code>, skipping its value. True if another entry exists, and false at end of file.
      */
     public synchronized boolean next(Writable key) throws IOException {
-      if (key.getClass() != getKeyClass()) throw new IOException("wrong key class: " + key.getClass().getName() + " is not " + keyClass);
+      if (key.getClass() != getKeyClass())
+        throw new IOException("wrong key class: " + key.getClass().getName() + " is not " + keyClass);
       
       if (!blockCompressed) {
         outBuf.reset();
         
         keyLength = next(outBuf);
-        if (keyLength < 0) return false;
+        if (keyLength < 0)
+          return false;
         
         valBuffer.reset(outBuf.getData(), outBuf.getLength());
         
         key.readFields(valBuffer);
         valBuffer.mark(0);
-        if (valBuffer.getPosition() != keyLength) throw new IOException(key + " read " + valBuffer.getPosition() + " bytes, should read " + keyLength);
+        if (valBuffer.getPosition() != keyLength)
+          throw new IOException(key + " read " + valBuffer.getPosition() + " bytes, should read " + keyLength);
       } else {
         // Reset syncSeen
         syncSeen = false;
@@ -1819,7 +1838,8 @@ public class MySequenceFile {
      * Read the next key/value pair in the file into <code>key</code> and <code>val</code>. Returns true if such a pair exists and false when at end of file
      */
     public synchronized boolean next(Writable key, Writable val) throws IOException {
-      if (val.getClass() != getValueClass()) throw new IOException("wrong value class: " + val + " is not " + valClass);
+      if (val.getClass() != getValueClass())
+        throw new IOException("wrong value class: " + val + " is not " + valClass);
       
       boolean more = next(key);
       
@@ -1844,7 +1864,7 @@ public class MySequenceFile {
       if (version > 1 && sync != null && length == SYNC_ESCAPE) { // process a sync entry
         in.readFully(syncCheck); // read syncCheck
         if (!Arrays.equals(sync, syncCheck)) // check it
-        throw new IOException("File is corrupt!");
+          throw new IOException("File is corrupt!");
         syncSeen = true;
         if (in.getPos() >= end) {
           return -1;
@@ -1925,7 +1945,8 @@ public class MySequenceFile {
       
       // Read 'key'
       if (noBufferedKeys == 0) {
-        if (in.getPos() >= end) return -1;
+        if (in.getPos() >= end)
+          return -1;
         
         try {
           readBlock();
@@ -1973,7 +1994,8 @@ public class MySequenceFile {
       
       // Read 'key'
       if (noBufferedKeys == 0) {
-        if (in.getPos() >= end) return -1;
+        if (in.getPos() >= end)
+          return -1;
         
         try {
           readBlock();
@@ -2004,13 +2026,15 @@ public class MySequenceFile {
         outBuf.reset();
         
         keyLength = next(outBuf);
-        if (keyLength < 0) return null;
+        if (keyLength < 0)
+          return null;
         
         valBuffer.reset(outBuf.getData(), outBuf.getLength());
         
         key = deserializeKey(key);
         valBuffer.mark(0);
-        if (valBuffer.getPosition() != keyLength) throw new IOException(key + " read " + valBuffer.getPosition() + " bytes, should read " + keyLength);
+        if (valBuffer.getPosition() != keyLength)
+          throw new IOException(key + " read " + valBuffer.getPosition() + " bytes, should read " + keyLength);
       } else {
         // Reset syncSeen
         syncSeen = false;
@@ -2112,7 +2136,8 @@ public class MySequenceFile {
         for (int i = 0; in.getPos() < end; i++) {
           int j = 0;
           for (; j < syncLen; j++) {
-            if (sync[j] != syncCheck[(i + j) % syncLen]) break;
+            if (sync[j] != syncCheck[(i + j) % syncLen])
+              break;
           }
           if (j == syncLen) {
             in.seek(in.getPos() - SYNC_SIZE); // position before sync
@@ -2260,9 +2285,12 @@ public class MySequenceFile {
       this.outFile = outFile;
       
       int segments = sortPass(deleteInput);
-      if (segments > 1) return merge(outFile.suffix(".0"), outFile.suffix(".0.index"), tempDir);
-      else if (segments == 1) return merge(new Path[] {outFile}, true, tempDir);
-      else return null;
+      if (segments > 1)
+        return merge(outFile.suffix(".0"), outFile.suffix(".0.index"), tempDir);
+      else if (segments == 1)
+        return merge(new Path[] {outFile}, true, tempDir);
+      else
+        return null;
     }
     
     /**
@@ -2361,7 +2389,8 @@ public class MySequenceFile {
             
             int keyLength = rawKeys.getLength() - keyOffset;
             
-            if (count == keyOffsets.length) grow();
+            if (count == keyOffsets.length)
+              grow();
             
             keyOffsets[count] = keyOffset; // update pointers
             pointers[count] = count;
@@ -2761,7 +2790,8 @@ public class MySequenceFile {
       }
       
       public boolean next() throws IOException {
-        if (size() == 0) return false;
+        if (size() == 0)
+          return false;
         if (minSegment != null) {
           // minSegment is non-null for all invocations of next except the first
           // one. For the first invocation, the priority queue is ready for use
@@ -2867,7 +2897,7 @@ public class MySequenceFile {
               totalBytes += segmentsToMerge.get(i).segmentLength;
             }
             if (totalBytes != 0) // being paranoid
-            progPerByte = 1.0f / (float) totalBytes;
+              progPerByte = 1.0f / (float) totalBytes;
             // reset factor to what it originally was
             factor = origFactor;
             return this;
@@ -2904,9 +2934,11 @@ public class MySequenceFile {
       
       // Hadoop-591
       public int getPassFactor(int passNo, int numSegments) {
-        if (passNo > 1 || numSegments <= factor || factor == 1) return factor;
+        if (passNo > 1 || numSegments <= factor || factor == 1)
+          return factor;
         int mod = (numSegments - 1) % (factor - 1);
-        if (mod == 0) return factor;
+        if (mod == 0)
+          return factor;
         return mod + 1;
       }
       
@@ -2914,7 +2946,8 @@ public class MySequenceFile {
        * Return (& remove) the requested number of segment descriptors from the sorted map.
        */
       public SegmentDescriptor[] getSegmentDescriptors(int numDescriptors) {
-        if (numDescriptors > sortedSegmentSizes.size()) numDescriptors = sortedSegmentSizes.size();
+        if (numDescriptors > sortedSegmentSizes.size())
+          numDescriptors = sortedSegmentSizes.size();
         SegmentDescriptor[] SegmentDescriptors = new SegmentDescriptor[numDescriptors];
         Iterator iter = sortedSegmentSizes.keySet().iterator();
         int i = 0;
@@ -3011,10 +3044,13 @@ public class MySequenceFile {
           Reader reader = new Reader(fs, segmentPathName, bufferSize, segmentOffset, segmentLength, conf, false);
           
           // sometimes we ignore syncs especially for temp merge files
-          if (ignoreSync) reader.sync = null;
+          if (ignoreSync)
+            reader.sync = null;
           
-          if (reader.getKeyClass() != keyClass) throw new IOException("wrong key class: " + reader.getKeyClass() + " is not " + keyClass);
-          if (reader.getValueClass() != valClass) throw new IOException("wrong value class: " + reader.getValueClass() + " is not " + valClass);
+          if (reader.getKeyClass() != keyClass)
+            throw new IOException("wrong key class: " + reader.getKeyClass() + " is not " + keyClass);
+          if (reader.getValueClass() != valClass)
+            throw new IOException("wrong value class: " + reader.getValueClass() + " is not " + valClass);
           this.in = reader;
           rawKey = new DataOutputBuffer();
         }
@@ -3084,7 +3120,8 @@ public class MySequenceFile {
        */
       public void cleanup() throws IOException {
         super.close();
-        if (super.shouldPreserveInput()) return;
+        if (super.shouldPreserveInput())
+          return;
         parentContainer.cleanup();
       }
     } // MySequenceFile.Sorter.LinkedSegmentsDescriptor

Modified: incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/rfile/IndexIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/rfile/IndexIterator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/rfile/IndexIterator.java (original)
+++ incubator/accumulo/trunk/src/core/src/main/java/org/apache/accumulo/core/file/rfile/IndexIterator.java Thu Oct 27 15:24:51 2011
@@ -36,8 +36,10 @@ class IndexIterator implements SortedKey
   
   IndexIterator(Iterator<IndexEntry> indexIter) {
     this.indexIter = indexIter;
-    if (indexIter.hasNext()) key = indexIter.next().getKey();
-    else key = null;
+    if (indexIter.hasNext())
+      key = indexIter.next().getKey();
+    else
+      key = null;
   }
   
   @Override
@@ -67,8 +69,10 @@ class IndexIterator implements SortedKey
   
   @Override
   public void next() throws IOException {
-    if (indexIter.hasNext()) key = indexIter.next().getKey();
-    else key = null;
+    if (indexIter.hasNext())
+      key = indexIter.next().getKey();
+    else
+      key = null;
   }
   
   @Override



Mime
View raw message