Skip to content
Closed
Show file tree
Hide file tree
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 Jul 29, 2021
2eceabd
HBASE-25988 Store the store file list by a file (#3578)
Apache9 Aug 26, 2021
88321fc
HBASE-26079 Use StoreFileTracker when splitting and merging (#3617)
wchevreuil Sep 8, 2021
0ae94b8
HBASE-26224 Introduce a MigrationStoreFileTracker to support migratin…
Apache9 Sep 9, 2021
c184a92
HBASE-26246 Persist the StoreFileTracker configurations to TableDescr…
wchevreuil Sep 12, 2021
434ec97
HBASE-26248 Should find a suitable way to let users specify the store…
Apache9 Sep 14, 2021
70906cf
HBASE-26264 Add more checks to prevent misconfiguration on store file…
Apache9 Sep 15, 2021
c705d80
HBASE-26280 Use store file tracker when snapshoting (#3685)
Apache9 Sep 17, 2021
4f0a8a1
HBASE-26326 CreateTableProcedure fails when FileBasedStoreFileTracker…
wchevreuil Oct 13, 2021
201fadc
HBASE-26386 Refactor StoreFileTracker implementations to expose the s…
Apache9 Oct 21, 2021
5c8d55a
HBASE-26328 Clone snapshot doesn't load reference files into FILE SFT…
wchevreuil Oct 22, 2021
71bd286
HBASE-26263 [Rolling Upgrading] Persist the StoreFileTracker configur…
GeorryHuang Nov 6, 2021
eebda10
HBASE-26271 Cleanup the broken store files under data directory (#3786)
BukrosSzabolcs Nov 9, 2021
d24e09d
HBASE-26454 CreateTableProcedure still relies on temp dir and renames…
wchevreuil Nov 19, 2021
9cca3c6
HBASE-26079 Use StoreFileTracker when splitting and merging (#3617)
wchevreuil Sep 8, 2021
55dd320
HBASE-26441: Add metrics for BrokenStoreFileCleaner
BukrosSzabolcs Nov 19, 2021
e9a86ef
HBASE-26441: Add metrics for BrokenStoreFileCleaner
BukrosSzabolcs Dec 2, 2021
0656cca
HBASE-26441: Add metrics for BrokenStoreFileCleaner
BukrosSzabolcs Dec 6, 2021
723cf07
HBASE-26064 Introduce a StoreFileTracker to abstract the store file t…
Apache9 Jul 29, 2021
620366a
HBASE-25988 Store the store file list by a file (#3578)
Apache9 Aug 26, 2021
2a2b274
HBASE-26079 Use StoreFileTracker when splitting and merging (#3617)
wchevreuil Sep 8, 2021
f021793
HBASE-26224 Introduce a MigrationStoreFileTracker to support migratin…
Apache9 Sep 9, 2021
ccf90ab
HBASE-26246 Persist the StoreFileTracker configurations to TableDescr…
wchevreuil Sep 12, 2021
8af8ac9
HBASE-26248 Should find a suitable way to let users specify the store…
Apache9 Sep 14, 2021
33079f3
HBASE-26264 Add more checks to prevent misconfiguration on store file…
Apache9 Sep 15, 2021
97c68be
HBASE-26280 Use store file tracker when snapshoting (#3685)
Apache9 Sep 17, 2021
d36749c
HBASE-26326 CreateTableProcedure fails when FileBasedStoreFileTracker…
wchevreuil Oct 13, 2021
0be4424
HBASE-26386 Refactor StoreFileTracker implementations to expose the s…
Apache9 Oct 21, 2021
0fa1b88
HBASE-26328 Clone snapshot doesn't load reference files into FILE SFT…
wchevreuil Oct 22, 2021
3f1a935
HBASE-26263 [Rolling Upgrading] Persist the StoreFileTracker configur…
GeorryHuang Nov 6, 2021
2fee980
HBASE-26271 Cleanup the broken store files under data directory (#3786)
BukrosSzabolcs Nov 9, 2021
4aa3f47
HBASE-26454 CreateTableProcedure still relies on temp dir and renames…
wchevreuil Nov 19, 2021
1cdbc2e
Merge branch 'HBASE-26067' into HBASE-26441
BukrosSzabolcs Dec 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);

}
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);
}
}
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);

}
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);
}
}
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -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 uint64 runs = 5;
}

message BrokenStoreFileCleanerUsageResponse {
}

service RegionServerStatusService {
/** Called when a region server first starts. */
rpc RegionServerStartup(RegionServerStartupRequest)
Expand Down Expand Up @@ -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)
Copy link
Contributor

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?

Copy link
Contributor Author

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:

  • Convenience. Aggregating the rs metrics is possible and usually done by queries from the db, storing aggregated metrics here is for ease of use.
  • Preparing things for the next PR where I'll add logic to store the reported metrics in-memory and extend the REST service to allow checking these values without having to access the metrics db.

returns(BrokenStoreFileCleanerUsageResponse);
}
Loading