Class SliceTransferJobDetails

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class SliceTransferJobDetails
    extends Object
    implements Closeable
    Contains the details of a specific slice to be transferred, including the read/write handles. The read channel is created lazily when requested.
    Author:
    Oren Peer, Eyal Schneider
    • Constructor Detail

      • SliceTransferJobDetails

        public SliceTransferJobDetails​(com.google.cloud.storage.Blob readBlob,
                                       int chunkSize,
                                       SlicedTransferFileHandler targetFileHandler,
                                       long start,
                                       long length)
        Parameters:
        readBlob - The blob to read from
        chunkSize - The download chunk size to use
        targetFileHandler - The handler for the file to write to. The same handler should be used in different jobs that refer to different slices of the same file.
        start - The file position at which the slice reading should begin. Non-negative.
        length - The size (in bytes) the reader should read
    • Method Detail

      • getReadChannel

        public com.google.cloud.ReadChannel getReadChannel()
        Returns:
        the channel for reading data from
      • getTargetFileHandler

        public SlicedTransferFileHandler getTargetFileHandler()
        Returns:
        The handler for the file to write to. The same handler should be used in different jobs that refer to different slices of the same file.
      • getPosition

        public long getPosition()
        Returns:
        The file position at which the slice reader is begin;
      • getLength

        public long getLength()
        Returns:
        The size (in bytes) the reader should read.