public class RecoveryStatus extends AbstractRefCounted
Constructor and Description |
---|
RecoveryStatus(IndexShard indexShard,
DiscoveryNode sourceNode,
RecoveryTarget.RecoveryListener listener) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(String reason)
cancel the recovery.
|
CancellableThreads |
CancellableThreads() |
protected void |
cleanOpenFiles() |
protected void |
closeInternal() |
void |
fail(RecoveryFailedException e,
boolean sendShardFailure)
fail the recovery and call listener
|
org.apache.lucene.store.IndexOutput |
getOpenIndexOutput(String key) |
String |
getTempNameForFile(String origFile)
Get a temporary name for the provided file name.
|
IndexShard |
indexShard() |
long |
lastAccessTime()
return the last time this RecoveryStatus was used (based on System.nanoTime()
|
Store.LegacyChecksums |
legacyChecksums() |
void |
markAsDone()
mark the current recovery as done
|
org.apache.lucene.store.IndexOutput |
openAndPutIndexOutput(String fileName,
StoreFileMetaData metaData,
Store store)
Creates an
IndexOutput for the given file name. |
long |
recoveryId() |
org.apache.lucene.store.IndexOutput |
removeOpenIndexOutputs(String name)
remove and
IndexOutput for a given file. |
void |
renameAllTempFiles()
renames all temporary files to their true name, potentially overriding existing files
|
void |
resetRecovery() |
void |
setLastAccessTime()
sets the lasAccessTime flag to now
|
ShardId |
shardId() |
DiscoveryNode |
sourceNode() |
RecoveryState.Stage |
stage() |
RecoveryState |
state() |
Store |
store() |
String |
toString() |
alreadyClosed, decRef, getName, incRef, refCount, tryIncRef
public RecoveryStatus(IndexShard indexShard, DiscoveryNode sourceNode, RecoveryTarget.RecoveryListener listener)
public long recoveryId()
public ShardId shardId()
public IndexShard indexShard()
public DiscoveryNode sourceNode()
public RecoveryState state()
public CancellableThreads CancellableThreads()
public long lastAccessTime()
public void setLastAccessTime()
public Store store()
public RecoveryState.Stage stage()
public Store.LegacyChecksums legacyChecksums()
public void renameAllTempFiles() throws IOException
IOException
public void cancel(String reason)
AbstractRefCounted.decRef()
if CancellableThreads()
was used, the threads will be interrupted.
public void fail(RecoveryFailedException e, boolean sendShardFailure)
e
- exception that encapsulating the failuresendShardFailure
- indicates whether to notify the master of the shard failurepublic void markAsDone()
public String getTempNameForFile(String origFile)
public org.apache.lucene.store.IndexOutput getOpenIndexOutput(String key)
public org.apache.lucene.store.IndexOutput removeOpenIndexOutputs(String name)
IndexOutput
for a given file. It is the caller's responsibility to close itpublic org.apache.lucene.store.IndexOutput openAndPutIndexOutput(String fileName, StoreFileMetaData metaData, Store store) throws IOException
IndexOutput
for the given file name. Note that the
IndexOutput actually point at a temporary file.
Note: You can use getOpenIndexOutput(String)
with the same filename to retrieve the same IndexOutput
at a later stage
IOException
public void resetRecovery() throws IOException
IOException
protected void closeInternal()
closeInternal
in class AbstractRefCounted
protected void cleanOpenFiles()
Copyright © 2009–2016. All rights reserved.