private static void assertDictionaryBlock(Block block, Slice[][][] expectedValues) { DictionaryBlock dictionaryBlock = createTestDictionaryBlock(block); Slice[][][] expectedDictionaryValues = createTestDictionaryExpectedValues(expectedValues); assertBlock(dictionaryBlock, expectedDictionaryValues); assertColumnarMap(dictionaryBlock, expectedDictionaryValues); assertRunLengthEncodedBlock(dictionaryBlock, expectedDictionaryValues); }
private static <T> void assertDictionaryBlock(Block block, T[] expectedValues) { DictionaryBlock dictionaryBlock = createTestDictionaryBlock(block); T[] expectedDictionaryValues = createTestDictionaryExpectedValues(expectedValues); assertBlock(dictionaryBlock, expectedDictionaryValues); assertColumnarRow(dictionaryBlock, expectedDictionaryValues); assertRunLengthEncodedBlock(dictionaryBlock, expectedDictionaryValues); }
@Override protected <T> void assertPositionValue(Block block, int position, T expectedValue) { if (expectedValue instanceof Map) { assertValue(block, position, (Map<String, Long>) expectedValue); return; } super.assertPositionValue(block, position, expectedValue); }
private static <T> void assertDictionaryBlock(Block block, T[] expectedValues) { DictionaryBlock dictionaryBlock = createTestDictionaryBlock(block); T[] expectedDictionaryValues = createTestDictionaryExpectedValues(expectedValues); assertBlock(dictionaryBlock, expectedDictionaryValues); assertColumnarArray(dictionaryBlock, expectedDictionaryValues); assertRunLengthEncodedBlock(dictionaryBlock, expectedDictionaryValues); }
@Override public Block[] getSequenceBlocks(int start, int length) { return new Block[] {createDoubleSequenceBlock(start, start + length), createDoubleSequenceBlock(start + 5, start + 5 + length)}; }
@Override protected <T> void assertPositionValue(Block block, int position, T expectedValue) { if (expectedValue instanceof List) { assertValue(block, position, (List<Object>) expectedValue); return; } super.assertPositionValue(block, position, expectedValue); }
protected static void testIncompactBlock(Block block) { assertNotCompact(block); testCopyRegionCompactness(block); } }
private static Slice[] createExpectedValues(int positionCount, int fixedSize) { Slice[] expectedValues = new Slice[positionCount]; for (int position = 0; position < positionCount; position++) { expectedValues[position] = createExpectedValue(fixedSize); } return expectedValues; } }
public static <T> void assertBlock(Block block, T[] expectedValues) { assertBlockPositions(block, expectedValues); assertBlockPositions(copyBlock(block), expectedValues); }
protected static void testCompactBlock(Block block) { assertCompact(block); testCopyRegionCompactness(block); }
@Override public Block[] getSequenceBlocks(int start, int length) { return new Block[] {createSequenceBlockOfReal(start, start + length), createSequenceBlockOfReal(start + 2, start + 2 + length)}; }
private static Slice[] createTestValue(int positionCount) { Slice[] expectedValues = new Slice[positionCount]; for (int position = 0; position < positionCount; position++) { expectedValues[position] = createExpectedValue(SIZE_OF_INT); } return expectedValues; }
private static Slice[] createTestValue(int positionCount) { Slice[] expectedValues = new Slice[positionCount]; for (int position = 0; position < positionCount; position++) { expectedValues[position] = createExpectedValue(SIZE_OF_LONG); } return expectedValues; }
private static Slice[] createTestValue(int positionCount) { Slice[] expectedValues = new Slice[positionCount]; for (int position = 0; position < positionCount; position++) { expectedValues[position] = createExpectedValue(SIZE_OF_SHORT); } return expectedValues; }
@Override public Block[] getSequenceBlocks(int start, int length) { return new Block[] {createDoubleSequenceBlock(start, start + length), createDoubleSequenceBlock(start + 2, start + 2 + length)}; }
@Override public Block[] getSequenceBlocks(int start, int length) { return new Block[] {createSequenceBlockOfReal(start, start + length), createSequenceBlockOfReal(start + 5, start + 5 + length)}; }
@Override public Block[] getSequenceBlocks(int start, int length) { return new Block[] {createDoubleSequenceBlock(start, start + length), createDoubleSequenceBlock(start + 2, start + 2 + length)}; }
@Override public Block[] getSequenceBlocks(int start, int length) { return new Block[] {createSequenceBlockOfReal(start, start + length), createSequenceBlockOfReal(start + 5, start + 5 + length)}; }
@Override public Block[] getSequenceBlocks(int start, int length) { return new Block[] {createDoubleSequenceBlock(start, start + length), createDoubleSequenceBlock(start + 2, start + 2 + length)}; }
@Override public Block[] getSequenceBlocks(int start, int length) { return new Block[] {createDoubleSequenceBlock(start, start + length), createDoubleSequenceBlock(start + 5, start + 5 + length)}; }