public abstract class HBaseRpc extends Object
Implementations of this class are not expected to be synchronized.
byte
arrays in argumentbyte[]
in argument will copy it.
If you change the contents of any byte array you give to an instance of
this class, you may affect the behavior of the request in an
unpredictable way. If you need to change the byte array,
clone
it before giving it to this class. For those
familiar with the term "defensive copy", we don't do it in order to avoid
unnecessary memory copies when you know you won't be changing (or event
holding a reference to) the byte array, which is frequently the case.Modifier and Type | Class and Description |
---|---|
static interface |
HBaseRpc.HasFamily
An RPC from which you can get a family name.
|
static interface |
HBaseRpc.HasKey
An RPC from which you can get a row key name.
|
static interface |
HBaseRpc.HasQualifier
An RPC from which you can get a column qualifier name.
|
static interface |
HBaseRpc.HasQualifiers
An RPC from which you can get multiple column qualifier names.
|
static interface |
HBaseRpc.HasTable
An RPC from which you can get a table name.
|
static interface |
HBaseRpc.HasTimestamp
An RPC from which you can get a timestamp.
|
static interface |
HBaseRpc.HasValue
An RPC from which you can get a value.
|
static interface |
HBaseRpc.HasValues
An RPC from which you can get multiple values.
|
Modifier and Type | Method and Description |
---|---|
boolean |
failfast()
Returns whether the RPC not be retried upon encountering a problem.
|
int |
getTimeout()
An optional timeout for the RPC in milliseconds.
|
boolean |
isProbe() |
boolean |
isTraceRPC() |
boolean |
setFailfast(boolean failfast)
Set whether the RPC not be retried upon encountering a problem.
|
void |
setProbe(boolean probe) |
void |
setTimeout(int timeout)
A timeout, in milliseconds, to set for this RPC.
|
void |
setTraceRPC(boolean trace_rpc) |
String |
toString() |
public boolean isTraceRPC()
public void setTraceRPC(boolean trace_rpc)
public final boolean setFailfast(boolean failfast)
RPCs can be retried for various legitimate reasons (e.g. NSRE due to a region moving), but under certain failure circumstances (such as a node going down) we want to give up and be alerted as soon as possible.
failfast
- If true
, this RPC should fail-fast as soon as
we know we have a problem.public final boolean failfast()
setFailfast(boolean)
public boolean isProbe()
public void setProbe(boolean probe)
public void setTimeout(int timeout)
RpcTimedOutException
will be returned in the deferred.
If no timeout is set, then "hbase.rpc.timeout" will be used by default. However if a value of "0" is supplied as the timeout, then the RPC will not be timed out.
timeout
- The timeout in milliseconds.IllegalArgumentException
- if the value is less than zeropublic int getTimeout()
Copyright © 2010-2017, The Async HBase Authors