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

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

Introduction

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

Prototype

public String get(String name) 

Source Link

Document

Get the value of the name property, null if no such property exists.

Usage

From source file:org.testifyproject.resource.hdfs.MiniDFSResource.java

License:Apache License

@Override
public LocalResourceInstance<MiniDFSCluster, DistributedFileSystem> start(TestContext testContext,
        LocalResource localResource, HdfsConfiguration config) throws Exception {
    String hdfsDirectory = config.get(MiniDFSCluster.HDFS_MINIDFS_BASEDIR);
    fileSystemUtil.recreateDirectory(hdfsDirectory);
    config.set(MiniDFSCluster.HDFS_MINIDFS_BASEDIR, hdfsDirectory);
    MiniDFSCluster.Builder builder = new MiniDFSCluster.Builder(config);
    hdfsCluster = builder.build();/* w  w w  .j  a v a  2s  .c o m*/
    fileSystem = hdfsCluster.getFileSystem();

    return LocalResourceInstanceBuilder.builder().resource(hdfsCluster).client(fileSystem).build("hdfs",
            localResource);

}