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();
}
Aggregations