Search in sources :

Example 1 with Block

use of herddb.index.brin.BlockRangeIndex.Block in project herddb by diennea.

the class BlockRangeIndexConcurrentTest method verifyIndex.

private void verifyIndex(BlockRangeIndex<Sized<Integer>, Sized<String>> index) {
    Integer lastmax = null;
    for (Block b : index.getBlocks().values()) {
        System.out.println("check block " + lastmax + " -> " + ((Sized<Integer>) b.minKey).dummy + "," + ((Sized<Integer>) b.maxKey).dummy);
        if (lastmax == null) {
            lastmax = ((Sized<Integer>) b.maxKey).dummy;
        } else {
            Integer entryMin = ((Sized<Integer>) b.minKey).dummy;
            Integer entryMax = ((Sized<Integer>) b.maxKey).dummy;
            if (entryMin < lastmax) {
                fail(entryMin + " < " + lastmax);
            }
            lastmax = entryMax;
        }
    }
}
Also used : Sized(herddb.utils.Sized) Block(herddb.index.brin.BlockRangeIndex.Block)

Aggregations

Block (herddb.index.brin.BlockRangeIndex.Block)1 Sized (herddb.utils.Sized)1