org.apache.hadoop.hbase.ipc
Class RpcServer.Connection

java.lang.Object
  extended by org.apache.hadoop.hbase.ipc.RpcServer.Connection
Enclosing class:
RpcServer

public class RpcServer.Connection
extends Object

Reads calls from a connection and queues them for handling.


Field Summary
 org.apache.hadoop.security.UserGroupInformation attemptingUser
           
protected  SocketChannel channel
           
protected  String hostAddress
           
protected  int remotePort
           
protected  LinkedList<org.apache.hadoop.hbase.ipc.RpcServer.Call> responseQueue
           
protected  Socket socket
           
protected  org.apache.hadoop.security.UserGroupInformation ugi
           
protected  User user
           
 
Constructor Summary
RpcServer.Connection(SocketChannel channel, long lastContact)
           
 
Method Summary
protected  void close()
           
protected  void decRpcCount()
           
 String getHostAddress()
           
 InetAddress getHostInetAddress()
           
 long getLastContact()
           
 int getRemotePort()
           
protected  void incRpcCount()
           
protected  void processRequest(ByteBuffer buf)
           
 int readAndProcess()
          Read off the wire.
 void setLastContact(long lastContact)
           
protected  boolean timedOut(long currentTime)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

channel

protected SocketChannel channel

responseQueue

protected final LinkedList<org.apache.hadoop.hbase.ipc.RpcServer.Call> responseQueue

socket

protected Socket socket

hostAddress

protected String hostAddress

remotePort

protected int remotePort

attemptingUser

public org.apache.hadoop.security.UserGroupInformation attemptingUser

user

protected User user

ugi

protected org.apache.hadoop.security.UserGroupInformation ugi
Constructor Detail

RpcServer.Connection

public RpcServer.Connection(SocketChannel channel,
                            long lastContact)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getHostAddress

public String getHostAddress()

getHostInetAddress

public InetAddress getHostInetAddress()

getRemotePort

public int getRemotePort()

setLastContact

public void setLastContact(long lastContact)

getLastContact

public long getLastContact()

decRpcCount

protected void decRpcCount()

incRpcCount

protected void incRpcCount()

timedOut

protected boolean timedOut(long currentTime)

readAndProcess

public int readAndProcess()
                   throws IOException,
                          InterruptedException
Read off the wire.

Returns:
Returns -1 if failure (and caller will close connection) else return how many bytes were read and processed
Throws:
IOException
InterruptedException

processRequest

protected void processRequest(ByteBuffer buf)
                       throws IOException,
                              InterruptedException
Parameters:
buf - Has the request header and the request param and optionally encoded data buffer all in this one array.
Throws:
IOException
InterruptedException

close

protected void close()


Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.