Apache9 commented on a change in pull request #3861: URL: https://github.com/apache/hbase/pull/3861#discussion_r753163460
########## File path: hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterBrokenStoreFileCleaner.java ########## @@ -0,0 +1,82 @@ +/* + * 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.master; + +import org.apache.yetus.audience.InterfaceAudience; + +/** + * BrokenStoreFileCleaner metrics for a specific table in a RegionServer. + */ [email protected] +public interface MetricsMasterBrokenStoreFileCleaner { + + /** + * The name of the metrics + */ + String METRICS_NAME = "BrokenStoreFileCleaner"; + + /** + * The name of the metrics context that metrics will be under. + */ + String METRICS_CONTEXT = "master"; + + /** + * Description + */ + String METRICS_DESCRIPTION = + "Metrics about BrokenStoreFileCleaner results on a single HBase RegionServer"; + + /** + * The name of the metrics context that metrics will be under in jmx + */ + String METRICS_JMX_CONTEXT = "Master,sub=" + METRICS_NAME; + + + String DELETES = "BrokenStoreFileCleanerDeletes"; + String DELETES_DESC = "Number of files deleted by BrokenStoreFileCleaner"; + String FAILED_DELETES = "BrokenStoreFileCleanerFailedDeletes"; + String FAILED_DELETES_DESC = + "Number of files BrokenStoreFileCleaner tried but failed to delete"; + String RUNS = "BrokenStoreFileCleanerRuns"; + String RUNS_DESC = "Number of time the BrokenStoreFileCleaner chore run"; + String RUNTIME = "BrokenStoreFileCleanerRuntime"; + String RUNTIME_DESC = "Time required to run BrokenStoreFileCleaner chore in milliseconds"; + + /** + * Increment the deleted files counter + * @param deletes Review comment: nits: avoid empty javadoc element, it will lead to a checkstyle warning. ########## File path: hbase-protocol-shaded/src/main/protobuf/server/master/RegionServerStatus.proto ########## @@ -184,6 +184,18 @@ message GetLiveRegionServersResponse { required uint32 total = 2; } + +message BrokenStoreFileCleanerUsageRequest { + required string server_name = 1; + required uint64 runtime = 2; + optional uint64 deleted_files = 3; + optional uint64 failed_deletes = 4; + required uint32 runs = 5; Review comment: In the above metrics class we use long to runs, why here we change to use uint32 instead of uint64? ########## File path: hbase-protocol-shaded/src/main/protobuf/server/master/RegionServerStatus.proto ########## @@ -230,4 +242,8 @@ service RegionServerStatusService { /** Get some live region servers to be used as seed for bootstrap nodes */ rpc GetLiveRegionServers(GetLiveRegionServersRequest) returns(GetLiveRegionServersResponse); + + /** Report BrokenStoreFileCleaner chore metrics to master */ + rpc ReportBrokenStoreFileCleanerUsage(BrokenStoreFileCleanerUsageRequest) Review comment: Is it worth a separated method? How do we report the metrics for other background tasks on region server to master? ########## File path: hbase-hadoop-compat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsBrokenStoreFileCleaner.java ########## @@ -0,0 +1,82 @@ +/* + * 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.yetus.audience.InterfaceAudience; + +/** + * BrokenStoreFileCleaner metrics for a specific RegionServer. + */ [email protected] +public interface MetricsBrokenStoreFileCleaner { + + /** + * The name of the metrics + */ + String METRICS_NAME = "BrokenStoreFileCleaner"; + + /** + * The name of the metrics context that metrics will be under. + */ + String METRICS_CONTEXT = "regionserver"; + + /** + * Description + */ + String METRICS_DESCRIPTION = + "Metrics about BrokenStoreFileCleaner results on a single HBase RegionServer"; + + /** + * The name of the metrics context that metrics will be under in jmx + */ + String METRICS_JMX_CONTEXT = "RegionServer,sub=" + METRICS_NAME; + + + String DELETES = "BrokenStoreFileCleanerDeletes"; + String DELETES_DESC = "Number of files deleted by BrokenStoreFileCleaner"; + String FAILED_DELETES = "BrokenStoreFileCleanerFailedDeletes"; + String FAILED_DELETES_DESC = + "Number of files BrokenStoreFileCleaner tried but failed to delete"; + String RUNS = "BrokenStoreFileCleanerRuns"; + String RUNS_DESC = "Number of time the BrokenStoreFileCleaner chore run"; Review comment: Number of times? -- 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]
