use of alluxio.thrift.LockBlockTOptions in project alluxio by Alluxio.
the class LockBlockOptions method toThrift.
/**
* Converts the object to a {@link LockBlockTOptions} object.
*
* @return the thrift lock block options
*/
public LockBlockTOptions toThrift() {
LockBlockTOptions options = new LockBlockTOptions();
options.setUfsPath(mUfsPath);
options.setOffset(mOffset);
options.setBlockSize(mBlockSize);
options.setMaxUfsReadConcurrency(mMaxUfsReadConcurrency);
return options;
}
use of alluxio.thrift.LockBlockTOptions in project alluxio by Alluxio.
the class UnderFileSystemBlockReaderTest method before.
@Before
public void before() throws Exception {
Configuration.set(PropertyKey.UNDERFS_ADDRESS, mFolder.getRoot().getAbsolutePath());
String testFilePath = mFolder.newFile().getAbsolutePath();
byte[] buffer = BufferUtils.getIncreasingByteArray((int) TEST_BLOCK_SIZE * 2);
BufferUtils.writeBufferToFile(testFilePath, buffer);
mAlluxioBlockStore = Mockito.mock(BlockStore.class);
mTempBlockMeta = Mockito.mock(TempBlockMeta.class);
Mockito.when(mAlluxioBlockStore.createBlock(Mockito.anyLong(), Mockito.anyLong(), Mockito.any(BlockStoreLocation.class), Mockito.anyLong())).thenReturn(mTempBlockMeta);
Mockito.when(mTempBlockMeta.getPath()).thenReturn(mFolder.newFile().getAbsolutePath());
LockBlockTOptions options = new LockBlockTOptions();
options.setMaxUfsReadConcurrency(10);
options.setBlockSize(TEST_BLOCK_SIZE);
options.setOffset(TEST_BLOCK_SIZE);
options.setUfsPath(testFilePath);
mUnderFileSystemBlockMeta = new UnderFileSystemBlockMeta(SESSION_ID, BLOCK_ID, new OpenUfsBlockOptions(options));
}
Aggregations