public abstract class AbstractResourceScanner<V> extends Object implements Callable<Long>
Callable
should return the #of resources which were accepted for
processing.Modifier and Type | Field and Description |
---|---|
protected static org.apache.log4j.Logger |
log |
Modifier | Constructor and Description |
---|---|
protected |
AbstractResourceScanner(BlockingBuffer<V[]> buffer) |
Modifier and Type | Method and Description |
---|---|
void |
accept(V resource)
Accept a resource for processing.
|
Long |
call()
Invokes
runScanner() , queuing and transferring chunks of
resources to the BlockingBuffer specified to the ctor. |
long |
getAcceptCount()
Return the #of accepted resources.
|
protected abstract void |
runScanner()
Run the scanner.
|
protected AbstractResourceScanner(BlockingBuffer<V[]> buffer)
buffer
- The buffer to which the resources should be added.public final long getAcceptCount()
public final Long call() throws Exception
runScanner()
, queuing and transferring chunks of
resources to the BlockingBuffer
specified to the ctor. When
runScanner()
completes normally, the remaining resources
are transferred from the internal queue to the BlockingBuffer
.public void accept(V resource) throws InterruptedException
resource
- The resource.InterruptedException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.