-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add abilty to yield in Ivarators, AndIterator, OrIterator and return …
…metrics before yield (#704)
- Loading branch information
Showing
40 changed files
with
2,023 additions
and
580 deletions.
There are no files selected for viewing
265 changes: 184 additions & 81 deletions
265
...ery-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexCachingIteratorJexl.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
warehouse/query-core/src/main/java/datawave/core/iterators/IvaratorFuture.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package datawave.core.iterators; | ||
|
||
import java.util.concurrent.ExecutionException; | ||
import java.util.concurrent.Future; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.concurrent.TimeoutException; | ||
|
||
public class IvaratorFuture implements Future { | ||
|
||
final private Future future; | ||
final private DatawaveFieldIndexCachingIteratorJexl ivarator; | ||
|
||
public IvaratorFuture(Future future, DatawaveFieldIndexCachingIteratorJexl ivarator) { | ||
this.future = future; | ||
this.ivarator = ivarator; | ||
} | ||
|
||
@Override | ||
public boolean cancel(boolean mayInterruptIfRunning) { | ||
return this.future.cancel(mayInterruptIfRunning); | ||
} | ||
|
||
@Override | ||
public boolean isCancelled() { | ||
return this.future.isCancelled(); | ||
} | ||
|
||
@Override | ||
public boolean isDone() { | ||
return this.future.isDone(); | ||
} | ||
|
||
@Override | ||
public Object get() throws InterruptedException, ExecutionException { | ||
return this.future.get(); | ||
} | ||
|
||
@Override | ||
public Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { | ||
return this.future.get(timeout, unit); | ||
} | ||
|
||
public DatawaveFieldIndexCachingIteratorJexl getIvarator() { | ||
return ivarator; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
warehouse/query-core/src/main/java/datawave/query/attributes/WaitWindowExceededMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package datawave.query.attributes; | ||
|
||
/** | ||
* Indicates that the scan session was ended after exceeding the wait window | ||
*/ | ||
public class WaitWindowExceededMetadata extends Metadata { | ||
|
||
@Override | ||
public int size() { | ||
return 1; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
warehouse/query-core/src/main/java/datawave/query/exceptions/WaitWindowOverrunException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package datawave.query.exceptions; | ||
|
||
import org.apache.accumulo.core.data.Key; | ||
|
||
public class WaitWindowOverrunException extends RuntimeException { | ||
|
||
private Key yieldKey; | ||
|
||
public WaitWindowOverrunException(Key yieldKey) { | ||
this.yieldKey = yieldKey; | ||
} | ||
|
||
public Key getYieldKey() { | ||
return yieldKey; | ||
} | ||
|
||
// disallow other constructors that don't include a yieldKey | ||
private WaitWindowOverrunException() { | ||
super(); | ||
} | ||
|
||
// disallow constructors that don't include a yieldKey | ||
private WaitWindowOverrunException(String message) { | ||
super(message); | ||
} | ||
|
||
// disallow constructors that don't include a yieldKey | ||
private WaitWindowOverrunException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
// disallow constructors that don't include a yieldKey | ||
private WaitWindowOverrunException(Throwable cause) { | ||
super(cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.