Search in sources :

Example 1 with UnderStorageType

use of alluxio.client.UnderStorageType in project alluxio by Alluxio.

the class OutStreamOptionsTest method defaults.

/**
   * Tests that building an {@link OutStreamOptions} with the defaults works.
   */
@Test
public void defaults() throws IOException {
    AlluxioStorageType alluxioType = AlluxioStorageType.STORE;
    UnderStorageType ufsType = UnderStorageType.SYNC_PERSIST;
    Configuration.set(PropertyKey.USER_BLOCK_SIZE_BYTES_DEFAULT, "64MB");
    Configuration.set(PropertyKey.USER_FILE_WRITE_TYPE_DEFAULT, WriteType.CACHE_THROUGH.toString());
    Configuration.set(PropertyKey.USER_FILE_WRITE_TIER_DEFAULT, Constants.LAST_TIER);
    OutStreamOptions options = OutStreamOptions.defaults();
    Assert.assertEquals(alluxioType, options.getAlluxioStorageType());
    Assert.assertEquals(64 * Constants.MB, options.getBlockSizeBytes());
    Assert.assertTrue(options.getLocationPolicy() instanceof LocalFirstPolicy);
    Assert.assertEquals("test_user", options.getOwner());
    Assert.assertEquals("test_group", options.getGroup());
    Assert.assertEquals(Mode.defaults().applyFileUMask(), options.getMode());
    Assert.assertEquals(Constants.NO_TTL, options.getTtl());
    Assert.assertEquals(TtlAction.DELETE, options.getTtlAction());
    Assert.assertEquals(ufsType, options.getUnderStorageType());
    Assert.assertEquals(WriteType.CACHE_THROUGH, options.getWriteType());
    Assert.assertEquals(Constants.LAST_TIER, options.getWriteTier());
    ConfigurationTestUtils.resetConfiguration();
}
Also used : UnderStorageType(alluxio.client.UnderStorageType) LocalFirstPolicy(alluxio.client.file.policy.LocalFirstPolicy) AlluxioStorageType(alluxio.client.AlluxioStorageType) Test(org.junit.Test)

Aggregations

AlluxioStorageType (alluxio.client.AlluxioStorageType)1 UnderStorageType (alluxio.client.UnderStorageType)1 LocalFirstPolicy (alluxio.client.file.policy.LocalFirstPolicy)1 Test (org.junit.Test)1