Module org.elasticsearch.server
Class IndexShardSnapshotStatus
java.lang.Object
org.elasticsearch.index.snapshots.IndexShardSnapshotStatus
Represent shard snapshot status
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Used to complete listeners added viaaddAbortListener(org.elasticsearch.action.ActionListener<org.elasticsearch.index.snapshots.IndexShardSnapshotStatus.AbortStatus>)
when the shard snapshot is either aborted/paused or it gets past the stages where an abort/pause could have occurred.static class
Returns an immutable state ofIndexShardSnapshotStatus
at a given point in time.static enum
Snapshot stage -
Method Summary
Modifier and TypeMethodDescriptionvoid
abortIfNotCompleted
(String failure, Consumer<ActionListener<Releasable>> notifyRunner) void
void
addProcessedFile
(long size) Increments number of processed filesvoid
addProcessedFiles
(int count, long totalSize) asCopy()
Returns a copy of the currentIndexShardSnapshotStatus
.void
boolean
isPaused()
void
moveToDone
(long endTime, ShardSnapshotResult shardSnapshotResult) void
moveToFailed
(long endTime, String failure) moveToStarted
(long startTime, int incrementalFileCount, int totalFileCount, long incrementalSize, long totalSize) moveToUnsuccessful
(IndexShardSnapshotStatus.Stage newStage, String failure, long endTime) newDone
(long startTime, long totalTime, int incrementalFileCount, int fileCount, long incrementalSize, long size, ShardGeneration generation) static IndexShardSnapshotStatus
newInitializing
(ShardGeneration generation) void
pauseIfNotCompleted
(Consumer<ActionListener<Releasable>> notifyRunner)
-
Method Details
-
moveToStarted
public IndexShardSnapshotStatus.Copy moveToStarted(long startTime, int incrementalFileCount, int totalFileCount, long incrementalSize, long totalSize) -
moveToFinalize
-
moveToDone
-
addAbortListener
-
abortIfNotCompleted
-
pauseIfNotCompleted
-
moveToUnsuccessful
public SnapshotsInProgress.ShardState moveToUnsuccessful(IndexShardSnapshotStatus.Stage newStage, String failure, long endTime) -
moveToFailed
-
generation
-
getShardSnapshotResult
-
ensureNotAborted
public void ensureNotAborted() -
isPaused
public boolean isPaused() -
addProcessedFile
public void addProcessedFile(long size) Increments number of processed files -
addProcessedFiles
public void addProcessedFiles(int count, long totalSize) -
asCopy
Returns a copy of the currentIndexShardSnapshotStatus
. This method is intended to be used when a coherent state ofIndexShardSnapshotStatus
is needed.- Returns:
- a
IndexShardSnapshotStatus.Copy
-
newInitializing
-
newFailed
-
newDone
public static IndexShardSnapshotStatus.Copy newDone(long startTime, long totalTime, int incrementalFileCount, int fileCount, long incrementalSize, long size, ShardGeneration generation)
-