List of usage examples for org.apache.hadoop.fs FileSystem newInstance
public static FileSystem newInstance(final URI uri, final Configuration conf, final String user) throws IOException, InterruptedException
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); } }