-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26441: Add metrics for BrokenStoreFileCleaner #3861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
13b69a9
HBASE-26064 Introduce a StoreFileTracker to abstract the store file t…
Apache9 2eceabd
HBASE-25988 Store the store file list by a file (#3578)
Apache9 88321fc
HBASE-26079 Use StoreFileTracker when splitting and merging (#3617)
wchevreuil 0ae94b8
HBASE-26224 Introduce a MigrationStoreFileTracker to support migratin…
Apache9 c184a92
HBASE-26246 Persist the StoreFileTracker configurations to TableDescr…
wchevreuil 434ec97
HBASE-26248 Should find a suitable way to let users specify the store…
Apache9 70906cf
HBASE-26264 Add more checks to prevent misconfiguration on store file…
Apache9 c705d80
HBASE-26280 Use store file tracker when snapshoting (#3685)
Apache9 4f0a8a1
HBASE-26326 CreateTableProcedure fails when FileBasedStoreFileTracker…
wchevreuil 201fadc
HBASE-26386 Refactor StoreFileTracker implementations to expose the s…
Apache9 5c8d55a
HBASE-26328 Clone snapshot doesn't load reference files into FILE SFT…
wchevreuil 71bd286
HBASE-26263 [Rolling Upgrading] Persist the StoreFileTracker configur…
GeorryHuang eebda10
HBASE-26271 Cleanup the broken store files under data directory (#3786)
BukrosSzabolcs d24e09d
HBASE-26454 CreateTableProcedure still relies on temp dir and renames…
wchevreuil 9cca3c6
HBASE-26079 Use StoreFileTracker when splitting and merging (#3617)
wchevreuil 55dd320
HBASE-26441: Add metrics for BrokenStoreFileCleaner
BukrosSzabolcs e9a86ef
HBASE-26441: Add metrics for BrokenStoreFileCleaner
BukrosSzabolcs 0656cca
HBASE-26441: Add metrics for BrokenStoreFileCleaner
BukrosSzabolcs 723cf07
HBASE-26064 Introduce a StoreFileTracker to abstract the store file t…
Apache9 620366a
HBASE-25988 Store the store file list by a file (#3578)
Apache9 2a2b274
HBASE-26079 Use StoreFileTracker when splitting and merging (#3617)
wchevreuil f021793
HBASE-26224 Introduce a MigrationStoreFileTracker to support migratin…
Apache9 ccf90ab
HBASE-26246 Persist the StoreFileTracker configurations to TableDescr…
wchevreuil 8af8ac9
HBASE-26248 Should find a suitable way to let users specify the store…
Apache9 33079f3
HBASE-26264 Add more checks to prevent misconfiguration on store file…
Apache9 97c68be
HBASE-26280 Use store file tracker when snapshoting (#3685)
Apache9 d36749c
HBASE-26326 CreateTableProcedure fails when FileBasedStoreFileTracker…
wchevreuil 0be4424
HBASE-26386 Refactor StoreFileTracker implementations to expose the s…
Apache9 0fa1b88
HBASE-26328 Clone snapshot doesn't load reference files into FILE SFT…
wchevreuil 3f1a935
HBASE-26263 [Rolling Upgrading] Persist the StoreFileTracker configur…
GeorryHuang 2fee980
HBASE-26271 Cleanup the broken store files under data directory (#3786)
BukrosSzabolcs 4aa3f47
HBASE-26454 CreateTableProcedure still relies on temp dir and renames…
wchevreuil 1cdbc2e
Merge branch 'HBASE-26067' into HBASE-26441
BukrosSzabolcs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
...pat/src/main/java/org/apache/hadoop/hbase/master/MetricsMasterBrokenStoreFileCleaner.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. | ||
| */ | ||
| @InterfaceAudience.Private | ||
| 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 number of new files deleted | ||
| */ | ||
| public void incrementBrokenStoreFileCleanerDeletes(long deletes); | ||
|
|
||
| /** | ||
| * Increment the failed file deletes counter | ||
| * @param failedDeletes number of files the chore failed to delete | ||
| */ | ||
| public void incrementBrokenStoreFileCleanerFailedDeletes(long failedDeletes); | ||
|
|
||
| /** | ||
| * Increment the number of cleaner runs counter | ||
| */ | ||
| public void incrementBrokenStoreFileCleanerRuns(long runs); | ||
|
|
||
| /** | ||
| * Update the chore runtime | ||
| * @param milis Chore runtime | ||
| */ | ||
| public void updateBrokenStoreFileCleanerTimer(long milis); | ||
|
|
||
| } |
68 changes: 68 additions & 0 deletions
68
...src/main/java/org/apache/hadoop/hbase/master/MetricsMasterBrokenStoreFileCleanerImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| /* | ||
| * 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.hadoop.hbase.metrics.BaseSourceImpl; | ||
| import org.apache.hadoop.metrics2.lib.MutableFastCounter; | ||
| import org.apache.hadoop.metrics2.lib.MutableTimeHistogram; | ||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| /** | ||
| * Implementation of {@link MetricsMasterBrokenStoreFileCleaner} to track latencies for one table | ||
| * in a RegionServer. | ||
| */ | ||
| @InterfaceAudience.Private | ||
| public class MetricsMasterBrokenStoreFileCleanerImpl extends BaseSourceImpl implements | ||
| MetricsMasterBrokenStoreFileCleaner { | ||
|
|
||
| private MutableFastCounter brokenStoreFileCleanerDeletes; | ||
| private MutableFastCounter brokenStoreFileCleanerFailedDeletes; | ||
| private MutableFastCounter brokenStoreFileCleanerRuns; | ||
| private MutableTimeHistogram brokenStoreFileCleanerTimer; | ||
|
|
||
| public MetricsMasterBrokenStoreFileCleanerImpl(String metricsName, String metricsDescription, | ||
| String metricsContext, String metricsJmxContext) { | ||
| super(metricsName, metricsDescription, metricsContext, metricsJmxContext); | ||
|
|
||
| brokenStoreFileCleanerDeletes = | ||
| getMetricsRegistry().newCounter(DELETES, DELETES_DESC, 0L); | ||
| brokenStoreFileCleanerFailedDeletes = | ||
| getMetricsRegistry().newCounter(FAILED_DELETES, FAILED_DELETES_DESC, 0L); | ||
| brokenStoreFileCleanerRuns = getMetricsRegistry().newCounter(RUNS, RUNS_DESC, 0L); | ||
| brokenStoreFileCleanerTimer = getMetricsRegistry().newTimeHistogram(RUNTIME, RUNTIME_DESC); | ||
| } | ||
|
|
||
| public MetricsMasterBrokenStoreFileCleanerImpl() { | ||
| this(METRICS_NAME, METRICS_DESCRIPTION, METRICS_CONTEXT, METRICS_JMX_CONTEXT); | ||
| } | ||
|
|
||
| @Override public void incrementBrokenStoreFileCleanerDeletes(long deletes) { | ||
| brokenStoreFileCleanerDeletes.incr(deletes); | ||
| } | ||
|
|
||
| @Override public void incrementBrokenStoreFileCleanerFailedDeletes(long failedDeletes) { | ||
| brokenStoreFileCleanerFailedDeletes.incr(failedDeletes); | ||
| } | ||
|
|
||
| @Override public void incrementBrokenStoreFileCleanerRuns(long runs) { | ||
| brokenStoreFileCleanerRuns.incr(runs); | ||
| } | ||
|
|
||
| @Override public void updateBrokenStoreFileCleanerTimer(long millis) { | ||
| brokenStoreFileCleanerTimer.add(millis); | ||
| } | ||
| } |
82 changes: 82 additions & 0 deletions
82
...pat/src/main/java/org/apache/hadoop/hbase/regionserver/MetricsBrokenStoreFileCleaner.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. | ||
| */ | ||
| @InterfaceAudience.Private | ||
| 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 times 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 number of new files deleted | ||
| */ | ||
| public void incrementBrokenStoreFileCleanerDeletes(long deletes); | ||
|
|
||
| /** | ||
| * Increment the failed file deletes counter | ||
| * @param failedDeletes number of files the chore failed to delete | ||
| */ | ||
| public void incrementBrokenStoreFileCleanerFailedDeletes(long failedDeletes); | ||
|
|
||
| /** | ||
| * Increment the number of cleaner runs counter | ||
| */ | ||
| public void incrementBrokenStoreFileCleanerRuns(); | ||
|
|
||
| /** | ||
| * Update the chore runtime | ||
| * @param milis Chore runtime | ||
| */ | ||
| public void updateBrokenStoreFileCleanerTimer(long milis); | ||
|
|
||
| } |
66 changes: 66 additions & 0 deletions
66
...src/main/java/org/apache/hadoop/hbase/regionserver/MetricsBrokenStoreFileCleanerImpl.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /* | ||
| * 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.hbase.metrics.BaseSourceImpl; | ||
| import org.apache.hadoop.metrics2.lib.MutableFastCounter; | ||
| import org.apache.hadoop.metrics2.lib.MutableTimeHistogram; | ||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| /** | ||
| * Implementation of {@link MetricsBrokenStoreFileCleaner} to track metrics for a specific | ||
| * RegionServer. | ||
| */ | ||
| @InterfaceAudience.Private public class MetricsBrokenStoreFileCleanerImpl extends BaseSourceImpl | ||
| implements MetricsBrokenStoreFileCleaner { | ||
|
|
||
| private MutableFastCounter brokenStoreFileCleanerDeletes; | ||
| private MutableFastCounter brokenStoreFileCleanerFailedDeletes; | ||
| private MutableFastCounter brokenStoreFileCleanerRuns; | ||
| private MutableTimeHistogram brokenStoreFileCleanerTimer; | ||
|
|
||
| public MetricsBrokenStoreFileCleanerImpl(String metricsName, String metricsDescription, | ||
| String metricsContext, String metricsJmxContext) { | ||
| super(metricsName, metricsDescription, metricsContext, metricsJmxContext); | ||
|
|
||
| brokenStoreFileCleanerDeletes = getMetricsRegistry().newCounter(DELETES, DELETES_DESC, 0L); | ||
| brokenStoreFileCleanerFailedDeletes = | ||
| getMetricsRegistry().newCounter(FAILED_DELETES, FAILED_DELETES_DESC, 0L); | ||
| brokenStoreFileCleanerRuns = getMetricsRegistry().newCounter(RUNS, RUNS_DESC, 0L); | ||
| brokenStoreFileCleanerTimer = getMetricsRegistry().newTimeHistogram(RUNTIME, RUNTIME_DESC); | ||
| } | ||
|
|
||
| public MetricsBrokenStoreFileCleanerImpl() { | ||
| this(METRICS_NAME, METRICS_DESCRIPTION, METRICS_CONTEXT, METRICS_JMX_CONTEXT); | ||
| } | ||
|
|
||
| @Override public void incrementBrokenStoreFileCleanerDeletes(long deletes) { | ||
| brokenStoreFileCleanerDeletes.incr(deletes); | ||
| } | ||
|
|
||
| @Override public void incrementBrokenStoreFileCleanerFailedDeletes(long failedDeletes) { | ||
| brokenStoreFileCleanerFailedDeletes.incr(failedDeletes); | ||
| } | ||
|
|
||
| @Override public void incrementBrokenStoreFileCleanerRuns() { | ||
| brokenStoreFileCleanerRuns.incr(); | ||
| } | ||
|
|
||
| @Override public void updateBrokenStoreFileCleanerTimer(long millis) { | ||
| brokenStoreFileCleanerTimer.add(millis); | ||
| } | ||
| } |
18 changes: 18 additions & 0 deletions
18
...rces/META-INF/services/org.apache.hadoop.hbase.master.MetricsMasterBrokenStoreFileCleaner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # 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. | ||
| # | ||
| org.apache.hadoop.hbase.master.MetricsMasterBrokenStoreFileCleanerImpl |
18 changes: 18 additions & 0 deletions
18
...rces/META-INF/services/org.apache.hadoop.hbase.regionserver.MetricsBrokenStoreFileCleaner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # 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. | ||
| # | ||
| org.apache.hadoop.hbase.regionserver.MetricsBrokenStoreFileCleanerImpl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth a separated method? How do we report the metrics for other background tasks on region server to master?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually we do not report metrics. I do this here for 2 reasons: