org.apache.hadoop.hbase.ipc
Class RpcClient.Connection.PingInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by 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.


Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
protected RpcClient.Connection.PingInputStream(InputStream in)
           
 
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.io.FilterInputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcClient.Connection.PingInputStream

protected RpcClient.Connection.PingInputStream(InputStream in)
Method Detail

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 © 2013 The Apache Software Foundation. All Rights Reserved.