org.apache.hadoop.hbase.ipc
Class HBaseServer.Call

java.lang.Object
  extended by org.apache.hadoop.hbase.ipc.HBaseServer.Call
All Implemented Interfaces:
Delayable, RpcCallContext
Direct Known Subclasses:
SecureServer.SecureCall
Enclosing class:
HBaseServer

protected class HBaseServer.Call
extends Object
implements RpcCallContext

A call queued for handling.


Field Summary
protected  HBaseServer.Connection connection
           
protected  boolean delayResponse
           
protected  boolean delayReturnValue
           
protected  int id
           
protected  boolean isError
           
protected  org.apache.hadoop.io.Writable param
           
protected  HBaseServer.Responder responder
           
protected  ByteBuffer response
           
protected  long size
           
protected  long timestamp
           
 
Constructor Summary
HBaseServer.Call(int id, org.apache.hadoop.io.Writable param, HBaseServer.Connection connection, HBaseServer.Responder responder, long size)
           
 
Method Summary
 void endDelay()
          Signal the end of a delayed RPC, without specifying the return value.
 void endDelay(Object result)
          Signal that the RPC server is now allowed to send the response.
 void endDelayThrowing(Throwable t)
          End the call, throwing and exception to the caller.
 long getSize()
           
 boolean isDelayed()
           
 boolean isReturnValueDelayed()
           
 void sendResponseIfReady()
          If we have a response, and delay is not set, then respond immediately.
protected  void setResponse(Object value, org.apache.hadoop.hbase.ipc.Status status, String errorClass, String error)
           
 void startDelay(boolean delayReturnValue)
          Signal that the call response should be delayed, thus freeing the RPC server to handle different requests.
 void throwExceptionIfCallerDisconnected()
          Throw an exception if the caller who made this IPC call has disconnected.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

protected int id

param

protected org.apache.hadoop.io.Writable param

connection

protected HBaseServer.Connection connection

timestamp

protected long timestamp

response

protected ByteBuffer response

delayResponse

protected boolean delayResponse

responder

protected HBaseServer.Responder responder

delayReturnValue

protected boolean delayReturnValue

size

protected long size

isError

protected boolean isError
Constructor Detail

HBaseServer.Call

public HBaseServer.Call(int id,
                        org.apache.hadoop.io.Writable param,
                        HBaseServer.Connection connection,
                        HBaseServer.Responder responder,
                        long size)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

setResponse

protected void setResponse(Object value,
                           org.apache.hadoop.hbase.ipc.Status status,
                           String errorClass,
                           String error)

endDelay

public void endDelay(Object result)
              throws IOException
Description copied from interface: Delayable
Signal that the RPC server is now allowed to send the response.

Specified by:
endDelay in interface Delayable
Parameters:
result - The value to return to the caller. If the corresponding delay response specified that the return value should not be delayed, this parameter must be null.
Throws:
IOException

endDelay

public void endDelay()
              throws IOException
Description copied from interface: Delayable
Signal the end of a delayed RPC, without specifying the return value. Use this only if the return value was not delayed

Specified by:
endDelay in interface Delayable
Throws:
IOException

startDelay

public void startDelay(boolean delayReturnValue)
Description copied from interface: Delayable
Signal that the call response should be delayed, thus freeing the RPC server to handle different requests.

Specified by:
startDelay in interface Delayable
Parameters:
delayReturnValue - Controls whether the return value of the call should be set when ending the delay or right away. There are cases when the return value can be set right away, even if the call is delayed.

endDelayThrowing

public void endDelayThrowing(Throwable t)
                      throws IOException
Description copied from interface: Delayable
End the call, throwing and exception to the caller. This works regardless of the return value being delayed.

Specified by:
endDelayThrowing in interface Delayable
Parameters:
t - Object to throw to the client.
Throws:
IOException

isDelayed

public boolean isDelayed()
Specified by:
isDelayed in interface Delayable
Returns:
is the call delayed?

isReturnValueDelayed

public boolean isReturnValueDelayed()
Specified by:
isReturnValueDelayed in interface Delayable
Returns:
is the return value delayed?

throwExceptionIfCallerDisconnected

public void throwExceptionIfCallerDisconnected()
                                        throws CallerDisconnectedException
Description copied from interface: RpcCallContext
Throw an exception if the caller who made this IPC call has disconnected. If called from outside the context of IPC, this does nothing.

Specified by:
throwExceptionIfCallerDisconnected in interface RpcCallContext
Throws:
CallerDisconnectedException

getSize

public long getSize()

sendResponseIfReady

public void sendResponseIfReady()
                         throws IOException
If we have a response, and delay is not set, then respond immediately. Otherwise, do not respond to client. This is called the by the RPC code in the context of the Handler thread.

Throws:
IOException


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.