K - the cache key typepublic class ClusterStreamManagerImpl<K> extends Object implements ClusterStreamManager<K>
RpcManager to do the underlying communications.ClusterStreamManager.ResultsCallback<R>| Modifier and Type | Field and Description |
|---|---|
protected Map<String,org.infinispan.stream.impl.ClusterStreamManagerImpl.RequestTracker> |
currentlyRunning |
protected CommandsFactory |
factory |
protected Address |
localAddress |
protected static Log |
log |
protected AtomicInteger |
requestId |
protected RpcManager |
rpc |
| Constructor and Description |
|---|
ClusterStreamManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitCompletion(Object id,
long time,
TimeUnit unit)
Awaits completion of the given request.
|
void |
forgetOperation(Object id)
Frees any resources related to this operation and signals to any ongoing remote operations to no longer continue
processing
|
void |
inject(RpcManager rpc,
CommandsFactory factory) |
boolean |
isComplete(Object id)
Tests whether this operation is still pending or not.
|
protected static void |
markTrackerWithException(org.infinispan.stream.impl.ClusterStreamManagerImpl.RequestTracker<?> tracker,
Address dest,
Throwable e,
Object uuid) |
<R1> boolean |
receiveResponse(Object id,
Address origin,
boolean complete,
Set<Integer> missingSegments,
R1 response)
Receives a response for a given request
|
<R> Object |
remoteStreamOperation(boolean parallelDistribution,
boolean parallelStream,
ConsistentHash ch,
Set<Integer> segments,
Set<K> keysToInclude,
Map<Integer,Set<K>> keysToExclude,
boolean includeLoader,
KeyTrackingTerminalOperation<K,R,?> operation,
ClusterStreamManager.ResultsCallback<Collection<R>> callback)
Key tracking remote operation that doesn't have rehash enabled.
|
<R> Object |
remoteStreamOperation(boolean parallelDistribution,
boolean parallelStream,
ConsistentHash ch,
Set<Integer> segments,
Set<K> keysToInclude,
Map<Integer,Set<K>> keysToExclude,
boolean includeLoader,
TerminalOperation<R> operation,
ClusterStreamManager.ResultsCallback<R> callback,
Predicate<? super R> earlyTerminatePredicate)
Performs the remote stream operation without rehash awareness.
|
<R2> Object |
remoteStreamOperationRehashAware(boolean parallelDistribution,
boolean parallelStream,
ConsistentHash ch,
Set<Integer> segments,
Set<K> keysToInclude,
Map<Integer,Set<K>> keysToExclude,
boolean includeLoader,
KeyTrackingTerminalOperation<K,?,R2> operation,
ClusterStreamManager.ResultsCallback<Map<K,R2>> callback)
Key tracking remote operation that has rehash enabled
|
<R> Object |
remoteStreamOperationRehashAware(boolean parallelDistribution,
boolean parallelStream,
ConsistentHash ch,
Set<Integer> segments,
Set<K> keysToInclude,
Map<Integer,Set<K>> keysToExclude,
boolean includeLoader,
TerminalOperation<R> operation,
ClusterStreamManager.ResultsCallback<R> callback,
Predicate<? super R> earlyTerminatePredicate)
Performs the remote stream operation with rehash awareness.
|
void |
start() |
protected final Map<String,org.infinispan.stream.impl.ClusterStreamManagerImpl.RequestTracker> currentlyRunning
protected final AtomicInteger requestId
protected RpcManager rpc
protected CommandsFactory factory
protected Address localAddress
protected static final Log log
public void inject(RpcManager rpc, CommandsFactory factory)
public void start()
public <R> Object remoteStreamOperation(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, Set<Integer> segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, TerminalOperation<R> operation, ClusterStreamManager.ResultsCallback<R> callback, Predicate<? super R> earlyTerminatePredicate)
ClusterStreamManagerremoteStreamOperation in interface ClusterStreamManager<K>R - the type of responseparallelDistribution - whether or not parallel distribution is enabledparallelStream - whether or not the stream is paralllelch - the consistent hash to use when determining segment ownershipsegments - the segments that this request should utilizekeysToInclude - which keys to include in the requestkeysToExclude - which keys to exclude in the requestincludeLoader - whether or not to use a loaderoperation - the actual operation to performcallback - the callback to collect individual node resultsearlyTerminatePredicate - a predicate to determine if this operation should stop based on intermediate resultspublic <R> Object remoteStreamOperationRehashAware(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, Set<Integer> segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, TerminalOperation<R> operation, ClusterStreamManager.ResultsCallback<R> callback, Predicate<? super R> earlyTerminatePredicate)
ClusterStreamManagerremoteStreamOperationRehashAware in interface ClusterStreamManager<K>R - the type of responseparallelDistribution - whether or not parallel distribution is enabledparallelStream - whether or not the stream is paralllelch - the consistent hash to use when determining segment ownershipsegments - the segments that this request should utilizekeysToInclude - which keys to include in the requestkeysToExclude - which keys to exclude in the requestincludeLoader - whether or not to use a loaderoperation - the actual operation to performcallback - the callback to collect individual node resultsearlyTerminatePredicate - a predicate to determine if this operation should stop based on intermediate resultspublic <R> Object remoteStreamOperation(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, Set<Integer> segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, KeyTrackingTerminalOperation<K,R,?> operation, ClusterStreamManager.ResultsCallback<Collection<R>> callback)
ClusterStreamManagerremoteStreamOperation in interface ClusterStreamManager<K>R - the type of responseparallelDistribution - whether or not parallel distribution is enabledparallelStream - whether or not the stream is paralllelch - the consistent hash to use when determining segment ownershipsegments - the segments that this request should utilizekeysToInclude - which keys to include in the requestkeysToExclude - which keys to exclude in the requestincludeLoader - whether or not to use a loaderoperation - the actual operation to performcallback - the callback to collect individual node resultspublic <R2> Object remoteStreamOperationRehashAware(boolean parallelDistribution, boolean parallelStream, ConsistentHash ch, Set<Integer> segments, Set<K> keysToInclude, Map<Integer,Set<K>> keysToExclude, boolean includeLoader, KeyTrackingTerminalOperation<K,?,R2> operation, ClusterStreamManager.ResultsCallback<Map<K,R2>> callback)
ClusterStreamManagerremoteStreamOperationRehashAware in interface ClusterStreamManager<K>R2 - the type of responseparallelDistribution - whether or not parallel distribution is enabledparallelStream - whether or not the stream is paralllelch - the consistent hash to use when determining segment ownershipsegments - the segments that this request should utilizekeysToInclude - which keys to include in the requestkeysToExclude - which keys to exclude in the requestincludeLoader - whether or not to use a loaderoperation - the actual operation to performcallback - the callback to collect individual node resultsprotected static void markTrackerWithException(org.infinispan.stream.impl.ClusterStreamManagerImpl.RequestTracker<?> tracker,
Address dest,
Throwable e,
Object uuid)
public boolean isComplete(Object id)
ClusterStreamManagerisComplete in interface ClusterStreamManager<K>id - the id of the operation that was returned from the invocationpublic boolean awaitCompletion(Object id, long time, TimeUnit unit) throws InterruptedException
ClusterStreamManagerawaitCompletion in interface ClusterStreamManager<K>id - the ide of the operation that was returned from the invocation - must be non nulltime - how long to wait before returning false - must be greater than 0unit - controls how long the time wait isInterruptedExceptionpublic void forgetOperation(Object id)
ClusterStreamManagerforgetOperation in interface ClusterStreamManager<K>id - the ide of the operation that was returned from the invocation - can be null in which case this is a nooppublic <R1> boolean receiveResponse(Object id, Address origin, boolean complete, Set<Integer> missingSegments, R1 response)
ClusterStreamManagerreceiveResponse in interface ClusterStreamManager<K>R1 - The type of the responseid - The request idorigin - The origin of the responsecomplete - Whether or not this is a completed responsemissingSegments - The segments that were suspectedresponse - The actual response valueCopyright © 2024 JBoss, a division of Red Hat. All rights reserved.