Author: kturner
Date: Tue May 29 19:31:57 2012
New Revision: 1343942

URL: http://svn.apache.org/viewvc?rev=1343942&view=rev
Log:
ACCUMULO-487 Made batch scanner iterator fail when batch scanner closed

Modified:
    
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java

Modified: 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
URL: 
http://svn.apache.org/viewvc/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java?rev=1343942&r1=1343941&r2=1343942&view=diff
==============================================================================
--- 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
 (original)
+++ 
accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
 Tue May 29 19:31:57 2012
@@ -178,7 +178,7 @@ public class TabletServerBatchReaderIter
       
       // don't have one cached, try to cache one and return success
       try {
-        while (nextEntry == null && fatalException == null)
+        while (nextEntry == null && fatalException == null && 
!queryThreadPool.isShutdown())
           nextEntry = resultsQueue.poll(1, TimeUnit.SECONDS);
         
         if (fatalException != null)
@@ -187,6 +187,9 @@ public class TabletServerBatchReaderIter
           else
             throw new RuntimeException(fatalException);
         
+        if (queryThreadPool.isShutdown())
+          throw new RuntimeException("scanner closed");
+
         return nextEntry.getKey() != null && nextEntry.getValue() != null;
       } catch (InterruptedException e) {
         throw new RuntimeException(e);


Reply via email to