HBASE-25747 Remove unused getWriteAvailable method in OperationQuota (#3133)

Signed-off-by: stack <stack@apache.org>
This commit is contained in:
meiyi 2021-04-09 10:23:34 +08:00 committed by GitHub
parent 8ba9034511
commit ad06aa2082
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 20 deletions

View File

@ -24,22 +24,18 @@ import java.util.List;
import org.apache.hadoop.conf.Configuration;
import org.apache.yetus.audience.InterfaceAudience;
import org.apache.yetus.audience.InterfaceStability;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.hadoop.hbase.client.Mutation;
import org.apache.hadoop.hbase.client.Result;
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class DefaultOperationQuota implements OperationQuota {
private static final Logger LOG = LoggerFactory.getLogger(DefaultOperationQuota.class);
protected final List<QuotaLimiter> limiters;
private final long writeCapacityUnit;
private final long readCapacityUnit;
// the available read/write quota size in bytes
protected long writeAvailable = 0;
protected long readAvailable = 0;
// estimated quota
protected long writeConsumed = 0;
@ -81,7 +77,6 @@ public class DefaultOperationQuota implements OperationQuota {
public void checkQuota(int numWrites, int numReads, int numScans) throws RpcThrottlingException {
updateEstimateConsumeQuota(numWrites, numReads, numScans);
writeAvailable = Long.MAX_VALUE;
readAvailable = Long.MAX_VALUE;
for (final QuotaLimiter limiter : limiters) {
if (limiter.isBypass()) continue;
@ -89,7 +84,6 @@ public class DefaultOperationQuota implements OperationQuota {
limiter.checkQuota(numWrites, writeConsumed, numReads + numScans, readConsumed,
writeCapacityUnitConsumed, readCapacityUnitConsumed);
readAvailable = Math.min(readAvailable, limiter.getReadAvailable());
writeAvailable = Math.min(writeAvailable, limiter.getWriteAvailable());
}
for (final QuotaLimiter limiter : limiters) {
@ -125,11 +119,6 @@ public class DefaultOperationQuota implements OperationQuota {
return readAvailable;
}
@Override
public long getWriteAvailable() {
return writeAvailable;
}
@Override
public void addGetResult(final Result result) {
operationSize[OperationType.GET.ordinal()] += QuotaUtil.calculateResultSize(result);

View File

@ -75,7 +75,6 @@ public class ExceedOperationQuota extends DefaultOperationQuota {
}
// 4. Region server limiter is enough and grab estimated consume quota.
readAvailable = Math.max(readAvailable, regionServerLimiter.getReadAvailable());
writeAvailable = Math.max(writeAvailable, regionServerLimiter.getWriteAvailable());
regionServerLimiter.grabQuota(numWrites, writeConsumed, numReads + numScans, readConsumed,
writeCapacityUnitConsumed, writeCapacityUnitConsumed);
if (exceed) {

View File

@ -71,9 +71,4 @@ class NoopOperationQuota implements OperationQuota {
public long getReadAvailable() {
return Long.MAX_VALUE;
}
@Override
public long getWriteAvailable() {
return Long.MAX_VALUE;
}
}

View File

@ -70,7 +70,4 @@ public interface OperationQuota {
/** @return the number of bytes available to read to avoid exceeding the quota */
long getReadAvailable();
/** @return the number of bytes available to write to avoid exceeding the quota */
long getWriteAvailable();
}