Author: billie
Date: Mon Oct 17 17:58:31 2011
New Revision: 1185309

URL: http://svn.apache.org/viewvc?rev=1185309&view=rev
Log:
ACCUMULO-15 fixed related findTop bug

Modified:
    
incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkCombiner.java

Modified: 
incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkCombiner.java
URL: 
http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkCombiner.java?rev=1185309&r1=1185308&r2=1185309&view=diff
==============================================================================
--- 
incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkCombiner.java
 (original)
+++ 
incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/filedata/ChunkCombiner.java
 Mon Oct 17 17:58:31 2011
@@ -69,20 +69,21 @@ public class ChunkCombiner implements So
        }
 
        private void findTop() throws IOException {
-               topKey = null;
-               topValue = null;
-                               
+           do {
+               topKey = null;
+               topValue = null;
+           } while (source.hasTop() && _findTop()==null);
+       }
+
+       private byte[] _findTop() throws IOException {
                long maxTS;
                
-               if(!source.hasTop())
-                       return;
-               
                topKey = new Key(source.getTopKey());
                topValue = new Value(source.getTopValue());
                source.next();
                
                
if(!topKey.getColumnFamilyData().equals(FileDataIngest.CHUNK_CF_BS))
-                       return;
+                       return topKey.getColumnVisibility().getBytes();
                
                maxTS = topKey.getTimestamp();
                
@@ -102,9 +103,8 @@ public class ChunkCombiner implements So
                                        topKey.getColumnFamilyData().toArray(),
                                        
topKey.getColumnQualifierData().toArray(), 
                                        vis,  maxTS);
-               } else {
-                       findTop();
                }
+               return vis;
        }
        
        private byte[] getVisFromRefs() throws IOException {


Reply via email to