Class SliceTransferJobDetails
- java.lang.Object
-
- org.pipecraft.infra.storage.google_cs.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 Summary
Constructors Constructor Description SliceTransferJobDetails(com.google.cloud.storage.Blob readBlob, int chunkSize, SlicedTransferFileHandler targetFileHandler, long start, long length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetLength()longgetPosition()com.google.cloud.ReadChannelgetReadChannel()SlicedTransferFileHandlergetTargetFileHandler()
-
-
-
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 fromchunkSize- The download chunk size to usetargetFileHandler- 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.
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-