org.apache.hadoop.hbase.ipc
Class RpcClient.Connection.PingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.hadoop.hbase.ipc.RpcClient.Connection.PingInputStream
- All Implemented Interfaces:
- Closeable
- Enclosing class:
- RpcClient.Connection
protected class RpcClient.Connection.PingInputStream
- extends FilterInputStream
This class sends a ping to the remote side when timeout on
reading. If no failure is detected, it retries until at least
a byte is read.
Method Summary |
int |
read()
Read a byte from the stream. |
int |
read(byte[] buf,
int off,
int len)
Read bytes into a buffer starting from offset off
Send a ping if timeout on read. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RpcClient.Connection.PingInputStream
protected RpcClient.Connection.PingInputStream(InputStream in)
read
public int read()
throws IOException
- Read a byte from the stream.
Send a ping if timeout on read. Retries if no failure is detected
until a byte is read.
- Overrides:
read
in class FilterInputStream
- Throws:
IOException
- for any IO problem other than socket timeout
read
public int read(byte[] buf,
int off,
int len)
throws IOException
- Read bytes into a buffer starting from offset
off
Send a ping if timeout on read. Retries if no failure is detected
until a byte is read.
- Overrides:
read
in class FilterInputStream
- Returns:
- the total number of bytes read; -1 if the connection is closed.
- Throws:
IOException
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.