use of org.apache.hadoop.hbase.io.FileLink in project hbase by apache.
the class TestInputStreamBlockDistribution method itDerivesLocalityFromFileLinkInputStream.
@Test
public void itDerivesLocalityFromFileLinkInputStream() throws Exception {
List<Path> files = new ArrayList<Path>();
files.add(testPath);
FileLink link = new FileLink(files);
try (FSDataInputStream stream = link.open(fs)) {
HDFSBlocksDistribution initial = new HDFSBlocksDistribution();
InputStreamBlockDistribution test = new InputStreamBlockDistribution(stream, getMockedStoreFileInfo(initial, true));
assertSame(initial, test.getHDFSBlockDistribution());
test.setLastCachedAt(test.getCachePeriodMs() + 1);
assertNotSame(initial, test.getHDFSBlockDistribution());
}
}
Aggregations