public class FileStreamTask extends WrappedRunnable
| Modifier and Type | Field and Description |
|---|---|
static int |
CHUNK_SIZE |
protected StreamHeader |
header |
static int |
MAX_CONNECT_ATTEMPTS |
protected StreamingMetrics |
metrics |
protected java.net.Socket |
socket |
protected Throttle |
throttle |
protected java.net.InetAddress |
to |
| Constructor and Description |
|---|
FileStreamTask(StreamHeader header,
java.net.InetAddress to) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
close() |
protected void |
receiveReply() |
void |
runMayThrow() |
protected void |
stream()
Stream file by it's sections specified by this.header
|
java.lang.String |
toString() |
protected long |
write(RandomAccessReader reader,
long length,
long bytesTransferred)
Sequentially read bytes from the file and write them to the output stream
|
runpublic static final int CHUNK_SIZE
public static final int MAX_CONNECT_ATTEMPTS
protected final StreamHeader header
protected final java.net.InetAddress to
protected java.net.Socket socket
protected final Throttle throttle
protected final StreamingMetrics metrics
public FileStreamTask(StreamHeader header, java.net.InetAddress to)
public void runMayThrow()
throws java.io.IOException
runMayThrow in class WrappedRunnablejava.io.IOExceptionprotected void stream()
throws java.io.IOException
java.io.IOException - on any I/O errorprotected void receiveReply()
throws java.io.IOException
java.io.IOExceptionprotected long write(RandomAccessReader reader, long length, long bytesTransferred) throws java.io.IOException
reader - The file reader to read fromlength - The full length that should be transferredbytesTransferred - Number of bytes remaining to transferjava.io.IOException - on any I/O errorprotected void close()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014 The Apache Software Foundation