Example usage for org.apache.hadoop.fs FileSystem newInstance

List of usage examples for org.apache.hadoop.fs FileSystem newInstance

Introduction

In this page you can find the example usage for org.apache.hadoop.fs FileSystem newInstance.

Prototype

public static FileSystem newInstance(final URI uri, final Configuration conf, final String user)
        throws IOException, InterruptedException 

Source Link

Document

Returns the FileSystem for this URI's scheme and authority and the given user.

Usage

From source file:madgik.exareme.worker.arm.storage.client.cluster.ClusterArmStorageClient.java

/**
 * @throws ArmStorageClientException/*w  ww .ja v a 2  s  .c om*/
 */
@Override
public void connect() throws ArmStorageClientException {

    if (this.fs != null)
        this.disconnect();

    Configuration configuration = new Configuration();
    try {
        URI uri = URI.create(armStorageURI);
        this.fs = FileSystem.newInstance(uri, configuration, uri.getUserInfo());
    } catch (IOException ex) {
        throw new ArmStorageClientException("Connect failure : ", ex);
    } catch (InterruptedException ex) {
        throw new ArmStorageClientException("Connect failure : ", ex);
    }
}

From source file:madgik.exareme.worker.arm.storage.client.cluster.HDFSArmStorageClient.java

/**
 * @throws ArmStorageClientException//from  w  w w . ja v a 2 s  .co m
 */
@Override
public void connect() throws ArmStorageClientException {

    if (this.fs != null)
        this.disconnect();

    Configuration configuration = new Configuration();
    try {
        URI uri = URI.create(armStorageURI);
        this.fs = (DistributedFileSystem) FileSystem.newInstance(uri, configuration, uri.getUserInfo());
    } catch (IOException ex) {
        throw new ArmStorageClientException("Connect failure : ", ex);
    } catch (InterruptedException ex) {
        throw new ArmStorageClientException("Connect failure : ", ex);
    }
}