HBASE-19029 Align RPC timout methods in Table and AsyncTableBase
As part of HBASE-18978 the rpc timeout methods gets aligned between Table and AsyncTable interfaces. Deprecate the following methods in Table: - int getRpcTimeout() - int getReadRpcTimeout() - int getWriteRpcTimeout() - int getOperationTimeout() Add the following methods to Table: - long getRpcTimeout(TimeUnit) - long getReadRpcTimeout(TimeUnit) - long getWriteRpcTimeout(TimeUnit) - long getOperationTimeout(TimeUnit) Fix some javadoc issues. Signed-off-by: Michael Stack <stack@apache.org>
This commit is contained in:
parent
5255ae6dfa
commit
28d81295f3
|
@ -63,27 +63,37 @@ public interface AsyncTableBase {
|
|||
* specific rpc timeout config such as readRpcTimeout or writeRpcTimeout.
|
||||
* @see #getReadRpcTimeout(TimeUnit)
|
||||
* @see #getWriteRpcTimeout(TimeUnit)
|
||||
* @param unit the unit of time the timeout to be represented in
|
||||
* @return rpc timeout in the specified time unit
|
||||
*/
|
||||
long getRpcTimeout(TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Get timeout of each rpc read request in this Table instance.
|
||||
* @param unit the unit of time the timeout to be represented in
|
||||
* @return read rpc timeout in the specified time unit
|
||||
*/
|
||||
long getReadRpcTimeout(TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Get timeout of each rpc write request in this Table instance.
|
||||
* @param unit the unit of time the timeout to be represented in
|
||||
* @return write rpc timeout in the specified time unit
|
||||
*/
|
||||
long getWriteRpcTimeout(TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Get timeout of each operation in Table instance.
|
||||
* @param unit the unit of time the timeout to be represented in
|
||||
* @return operation rpc timeout in the specified time unit
|
||||
*/
|
||||
long getOperationTimeout(TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Get the timeout of a single operation in a scan. It works like operation timeout for other
|
||||
* operations.
|
||||
* @param unit the unit of time the timeout to be represented in
|
||||
* @return scan rpc timeout in the specified time unit
|
||||
*/
|
||||
long getScanTimeout(TimeUnit unit);
|
||||
|
||||
|
|
|
@ -112,10 +112,10 @@ public class HTable implements Table {
|
|||
private final int scannerCaching;
|
||||
private final long scannerMaxResultSize;
|
||||
private final ExecutorService pool; // For Multi & Scan
|
||||
private int operationTimeout; // global timeout for each blocking method with retrying rpc
|
||||
private final int rpcTimeout; // FIXME we should use this for rpc like batch and checkAndXXX
|
||||
private int readRpcTimeout; // timeout for each read rpc request
|
||||
private int writeRpcTimeout; // timeout for each write rpc request
|
||||
private int operationTimeoutMs; // global timeout for each blocking method with retrying rpc
|
||||
private final int rpcTimeoutMs; // FIXME we should use this for rpc like batch and checkAndXXX
|
||||
private int readRpcTimeoutMs; // timeout for each read rpc request
|
||||
private int writeRpcTimeoutMs; // timeout for each write rpc request
|
||||
private final boolean cleanupPoolOnClose; // shutdown the pool in close()
|
||||
private final HRegionLocator locator;
|
||||
|
||||
|
@ -187,10 +187,10 @@ public class HTable implements Table {
|
|||
}
|
||||
|
||||
this.tableName = builder.tableName;
|
||||
this.operationTimeout = builder.operationTimeout;
|
||||
this.rpcTimeout = builder.rpcTimeout;
|
||||
this.readRpcTimeout = builder.readRpcTimeout;
|
||||
this.writeRpcTimeout = builder.writeRpcTimeout;
|
||||
this.operationTimeoutMs = builder.operationTimeout;
|
||||
this.rpcTimeoutMs = builder.rpcTimeout;
|
||||
this.readRpcTimeoutMs = builder.readRpcTimeout;
|
||||
this.writeRpcTimeoutMs = builder.writeRpcTimeout;
|
||||
this.scannerCaching = connConfiguration.getScannerCaching();
|
||||
this.scannerMaxResultSize = connConfiguration.getScannerMaxResultSize();
|
||||
|
||||
|
@ -235,7 +235,7 @@ public class HTable implements Table {
|
|||
@Override
|
||||
public HTableDescriptor getTableDescriptor() throws IOException {
|
||||
HTableDescriptor htd = HBaseAdmin.getHTableDescriptor(tableName, connection, rpcCallerFactory,
|
||||
rpcControllerFactory, operationTimeout, readRpcTimeout);
|
||||
rpcControllerFactory, operationTimeoutMs, readRpcTimeoutMs);
|
||||
if (htd != null) {
|
||||
return new ImmutableHTableDescriptor(htd);
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ public class HTable implements Table {
|
|||
@Override
|
||||
public TableDescriptor getDescriptor() throws IOException {
|
||||
return HBaseAdmin.getTableDescriptor(tableName, connection, rpcCallerFactory,
|
||||
rpcControllerFactory, operationTimeout, readRpcTimeout);
|
||||
rpcControllerFactory, operationTimeoutMs, readRpcTimeoutMs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -392,17 +392,16 @@ public class HTable implements Table {
|
|||
ProtobufUtil.toResult(response.getResult(), getRpcControllerCellScanner());
|
||||
}
|
||||
};
|
||||
return rpcCallerFactory.<Result>newCaller(readRpcTimeout).callWithRetries(callable,
|
||||
this.operationTimeout);
|
||||
return rpcCallerFactory.<Result>newCaller(readRpcTimeoutMs).callWithRetries(callable,
|
||||
this.operationTimeoutMs);
|
||||
}
|
||||
|
||||
// Call that takes into account the replica
|
||||
RpcRetryingCallerWithReadReplicas callable = new RpcRetryingCallerWithReadReplicas(
|
||||
rpcControllerFactory, tableName, this.connection, get, pool,
|
||||
connConfiguration.getRetriesNumber(),
|
||||
operationTimeout, readRpcTimeout,
|
||||
connConfiguration.getRetriesNumber(), operationTimeoutMs, readRpcTimeoutMs,
|
||||
connConfiguration.getPrimaryCallTimeoutMicroSecond());
|
||||
return callable.call(operationTimeout);
|
||||
return callable.call(operationTimeoutMs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -415,7 +414,7 @@ public class HTable implements Table {
|
|||
}
|
||||
try {
|
||||
Object[] r1 = new Object[gets.size()];
|
||||
batch((List<? extends Row>)gets, r1, readRpcTimeout);
|
||||
batch((List<? extends Row>)gets, r1, readRpcTimeoutMs);
|
||||
// Translate.
|
||||
Result [] results = new Result[r1.length];
|
||||
int i = 0;
|
||||
|
@ -435,7 +434,7 @@ public class HTable implements Table {
|
|||
@Override
|
||||
public void batch(final List<? extends Row> actions, final Object[] results)
|
||||
throws InterruptedException, IOException {
|
||||
int rpcTimeout = writeRpcTimeout;
|
||||
int rpcTimeout = writeRpcTimeoutMs;
|
||||
boolean hasRead = false;
|
||||
boolean hasWrite = false;
|
||||
for (Row action : actions) {
|
||||
|
@ -449,7 +448,7 @@ public class HTable implements Table {
|
|||
}
|
||||
}
|
||||
if (hasRead && !hasWrite) {
|
||||
rpcTimeout = readRpcTimeout;
|
||||
rpcTimeout = readRpcTimeoutMs;
|
||||
}
|
||||
batch(actions, results, rpcTimeout);
|
||||
}
|
||||
|
@ -462,7 +461,7 @@ public class HTable implements Table {
|
|||
.setRowAccess(actions)
|
||||
.setResults(results)
|
||||
.setRpcTimeout(rpcTimeout)
|
||||
.setOperationTimeout(operationTimeout)
|
||||
.setOperationTimeout(operationTimeoutMs)
|
||||
.setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)
|
||||
.build();
|
||||
AsyncRequestFuture ars = multiAp.submit(task);
|
||||
|
@ -514,7 +513,7 @@ public class HTable implements Table {
|
|||
CancellableRegionServerCallable<SingleResponse> callable =
|
||||
new CancellableRegionServerCallable<SingleResponse>(
|
||||
connection, getName(), delete.getRow(), this.rpcControllerFactory.newController(),
|
||||
writeRpcTimeout, new RetryingTimeTracker().start(), delete.getPriority()) {
|
||||
writeRpcTimeoutMs, new RetryingTimeTracker().start(), delete.getPriority()) {
|
||||
@Override
|
||||
protected SingleResponse rpcCall() throws Exception {
|
||||
MutateRequest request = RequestConverter.buildMutateRequest(
|
||||
|
@ -529,8 +528,8 @@ public class HTable implements Table {
|
|||
.setTableName(tableName)
|
||||
.setRowAccess(rows)
|
||||
.setCallable(callable)
|
||||
.setRpcTimeout(writeRpcTimeout)
|
||||
.setOperationTimeout(operationTimeout)
|
||||
.setRpcTimeout(writeRpcTimeoutMs)
|
||||
.setOperationTimeout(operationTimeoutMs)
|
||||
.setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)
|
||||
.build();
|
||||
AsyncRequestFuture ars = multiAp.submit(task);
|
||||
|
@ -548,7 +547,7 @@ public class HTable implements Table {
|
|||
throws IOException {
|
||||
Object[] results = new Object[deletes.size()];
|
||||
try {
|
||||
batch(deletes, results, writeRpcTimeout);
|
||||
batch(deletes, results, writeRpcTimeoutMs);
|
||||
} catch (InterruptedException e) {
|
||||
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
|
||||
} finally {
|
||||
|
@ -584,8 +583,8 @@ public class HTable implements Table {
|
|||
return null;
|
||||
}
|
||||
};
|
||||
rpcCallerFactory.<Void> newCaller(this.writeRpcTimeout).callWithRetries(callable,
|
||||
this.operationTimeout);
|
||||
rpcCallerFactory.<Void> newCaller(this.writeRpcTimeoutMs).callWithRetries(callable,
|
||||
this.operationTimeoutMs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -599,7 +598,7 @@ public class HTable implements Table {
|
|||
}
|
||||
Object[] results = new Object[puts.size()];
|
||||
try {
|
||||
batch(puts, results, writeRpcTimeout);
|
||||
batch(puts, results, writeRpcTimeoutMs);
|
||||
} catch (InterruptedException e) {
|
||||
throw (InterruptedIOException) new InterruptedIOException().initCause(e);
|
||||
}
|
||||
|
@ -612,7 +611,8 @@ public class HTable implements Table {
|
|||
public void mutateRow(final RowMutations rm) throws IOException {
|
||||
CancellableRegionServerCallable<MultiResponse> callable =
|
||||
new CancellableRegionServerCallable<MultiResponse>(this.connection, getName(), rm.getRow(),
|
||||
rpcControllerFactory.newController(), writeRpcTimeout, new RetryingTimeTracker().start(), rm.getMaxPriority()){
|
||||
rpcControllerFactory.newController(), writeRpcTimeoutMs,
|
||||
new RetryingTimeTracker().start(), rm.getMaxPriority()) {
|
||||
@Override
|
||||
protected MultiResponse rpcCall() throws Exception {
|
||||
RegionAction.Builder regionMutationBuilder = RequestConverter.buildRegionAction(
|
||||
|
@ -637,8 +637,8 @@ public class HTable implements Table {
|
|||
.setTableName(tableName)
|
||||
.setRowAccess(rm.getMutations())
|
||||
.setCallable(callable)
|
||||
.setRpcTimeout(writeRpcTimeout)
|
||||
.setOperationTimeout(operationTimeout)
|
||||
.setRpcTimeout(writeRpcTimeoutMs)
|
||||
.setOperationTimeout(operationTimeoutMs)
|
||||
.setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)
|
||||
.build();
|
||||
AsyncRequestFuture ars = multiAp.submit(task);
|
||||
|
@ -666,8 +666,8 @@ public class HTable implements Table {
|
|||
return ProtobufUtil.toResult(response.getResult(), getRpcControllerCellScanner());
|
||||
}
|
||||
};
|
||||
return rpcCallerFactory.<Result> newCaller(this.writeRpcTimeout).
|
||||
callWithRetries(callable, this.operationTimeout);
|
||||
return rpcCallerFactory.<Result> newCaller(this.writeRpcTimeoutMs).
|
||||
callWithRetries(callable, this.operationTimeoutMs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -688,8 +688,8 @@ public class HTable implements Table {
|
|||
return ProtobufUtil.toResult(response.getResult(), getRpcControllerCellScanner());
|
||||
}
|
||||
};
|
||||
return rpcCallerFactory.<Result> newCaller(writeRpcTimeout).callWithRetries(callable,
|
||||
this.operationTimeout);
|
||||
return rpcCallerFactory.<Result> newCaller(writeRpcTimeoutMs).callWithRetries(callable,
|
||||
this.operationTimeoutMs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -733,8 +733,8 @@ public class HTable implements Table {
|
|||
return Long.valueOf(Bytes.toLong(result.getValue(family, qualifier)));
|
||||
}
|
||||
};
|
||||
return rpcCallerFactory.<Long> newCaller(this.writeRpcTimeout).
|
||||
callWithRetries(callable, this.operationTimeout);
|
||||
return rpcCallerFactory.<Long> newCaller(this.writeRpcTimeoutMs).
|
||||
callWithRetries(callable, this.operationTimeoutMs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -765,8 +765,8 @@ public class HTable implements Table {
|
|||
return Boolean.valueOf(response.getProcessed());
|
||||
}
|
||||
};
|
||||
return rpcCallerFactory.<Boolean> newCaller(this.writeRpcTimeout).
|
||||
callWithRetries(callable, this.operationTimeout);
|
||||
return rpcCallerFactory.<Boolean> newCaller(this.writeRpcTimeoutMs).
|
||||
callWithRetries(callable, this.operationTimeoutMs);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -808,8 +808,8 @@ public class HTable implements Table {
|
|||
throws IOException {
|
||||
CancellableRegionServerCallable<SingleResponse> callable =
|
||||
new CancellableRegionServerCallable<SingleResponse>(
|
||||
this.connection, getName(), row, this.rpcControllerFactory.newController(),
|
||||
writeRpcTimeout, new RetryingTimeTracker().start(), delete.getPriority()) {
|
||||
this.connection, getName(), row, this.rpcControllerFactory.newController(), writeRpcTimeoutMs,
|
||||
new RetryingTimeTracker().start(), delete.getPriority()) {
|
||||
@Override
|
||||
protected SingleResponse rpcCall() throws Exception {
|
||||
CompareType compareType = CompareType.valueOf(opName);
|
||||
|
@ -828,8 +828,8 @@ public class HTable implements Table {
|
|||
.setRowAccess(rows)
|
||||
.setCallable(callable)
|
||||
// TODO any better timeout?
|
||||
.setRpcTimeout(Math.max(readRpcTimeout, writeRpcTimeout))
|
||||
.setOperationTimeout(operationTimeout)
|
||||
.setRpcTimeout(Math.max(readRpcTimeoutMs, writeRpcTimeoutMs))
|
||||
.setOperationTimeout(operationTimeoutMs)
|
||||
.setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)
|
||||
.setResults(results)
|
||||
.build();
|
||||
|
@ -868,7 +868,8 @@ public class HTable implements Table {
|
|||
throws IOException {
|
||||
CancellableRegionServerCallable<MultiResponse> callable =
|
||||
new CancellableRegionServerCallable<MultiResponse>(connection, getName(), rm.getRow(),
|
||||
rpcControllerFactory.newController(), writeRpcTimeout, new RetryingTimeTracker().start(), rm.getMaxPriority()) {
|
||||
rpcControllerFactory.newController(), writeRpcTimeoutMs, new RetryingTimeTracker().start(),
|
||||
rm.getMaxPriority()) {
|
||||
@Override
|
||||
protected MultiResponse rpcCall() throws Exception {
|
||||
CompareType compareType = CompareType.valueOf(opName);
|
||||
|
@ -901,8 +902,8 @@ public class HTable implements Table {
|
|||
.setResults(results)
|
||||
.setCallable(callable)
|
||||
// TODO any better timeout?
|
||||
.setRpcTimeout(Math.max(readRpcTimeout, writeRpcTimeout))
|
||||
.setOperationTimeout(operationTimeout)
|
||||
.setRpcTimeout(Math.max(readRpcTimeoutMs, writeRpcTimeoutMs))
|
||||
.setOperationTimeout(operationTimeoutMs)
|
||||
.setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)
|
||||
.build();
|
||||
AsyncRequestFuture ars = multiAp.submit(task);
|
||||
|
@ -961,7 +962,7 @@ public class HTable implements Table {
|
|||
|
||||
Object[] r1= new Object[exists.size()];
|
||||
try {
|
||||
batch(exists, r1, readRpcTimeout);
|
||||
batch(exists, r1, readRpcTimeoutMs);
|
||||
} catch (InterruptedException e) {
|
||||
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
|
||||
}
|
||||
|
@ -1134,20 +1135,14 @@ public class HTable implements Table {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setOperationTimeout(int operationTimeout) {
|
||||
this.operationTimeout = operationTimeout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOperationTimeout() {
|
||||
return operationTimeout;
|
||||
public long getRpcTimeout(TimeUnit unit) {
|
||||
return unit.convert(rpcTimeoutMs, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getRpcTimeout() {
|
||||
return rpcTimeout;
|
||||
return rpcTimeoutMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1158,23 +1153,54 @@ public class HTable implements Table {
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getReadRpcTimeout(TimeUnit unit) {
|
||||
return unit.convert(readRpcTimeoutMs, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getReadRpcTimeout() {
|
||||
return readRpcTimeoutMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setReadRpcTimeout(int readRpcTimeout) {
|
||||
this.readRpcTimeoutMs = readRpcTimeout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getWriteRpcTimeout(TimeUnit unit) {
|
||||
return unit.convert(writeRpcTimeoutMs, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getWriteRpcTimeout() {
|
||||
return writeRpcTimeout;
|
||||
return writeRpcTimeoutMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setWriteRpcTimeout(int writeRpcTimeout) {
|
||||
this.writeRpcTimeout = writeRpcTimeout;
|
||||
this.writeRpcTimeoutMs = writeRpcTimeout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getReadRpcTimeout() { return readRpcTimeout; }
|
||||
public long getOperationTimeout(TimeUnit unit) {
|
||||
return unit.convert(operationTimeoutMs, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setReadRpcTimeout(int readRpcTimeout) {
|
||||
this.readRpcTimeout = readRpcTimeout;
|
||||
public int getOperationTimeout() {
|
||||
return operationTimeoutMs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setOperationTimeout(int operationTimeout) {
|
||||
this.operationTimeoutMs = operationTimeout;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1272,13 +1298,14 @@ public class HTable implements Table {
|
|||
callbackErrorServers.add("null");
|
||||
}
|
||||
};
|
||||
AsyncProcessTask<ClientProtos.CoprocessorServiceResult> task = AsyncProcessTask.newBuilder(resultsCallback)
|
||||
AsyncProcessTask<ClientProtos.CoprocessorServiceResult> task =
|
||||
AsyncProcessTask.newBuilder(resultsCallback)
|
||||
.setPool(pool)
|
||||
.setTableName(tableName)
|
||||
.setRowAccess(execs)
|
||||
.setResults(results)
|
||||
.setRpcTimeout(readRpcTimeout)
|
||||
.setOperationTimeout(operationTimeout)
|
||||
.setRpcTimeout(readRpcTimeoutMs)
|
||||
.setOperationTimeout(operationTimeoutMs)
|
||||
.setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)
|
||||
.build();
|
||||
AsyncRequestFuture future = asyncProcess.submit(task);
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.io.Closeable;
|
|||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.hbase.CompareOperator;
|
||||
|
@ -660,29 +661,21 @@ public interface Table extends Closeable {
|
|||
byte[] value, RowMutations mutation) throws IOException;
|
||||
|
||||
/**
|
||||
* Set timeout (millisecond) of each operation in this Table instance, will override the value
|
||||
* of hbase.client.operation.timeout in configuration.
|
||||
* Operation timeout is a top-level restriction that makes sure a blocking method will not be
|
||||
* blocked more than this. In each operation, if rpc request fails because of timeout or
|
||||
* other reason, it will retry until success or throw a RetriesExhaustedException. But if the
|
||||
* total time being blocking reach the operation timeout before retries exhausted, it will break
|
||||
* early and throw SocketTimeoutException.
|
||||
* @param operationTimeout the total timeout of each operation in millisecond.
|
||||
* @deprecated since 2.0.0, use {@link TableBuilder#setOperationTimeout} instead
|
||||
* Get timeout of each rpc request in this Table instance. It will be overridden by a more
|
||||
* specific rpc timeout config such as readRpcTimeout or writeRpcTimeout.
|
||||
* @see #getReadRpcTimeout(TimeUnit)
|
||||
* @see #getWriteRpcTimeout(TimeUnit)
|
||||
* @param unit the unit of time the timeout to be represented in
|
||||
* @return rpc timeout in the specified time unit
|
||||
*/
|
||||
@Deprecated
|
||||
void setOperationTimeout(int operationTimeout);
|
||||
|
||||
/**
|
||||
* Get timeout (millisecond) of each operation for in Table instance.
|
||||
*/
|
||||
int getOperationTimeout();
|
||||
long getRpcTimeout(TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Get timeout (millisecond) of each rpc request in this Table instance.
|
||||
*
|
||||
* @return Currently configured read timeout
|
||||
* @deprecated Use getReadRpcTimeout or getWriteRpcTimeout instead
|
||||
* @deprecated use {@link #getReadRpcTimeout(TimeUnit)} or
|
||||
* {@link #getWriteRpcTimeout(TimeUnit)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
int getRpcTimeout();
|
||||
|
@ -703,8 +696,18 @@ public interface Table extends Closeable {
|
|||
void setRpcTimeout(int rpcTimeout);
|
||||
|
||||
/**
|
||||
* Get timeout (millisecond) of each rpc read request in this Table instance.
|
||||
* Get timeout of each rpc read request in this Table instance.
|
||||
* @param unit the unit of time the timeout to be represented in
|
||||
* @return read rpc timeout in the specified time unit
|
||||
*/
|
||||
long getReadRpcTimeout(TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Get timeout (millisecond) of each rpc read request in this Table instance.
|
||||
* @deprecated since 2.0 and will be removed in 3.0 version
|
||||
* use {@link #getReadRpcTimeout(TimeUnit)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
int getReadRpcTimeout();
|
||||
|
||||
/**
|
||||
|
@ -713,15 +716,25 @@ public interface Table extends Closeable {
|
|||
* If a rpc read request waiting too long, it will stop waiting and send a new request to retry
|
||||
* until retries exhausted or operation timeout reached.
|
||||
*
|
||||
* @param readRpcTimeout
|
||||
* @param readRpcTimeout the timeout for read rpc request in milliseconds
|
||||
* @deprecated since 2.0.0, use {@link TableBuilder#setReadRpcTimeout} instead
|
||||
*/
|
||||
@Deprecated
|
||||
void setReadRpcTimeout(int readRpcTimeout);
|
||||
|
||||
/**
|
||||
* Get timeout (millisecond) of each rpc write request in this Table instance.
|
||||
* Get timeout of each rpc write request in this Table instance.
|
||||
* @param unit the unit of time the timeout to be represented in
|
||||
* @return write rpc timeout in the specified time unit
|
||||
*/
|
||||
long getWriteRpcTimeout(TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Get timeout (millisecond) of each rpc write request in this Table instance.
|
||||
* @deprecated since 2.0 and will be removed in 3.0 version
|
||||
* use {@link #getWriteRpcTimeout(TimeUnit)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
int getWriteRpcTimeout();
|
||||
|
||||
/**
|
||||
|
@ -730,9 +743,38 @@ public interface Table extends Closeable {
|
|||
* If a rpc write request waiting too long, it will stop waiting and send a new request to retry
|
||||
* until retries exhausted or operation timeout reached.
|
||||
*
|
||||
* @param writeRpcTimeout
|
||||
* @param writeRpcTimeout the timeout for write rpc request in milliseconds
|
||||
* @deprecated since 2.0.0, use {@link TableBuilder#setWriteRpcTimeout} instead
|
||||
*/
|
||||
@Deprecated
|
||||
void setWriteRpcTimeout(int writeRpcTimeout);
|
||||
|
||||
/**
|
||||
* Get timeout of each operation in Table instance.
|
||||
* @param unit the unit of time the timeout to be represented in
|
||||
* @return operation rpc timeout in the specified time unit
|
||||
*/
|
||||
long getOperationTimeout(TimeUnit unit);
|
||||
|
||||
/**
|
||||
* Get timeout (millisecond) of each operation for in Table instance.
|
||||
* @deprecated since 2.0 and will be removed in 3.0 version
|
||||
* use {@link #getOperationTimeout(TimeUnit)} instead
|
||||
*/
|
||||
@Deprecated
|
||||
int getOperationTimeout();
|
||||
|
||||
/**
|
||||
* Set timeout (millisecond) of each operation in this Table instance, will override the value
|
||||
* of hbase.client.operation.timeout in configuration.
|
||||
* Operation timeout is a top-level restriction that makes sure a blocking method will not be
|
||||
* blocked more than this. In each operation, if rpc request fails because of timeout or
|
||||
* other reason, it will retry until success or throw a RetriesExhaustedException. But if the
|
||||
* total time being blocking reach the operation timeout before retries exhausted, it will break
|
||||
* early and throw SocketTimeoutException.
|
||||
* @param operationTimeout the total timeout of each operation in millisecond.
|
||||
* @deprecated since 2.0.0, use {@link TableBuilder#setOperationTimeout} instead
|
||||
*/
|
||||
@Deprecated
|
||||
void setOperationTimeout(int operationTimeout);
|
||||
}
|
||||
|
|
|
@ -74,6 +74,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* HTable interface to remote tables accessed via REST gateway
|
||||
|
@ -864,6 +865,7 @@ public class RemoteHTable implements Table {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getOperationTimeout() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@ -874,6 +876,11 @@ public class RemoteHTable implements Table {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getReadRpcTimeout(TimeUnit unit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getRpcTimeout() {
|
||||
|
@ -881,6 +888,12 @@ public class RemoteHTable implements Table {
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getRpcTimeout(TimeUnit unit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getReadRpcTimeout() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@ -891,6 +904,12 @@ public class RemoteHTable implements Table {
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getWriteRpcTimeout(TimeUnit unit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getWriteRpcTimeout() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@ -900,6 +919,11 @@ public class RemoteHTable implements Table {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getOperationTimeout(TimeUnit unit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/*
|
||||
* Only a small subset of characters are valid in URLs.
|
||||
*
|
||||
|
|
|
@ -22,10 +22,10 @@ import java.util.ArrayList;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.hadoop.conf.Configuration;
|
||||
import org.apache.hadoop.hbase.Cell;
|
||||
import org.apache.hadoop.hbase.HConstants;
|
||||
import org.apache.hadoop.hbase.HTableDescriptor;
|
||||
import org.apache.hadoop.hbase.TableName;
|
||||
import org.apache.hadoop.hbase.CompareOperator;
|
||||
|
@ -353,6 +353,7 @@ public class RegionAsTable implements Table {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getOperationTimeout() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
@ -363,12 +364,27 @@ public class RegionAsTable implements Table {
|
|||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getReadRpcTimeout(TimeUnit unit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWriteRpcTimeout(int writeRpcTimeout) {throw new UnsupportedOperationException(); }
|
||||
|
||||
@Override
|
||||
public long getOperationTimeout(TimeUnit unit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadRpcTimeout(int readRpcTimeout) {throw new UnsupportedOperationException(); }
|
||||
|
||||
@Override
|
||||
public long getWriteRpcTimeout(TimeUnit unit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getRpcTimeout() {
|
||||
|
@ -376,8 +392,15 @@ public class RegionAsTable implements Table {
|
|||
}
|
||||
|
||||
@Override
|
||||
public long getRpcTimeout(TimeUnit unit) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getWriteRpcTimeout() { throw new UnsupportedOperationException(); }
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getReadRpcTimeout() { throw new UnsupportedOperationException(); }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue