zhuyaogai commented on code in PR #5428: URL: https://github.com/apache/hbase/pull/5428#discussion_r1338344101
########## hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerLimiter.java: ########## @@ -0,0 +1,89 @@ +/* + * 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.regionserver; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.conf.ConfigurationObserver; +import org.apache.yetus.audience.InterfaceAudience; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Limit max count of rows filtered per scan request. + */ +@InterfaceAudience.Private +public class RegionScannerLimiter implements ConfigurationObserver { + + private static final Logger LOG = LoggerFactory.getLogger(RegionScannerLimiter.class); + + public static final String HBASE_SERVER_SCANNER_MAX_ROWS_FILTERED_PER_REQUEST_KEY = + "hbase.server.scanner.max.rows.filtered.per.request"; + + private static RegionScannerLimiter INSTANCE; Review Comment: done. ########## hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionScannerLimiter.java: ########## @@ -0,0 +1,89 @@ +/* + * 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.regionserver; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.conf.ConfigurationObserver; +import org.apache.yetus.audience.InterfaceAudience; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Limit max count of rows filtered per scan request. + */ +@InterfaceAudience.Private +public class RegionScannerLimiter implements ConfigurationObserver { + + private static final Logger LOG = LoggerFactory.getLogger(RegionScannerLimiter.class); + + public static final String HBASE_SERVER_SCANNER_MAX_ROWS_FILTERED_PER_REQUEST_KEY = + "hbase.server.scanner.max.rows.filtered.per.request"; + + private static RegionScannerLimiter INSTANCE; + + // Max count of rows filtered per request. If zero, it means no limitation. + private volatile long maxRowsFilteredPerRequest = 0; + + private RegionScannerLimiter(Configuration conf) { + updateLimiterConf(conf, HBASE_SERVER_SCANNER_MAX_ROWS_FILTERED_PER_REQUEST_KEY); + } + + private void updateLimiterConf(Configuration conf, String configKey) { Review Comment: done. -- 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: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org