public static void throwNumRequestsExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.NumRequestsExceeded, waitInterval); }
public RpcThrottlingException(String msg) { super(msg); // Dirty workaround to get the information after // ((RemoteException)e.getCause()).unwrapRemoteException() for (int i = 0; i < MSG_TYPE.length; ++i) { int index = msg.indexOf(MSG_TYPE[i]); if (index >= 0) { String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length()); type = Type.values()[i]; waitInterval = timeFromString(waitTimeStr); break; } } }
throws RpcThrottlingException { if (!reqsLimiter.canExecute(writeReqs + readReqs)) { RpcThrottlingException.throwNumRequestsExceeded(reqsLimiter.waitInterval()); RpcThrottlingException.throwRequestSizeExceeded( reqSizeLimiter.waitInterval(estimateWriteSize + estimateReadSize)); RpcThrottlingException.throwRequestCapacityUnitExceeded( reqCapacityUnitLimiter.waitInterval(estimateWriteCapacityUnit + estimateReadCapacityUnit)); RpcThrottlingException.throwNumWriteRequestsExceeded(writeReqsLimiter.waitInterval()); RpcThrottlingException.throwWriteSizeExceeded( writeSizeLimiter.waitInterval(estimateWriteSize)); RpcThrottlingException.throwWriteCapacityUnitExceeded( writeCapacityUnitLimiter.waitInterval(estimateWriteCapacityUnit)); RpcThrottlingException.throwNumReadRequestsExceeded(readReqsLimiter.waitInterval()); RpcThrottlingException.throwReadSizeExceeded( readSizeLimiter.waitInterval(estimateReadSize)); RpcThrottlingException.throwReadCapacityUnitExceeded( readCapacityUnitLimiter.waitInterval(estimateReadCapacityUnit));
private static void throwThrottlingException(final Type type, final long waitInterval) throws RpcThrottlingException { String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + StringUtils.formatTime(waitInterval); throw new RpcThrottlingException(type, waitInterval, msg); }
" table=" + table + " numWrites=" + numWrites + " numReads=" + numReads + " numScans=" + numScans + ": " + e.getMessage()); throw e;
public static List<Throwable> metaCachePreservingExceptions() { return new ArrayList<Throwable>() {{ add(new RegionOpeningException(" ")); add(new RegionTooBusyException("Some old message")); add(new RpcThrottlingException(" ")); add(new MultiActionResultTooLarge(" ")); add(new RetryImmediatelyException(" ")); add(new CallQueueTooBigException()); }}; }
public static void throwNumReadRequestsExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.NumReadRequestsExceeded, waitInterval); }
private static void throwThrottlingException(final Type type, final long waitInterval) throws RpcThrottlingException { String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + StringUtils.formatTime(waitInterval); throw new RpcThrottlingException(type, waitInterval, msg); }
public RpcThrottlingException(String msg) { super(msg); // Dirty workaround to get the information after // ((RemoteException)e.getCause()).unwrapRemoteException() for (int i = 0; i < MSG_TYPE.length; ++i) { int index = msg.indexOf(MSG_TYPE[i]); if (index >= 0) { String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length()); type = Type.values()[i]; waitInterval = timeFromString(waitTimeStr); break; } } }
public static void throwNumWriteRequestsExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.NumWriteRequestsExceeded, waitInterval); }
private static void throwThrottlingException(final Type type, final long waitInterval) throws RpcThrottlingException { String msg = MSG_TYPE[type.ordinal()] + MSG_WAIT + StringUtils.formatTime(waitInterval); throw new RpcThrottlingException(type, waitInterval, msg); }
public RpcThrottlingException(String msg) { super(msg); // Dirty workaround to get the information after // ((RemoteException)e.getCause()).unwrapRemoteException() for (int i = 0; i < MSG_TYPE.length; ++i) { int index = msg.indexOf(MSG_TYPE[i]); if (index >= 0) { String waitTimeStr = msg.substring(index + MSG_TYPE[i].length() + MSG_WAIT.length()); type = Type.values()[i]; waitInterval = timeFromString(waitTimeStr); break; } } }
public static void throwReadSizeExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.ReadSizeExceeded, waitInterval); }
public static List<Throwable> metaCachePreservingExceptions() { return new ArrayList<Throwable>() {{ add(new RegionOpeningException(" ")); add(new RegionTooBusyException("Some old message")); add(new RpcThrottlingException(" ")); add(new MultiActionResultTooLarge(" ")); add(new RetryImmediatelyException(" ")); add(new CallQueueTooBigException()); }}; }
public static void throwRequestCapacityUnitExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.RequestCapacityUnitExceeded, waitInterval); }
public static void throwRequestSizeExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.RequestSizeExceeded, waitInterval); }
public static void throwReadCapacityUnitExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.ReadCapacityUnitExceeded, waitInterval); }
public static void throwWriteCapacityUnitExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.WriteCapacityUnitExceeded, waitInterval); }
public static void throwWriteSizeExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.WriteSizeExceeded, waitInterval); }
public static void throwNumRequestsExceeded(final long waitInterval) throws RpcThrottlingException { throwThrottlingException(Type.NumRequestsExceeded, waitInterval); }