Skip to content

Commit 2825e30

Browse files
Remove references to ClientProtos
1 parent cbc708b commit 2825e30

File tree

4 files changed

+24
-12
lines changed

4 files changed

+24
-12
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionCoprocessorEnvironment.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
package org.apache.hadoop.hbase.coprocessor;
1919

2020
import java.io.IOException;
21-
import java.util.List;
2221
import java.util.concurrent.ConcurrentMap;
2322
import org.apache.hadoop.conf.Configuration;
2423
import org.apache.hadoop.hbase.CoprocessorEnvironment;
@@ -37,8 +36,6 @@
3736
import org.apache.yetus.audience.InterfaceAudience;
3837
import org.apache.yetus.audience.InterfaceStability;
3938

40-
import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos;
41-
4239
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
4340
@InterfaceStability.Evolving
4441
public interface RegionCoprocessorEnvironment extends CoprocessorEnvironment<RegionCoprocessor> {
@@ -167,12 +164,12 @@ OperationQuota checkBatchQuota(final Region region, final OperationQuota.Operati
167164
* available quota and to report the data/usage of the operation. This method does not support
168165
* scans because estimating a scan's workload is more complicated than estimating the workload of
169166
* a get/put.
170-
* @param region the region where the operation will be performed
171-
* @param actions the "multi" actions to perform
172-
* @param hasCondition whether the RegionAction has a condition
167+
* @param region the region where the operation will be performed
168+
* @param numWrites number of writes to count against quota
169+
* @param numReads number of reads to count against quota
173170
* @return the OperationQuota
174171
* @throws RpcThrottlingException if the operation cannot be executed due to quota exceeded.
175172
*/
176-
OperationQuota checkBatchQuota(final Region region, final List<ClientProtos.Action> actions,
177-
boolean hasCondition) throws IOException, RpcThrottlingException;
173+
OperationQuota checkBatchQuota(final Region region, int numWrites, int numReads)
174+
throws IOException, RpcThrottlingException;
178175
}

hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RegionServerRpcQuotaManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ public OperationQuota checkBatchQuota(final Region region,
225225
* @return the OperationQuota
226226
* @throws RpcThrottlingException if the operation cannot be executed due to quota exceeded.
227227
*/
228-
private OperationQuota checkBatchQuota(final Region region, final int numWrites,
228+
@Override
229+
public OperationQuota checkBatchQuota(final Region region, final int numWrites,
229230
final int numReads) throws IOException, RpcThrottlingException {
230231
Optional<User> user = RpcServer.getRequestUser();
231232
UserGroupInformation ugi;

hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RpcQuotaManager.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,18 @@ OperationQuota checkBatchQuota(final Region region, final OperationQuota.Operati
7575
*/
7676
OperationQuota checkBatchQuota(final Region region, final List<ClientProtos.Action> actions,
7777
boolean hasCondition) throws IOException, RpcThrottlingException;
78+
79+
/**
80+
* Check the quota for the current (rpc-context) user. Returns the OperationQuota used to get the
81+
* available quota and to report the data/usage of the operation. This method does not support
82+
* scans because estimating a scan's workload is more complicated than estimating the workload of
83+
* a get/put.
84+
* @param region the region where the operation will be performed
85+
* @param numWrites number of writes to count against quota
86+
* @param numReads number of reads to count against quota
87+
* @return the OperationQuota
88+
* @throws RpcThrottlingException if the operation cannot be executed due to quota exceeded.
89+
*/
90+
OperationQuota checkBatchQuota(final Region region, int numWrites, int numReads)
91+
throws IOException, RpcThrottlingException;
7892
}

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ public OperationQuota checkBatchQuota(Region region, OperationQuota.OperationTyp
225225
}
226226

227227
@Override
228-
public OperationQuota checkBatchQuota(Region region, List<ClientProtos.Action> actions,
229-
boolean hasCondition) throws IOException, RpcThrottlingException {
230-
return rpcQuotaManager.checkBatchQuota(region, actions, hasCondition);
228+
public OperationQuota checkBatchQuota(final Region region, int numWrites, int numReads)
229+
throws IOException, RpcThrottlingException {
230+
return rpcQuotaManager.checkBatchQuota(region, numWrites, numReads);
231231
}
232232
}
233233

0 commit comments

Comments
 (0)