@Test public void testReadAndPrint() throws IOException { String[] args = new String[] { "test_kylin_cube_with_slr_1_new_segment" }; CubeStatsReader.main(args); }
public static void main(String[] args) throws IOException { logger.info("CubeStatsReader is used to read cube statistic saved in metadata store"); KylinConfig config = KylinConfig.getInstanceFromEnv(); CubeInstance cube = CubeManager.getInstance(config).getCube(args[0]); List<CubeSegment> segments = cube.getSegments(); PrintWriter out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out, StandardCharsets.UTF_8))); for (CubeSegment seg : segments) { try { new CubeStatsReader(seg, config).print(out); } catch (Exception e) { logger.info("CubeStatsReader for Segment {} failed, skip it.", seg.getName()); } } out.flush(); }
CubeStatsReader { public static void main(String[] args) throws IOException { logger.info("CubeStatsReader is used to read cube statistic saved in metadata store"); KylinConfig config = KylinConfig.getInstanceFromEnv(); CubeInstance cube = CubeManager.getInstance(config).getCube(args[0]); List<CubeSegment> segments = cube.getSegments(); PrintWriter out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out, StandardCharsets.UTF_8))); for (CubeSegment seg : segments) { try { new CubeStatsReader(seg, config).print(out); } catch (Exception e) { logger.info("CubeStatsReader for Segment {} failed, skip it.", seg.getName()); } } out.flush(); } }
CubeStatsReader { public static void main(String[] args) throws IOException { logger.info("CubeStatsReader is used to read cube statistic saved in metadata store"); KylinConfig config = KylinConfig.getInstanceFromEnv(); CubeInstance cube = CubeManager.getInstance(config).getCube(args[0]); List<CubeSegment> segments = cube.getSegments(); PrintWriter out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out, StandardCharsets.UTF_8))); for (CubeSegment seg : segments) { try { new CubeStatsReader(seg, config).print(out); } catch (Exception e) { logger.info("CubeStatsReader for Segment {} failed, skip it.", seg.getName()); } } out.flush(); } CubeStatsReader(CubeSegment cubeSegment, KylinConfig kylinConfig);  CubeStatsReader(CubeSegment cubeSegment, CuboidScheduler cuboidScheduler, KylinConfig kylinConfig);  CubeStatsReader(CubeSegment cubeSegment, CuboidScheduler cuboidScheduler, KylinConfig kylinConfig, Path path); }
CubeStatsReader { public static void main(String[] args) throws IOException { logger.info("CubeStatsReader is used to read cube statistic saved in metadata store"); KylinConfig config = KylinConfig.getInstanceFromEnv(); CubeInstance cube = CubeManager.getInstance(config).getCube(args[0]); List<CubeSegment> segments = cube.getSegments(); PrintWriter out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out, StandardCharsets.UTF_8))); for (CubeSegment seg : segments) { try { new CubeStatsReader(seg, config).print(out); } catch (Exception e) { logger.info("CubeStatsReader for Segment {} failed, skip it.", seg.getName()); } } out.flush(); } CubeStatsReader(CubeSegment cubeSegment, KylinConfig kylinConfig);  CubeStatsReader(CubeSegment cubeSegment, CuboidScheduler cuboidScheduler, KylinConfig kylinConfig);  CubeStatsReader(CubeSegment cubeSegment, CuboidScheduler cuboidScheduler, KylinConfig kylinConfig, Path path); Map<Long, HLLCounter> getCuboidRowHLLCounters(); int getSamplingPercentage(); long getSourceRowCount(); Map<Long, Long> getCuboidRowEstimatesHLL(); Map<Long, Double> getCuboidSizeMap(); Map<Long, Double> getCuboidSizeMap(boolean origin); double estimateCubeSize(); int getMapperNumberOfFirstBuild(); double getMapperOverlapRatioOfFirstBuild(); static Map<Long, Long> getCuboidRowCountMapFromSampling(Map<Long, HLLCounter> hllcMap,
            int samplingPercentage); static Map<Long, Double> getCuboidSizeMapFromRowCount(CubeSegment cubeSegment, Map<Long, Long> rowCountMap,
            long sourceRowCount); double estimateLayerSize(int level); List<Long> getCuboidsByLayer(int level); static void main(String[] args); }
CubeStatsReader { public static void main(String[] args) throws IOException { logger.info("CubeStatsReader is used to read cube statistic saved in metadata store"); KylinConfig config = KylinConfig.getInstanceFromEnv(); CubeInstance cube = CubeManager.getInstance(config).getCube(args[0]); List<CubeSegment> segments = cube.getSegments(); PrintWriter out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out, StandardCharsets.UTF_8))); for (CubeSegment seg : segments) { try { new CubeStatsReader(seg, config).print(out); } catch (Exception e) { logger.info("CubeStatsReader for Segment {} failed, skip it.", seg.getName()); } } out.flush(); } CubeStatsReader(CubeSegment cubeSegment, KylinConfig kylinConfig);  CubeStatsReader(CubeSegment cubeSegment, CuboidScheduler cuboidScheduler, KylinConfig kylinConfig);  CubeStatsReader(CubeSegment cubeSegment, CuboidScheduler cuboidScheduler, KylinConfig kylinConfig, Path path); Map<Long, HLLCounter> getCuboidRowHLLCounters(); int getSamplingPercentage(); long getSourceRowCount(); Map<Long, Long> getCuboidRowEstimatesHLL(); Map<Long, Double> getCuboidSizeMap(); Map<Long, Double> getCuboidSizeMap(boolean origin); double estimateCubeSize(); int getMapperNumberOfFirstBuild(); double getMapperOverlapRatioOfFirstBuild(); static Map<Long, Long> getCuboidRowCountMapFromSampling(Map<Long, HLLCounter> hllcMap,
            int samplingPercentage); static Map<Long, Double> getCuboidSizeMapFromRowCount(CubeSegment cubeSegment, Map<Long, Long> rowCountMap,
            long sourceRowCount); double estimateLayerSize(int level); List<Long> getCuboidsByLayer(int level); static void main(String[] args);  }