public abstract class AsyncShardFetch<T extends NodeOperationResponse> extends Object implements Releasable
Modifier and Type | Class and Description |
---|---|
static class |
AsyncShardFetch.FetchResult<T extends NodeOperationResponse>
The result of a fetch operation.
|
static interface |
AsyncShardFetch.List<NodesResponse extends NodesOperationResponse<NodeResponse>,NodeResponse extends NodeOperationResponse>
An action that lists the relevant shard data that needs to be fetched.
|
Modifier and Type | Field and Description |
---|---|
protected ESLogger |
logger |
protected String |
type |
Modifier | Constructor and Description |
---|---|
protected |
AsyncShardFetch(ESLogger logger,
String type,
ShardId shardId,
AsyncShardFetch.List<? extends NodesOperationResponse<T>,T> action) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
AsyncShardFetch.FetchResult<T> |
fetchData(DiscoveryNodes nodes,
MetaData metaData,
Set<String> ignoreNodes)
Fetches the data for the relevant shard.
|
int |
getNumberOfInFlightFetches()
Returns the number of async fetches that are currently ongoing.
|
protected void |
processAsyncFetch(ShardId shardId,
T[] responses,
FailedNodeException[] failures)
Called by the response handler of the async action to fetch data.
|
protected abstract void |
reroute(ShardId shardId,
String reason)
Implement this in order to scheduled another round that causes a call to fetch data.
|
protected AsyncShardFetch(ESLogger logger, String type, ShardId shardId, AsyncShardFetch.List<? extends NodesOperationResponse<T>,T> action)
public void close()
close
in interface AutoCloseable
close
in interface Releasable
public int getNumberOfInFlightFetches()
public AsyncShardFetch.FetchResult<T> fetchData(DiscoveryNodes nodes, MetaData metaData, Set<String> ignoreNodes)
protected void processAsyncFetch(ShardId shardId, T[] responses, FailedNodeException[] failures)
Copyright © 2009–2016. All rights reserved.