Search in sources :

Example 26 with GetStatusPOptions

use of alluxio.grpc.GetStatusPOptions in project alluxio by Alluxio.

the class LoadMetadataIntegrationTest method loadMetadataNever.

@Test
public void loadMetadataNever() throws Exception {
    GetStatusPOptions options = GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER).build();
    checkGetStatus("/mnt/dir1/dirA/fileDNE1", options, false, true, 0);
    checkGetStatus("/mnt/dir1/dirA/fileDNE1", options, false, true, 0);
    checkGetStatus("/mnt/dir1/dirA/fileDNE2", options, false, true, 0);
    checkGetStatus("/mnt/dir1/dirA/file", options, false, true, 0);
    checkGetStatus("/mnt/dir1/dirA/dirDNE/", options, false, true, 0);
    checkGetStatus("/mnt/dir1/dirA/dirDNE/fileDNE3", options, false, true, 0);
}
Also used : GetStatusPOptions(alluxio.grpc.GetStatusPOptions) BaseIntegrationTest(alluxio.testutils.BaseIntegrationTest) Test(org.junit.Test)

Example 27 with GetStatusPOptions

use of alluxio.grpc.GetStatusPOptions in project alluxio by Alluxio.

the class LoadMetadataIntegrationTest method loadNeverConfiguration.

@LocalAlluxioClusterResource.Config(confParams = { PropertyKey.Name.USER_FILE_METADATA_LOAD_TYPE, "NEVER" })
@Test
public void loadNeverConfiguration() throws Exception {
    GetStatusPOptions options = GetStatusPOptions.getDefaultInstance();
    checkGetStatus("/mnt/dir1/dirA/fileDNE1", options, false, true, 0);
    checkGetStatus("/mnt/dir1/dirA/fileDNE1", options, false, true, 0);
}
Also used : GetStatusPOptions(alluxio.grpc.GetStatusPOptions) BaseIntegrationTest(alluxio.testutils.BaseIntegrationTest) Test(org.junit.Test)

Example 28 with GetStatusPOptions

use of alluxio.grpc.GetStatusPOptions in project alluxio by Alluxio.

the class LoadMetadataIntegrationTest method syncOverrideLoadMetadata.

@Test
public void syncOverrideLoadMetadata() throws Exception {
    GetStatusPOptions options = GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER).setCommonOptions(FileSystemMasterCommonPOptions.newBuilder().setSyncIntervalMs(0)).build();
    // The first time, it needs status of /dir1, /dir1/dirA to create the dirs in Alluxio
    // and the file itself
    checkGetStatus("/mnt/dir1/dirA/file", options, true, true, 3);
    // The second time, it only needs to sync the file, so 1 access
    checkGetStatus("/mnt/dir1/dirA/file", options, true, true, 1);
}
Also used : GetStatusPOptions(alluxio.grpc.GetStatusPOptions) BaseIntegrationTest(alluxio.testutils.BaseIntegrationTest) Test(org.junit.Test)

Example 29 with GetStatusPOptions

use of alluxio.grpc.GetStatusPOptions in project alluxio by Alluxio.

the class UfsSyncIntegrationTest method alluxioModeFingerprintUpdate.

@Test
public void alluxioModeFingerprintUpdate() throws Exception {
    GetStatusPOptions options = GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.ONCE).setCommonOptions(PSYNC_NEVER).build();
    writeUfsFile(ufsPath(EXISTING_FILE), 10);
    Assert.assertNotNull(mFileSystem.getStatus(new AlluxioURI(alluxioPath(EXISTING_FILE)), options));
    // Set initial alluxio permissions
    mFileSystem.setAttribute(new AlluxioURI(alluxioPath(EXISTING_FILE)), SetAttributePOptions.newBuilder().setMode(new Mode((short) 0777).toProto()).build());
    URIStatus status = mFileSystem.getStatus(new AlluxioURI(alluxioPath(EXISTING_FILE)), options);
    String startFingerprint = status.getUfsFingerprint();
    // Change alluxio permissions
    mFileSystem.setAttribute(new AlluxioURI(alluxioPath(EXISTING_FILE)), SetAttributePOptions.newBuilder().setMode(new Mode((short) 0655).toProto()).build());
    status = mFileSystem.getStatus(new AlluxioURI(alluxioPath(EXISTING_FILE)), options);
    String endFingerprint = status.getUfsFingerprint();
    // Verify the fingerprints are different.
    Assert.assertNotEquals(startFingerprint, endFingerprint);
}
Also used : Mode(alluxio.security.authorization.Mode) URIStatus(alluxio.client.file.URIStatus) GetStatusPOptions(alluxio.grpc.GetStatusPOptions) AlluxioURI(alluxio.AlluxioURI) BaseIntegrationTest(alluxio.testutils.BaseIntegrationTest) Test(org.junit.Test)

Example 30 with GetStatusPOptions

use of alluxio.grpc.GetStatusPOptions in project alluxio by Alluxio.

the class UfsSyncIntegrationTest method getStatusFileSync.

@Test
public void getStatusFileSync() throws Exception {
    GetStatusPOptions options = GetStatusPOptions.newBuilder().setLoadMetadataType(LoadMetadataPType.NEVER).setCommonOptions(PSYNC_ALWAYS).build();
    checkGetStatus(EXISTING_FILE, options, true);
}
Also used : GetStatusPOptions(alluxio.grpc.GetStatusPOptions) BaseIntegrationTest(alluxio.testutils.BaseIntegrationTest) Test(org.junit.Test)

Aggregations

GetStatusPOptions (alluxio.grpc.GetStatusPOptions)38 Test (org.junit.Test)34 BaseIntegrationTest (alluxio.testutils.BaseIntegrationTest)26 AlluxioURI (alluxio.AlluxioURI)17 URIStatus (alluxio.client.file.URIStatus)12 File (java.io.File)9 ListStatusPOptions (alluxio.grpc.ListStatusPOptions)6 AbstractFileSystemShellTest (alluxio.client.cli.fs.AbstractFileSystemShellTest)4 DeletePOptions (alluxio.grpc.DeletePOptions)4 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)4 FileInfo (alluxio.wire.FileInfo)2 AlluxioConfiguration (alluxio.conf.AlluxioConfiguration)1 AlluxioException (alluxio.exception.AlluxioException)1 SetAttributePOptions (alluxio.grpc.SetAttributePOptions)1 GrpcCallTracker (alluxio.master.file.contexts.GrpcCallTracker)1 Mode (alluxio.security.authorization.Mode)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1