use of alluxio.wire.BlockInfo in project alluxio by Alluxio.
the class DataServerIntegrationTest method multiRead.
@Test
public void multiRead() throws Exception {
final int length = 20;
FileSystemTestUtils.createByteFile(mFileSystem, "/file", WriteType.MUST_CACHE, length);
BlockInfo block = getFirstBlockInfo(new AlluxioURI("/file"));
for (int i = 0; i < 10; i++) {
DataServerMessage recvMsg = request(block);
assertValid(recvMsg, length, block.getBlockId(), 0, length);
}
}
use of alluxio.wire.BlockInfo in project alluxio by Alluxio.
the class DataServerIntegrationTest method tooLargeOffset.
@Test
public void tooLargeOffset() throws Exception {
final int length = 10;
FileSystemTestUtils.createByteFile(mFileSystem, "/file", WriteType.MUST_CACHE, length);
BlockInfo block = getFirstBlockInfo(new AlluxioURI("/file"));
DataServerMessage recvMsg = request(block, length * 2, 1);
assertError(recvMsg, block.getBlockId());
}
use of alluxio.wire.BlockInfo in project alluxio by Alluxio.
the class DataServerIntegrationTest method lengthTooSmall.
@Test
public void lengthTooSmall() throws Exception {
final int length = 20;
FileSystemTestUtils.createByteFile(mFileSystem, "/file", WriteType.MUST_CACHE, length);
BlockInfo block = getFirstBlockInfo(new AlluxioURI("/file"));
DataServerMessage recvMsg = request(block, 0, length * -2);
assertError(recvMsg, block.getBlockId());
}
use of alluxio.wire.BlockInfo in project alluxio by Alluxio.
the class DataServerIntegrationTest method readMultiFiles.
@Test
public void readMultiFiles() throws Exception {
final int length = WORKER_CAPACITY_BYTES / 2 + 1;
FileSystemTestUtils.createByteFile(mFileSystem, "/file1", WriteType.MUST_CACHE, length);
HeartbeatScheduler.execute(HeartbeatContext.WORKER_BLOCK_SYNC);
BlockInfo block1 = getFirstBlockInfo(new AlluxioURI("/file1"));
DataServerMessage recvMsg1 = request(block1);
assertValid(recvMsg1, length, block1.getBlockId(), 0, length);
FileSystemTestUtils.createByteFile(mFileSystem, "/file2", WriteType.MUST_CACHE, length);
HeartbeatScheduler.execute(HeartbeatContext.WORKER_BLOCK_SYNC);
BlockInfo block2 = getFirstBlockInfo(new AlluxioURI("/file2"));
DataServerMessage recvMsg2 = request(block2);
assertValid(recvMsg2, length, block2.getBlockId(), 0, length);
Assert.assertEquals(0, mFileSystem.getStatus(new AlluxioURI("/file1")).getInMemoryPercentage());
}
use of alluxio.wire.BlockInfo in project alluxio by Alluxio.
the class DataServerIntegrationTest method read.
@Test
public void read() throws Exception {
final int length = 10;
FileSystemTestUtils.createByteFile(mFileSystem, "/file", WriteType.MUST_CACHE, length);
BlockInfo block = getFirstBlockInfo(new AlluxioURI("/file"));
DataServerMessage recvMsg = request(block);
assertValid(recvMsg, length, block.getBlockId(), 0, length);
}
Aggregations