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 [9/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/j...
Date Thu, 27 Oct 2011 15:25:17 GMT
Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/ClassSize.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java (original)
+++ incubator/accumulo/branches/1.3/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.info("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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/SimpleBlockCache.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/keyfunctor/RowFunctor.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileOperations.java Thu Oct 27 15:24:51 2011
@@ -84,13 +84,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();
     }
     
@@ -106,7 +108,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());
     }
@@ -138,7 +141,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;
   }
@@ -167,7 +171,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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileUtil.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileUtil.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileUtil.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MapFileUtil.java Thu Oct 27 15:24:51 2011
@@ -100,9 +100,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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MyMapFile.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MyMapFile.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MyMapFile.java (original)
+++ incubator/accumulo/branches/1.3/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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MySequenceFile.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MySequenceFile.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MySequenceFile.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/map/MySequenceFile.java Thu Oct 27 15:24:51 2011
@@ -741,7 +741,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();
@@ -753,7 +754,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 {
     }
     
     public boolean equals(Object other) {
-      if (other instanceof Metadata) return equals((Metadata) other);
+      if (other instanceof Metadata)
+        return equals((Metadata) other);
       return false;
     }
     
@@ -992,15 +995,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) {
@@ -1020,7 +1026,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();
       
@@ -1100,15 +1107,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();
@@ -1126,7 +1136,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();
       
@@ -1263,14 +1274,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();
@@ -1291,7 +1305,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();
       
@@ -1407,12 +1422,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();
@@ -1629,7 +1645,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;
       
@@ -1774,19 +1790,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;
@@ -1818,7 +1837,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);
       
