Class CopyJob

  • All Implemented Interfaces:
    Comparable<CopyJob>

    public abstract class CopyJob
    extends Object
    implements Comparable<CopyJob>
    Handles copying one set of files, e.g. all files for a new NRT point, or files for pre-copying a merged segment. This notifies the caller via OnceDone when the job finishes or failed.
    WARNING: This API is experimental and might change in incompatible ways in the next release.
    • Field Detail

      • ord

        public final long ord
      • highPriority

        public final boolean highPriority
        True for an NRT sync, false for pre-copying a newly merged segment
      • startNS

        public final long startNS
      • reason

        public final String reason
      • totBytes

        protected long totBytes
      • totBytesCopied

        protected long totBytesCopied
      • cancelReason

        protected volatile String cancelReason
    • Method Detail

      • transferAndCancel

        public void transferAndCancel​(CopyJob prevJob)
                               throws IOException
        Transfers whatever tmp files were already copied in this previous job and cancels the previous job
        Throws:
        IOException
      • runBlocking

        public abstract void runBlocking()
                                  throws Exception
        Use current thread (blocking) to do all copying and then return once done, or throw exception on failure
        Throws:
        Exception
      • conflicts

        public abstract boolean conflicts​(CopyJob other)
        Return true if this job is trying to copy any of the same files as the other job
      • finish

        public abstract void finish()
                             throws IOException
        Renames all copied (tmp) files to their true file names
        Throws:
        IOException
      • getFailed

        public abstract boolean getFailed()
      • getFileNamesToCopy

        public abstract Set<String> getFileNamesToCopy()
        Returns only those file names (a subset of getFileNames()) that need to be copied
      • getFileNames

        public abstract Set<String> getFileNames()
        Returns all file names referenced in this copy job
      • getCopyState

        public abstract CopyState getCopyState()
      • getTotalBytesCopied

        public abstract long getTotalBytesCopied()