use of alluxio.grpc.ListStatusPOptions in project alluxio by Alluxio.
the class LoadMetadataIntegrationTest method loadMetadataListDir.
@Test
public void loadMetadataListDir() throws Exception {
ListStatusPOptions listOptions = ListStatusPOptions.newBuilder().setRecursive(false).setLoadMetadataType(LoadMetadataPType.ONCE).setCommonOptions(FileSystemMasterCommonPOptions.newBuilder().setSyncIntervalMs(-1)).build();
checkListStatus("/mnt/", listOptions, true, true, 3);
}
use of alluxio.grpc.ListStatusPOptions in project alluxio by Alluxio.
the class LoadMetadataIntegrationTest method absentCacheListStatus.
@Test
public void absentCacheListStatus() throws Exception {
ListStatusPOptions options = ListStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.ONCE).setCommonOptions(FileSystemMasterCommonPOptions.newBuilder().setSyncIntervalMs(-1)).build();
// The first time, it needs status of /dir1, /dir1/dirA to create the dirs in Alluxio
// and the file itself
checkListStatus("/mnt/dir1/dirA/file", options, true, true, 3);
// The second time, it only needs to sync the file, so 1 access
checkListStatus("/mnt/dir1/dirA/file", options, true, true, 0);
// The first time, it needs status of /dir1, /dir1/dirA to create the dirs in Alluxio
// and the file itself
checkListStatus("/mnt/dir1/dirDNE", options, false, false, 1);
// The second time, it only needs to sync the file, so 1 access
checkListStatus("/mnt/dir1/dirDNE/dirDNE2/file1", options, false, false, 0);
}
use of alluxio.grpc.ListStatusPOptions in project alluxio by Alluxio.
the class LoadMetadataIntegrationTest method listStatusLoadsFile.
@Test
public void listStatusLoadsFile() throws Exception {
GetStatusPOptions getStatusOptions = GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.ONCE).build();
ListStatusPOptions lsOptions = ListStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.ALWAYS).setCommonOptions(PSYNC_ALWAYS).build();
// load metadata for dirA with 'ALWAYS'
checkListStatus("/mnt/dir1/dirA", lsOptions, true, true, 3);
// the file should already be loaded
checkGetStatus("/mnt/dir1/dirA/file", getStatusOptions, true, true, 0);
}
use of alluxio.grpc.ListStatusPOptions in project alluxio by Alluxio.
the class LoadMetadataIntegrationTest method repeatedChildrenSync.
@Test
public void repeatedChildrenSync() throws Exception {
ListStatusPOptions listOptions = ListStatusPOptions.newBuilder().setRecursive(true).setLoadMetadataType(LoadMetadataPType.ONCE).setCommonOptions(FileSystemMasterCommonPOptions.newBuilder().setSyncIntervalMs(-1)).build();
GetStatusPOptions getOptions = GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.ONCE).setCommonOptions(FileSystemMasterCommonPOptions.newBuilder().setSyncIntervalMs(-1)).build();
// This can be improved
checkGetStatus("/mnt/dir1/dirA/file", getOptions, true, true, 3);
checkListStatus("/mnt/dir1/", listOptions, true, true, 3);
}
use of alluxio.grpc.ListStatusPOptions in project alluxio by Alluxio.
the class UfsSyncIntegrationTest method clusterRestartSync.
@Test
public void clusterRestartSync() throws Exception {
ListStatusPOptions listStatusPOptions = ListStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER).setCommonOptions(PSYNC_LARGE_INTERVAL).build();
List<URIStatus> statusList = mFileSystem.listStatus(new AlluxioURI(alluxioPath(EXISTING_DIR)), listStatusPOptions);
Assert.assertNotNull(statusList);
assertEquals(0, statusList.size());
mLocalAlluxioClusterResource.get().stopMasters();
mLocalAlluxioClusterResource.get().startMasters();
List<URIStatus> statusListAfterRestart = mFileSystem.listStatus(new AlluxioURI(alluxioPath(EXISTING_DIR)), listStatusPOptions);
Assert.assertNotNull(statusListAfterRestart);
assertEquals(0, statusListAfterRestart.size());
writeUfsFile(ufsPath(NEW_FILE_UNDER_DIR), 1);
List<URIStatus> statusListAgain = mFileSystem.listStatus(new AlluxioURI(alluxioPath(EXISTING_DIR)), listStatusPOptions);
Assert.assertNotNull(statusListAgain);
assertEquals(0, statusListAgain.size());
Thread.sleep(LARGE_INTERVAL_MS);
List<URIStatus> statusListAfterSleeping = mFileSystem.listStatus(new AlluxioURI(alluxioPath(EXISTING_DIR)), listStatusPOptions);
Assert.assertNotNull(statusListAfterSleeping);
assertEquals(1, statusListAfterSleeping.size());
}
Aggregations