Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
5 changes: 5 additions & 0 deletions hadoop-hdds/server-scm/dev-support/findbugsExcludeFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@
<Class name="org.apache.hadoop.hdds.scm.metadata.TestSCMTransactionInfoCodec"/>
<Bug pattern="NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS" />
</Match>
<Match>
<Class name="org.apache.hadoop.hdds.scm.container.replication.ReplicationManager"/>
<Field name="metrics" />
<Bug pattern="IS2_INCONSISTENT_SYNC" />
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ public synchronized void start() {
if (!isRunning()) {
LOG.info("Starting Replication Monitor Thread.");
running = true;
metrics = ReplicationManagerMetrics.create(this);
if (rmConf.isLegacyEnabled()) {
legacyReplicationManager.setMetrics(metrics);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,15 @@ public ReplicationManagerMetrics(ReplicationManager manager) {
}

public static ReplicationManagerMetrics create(ReplicationManager manager) {
return DefaultMetricsSystem.instance().register(METRICS_SOURCE_NAME,
"SCM Replication manager (closed container replication) related "
+ "metrics",
new ReplicationManagerMetrics(manager));
ReplicationManagerMetrics replicationManagerMetrics = (ReplicationManagerMetrics)
DefaultMetricsSystem.instance().getSource(METRICS_SOURCE_NAME);
if (replicationManagerMetrics == null) {
return DefaultMetricsSystem.instance().register(METRICS_SOURCE_NAME,
"SCM Replication manager (closed container replication) related "
+ "metrics",
new ReplicationManagerMetrics(manager));
}
return replicationManagerMetrics;
}

@Override
Expand Down