adoroszlai commented on code in PR #6682:
URL: https://github.com/apache/ozone/pull/6682#discussion_r1602030741
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -1669,21 +1670,27 @@ public void start() throws IOException {
}
// Set metrics and start metrics back ground thread
- metrics.setNumVolumes(metadataManager.countRowsInTable(metadataManager
- .getVolumeTable()));
- metrics.setNumBuckets(metadataManager.countRowsInTable(metadataManager
- .getBucketTable()));
-
- if (getMetricsStorageFile().exists()) {
- OmMetricsInfo metricsInfo = READER.readValue(getMetricsStorageFile());
- metrics.setNumKeys(metricsInfo.getNumKeys());
- }
+ CompletableFuture.runAsync(() -> {
+ try {
+ metrics.setNumVolumes(
+
metadataManager.countRowsInTable(metadataManager.getVolumeTable()));
+ metrics.setNumBuckets(
+
metadataManager.countRowsInTable(metadataManager.getBucketTable()));
+
+ if (getMetricsStorageFile().exists()) {
+ OmMetricsInfo metricsInfo =
READER.readValue(getMetricsStorageFile());
+ metrics.setNumKeys(metricsInfo.getNumKeys());
+ }
Review Comment:
`ScheduleOMMetricsWriteTask` is not a one-time task, it is run periodically.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]