public class RecoverySourceHandler extends Object implements Engine.RecoveryHandler
Constructor and Description |
---|
RecoverySourceHandler(IndexShard shard,
StartRecoveryRequest request,
RecoverySettings recoverySettings,
TransportService transportService,
ClusterService clusterService,
IndicesService indicesService,
MappingUpdatedAction mappingUpdatedAction,
ESLogger logger) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(String reason)
Cancels the recovery and interrupts all eligible threads.
|
org.elasticsearch.indices.recovery.RecoveryResponse |
getResponse() |
void |
phase1(SnapshotIndexCommit snapshot)
Perform phase1 of the recovery operations.
|
void |
phase2(Translog.Snapshot snapshot)
Perform phase2 of the recovery process
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).
|
void |
phase3(Translog.Snapshot snapshot)
Perform phase 3 of the recovery process
Phase3 again takes a snapshot of the translog, however this time the
snapshot is acquired under a write lock.
|
protected int |
sendSnapshot(Translog.Snapshot snapshot)
Send the given snapshot's operations to this handler's target node.
|
String |
toString() |
protected final ESLogger logger
public RecoverySourceHandler(IndexShard shard, StartRecoveryRequest request, RecoverySettings recoverySettings, TransportService transportService, ClusterService clusterService, IndicesService indicesService, MappingUpdatedAction mappingUpdatedAction, ESLogger logger)
public org.elasticsearch.indices.recovery.RecoveryResponse getResponse()
RecoveryResponse
after the recovery has completed all three phasespublic void phase1(SnapshotIndexCommit snapshot) throws ElasticsearchException
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
InternalEngine#recover
is responsible for snapshotting the index
and releasing the snapshot once all 3 phases of recovery are completephase1
in interface Engine.RecoveryHandler
ElasticsearchException
public void phase2(Translog.Snapshot snapshot) throws ElasticsearchException
InternalEngine#recover
is responsible for taking the snapshot
of the translog and releasing it once all 3 phases of recovery are completephase2
in interface Engine.RecoveryHandler
ElasticsearchException
public void phase3(Translog.Snapshot snapshot) throws ElasticsearchException
InternalEngine#recover
is responsible for taking the snapshot
of the translog, and after phase 3 completes the snapshots from all
three phases are released.phase3
in interface Engine.RecoveryHandler
ElasticsearchException
protected int sendSnapshot(Translog.Snapshot snapshot) throws ElasticsearchException
ElasticsearchException
public void cancel(String reason)
Copyright © 2009–2015. All rights reserved.