Revision: 8066
http://sourceforge.net/p/bigdata/code/8066
Author: thompsonbry
Date: 2014-04-07 12:08:13 +0000 (Mon, 07 Apr 2014)
Log Message:
-----------
Bug fix for scale-out client-side async iterator.
Bug fix for subtask used in scale-out bulk loader (async index writer).
See #871 (interrupt handling code review).
Modified Paths:
--------------
branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/ndx/pipeline/AbstractSubtask.java
branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/proxy/ClientAsynchronousIterator.java
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/ndx/pipeline/AbstractSubtask.java
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/ndx/pipeline/AbstractSubtask.java 2014-04-07 12:01:15 UTC (rev 8065)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/ndx/pipeline/AbstractSubtask.java 2014-04-07 12:08:13 UTC (rev 8066)
@@ -337,8 +337,8 @@
public boolean hasNext() throws InterruptedException {
- // The thread in which this method runs.
- final Thread t = Thread.currentThread();
+// // The thread in which this method runs.
+// final Thread t = Thread.currentThread();
// when we start looking for a chunk.
final long begin = System.nanoTime();
@@ -349,7 +349,7 @@
master.halted();
// interrupted?
- if (t.isInterrupted()) {
+ if (Thread.interrupted()) {
throw master.halt(new InterruptedException(toString()));
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/proxy/ClientAsynchronousIterator.java
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/proxy/ClientAsynchronousIterator.java 2014-04-07 12:01:15 UTC (rev 8065)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata/src/java/com/bigdata/service/proxy/ClientAsynchronousIterator.java 2014-04-07 12:08:13 UTC (rev 8066)
@@ -268,10 +268,13 @@
*/
private class ReaderTask implements Callable<Void> {
+ @Override
public Void call() throws Exception {
- final Thread t = Thread.currentThread();
+// final Thread t = Thread.currentThread();
+ boolean interrupted = false;
+
try {
/*
@@ -299,10 +302,11 @@
if (trace)
System.err.print('~');
- if (t.isInterrupted()) {
+ if (Thread.interrupted()) {
// thread interrupted, so we are done.
- break;
+ interrupted = true;
+ break; // break out of while(true)
}
@@ -344,10 +348,11 @@
*/
// don't call blocking method next() if we were interrupted.
- if (t.isInterrupted()) {
+ if (Thread.interrupted()) {
// thread interrupted, so we are done.
- break;
+ interrupted = true;
+ break; // break out of while(true)
}
@@ -392,7 +397,7 @@
}
if (INFO)
- log.info("Reader is done.");
+ log.info("Reader is done: interrupted" + interrupted);
return null;
@@ -448,7 +453,8 @@
}
}
-
+
+ @Override
public void close() {
if (future == null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|