You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@accumulo.apache.org by "shweta.agrawal" <sh...@orkash.com> on 2015/06/03 13:57:45 UTC

Getting InterruptedException

Hi all,

I am reading data from one table through batch scanner and writing to 
other table and doing some modification.

But while doing this i am getting following error:

Exception in thread "main" java.lang.RuntimeException: 
java.lang.InterruptedException
     at 
org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator$1.receive(TabletServerBatchReaderIterator.java:173)
     at 
org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator.doLookup(TabletServerBatchReaderIterator.java:697)
     at 
org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator$QueryTask.run(TabletServerBatchReaderIterator.java:372)
     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)
Caused by: java.lang.InterruptedException
     at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2017)
     at 
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2052)
     at 
java.util.concurrent.ArrayBlockingQueue.put(ArrayBlockingQueue.java:324)
     at 
org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator$1.receive(TabletServerBatchReaderIterator.java:166)
     ... 8 more

Can anyone tell me about this exception ?

Thanks
Shweta

Re: Getting InterruptedException

Posted by William Slacum <ws...@gmail.com>.
What does your code look like?

I've seen issues where I have some code of the form:

BatchScanner s = connector.createBatchScanner(...);
for(Entry e : s) { System.out.println(e); }

This usually results in an InterruptedException because the
TabletServerBatchReaderIterator doesn't seem to have a reference back to
the batch scanner implementation, so the scanner will get garbage
collected, which closes the batch scanner. If I change my code to the
following I can avoid the issue:

BatchScanner s = connector.createBatchScanner(...);
try {
  for(Entry e: s) { System.out.println(e); }
} finally {
  s.close();
}

On Wed, Jun 3, 2015 at 7:57 AM, shweta.agrawal <sh...@orkash.com>
wrote:

> Hi all,
>
> I am reading data from one table through batch scanner and writing to
> other table and doing some modification.
>
> But while doing this i am getting following error:
>
> Exception in thread "main" java.lang.RuntimeException:
> java.lang.InterruptedException
>     at
> org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator$1.receive(TabletServerBatchReaderIterator.java:173)
>     at
> org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator.doLookup(TabletServerBatchReaderIterator.java:697)
>     at
> org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator$QueryTask.run(TabletServerBatchReaderIterator.java:372)
>     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)
> Caused by: java.lang.InterruptedException
>     at
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.reportInterruptAfterWait(AbstractQueuedSynchronizer.java:2017)
>     at
> java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2052)
>     at
> java.util.concurrent.ArrayBlockingQueue.put(ArrayBlockingQueue.java:324)
>     at
> org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator$1.receive(TabletServerBatchReaderIterator.java:166)
>     ... 8 more
>
> Can anyone tell me about this exception ?
>
> Thanks
> Shweta
>