Example usage for org.apache.hadoop.hdfs HdfsConfiguration init

List of usage examples for org.apache.hadoop.hdfs HdfsConfiguration init

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs HdfsConfiguration init.

Prototype

public static void init() 

Source Link

Document

This method is here so that when invoked, HdfsConfiguration is class-loaded if it hasn't already been previously loaded.

Usage

From source file:com.moz.fiji.schema.platform.CDH5SchemaBridge.java

License:Apache License

/** {@inheritDoc} */
@Override//from  w  w w.j  av  a2  s.  c  o m
public void initializeHadoopResources() {
    // Force initialization of HdfsConfiguration,
    // to register hdfs-site.xml and hdfs-default.xml resources:
    HdfsConfiguration.init();

    // Force initialization of JobConf,
    // to register mapred-site.xml and mapred-default.xml resources:
    try {
        // JobConf does not provide a static initialization method,
        // use Class.forName() to trigger static initialization:
        Class.forName(JobConf.class.getName());
    } catch (ClassNotFoundException cnfe) {
        throw new RuntimeException("Error initializing class JobConf to register mapred resources.", cnfe);
    }
}