use of io.hetu.core.plugin.heuristicindex.index.minmax.MinMaxIndex in project hetu-core by openlookeng.
the class TestHeuristicIndexFilter method setup.
@BeforeClass
public void setup() throws IOException {
try (TempFolder folder = new TempFolder()) {
folder.create();
File testFile = folder.newFile();
bloomIndex1 = new BloomIndex();
bloomIndex1.setExpectedNumOfEntries(2);
bloomIndex1.addValues(Collections.singletonList(new Pair<>("testColumn", ImmutableList.of("a", "b"))));
try (FileOutputStream fo = new FileOutputStream(testFile)) {
bloomIndex1.serialize(fo);
}
try (FileInputStream fi = new FileInputStream(testFile)) {
bloomIndex1.deserialize(fi);
}
bloomIndex2 = new BloomIndex();
bloomIndex2.setExpectedNumOfEntries(2);
bloomIndex2.addValues(Collections.singletonList(new Pair<>("testColumn", ImmutableList.of("c", "d"))));
try (FileOutputStream fo = new FileOutputStream(testFile)) {
bloomIndex2.serialize(fo);
}
try (FileInputStream fi = new FileInputStream(testFile)) {
bloomIndex2.deserialize(fi);
}
minMaxIndex1 = new MinMaxIndex();
minMaxIndex1.addValues(Collections.singletonList(new Pair<>("testColumn", ImmutableList.of(1L, 5L, 10L))));
minMaxIndex2 = new MinMaxIndex();
minMaxIndex2.addValues(Collections.singletonList(new Pair<>("testColumn", ImmutableList.of(50L, 80L, 100L))));
}
}
Aggregations