public class StreamWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected com.google.common.util.concurrent.RateLimiter |
limiter |
protected java.util.Collection<Pair<java.lang.Long,java.lang.Long>> |
sections |
protected StreamSession |
session |
protected SSTableReader |
sstable |
Constructor and Description |
---|
StreamWriter(SSTableReader sstable,
java.util.Collection<Pair<java.lang.Long,java.lang.Long>> sections,
StreamSession session) |
Modifier and Type | Method and Description |
---|---|
protected long |
totalSize() |
protected long |
write(RandomAccessReader reader,
DataIntegrityMetadata.ChecksumValidator validator,
int start,
long length,
long bytesTransferred)
Sequentially read bytes from the file and write them to the output stream
|
void |
write(java.nio.channels.WritableByteChannel channel)
Stream file of specified sections to given channel.
|
protected final SSTableReader sstable
protected final java.util.Collection<Pair<java.lang.Long,java.lang.Long>> sections
protected final com.google.common.util.concurrent.RateLimiter limiter
protected final StreamSession session
public StreamWriter(SSTableReader sstable, java.util.Collection<Pair<java.lang.Long,java.lang.Long>> sections, StreamSession session)
public void write(java.nio.channels.WritableByteChannel channel) throws java.io.IOException
channel
- where this writes data tojava.io.IOException
- on any I/O errorprotected long totalSize()
protected long write(RandomAccessReader reader, DataIntegrityMetadata.ChecksumValidator validator, int start, long length, long bytesTransferred) throws java.io.IOException
reader
- The file reader to read fromvalidator
- validator to verify data integritystart
- number of bytes to skip transfer, but include for validation.length
- The full length that should be transferredbytesTransferred
- Number of bytes remaining to transferjava.io.IOException
- on any I/O errorCopyright © 2013 The Apache Software Foundation