public abstract class CopyJob extends Object implements Comparable<CopyJob>
Modifier and Type | Class and Description |
---|---|
static interface |
CopyJob.OnceDone
Callback invoked by CopyJob once all files have (finally) finished copying
|
Modifier and Type | Field and Description |
---|---|
protected String |
cancelReason |
protected Map<String,String> |
copiedFiles |
protected CopyOneFile |
current |
protected ReplicaNode |
dest |
protected Throwable |
exc |
protected Map<String,FileMetaData> |
files |
boolean |
highPriority
True for an NRT sync, false for pre-copying a newly merged segment
|
CopyJob.OnceDone |
onceDone |
long |
ord |
String |
reason |
long |
startNS |
protected List<Map.Entry<String,FileMetaData>> |
toCopy |
protected long |
totBytes |
protected long |
totBytesCopied |
Modifier | Constructor and Description |
---|---|
protected |
CopyJob(String reason,
Map<String,FileMetaData> files,
ReplicaNode dest,
boolean highPriority,
CopyJob.OnceDone onceDone) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(String reason,
Throwable exc) |
abstract boolean |
conflicts(CopyJob other)
Return true if this job is trying to copy any of the same files as the other job
|
abstract void |
finish()
Renames all copied (tmp) files to their true file names
|
abstract CopyState |
getCopyState() |
abstract boolean |
getFailed() |
abstract Set<String> |
getFileNames()
Returns all file names referenced in this copy job
|
abstract Set<String> |
getFileNamesToCopy()
Returns only those file names (a subset of
getFileNames() ) that need to be copied |
abstract long |
getTotalBytesCopied() |
protected abstract CopyOneFile |
newCopyOneFile(CopyOneFile current) |
abstract void |
runBlocking()
Use current thread (blocking) to do all copying and then return once done, or throw exception on failure
|
abstract void |
start()
Begin copying files
|
void |
transferAndCancel(CopyJob prevJob)
Transfers whatever tmp files were already copied in this previous job and cancels the previous job
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compareTo
protected final ReplicaNode dest
protected final Map<String,FileMetaData> files
public final long ord
public final boolean highPriority
public final CopyJob.OnceDone onceDone
public final long startNS
public final String reason
protected final List<Map.Entry<String,FileMetaData>> toCopy
protected long totBytes
protected long totBytesCopied
protected CopyOneFile current
protected volatile Throwable exc
protected volatile String cancelReason
protected CopyJob(String reason, Map<String,FileMetaData> files, ReplicaNode dest, boolean highPriority, CopyJob.OnceDone onceDone) throws IOException
IOException
public void transferAndCancel(CopyJob prevJob) throws IOException
IOException
protected abstract CopyOneFile newCopyOneFile(CopyOneFile current)
public abstract void start() throws IOException
IOException
public abstract void runBlocking() throws Exception
Exception
public void cancel(String reason, Throwable exc) throws IOException
IOException
public abstract boolean conflicts(CopyJob other)
public abstract void finish() throws IOException
IOException
public abstract boolean getFailed()
public abstract Set<String> getFileNamesToCopy()
getFileNames()
) that need to be copiedpublic abstract Set<String> getFileNames()
public abstract CopyState getCopyState()
public abstract long getTotalBytesCopied()
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.