use of alluxio.client.file.FileSystem in project alluxio by Alluxio.
the class ManagerProcessContextTest method testApplyNewMount.
@Test
public void testApplyNewMount() throws Exception {
FileSystem mockFs = mock(FileSystem.class);
Map<String, MountPointInfo> mpi = new HashMap<>();
mpi.put("/", new MountPointInfo().setUfsUri("hdfs://localhost:9000/").setReadOnly(true).setUfsType("hdfs").setUfsCapacityBytes(9001));
doReturn(mockFs).when(mContext).getFileSystem();
doReturn(mpi).when(mockFs).getMountTable();
ApplyMountPointRequest vr = ApplyMountPointRequest.newBuilder().setPayload(ApplyMountPointRequest.Payload.newBuilder().setNew(mContext.getMountPointList().getMountPointList().get(0))).build();
mContext.applyMount(vr);
}
use of alluxio.client.file.FileSystem in project alluxio by Alluxio.
the class MultiProcessCluster method getPrimaryMasterIndex.
/**
* Gets the index of the primary master.
*
* @param timeoutMs maximum amount of time to wait, in milliseconds
* @return the index of the primary master
*/
public synchronized int getPrimaryMasterIndex(int timeoutMs) throws TimeoutException, InterruptedException {
final FileSystem fs = getFileSystemClient();
final MasterInquireClient inquireClient = getMasterInquireClient();
CommonUtils.waitFor("a primary master to be serving", () -> {
try {
// Make sure the leader is serving.
fs.getStatus(new AlluxioURI("/"));
return true;
} catch (Exception e) {
LOG.error("Failed to get status of root directory:", e);
return false;
}
}, WaitForOptions.defaults().setTimeoutMs(timeoutMs));
int primaryRpcPort;
try {
primaryRpcPort = inquireClient.getPrimaryRpcAddress().getPort();
} catch (UnavailableException e) {
throw new RuntimeException(e);
}
// Returns the master whose RPC port matches the primary RPC port.
for (int i = 0; i < mMasterAddresses.size(); i++) {
if (mMasterAddresses.get(i).getRpcPort() == primaryRpcPort) {
return i;
}
}
throw new RuntimeException(String.format("No master found with RPC port %d. Master addresses: %s", primaryRpcPort, mMasterAddresses));
}
use of alluxio.client.file.FileSystem in project alluxio by Alluxio.
the class BasicNonByteBufferOperations method call.
@Override
public Boolean call() throws Exception {
FileSystem alluxioClient = FileSystem.Factory.create(mFsContext);
write(alluxioClient);
return read(alluxioClient);
}
use of alluxio.client.file.FileSystem in project alluxio by Alluxio.
the class BasicCheckpoint method call.
@Override
public Boolean call() throws Exception {
FileSystem fs = FileSystem.Factory.create(mFsContext);
writeFile(fs);
return readFile(fs);
}
use of alluxio.client.file.FileSystem in project alluxio by Alluxio.
the class BasicOperations method call.
@Override
public Boolean call() throws Exception {
FileSystem fs = FileSystem.Factory.create(mFsContext);
writeFile(fs);
return readFile(fs);
}
Aggregations