use of alluxio.client.block.policy.RoundRobinPolicy in project alluxio by Alluxio.
the class OutStreamOptionsTest method fields.
/**
* Tests getting and setting fields.
*/
@Test
public void fields() throws Exception {
Random random = new Random();
long blockSize = random.nextLong();
BlockLocationPolicy locationPolicy = new RoundRobinPolicy(mConf);
String owner = CommonUtils.randomAlphaNumString(10);
String group = CommonUtils.randomAlphaNumString(10);
Mode mode = new Mode((short) random.nextInt());
int ttl = 5;
TtlAction ttlAction = TtlAction.FREE;
int writeTier = random.nextInt();
WriteType writeType = WriteType.NONE;
mConf.set(PropertyKey.USER_FILE_CREATE_TTL, ttl);
mConf.set(PropertyKey.USER_FILE_CREATE_TTL_ACTION, ttlAction);
ClientContext clientContext = ClientContext.create(mConf);
OutStreamOptions options = OutStreamOptions.defaults(clientContext);
options.setBlockSizeBytes(blockSize);
options.setLocationPolicy(locationPolicy);
options.setOwner(owner);
options.setGroup(group);
options.setMode(mode);
options.setWriteTier(writeTier);
options.setWriteType(writeType);
assertEquals(blockSize, options.getBlockSizeBytes());
assertEquals(locationPolicy, options.getLocationPolicy());
assertEquals(owner, options.getOwner());
assertEquals(group, options.getGroup());
assertEquals(mode, options.getMode());
assertEquals(ttl, options.getCommonOptions().getTtl());
assertEquals(ttlAction, options.getCommonOptions().getTtlAction());
assertEquals(writeTier, options.getWriteTier());
assertEquals(writeType.getAlluxioStorageType(), options.getAlluxioStorageType());
assertEquals(writeType.getUnderStorageType(), options.getUnderStorageType());
}
Aggregations