public interface RecoveryTargetHandler
Modifier and Type | Method and Description |
---|---|
void |
cleanFiles(int totalTranslogOps,
Store.MetadataSnapshot sourceMetaData)
After all source files has been sent over, this command is sent to the target so it can clean any local
files that are not part of the source store
|
void |
ensureClusterStateVersion(long clusterStateVersion)
Blockingly waits for cluster state with at least clusterStateVersion to be available
|
void |
finalizeRecovery()
The finalize request clears unreferenced translog files, refreshes the engine now that
new segments are available, and enables garbage collection of
tombstone files.
|
void |
indexTranslogOperations(java.util.List<Translog.Operation> operations,
int totalTranslogOps)
Index a set of translog operations on the target
|
void |
prepareForTranslogOperations(int totalTranslogOps,
long maxUnsafeAutoIdTimestamp)
Prepares the tranget to receive translog operations, after all file have been copied
|
void |
receiveFileInfo(java.util.List<java.lang.String> phase1FileNames,
java.util.List<java.lang.Long> phase1FileSizes,
java.util.List<java.lang.String> phase1ExistingFileNames,
java.util.List<java.lang.Long> phase1ExistingFileSizes,
int totalTranslogOps)
Notifies the target of the files it is going to receive
|
void |
writeFileChunk(StoreFileMetaData fileMetaData,
long position,
BytesReference content,
boolean lastChunk,
int totalTranslogOps)
writes a partial file chunk to the target store
|
void prepareForTranslogOperations(int totalTranslogOps, long maxUnsafeAutoIdTimestamp) throws java.io.IOException
totalTranslogOps
- total translog operations expected to be sentmaxUnsafeAutoIdTimestamp
- the max timestamp that is used to de-optimize documents with auto-generated IDs in the engine.
This is used to ensure we don't add duplicate documents when we assume an append only case based on auto-generated IDsjava.io.IOException
void finalizeRecovery()
void ensureClusterStateVersion(long clusterStateVersion)
void indexTranslogOperations(java.util.List<Translog.Operation> operations, int totalTranslogOps)
operations
- operations to indextotalTranslogOps
- current number of total operations expected to be indexedvoid receiveFileInfo(java.util.List<java.lang.String> phase1FileNames, java.util.List<java.lang.Long> phase1FileSizes, java.util.List<java.lang.String> phase1ExistingFileNames, java.util.List<java.lang.Long> phase1ExistingFileSizes, int totalTranslogOps)
void cleanFiles(int totalTranslogOps, Store.MetadataSnapshot sourceMetaData) throws java.io.IOException
totalTranslogOps
- an update number of translog operations that will be replayed later onsourceMetaData
- meta data of the source storejava.io.IOException
void writeFileChunk(StoreFileMetaData fileMetaData, long position, BytesReference content, boolean lastChunk, int totalTranslogOps) throws java.io.IOException
java.io.IOException