Package org.apache.hadoop.ipc
Class Server.Connection
java.lang.Object
org.apache.hadoop.ipc.Server.Connection
- Enclosing class:
- Server
Reads calls from a connection and queues them for handling.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConnection(SocketChannel channel, long lastContact, int ingressPort, boolean isOnAuxiliaryPort) -
Method Summary
Modifier and TypeMethodDescriptiongetConf()intlongintintGet service class for connectionbooleanintThis method reads in a non-blocking fashion from the channel: this method is called repeatedly when data is present in the channel; when it has enough data to process one rpc it processes that rpc.voidsetLastContact(long lastContact) voidsetServiceClass(int serviceClass) Set service class for connectiontoString()
-
Field Details
-
attemptingUser
-
-
Constructor Details
-
Connection
public Connection(SocketChannel channel, long lastContact, int ingressPort, boolean isOnAuxiliaryPort)
-
-
Method Details
-
toString
-
getHostAddress
-
getIngressPort
public int getIngressPort() -
getRemotePort
public int getRemotePort() -
getHostInetAddress
-
getEstablishedQOP
-
isOnAuxiliaryPort
public boolean isOnAuxiliaryPort() -
setLastContact
public void setLastContact(long lastContact) -
getLastContact
public long getLastContact() -
getServer
-
getConf
-
readAndProcess
This method reads in a non-blocking fashion from the channel: this method is called repeatedly when data is present in the channel; when it has enough data to process one rpc it processes that rpc. On the first pass, it processes the connectionHeader, connectionContext (an outOfBand RPC) and at most one RPC request that follows that. On future passes it will process at most one RPC request. Quirky things: dataLengthBuffer (4 bytes) is used to read "hrpc" OR rpc request length.- Returns:
- -1 in case of error, else num bytes read so far
- Throws:
IOException- - internal error that should not be returned to client, typically failure to respond to clientInterruptedException- - if the thread is interrupted.
-
getServiceClass
public int getServiceClass()Get service class for connection- Returns:
- the serviceClass
-
setServiceClass
public void setServiceClass(int serviceClass) Set service class for connection- Parameters:
serviceClass- the serviceClass to set
-