Samrat002 commented on code in PR #28427:
URL: https://github.com/apache/flink/pull/28427#discussion_r3610958128


##########
flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java:
##########
@@ -316,6 +318,53 @@ public static List<FileSystemFactory> 
getRegisteredFileSystemFactories() {
         }
     }
 
+    /**
+     * Hands a runtime-owned, process-level {@link MetricGroup} to every 
registered {@link
+     * FileSystemFactory} that opts into metrics via {@link MetricsAware}.
+     *
+     * <p>This is the second phase of file system initialization. {@link 
#initialize(Configuration,
+     * PluginManager)} runs at process startup, before the {@code 
MetricRegistry} exists; this
+     * method is therefore invoked separately, once the registry and a 
process-level {@link
+     * MetricGroup} are available. It is called from the TaskManager and 
JobManager entrypoints
+     * only. Contexts without a process-level {@link MetricGroup} (CLI, 
HistoryServer, YARN client)
+     * simply never call it, and their file system plugins continue to operate 
without emitting
+     * metrics.
+     *
+     * <p>The call is idempotent: factories receive a child group {@code 
<process>.filesystem}, and
+     * {@link MetricGroup#addGroup} returns the same child on repeated calls 
with the same parent,
+     * so re-invocation does not register duplicate metrics. Factories that do 
not implement {@link

Review Comment:
   No extra spam. attachMetrics always resolves the same <process>.filesystem 
child and the S3 factory ignores repeated attachment of the same parent group.



-- 
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]

Reply via email to