Description
When using WholeColumnFamilyIterator this exception is thrown:
java.lang.IllegalStateException: never been seeked at org.apache.accumulo.core.iterators.WrappingIterator.hasTop(WrappingIterator.java:80) at org.apache.accumulo.core.iterators.user.WholeColumnFamilyIterator.hasTop(WholeColumnFamilyIterator.java:213) at org.apache.accumulo.core.iterators.system.SourceSwitchingIterator.readNext(SourceSwitchingIterator.java:132) at org.apache.accumulo.core.iterators.system.SourceSwitchingIterator.seek(SourceSwitchingIterator.java:167) at org.apache.accumulo.tserver.Tablet.lookup(Tablet.java:1523) at org.apache.accumulo.tserver.Tablet.lookup(Tablet.java:1630) at org.apache.accumulo.tserver.TabletServer$ThriftClientHandler$LookupTask.run(TabletServer.java:1155) at org.apache.accumulo.trace.instrument.TraceRunnable.run(TraceRunnable.java:47) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.accumulo.trace.instrument.TraceRunnable.run(TraceRunnable.java:47) at org.apache.accumulo.core.util.LoggingRunnable.run(LoggingRunnable.java:34) at java.lang.Thread.run(Thread.java:745)
I THINK this is caused by re-initialization of the iterator stack. When this happens WCFI.seek() may end up returning without calling seek() on its source (because it gets a range with effectively nothing in it). This would be fine except that WCFI.hasTop() calls hasTop() on its source; since the source has not been seeked yet, the exception is thrown.
WholeRowIterator does not run into this problem in spite of using the same seek logic because its hasTop (actually RowEncodingIterator.hasTop) does not check the source's hasTop. (The way RowEncodingIterator and WCFI handle all of this does not really conform to the interface definition - they should really keep track themselves of whether they have been seeked and throw the appropriate exceptions.)
I actually encountered this in 1.6.2, but I can't select that as a version here. I believe the problem also exists in 1.6.5 (and 1.7.2) based on inspecting the source, but cannot test with those versions right now to confirm.