SegmentProperties { public Map<Integer, Integer> getDimensionOrdinalToBlockMapping() { return dimensionOrdinalToBlockMapping; } SegmentProperties(List<ColumnSchema> columnsInTable, int[] columnCardinality); int[] getDimensionColumnsValueSize(); KeyGenerator getDimensionKeyGenerator(); List<CarbonDimension> getDimensions(); List<CarbonDimension> getComplexDimensions(); List<CarbonMeasure> getMeasures(); int[] getDimColumnsCardinality(); int[] getComplexDimColumnCardinality(); Map<Integer, Integer> getDimensionOrdinalToBlockMapping(); Map<Integer, Integer> getMeasuresOrdinalToBlockMapping(); int[] getEachDimColumnValueSize(); int[] getEachComplexDimColumnValueSize(); ColumnarSplitter getFixedLengthKeySplitter(); Map<Integer, KeyGenerator> getColumnGroupAndItsKeygenartor(); int getNumberOfNoDictionaryDimension(); int[][] getColumnGroups(); ColumnGroupModel getColumnGroupModel(); int getColumnGroupMdKeyOrdinal(int colGrpId, int ordinal); int getNoOfColumnsInColumnGroup(int colGrpId); Set<Integer> getDimensionOrdinalForBlock(int blockIndex);  }
@Test public void testBlockMetadataHasProperDimensionBlockMapping() { Map<Integer, Integer> dimensionOrdinalToBlockMapping = new HashMap<Integer, Integer>(); dimensionOrdinalToBlockMapping.put(0, 0); dimensionOrdinalToBlockMapping.put(1, 1); dimensionOrdinalToBlockMapping.put(2, 2); dimensionOrdinalToBlockMapping.put(3, 2); dimensionOrdinalToBlockMapping.put(4, 3); dimensionOrdinalToBlockMapping.put(5, 4); dimensionOrdinalToBlockMapping.put(6, 4); dimensionOrdinalToBlockMapping.put(7, 4); dimensionOrdinalToBlockMapping.put(8, 5); dimensionOrdinalToBlockMapping.put(9, 6); Map<Integer, Integer> dimensionOrdinalToBlockMappingActual = blockMetadataInfos.getDimensionOrdinalToBlockMapping(); assertEquals(dimensionOrdinalToBlockMapping.size(), dimensionOrdinalToBlockMappingActual.size()); Iterator<Entry<Integer, Integer>> iterator = dimensionOrdinalToBlockMapping.entrySet().iterator(); while (iterator.hasNext()) { Entry<Integer, Integer> next = iterator.next(); Integer integer = dimensionOrdinalToBlockMappingActual.get(next.getKey()); if (integer != next.getValue()) { assertTrue(false); } } assertTrue(true); }