@@ -1843,7 +1863,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;
@@ -1924,7 +1944,8 @@ public class MySequenceFile {
       
       // Read 'key'
       if (noBufferedKeys == 0) {
-        if (in.getPos() >= end) return -1;
+        if (in.getPos() >= end)
+          return -1;
         
         try {
           readBlock();
@@ -1972,7 +1993,8 @@ public class MySequenceFile {
       
       // Read 'key'
       if (noBufferedKeys == 0) {
-        if (in.getPos() >= end) return -1;
+        if (in.getPos() >= end)
+          return -1;
         
         try {
           readBlock();
@@ -2003,13 +2025,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;
@@ -2111,7 +2135,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
@@ -2259,9 +2284,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;
     }
     
     /**
@@ -2360,7 +2388,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;
@@ -2760,7 +2789,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
@@ -2866,7 +2896,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;
@@ -2903,9 +2933,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;
       }
       
@@ -2913,7 +2945,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;
@@ -3010,10 +3043,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();
         }
@@ -3083,7 +3119,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/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/IndexIterator.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/IndexIterator.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/IndexIterator.java (original)
+++ incubator/accumulo/branches/1.3/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

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RFile.java Thu Oct 27 15:24:51 2011
@@ -144,8 +144,10 @@ public class RFile {
     @Override
     public IndexEntry get(int index) {
       int len;
-      if (index == offsets.length - 1) len = data.length - offsets[index];
-      else len = offsets[index + 1] - offsets[index];
+      if (index == offsets.length - 1)
+        len = data.length - offsets[index];
+      else
+        len = offsets[index + 1] - offsets[index];
       
       ByteArrayInputStream bais = new ByteArrayInputStream(data, offsets[index], len);
       DataInputStream dis = new DataInputStream(bais);
@@ -222,7 +224,8 @@ public class RFile {
     }
     
     private void setFirstKey(Key key) {
-      if (firstKey != null) throw new IllegalStateException();
+      if (firstKey != null)
+        throw new IllegalStateException();
       this.firstKey = new Key(key);
     }
     
@@ -280,12 +283,15 @@ public class RFile {
       int size = in.readInt();
       
       if (size == -1) {
-        if (!isDefaultLG) throw new IllegalStateException("Non default LG " + name + " does not have column families");
+        if (!isDefaultLG)
+          throw new IllegalStateException("Non default LG " + name + " does not have column families");
         
         columnFamilies = null;
       } else {
-        if (columnFamilies == null) columnFamilies = new HashMap<ByteSequence,Count>();
-        else columnFamilies.clear();
+        if (columnFamilies == null)
+          columnFamilies = new HashMap<ByteSequence,Count>();
+        else
+          columnFamilies.clear();
         
         for (int i = 0; i < size; i++) {
           int len = in.readInt();
@@ -369,7 +375,8 @@ public class RFile {
       }
       
       out.writeBoolean(firstKey != null);
-      if (firstKey != null) firstKey.write(out);
+      if (firstKey != null)
+        firstKey.write(out);
       
       out.writeInt(offsets.size());
       for (Integer offset : offsets) {
@@ -454,7 +461,8 @@ public class RFile {
       mba.writeInt(RINDEX_MAGIC);
       mba.writeInt(RINDEX_VER);
       
-      if (currentLocalityGroup != null) localityGroups.add(currentLocalityGroup);
+      if (currentLocalityGroup != null)
+        localityGroups.add(currentLocalityGroup);
       
       mba.writeInt(localityGroups.size());
       
@@ -569,7 +577,8 @@ public class RFile {
     
     @Override
     public void startNewLocalityGroup(String name, Set<ByteSequence> columnFamilies) throws IOException {
-      if (columnFamilies == null) throw new NullPointerException();
+      if (columnFamilies == null)
+        throw new NullPointerException();
       
       _startNewLocalityGroup(name, columnFamilies);
     }
@@ -646,7 +655,8 @@ public class RFile {
     public void close() throws IOException {
       closed = true;
       hasTop = false;
-      if (currBlock != null) currBlock.close();
+      if (currBlock != null)
+        currBlock.close();
       
     }
     
@@ -687,7 +697,8 @@ public class RFile {
     
     private void _next() throws IOException {
       
-      if (!hasTop) throw new IllegalStateException();
+      if (!hasTop)
+        throw new IllegalStateException();
       
       if (entriesLeft == 0) {
         
@@ -713,7 +724,8 @@ public class RFile {
     }
     
     private ABlockReader getDataBlock() throws IOException {
-      if (interruptFlag != null && interruptFlag.get()) throw new IterationInterruptedException();
+      if (interruptFlag != null && interruptFlag.get())
+        throw new IterationInterruptedException();
       
       return reader.getDataBlock(startBlock + block);
     }
@@ -721,11 +733,14 @@ public class RFile {
     @Override
     public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException {
       
-      if (closed) throw new IllegalStateException("Locality group reader closed");
+      if (closed)
+        throw new IllegalStateException("Locality group reader closed");
       
-      if (columnFamilies.size() != 0 || inclusive) throw new IllegalArgumentException("I do not know how to filter column families");
+      if (columnFamilies.size() != 0 || inclusive)
+        throw new IllegalArgumentException("I do not know how to filter column families");
       
-      if (interruptFlag != null && interruptFlag.get()) throw new IterationInterruptedException();
+      if (interruptFlag != null && interruptFlag.get())
+        throw new IterationInterruptedException();
       
       try {
         _seek(range);
@@ -762,7 +777,8 @@ public class RFile {
       }
       
       Key startKey = range.getStartKey();
-      if (startKey == null) startKey = new Key();
+      if (startKey == null)
+        startKey = new Key();
       
       boolean reseek = true;
       
@@ -841,9 +857,11 @@ public class RFile {
           
           val = new Value();
           
-          if (block > 0) prevKey = new Key(index.get(block - 1).getKey()); // initially prevKey is the last key of the prev block
-          else prevKey = new Key(); // first block in the file, so set prev key to minimal key
-          
+          if (block > 0)
+            prevKey = new Key(index.get(block - 1).getKey()); // initially prevKey is the last key of the prev block
+          else
+            prevKey = new Key(); // first block in the file, so set prev key to minimal key
+            
           MByteSequence valbs = new MByteSequence(new byte[64], 0, 0);
           RelativeKey tmpRk = new RelativeKey();
           fastSkipped = tmpRk.fastSkip(currBlock, startKey, valbs, prevKey, null);
@@ -869,7 +887,8 @@ public class RFile {
     
     @Override
     public Key getLastKey() throws IOException {
-      if (index.size() == 0) return null;
+      if (index.size() == 0)
+        return null;
       return index.get(index.size() - 1).getKey();
     }
     
@@ -923,8 +942,10 @@ public class RFile {
       int magic = mb.readInt();
       int ver = mb.readInt();
       
-      if (magic != RINDEX_MAGIC) throw new IOException("Did not see expected magic number, saw " + magic);
-      if (ver != RINDEX_VER && ver != 3) throw new IOException("Did not see expected version, saw " + ver);
+      if (magic != RINDEX_MAGIC)
+        throw new IOException("Did not see expected magic number, saw " + magic);
+      if (ver != RINDEX_VER && ver != 3)
+        throw new IOException("Did not see expected version, saw " + ver);
       
       int size = mb.readInt();
       lgReaders = new LocalityGroupReader[size];
@@ -943,7 +964,8 @@ public class RFile {
       
       nonDefaultColumnFamilies = new HashSet<ByteSequence>();
       for (LocalityGroupMetadata lgm : localityGroups) {
-        if (!lgm.isDefaultLG) nonDefaultColumnFamilies.addAll(lgm.columnFamilies.keySet());
+        if (!lgm.isDefaultLG)
+          nonDefaultColumnFamilies.addAll(lgm.columnFamilies.keySet());
       }
       
       createHeap(lgReaders.length);
@@ -974,7 +996,8 @@ public class RFile {
     
     @Override
     public void closeDeepCopies() {
-      if (deepCopy) throw new RuntimeException("Calling closeDeepCopies on a deep copy is not supported");
+      if (deepCopy)
+        throw new RuntimeException("Calling closeDeepCopies on a deep copy is not supported");
       
       for (Reader deepCopy : deepCopies)
         deepCopy.closeLocalityGroupReaders();
@@ -984,7 +1007,8 @@ public class RFile {
     
     @Override
     public void close() throws IOException {
-      if (deepCopy) throw new RuntimeException("Calling close on a deep copy is not supported");
+      if (deepCopy)
+        throw new RuntimeException("Calling close on a deep copy is not supported");
       
       closeDeepCopies();
       closeLocalityGroupReaders();
@@ -1011,7 +1035,8 @@ public class RFile {
           minKey = lgReaders[i].getFirstKey();
         } else {
           Key firstKey = lgReaders[i].getFirstKey();
-          if (firstKey != null && firstKey.compareTo(minKey) < 0) minKey = firstKey;
+          if (firstKey != null && firstKey.compareTo(minKey) < 0)
+            minKey = firstKey;
         }
       }
       
@@ -1031,7 +1056,8 @@ public class RFile {
           maxKey = lgReaders[i].getLastKey();
         } else {
           Key lastKey = lgReaders[i].getLastKey();
-          if (lastKey != null && lastKey.compareTo(maxKey) > 0) maxKey = lastKey;
+          if (lastKey != null && lastKey.compareTo(maxKey) > 0)
+            maxKey = lastKey;
         }
       }
       
@@ -1071,13 +1097,15 @@ public class RFile {
       numLGSeeked = 0;
       
       Set<ByteSequence> cfSet;
-      if (columnFamilies.size() > 0) if (columnFamilies instanceof Set<?>) {
-        cfSet = (Set<ByteSequence>) columnFamilies;
-      } else {
-        cfSet = new HashSet<ByteSequence>();
-        cfSet.addAll(columnFamilies);
-      }
-      else cfSet = Collections.emptySet();
+      if (columnFamilies.size() > 0)
+        if (columnFamilies instanceof Set<?>) {
+          cfSet = (Set<ByteSequence>) columnFamilies;
+        } else {
+          cfSet = new HashSet<ByteSequence>();
+          cfSet.addAll(columnFamilies);
+        }
+      else
+        cfSet = Collections.emptySet();
       
       for (LocalityGroupReader lgr : lgReaders) {
         
@@ -1115,10 +1143,16 @@ public class RFile {
            */
           
           for (Entry<ByteSequence,Count> entry : lgr.columnFamilies.entrySet())
-            if (entry.getValue().count > 0) if (cfSet.contains(entry.getKey())) if (inclusive) include = true;
-            else exclude = true;
-            else if (inclusive) exclude = true;
-            else include = true;
+            if (entry.getValue().count > 0)
+              if (cfSet.contains(entry.getKey()))
+                if (inclusive)
+                  include = true;
+                else
+                  exclude = true;
+              else if (inclusive)
+                exclude = true;
+              else
+                include = true;
         }
         
         if (include) {
@@ -1161,9 +1195,11 @@ public class RFile {
     
     @Override
     public void setInterruptFlag(AtomicBoolean flag) {
-      if (deepCopy) throw new RuntimeException("Calling setInterruptFlag on a deep copy is not supported");
+      if (deepCopy)
+        throw new RuntimeException("Calling setInterruptFlag on a deep copy is not supported");
       
-      if (deepCopies.size() != 0) throw new RuntimeException("Setting interrupt flag after calling deep copy not supported");
+      if (deepCopies.size() != 0)
+        throw new RuntimeException("Setting interrupt flag after calling deep copy not supported");
       
       setInterruptFlagInternal(flag);
     }

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RFileOperations.java Thu Oct 27 15:24:51 2011
@@ -112,7 +112,8 @@ public class RFileOperations extends Fil
     long hblock = conf.getLong("dfs.block.size", 1 << 26);
     long tblock = acuconf.getMemoryInBytes(Property.TABLE_FILE_BLOCK_SIZE);
     long block = hblock;
-    if (tblock > 0) block = tblock;
+    if (tblock > 0)
+      block = tblock;
     int bufferSize = conf.getInt("io.file.buffer.size", 4096);
     
     long blockSize = acuconf.getMemoryInBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE);

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/RelativeKey.java Thu Oct 27 15:24:51 2011
@@ -89,20 +89,26 @@ public class RelativeKey implements Writ
     fieldsSame = 0;
     
     if (prevKey != null) {
-      if (prevKey.getRowData().equals(key.getRowData())) fieldsSame |= ROW_SAME;
+      if (prevKey.getRowData().equals(key.getRowData()))
+        fieldsSame |= ROW_SAME;
       
-      if (prevKey.getColumnFamilyData().equals(key.getColumnFamilyData())) fieldsSame |= CF_SAME;
+      if (prevKey.getColumnFamilyData().equals(key.getColumnFamilyData()))
+        fieldsSame |= CF_SAME;
       
-      if (prevKey.getColumnQualifierData().equals(key.getColumnQualifierData())) fieldsSame |= CQ_SAME;
+      if (prevKey.getColumnQualifierData().equals(key.getColumnQualifierData()))
+        fieldsSame |= CQ_SAME;
       
-      if (prevKey.getColumnVisibilityData().equals(key.getColumnVisibilityData())) fieldsSame |= CV_SAME;
+      if (prevKey.getColumnVisibilityData().equals(key.getColumnVisibilityData()))
+        fieldsSame |= CV_SAME;
       
-      if (prevKey.getTimestamp() == key.getTimestamp()) fieldsSame |= TS_SAME;
+      if (prevKey.getTimestamp() == key.getTimestamp())
+        fieldsSame |= TS_SAME;
       
     }
     
     // stored deleted information in bit vector instead of its own byte
-    if (key.isDeleted()) fieldsSame |= DELETED;
+    if (key.isDeleted())
+      fieldsSame |= DELETED;
   }
   
   @Override
@@ -209,12 +215,15 @@ public class RelativeKey implements Writ
       cqCmp = cq.compareTo(stopCQ);
       
       if (rowCmp >= 0) {
-        if (rowCmp > 0) return 0;
+        if (rowCmp > 0)
+          return 0;
         
         if (cfCmp >= 0) {
-          if (cfCmp > 0) return 0;
+          if (cfCmp > 0)
+            return 0;
           
-          if (cqCmp >= 0) return 0;
+          if (cqCmp >= 0)
+            return 0;
         }
       }
       
@@ -297,12 +306,15 @@ public class RelativeKey implements Writ
       count++;
       
       if (changed && rowCmp >= 0) {
-        if (rowCmp > 0) break;
+        if (rowCmp > 0)
+          break;
         
         if (cfCmp >= 0) {
-          if (cfCmp > 0) break;
+          if (cfCmp > 0)
+            break;
           
-          if (cqCmp >= 0) break;
+          if (cqCmp >= 0)
+            break;
         }
       }
       

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BoundedRangeFileInputStream.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BoundedRangeFileInputStream.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BoundedRangeFileInputStream.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/BoundedRangeFileInputStream.java Thu Oct 27 15:24:51 2011
@@ -70,7 +70,8 @@ class BoundedRangeFileInputStream extend
   @Override
   public int read() throws IOException {
     int ret = read(oneByte);
-    if (ret == 1) return oneByte[0] & 0xff;
+    if (ret == 1)
+      return oneByte[0] & 0xff;
     return -1;
   }
   
@@ -86,7 +87,8 @@ class BoundedRangeFileInputStream extend
     }
     
     int n = (int) Math.min(Integer.MAX_VALUE, Math.min(len, (end - pos)));
-    if (n == 0) return -1;
+    if (n == 0)
+      return -1;
     int ret = 0;
     synchronized (in) {
       in.seek(pos);
@@ -117,7 +119,8 @@ class BoundedRangeFileInputStream extend
   
   @Override
   public void reset() throws IOException {
-    if (mark < 0) throw new IOException("Resetting to invalid mark");
+    if (mark < 0)
+      throw new IOException("Resetting to invalid mark");
     pos = mark;
   }
   

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Chunk.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Chunk.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Chunk.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Chunk.java Thu Oct 27 15:24:51 2011
@@ -113,10 +113,13 @@ final class Chunk {
      *           on I/O errors.
      */
     private boolean checkEOF() throws IOException {
-      if (isClosed()) return true;
+      if (isClosed())
+        return true;
       while (true) {
-        if (remain > 0) return false;
-        if (lastChunk) return true;
+        if (remain > 0)
+          return false;
+        if (lastChunk)
+          return true;
         readLength();
       }
     }
@@ -131,9 +134,11 @@ final class Chunk {
     
     @Override
     public int read() throws IOException {
-      if (checkEOF()) return -1;
+      if (checkEOF())
+        return -1;
       int ret = in.read();
-      if (ret < 0) throw new IOException("Corrupted chunk encoding stream");
+      if (ret < 0)
+        throw new IOException("Corrupted chunk encoding stream");
       --remain;
       return ret;
     }
@@ -152,7 +157,8 @@ final class Chunk {
       if (!checkEOF()) {
         int n = Math.min(remain, len);
         int ret = in.read(b, off, n);
-        if (ret < 0) throw new IOException("Corrupted chunk encoding stream");
+        if (ret < 0)
+          throw new IOException("Corrupted chunk encoding stream");
         remain -= ret;
         return ret;
       }

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/CompareUtils.java Thu Oct 27 15:24:51 2011
@@ -72,8 +72,10 @@ class CompareUtils {
     @Override
     public int compare(Scalar o1, Scalar o2) {
       long diff = o1.magnitude() - o2.magnitude();
-      if (diff < 0) return -1;
-      if (diff > 0) return 1;
+      if (diff < 0)
+        return -1;
+      if (diff > 0)
+        return 1;
       return 0;
     }
   }

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFile.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFile.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFile.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFile.java Thu Oct 27 15:24:51 2011
@@ -652,8 +652,10 @@ public class TFile {
       int compareTo(int bid, long rid) {
         if (this.blockIndex == bid) {
           long ret = this.recordIndex - rid;
-          if (ret > 0) return 1;
-          if (ret < 0) return -1;
+          if (ret > 0)
+            return 1;
+          if (ret < 0)
+            return -1;
           return 0;
         }
         return this.blockIndex - bid;
@@ -683,12 +685,17 @@ public class TFile {
        */
       @Override
       public boolean equals(Object obj) {
-        if (this == obj) return true;
-        if (obj == null) return false;
-        if (getClass() != obj.getClass()) return false;
+        if (this == obj)
+          return true;
+        if (obj == null)
+          return false;
+        if (getClass() != obj.getClass())
+          return false;
         Location other = (Location) obj;
-        if (blockIndex != other.blockIndex) return false;
-        if (recordIndex != other.recordIndex) return false;
+        if (blockIndex != other.blockIndex)
+          return false;
+        if (recordIndex != other.recordIndex)
+          return false;
         return true;
       }
     }
@@ -875,7 +882,8 @@ public class TFile {
       }
       checkTFileDataIndex();
       int blkIndex = (greater) ? tfileIndex.upperBound(key) : tfileIndex.lowerBound(key);
-      if (blkIndex < 0) return end;
+      if (blkIndex < 0)
+        return end;
       return new Location(blkIndex, 0);
     }
     
@@ -903,7 +911,8 @@ public class TFile {
      */
     Location getLocationNear(long offset) {
       int blockIndex = readerBCF.getBlockIndexNear(offset);
-      if (blockIndex == -1) return end;
+      if (blockIndex == -1)
+        return end;
       return new Location(blockIndex, 0);
     }
     
@@ -917,7 +926,8 @@ public class TFile {
      */
     public RawComparable getKeyNear(long offset) throws IOException {
       int blockIndex = readerBCF.getBlockIndexNear(offset);
-      if (blockIndex == -1) return null;
+      if (blockIndex == -1)
+        return null;
       checkTFileDataIndex();
       return new ByteArray(tfileIndex.getEntry(blockIndex).key);
     }
@@ -1332,7 +1342,8 @@ public class TFile {
        * check whether we have already successfully obtained the key. It also initializes the valueInputStream.
        */
       void checkKey() throws IOException {
-        if (klen >= 0) return;
+        if (klen >= 0)
+          return;
         if (atEnd()) {
           throw new EOFException("No key-value to read");
         }
@@ -1651,8 +1662,10 @@ public class TFile {
          */
         @Override
         public boolean equals(Object other) {
-          if (this == other) return true;
-          if (!(other instanceof Entry)) return false;
+          if (this == other)
+            return true;
+          if (!(other instanceof Entry))
+            return false;
           return ((Entry) other).compareTo(keyBuffer, 0, getKeyLength()) == 0;
         }
         
@@ -1699,8 +1712,10 @@ public class TFile {
         
         while (currentLocation.getRecordIndex() < entryInBlock) {
           int cmp = compareCursorKeyTo(key);
-          if (cmp > 0) return false;
-          if (cmp == 0 && !greater) return true;
+          if (cmp > 0)
+            return false;
+          if (cmp == 0 && !greater)
+            return true;
           if (!valueBufferInputStream.isClosed()) {
             valueBufferInputStream.close();
           }

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFileDumper.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFileDumper.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFileDumper.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/TFileDumper.java Thu Oct 27 15:24:51 2011
@@ -49,7 +49,8 @@ class TFileDumper {
   private enum Align {
     LEFT, CENTER, RIGHT, ZERO_PADDED;
     static String format(String s, int width, Align align) {
-      if (s.length() >= width) return s;
+      if (s.length() >= width)
+        return s;
       int room = width - s.length();
       Align alignAdjusted = align;
       if (room == 1) {

Modified: incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Utils.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Utils.java?rev=1189806&r1=1189805&r2=1189806&view=diff
==============================================================================
--- incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Utils.java (original)
+++ incubator/accumulo/branches/1.3/src/core/src/main/java/org/apache/accumulo/core/file/rfile/bcfile/Utils.java Thu Oct 27 15:24:51 2011
@@ -245,7 +245,8 @@ public final class Utils {
    */
   public static String readString(DataInput in) throws IOException {
     int length = readVInt(in);
-    if (length == -1) return null;
+    if (length == -1)
+      return null;
     byte[] buffer = new byte[length];
     in.readFully(buffer);
     return Text.decode(buffer);
@@ -357,8 +358,10 @@ public final class Utils {
     
     @Override
     public boolean equals(Object other) {
-      if (this == other) return true;
-      if (!(other instanceof Version)) return false;
+      if (this == other)
+        return true;
+      if (!(other instanceof Version))
+        return false;
       return compareTo((Version) other) == 0;
     }
     
@@ -389,8 +392,10 @@ public final class Utils {
       int mid = (low + high) >>> 1;
       T midVal = list.get(mid);
       int ret = cmp.compare(midVal, key);
-      if (ret < 0) low = mid + 1;
-      else high = mid;
+      if (ret < 0)
+        low = mid + 1;
+      else
+        high = mid;
     }
     return low;
   }
@@ -416,8 +421,10 @@ public final class Utils {
       int mid = (low + high) >>> 1;
       T midVal = list.get(mid);
       int ret = cmp.compare(midVal, key);
-      if (ret <= 0) low = mid + 1;
-      else high = mid;
+      if (ret <= 0)
+        low = mid + 1;
+      else
+        high = mid;
     }
     return low;
   }
@@ -441,8 +448,10 @@ public final class Utils {
       int mid = (low + high) >>> 1;
       Comparable<? super T> midVal = list.get(mid);
       int ret = midVal.compareTo(key);
-      if (ret < 0) low = mid + 1;
-      else high = mid;
+      if (ret < 0)
+        low = mid + 1;
+      else
+        high = mid;
     }
     return low;
   }
@@ -466,8 +475,10 @@ public final class Utils {
       int mid = (low + high) >>> 1;
       Comparable<? super T> midVal = list.get(mid);
       int ret = midVal.compareTo(key);
-      if (ret <= 0) low = mid + 1;
-      else high = mid;
+      if (ret <= 0)
+        low = mid + 1;
+      else
+        high = mid;
     }
     return low;
   }



Mime
View raw message