public class RecoveryTarget extends AbstractComponent
Note, it can be safely assumed that there will only be a single recovery per shard (index+id) and not several of them (since we don't allocate several shard replicas to the same node).
Modifier and Type | Class and Description |
---|---|
static class |
RecoveryTarget.Actions |
static interface |
RecoveryTarget.RecoveryListener |
deprecationLogger, logger, settings
Constructor and Description |
---|
RecoveryTarget(Settings settings,
ThreadPool threadPool,
TransportService transportService,
IndicesLifecycle indicesLifecycle,
RecoverySettings recoverySettings,
ClusterService clusterService) |
Modifier and Type | Method and Description |
---|---|
boolean |
cancelRecoveriesForShard(ShardId shardId,
String reason,
com.google.common.base.Predicate<RecoveryStatus> shouldCancel)
cancel all ongoing recoveries for the given shard, if their status match a predicate
|
protected void |
retryRecovery(RecoveryStatus recoveryStatus,
String reason,
TimeValue retryAfter,
StartRecoveryRequest currentRequest) |
void |
startRecovery(IndexShard indexShard,
RecoveryState.Type recoveryType,
DiscoveryNode sourceNode,
RecoveryTarget.RecoveryListener listener) |
logDeprecatedSetting, logRemovedSetting, nodeName
@Inject public RecoveryTarget(Settings settings, ThreadPool threadPool, TransportService transportService, IndicesLifecycle indicesLifecycle, RecoverySettings recoverySettings, ClusterService clusterService)
public boolean cancelRecoveriesForShard(ShardId shardId, String reason, @Nullable com.google.common.base.Predicate<RecoveryStatus> shouldCancel)
reason
- reason for cancellationshardId
- shardId for which to cancel recoveriesshouldCancel
- a predicate to check if a recovery should be cancelled or not. Null means cancel without an extra check.
note that the recovery state can change after this check, but before it is being cancelled via other
already issued outstanding references.public void startRecovery(IndexShard indexShard, RecoveryState.Type recoveryType, DiscoveryNode sourceNode, RecoveryTarget.RecoveryListener listener)
protected void retryRecovery(RecoveryStatus recoveryStatus, String reason, TimeValue retryAfter, StartRecoveryRequest currentRequest)
Copyright © 2009–2017. All rights reserved.