@Test public void testReadSinkToolsJson() throws Exception { Set<SinkTool> sinkToolSet = readSinkToolsJson("src/main/resources/SCSinkTools.json"); for (SinkTool entry : sinkToolSet) { Map<String, String> props = entry.getCubeDescOverrideProperties(); assertEquals(props.get("kylin.cube.algorithm"), "INMEM"); } }
@Test public void testWriteSinkToolsJson() throws Exception { Map<String, String> cubeDescOverrideProperties = Maps.newHashMap(); cubeDescOverrideProperties.put("kylin.cube.algorithm", "INMEM"); HiveSinkTool hiveSinkTool = new HiveSinkTool(); hiveSinkTool.setCubeDescOverrideProperties(cubeDescOverrideProperties); String outputPath = "src/test/resources/SCSinkTools.json"; try (BufferedOutputStream os = new BufferedOutputStream(new FileOutputStream(outputPath))) { ObjectMapper mapper = new ObjectMapper(); mapper.enableDefaultTyping(); mapper.writeValue(os, Sets.newHashSet(hiveSinkTool)); } Set<SinkTool> sinkToolSet = readSinkToolsJson(outputPath); for (SinkTool entry : sinkToolSet) { Map<String, String> props = entry.getCubeDescOverrideProperties(); for (String key : cubeDescOverrideProperties.keySet()) { assertEquals(props.get(key), cubeDescOverrideProperties.get(key)); } } }
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());
rowKeyDesc, aggGroup, hBaseMapping, sinkTool.getCubeDescOverrideProperties());