charlesconnell commented on code in PR #8705: URL: https://github.com/apache/hbase/pull/8705#discussion_r4221208444
########## hbase-server/src/main/java/org/apache/hadoop/hbase/quotas/RpcThrottleStateStore.java: ########## @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.hadoop.hbase.quotas; + +import java.io.IOException; +import org.apache.hadoop.hbase.exceptions.DeserializationException; +import org.apache.hadoop.hbase.master.BooleanStateStore; +import org.apache.hadoop.hbase.master.region.MasterRegion; +import org.apache.hadoop.hbase.util.Bytes; +import org.apache.hadoop.hbase.zookeeper.ZKWatcher; +import org.apache.yetus.audience.InterfaceAudience; +import org.apache.zookeeper.KeeperException; + +/** + * Store whether rpc throttle is enabled. + * <p> + * Notice that, this is stored in master local region so only master can read it. For region + * servers, we will publish the change through + * {@link org.apache.hadoop.hbase.master.procedure.SwitchRpcThrottleProcedure} and region servers + * can also query the flag through rpc request to master. + */ [email protected] +public class RpcThrottleStateStore extends BooleanStateStore { + + public static final String RPC_THROTTLE_ZNODE = "zookeeper.znode.quota.rpc.throttle"; + public static final String RPC_THROTTLE_ZNODE_DEFAULT = "rpc-throttle"; + + public static final String STATE_NAME = "rpc-throttle"; + + public RpcThrottleStateStore(MasterRegion masterRegion, ZKWatcher watcher, String zkPath) + throws IOException, KeeperException, DeserializationException { + super(masterRegion, STATE_NAME, watcher, zkPath); + } Review Comment: Is it necessary to keep the Zookeeper plumbing if it's not desired to use it? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
