use of com.facebook.presto.orc.writer.StreamLayout.ByStreamSize in project presto by prestodb.
the class TestStreamLayout method testByStreamSize.
@Test
public void testByStreamSize() {
List<StreamDataOutput> streams = new ArrayList<>();
int length = 10_000;
for (int i = 0; i < 10; i++) {
streams.add(createStream(i, StreamKind.PRESENT, length - i));
streams.add(createStream(i, StreamKind.DATA, length - 100 - i));
}
Collections.shuffle(streams);
new ByStreamSize().reorder(streams);
assertEquals(streams.size(), 20);
Iterator<StreamDataOutput> iterator = streams.iterator();
for (int i = 9; i >= 0; i--) {
verifyStream(iterator.next().getStream(), i, StreamKind.DATA, length - 100 - i);
}
for (int i = 9; i >= 0; i--) {
verifyStream(iterator.next().getStream(), i, StreamKind.PRESENT, length - i);
}
assertFalse(iterator.hasNext());
}
Aggregations