use of alluxio.client.WriteType in project alluxio by Alluxio.
the class OutStreamOptionsTest method fields.
/**
* Tests getting and setting fields.
*/
@Test
public void fields() {
Random random = new Random();
long blockSize = random.nextLong();
FileWriteLocationPolicy locationPolicy = new RoundRobinPolicy();
String owner = CommonUtils.randomAlphaNumString(10);
String group = CommonUtils.randomAlphaNumString(10);
Mode mode = new Mode((short) random.nextInt());
long ttl = random.nextLong();
int writeTier = random.nextInt();
WriteType writeType = WriteType.NONE;
OutStreamOptions options = OutStreamOptions.defaults();
options.setBlockSizeBytes(blockSize);
options.setLocationPolicy(locationPolicy);
options.setOwner(owner);
options.setGroup(group);
options.setMode(mode);
options.setTtl(ttl);
options.setTtlAction(TtlAction.FREE);
options.setWriteTier(writeTier);
options.setWriteType(writeType);
Assert.assertEquals(blockSize, options.getBlockSizeBytes());
Assert.assertEquals(locationPolicy, options.getLocationPolicy());
Assert.assertEquals(owner, options.getOwner());
Assert.assertEquals(group, options.getGroup());
Assert.assertEquals(mode, options.getMode());
Assert.assertEquals(ttl, options.getTtl());
Assert.assertEquals(TtlAction.FREE, options.getTtlAction());
Assert.assertEquals(writeTier, options.getWriteTier());
Assert.assertEquals(writeType.getAlluxioStorageType(), options.getAlluxioStorageType());
Assert.assertEquals(writeType.getUnderStorageType(), options.getUnderStorageType());
}
use of alluxio.client.WriteType in project alluxio by Alluxio.
the class TestRunner method runTests.
/**
* Runs combinations of tests of operation, read and write type.
*
* @return the number of failed tests
*/
private int runTests() {
int failed = 0;
List<ReadType> readTypes = mReadType == null ? READ_TYPES : Lists.newArrayList(ReadType.valueOf(mReadType));
List<WriteType> writeTypes = mWriteType == null ? WRITE_TYPES : Lists.newArrayList(WriteType.valueOf(mWriteType));
List<OperationType> operations = mOperation == null ? Lists.newArrayList(OperationType.values()) : Lists.newArrayList(OperationType.valueOf(mOperation));
for (ReadType readType : readTypes) {
for (WriteType writeType : writeTypes) {
for (OperationType opType : operations) {
System.out.println(String.format("runTest %s %s %s", opType, readType, writeType));
failed += runTest(opType, readType, writeType);
}
}
}
if (failed > 0) {
System.out.println("Number of failed tests: " + failed);
}
return failed;
}
Aggregations