Search in sources :

Example 6 with HoodieWrapperFileSystem

use of org.apache.hudi.common.fs.HoodieWrapperFileSystem in project hudi by apache.

the class SparkRDDWriteClient method initWrapperFSMetrics.

@Override
protected void initWrapperFSMetrics() {
    if (config.isMetricsOn()) {
        Registry registry;
        Registry registryMeta;
        JavaSparkContext jsc = ((HoodieSparkEngineContext) context).getJavaSparkContext();
        if (config.isExecutorMetricsEnabled()) {
            // Create a distributed registry for HoodieWrapperFileSystem
            registry = Registry.getRegistry(HoodieWrapperFileSystem.class.getSimpleName(), DistributedRegistry.class.getName());
            ((DistributedRegistry) registry).register(jsc);
            registryMeta = Registry.getRegistry(HoodieWrapperFileSystem.class.getSimpleName() + "MetaFolder", DistributedRegistry.class.getName());
            ((DistributedRegistry) registryMeta).register(jsc);
        } else {
            registry = Registry.getRegistry(HoodieWrapperFileSystem.class.getSimpleName());
            registryMeta = Registry.getRegistry(HoodieWrapperFileSystem.class.getSimpleName() + "MetaFolder");
        }
        HoodieWrapperFileSystem.setMetricsRegistry(registry, registryMeta);
    }
}
Also used : HoodieSparkEngineContext(org.apache.hudi.client.common.HoodieSparkEngineContext) DistributedRegistry(org.apache.hudi.metrics.DistributedRegistry) HoodieWrapperFileSystem(org.apache.hudi.common.fs.HoodieWrapperFileSystem) DistributedRegistry(org.apache.hudi.metrics.DistributedRegistry) Registry(org.apache.hudi.common.metrics.Registry) JavaSparkContext(org.apache.spark.api.java.JavaSparkContext)

Aggregations

HoodieWrapperFileSystem (org.apache.hudi.common.fs.HoodieWrapperFileSystem)6 IOException (java.io.IOException)3 Path (org.apache.hadoop.fs.Path)3 StandardCharsets (java.nio.charset.StandardCharsets)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Map (java.util.Map)2 Set (java.util.Set)2 FileStatus (org.apache.hadoop.fs.FileStatus)2 HoodieMergeArchiveFilePlan (org.apache.hudi.avro.model.HoodieMergeArchiveFilePlan)2 HoodieLogFile (org.apache.hudi.common.model.HoodieLogFile)2 HoodieActiveTimeline (org.apache.hudi.common.table.timeline.HoodieActiveTimeline)2 HoodieInstant (org.apache.hudi.common.table.timeline.HoodieInstant)2 Option (org.apache.hudi.common.util.Option)2 HoodieIOException (org.apache.hudi.exception.HoodieIOException)2 LogManager (org.apache.log4j.LogManager)2