Search in sources :

Example 1 with BlockLocationPolicy

use of alluxio.client.block.policy.BlockLocationPolicy in project alluxio by Alluxio.

the class InStreamOptionsTest method fields.

/**
   * Tests getting and setting fields.
   */
@Test
public void fields() {
    ReadType readType = ReadType.NO_CACHE;
    FileWriteLocationPolicy policy = new RoundRobinPolicy();
    BlockLocationPolicy blockLocationPolicy = new DeterministicHashPolicy();
    InStreamOptions options = InStreamOptions.defaults();
    options.setReadType(readType);
    options.setLocationPolicy(policy);
    options.setCachePartiallyReadBlock(true);
    options.setSeekBufferSizeBytes(Constants.MB);
    options.setUfsReadLocationPolicy(blockLocationPolicy);
    options.setMaxUfsReadConcurrency(5);
    Assert.assertEquals(options.getAlluxioStorageType(), readType.getAlluxioStorageType());
    Assert.assertEquals(policy, options.getCacheLocationPolicy());
    Assert.assertTrue(options.isCachePartiallyReadBlock());
    Assert.assertEquals(Constants.MB, options.getSeekBufferSizeBytes());
    Assert.assertEquals(blockLocationPolicy, options.getUfsReadLocationPolicy());
    Assert.assertEquals(5, options.getMaxUfsReadConcurrency());
}
Also used : FileWriteLocationPolicy(alluxio.client.file.policy.FileWriteLocationPolicy) DeterministicHashPolicy(alluxio.client.block.policy.DeterministicHashPolicy) ReadType(alluxio.client.ReadType) RoundRobinPolicy(alluxio.client.file.policy.RoundRobinPolicy) BlockLocationPolicy(alluxio.client.block.policy.BlockLocationPolicy) Test(org.junit.Test)

Aggregations

ReadType (alluxio.client.ReadType)1 BlockLocationPolicy (alluxio.client.block.policy.BlockLocationPolicy)1 DeterministicHashPolicy (alluxio.client.block.policy.DeterministicHashPolicy)1 FileWriteLocationPolicy (alluxio.client.file.policy.FileWriteLocationPolicy)1 RoundRobinPolicy (alluxio.client.file.policy.RoundRobinPolicy)1 Test (org.junit.Test)1