public class RecoverySourceHandler extends Object
Modifier and Type | Field and Description |
---|---|
protected ESLogger |
logger |
protected org.elasticsearch.indices.recovery.RecoveryResponse |
response |
Constructor and Description |
---|
RecoverySourceHandler(IndexShard shard,
StartRecoveryRequest request,
RecoverySettings recoverySettings,
TransportService transportService,
ESLogger logger) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(String reason)
Cancels the recovery and interrupts all eligible threads.
|
void |
finalizeRecovery()
finalizes the recovery process
|
void |
phase1(SnapshotIndexCommit snapshot,
Translog.View translogView)
Perform phase1 of the recovery operations.
|
void |
phase2(Translog.Snapshot snapshot)
Perform phase2 of the recovery process
|
protected void |
prepareTargetForTranslog(Translog.View translogView) |
org.elasticsearch.indices.recovery.RecoveryResponse |
recoverToTarget()
performs the recovery from the local engine to the target
|
protected int |
sendSnapshot(Translog.Snapshot snapshot)
Send the given snapshot's operations to this handler's target node.
|
String |
toString() |
protected final ESLogger logger
protected final org.elasticsearch.indices.recovery.RecoveryResponse response
public RecoverySourceHandler(IndexShard shard, StartRecoveryRequest request, RecoverySettings recoverySettings, TransportService transportService, ESLogger logger)
public org.elasticsearch.indices.recovery.RecoveryResponse recoverToTarget()
public void phase1(SnapshotIndexCommit snapshot, Translog.View translogView)
SnapshotIndexCommit
snapshot has been performed no commit operations (files being fsync'd)
are effectively allowed on this index until all recovery phases are done
Phase1 examines the segment files on the target node and copies over the segments that are missing. Only segments that have the same size and checksum can be reused
protected void prepareTargetForTranslog(Translog.View translogView)
public void phase2(Translog.Snapshot snapshot)
Phase2 takes a snapshot of the current translog *without* acquiring the write lock (however, the translog snapshot is a point-in-time view of the translog). It then sends each translog operation to the target node so it can be replayed into the new shard.
public void finalizeRecovery()
protected int sendSnapshot(Translog.Snapshot snapshot)
Operations are bulked into a single request depending on an operation count limit or size-in-bytes limit
public void cancel(String reason)
Copyright © 2009–2016. All rights reserved.