@Test public void testGetProperty() throws IOException { PrintStream o = System.out; File f = File.createTempFile("cfg", ".tmp"); PrintStream tmpOut = new PrintStream(new FileOutputStream(f), false, "UTF-8"); System.setOut(tmpOut); KylinConfigCLI.main(new String[] { "kylin.storage.url" }); String val = FileUtils.readFileToString(f, Charset.defaultCharset()).trim(); assertEquals("hbase", val); tmpOut.close(); FileUtils.forceDelete(f); System.setOut(o); }
public static void main(String[] args) { if (args.length != 1) { System.err.println("Usage: KylinConfigCLI conf_name"); System.err.println("Example: KylinConfigCLI kylin.server.mode"); System.exit(1); } Properties config = KylinConfig.getInstanceFromEnv().exportToProperties(); BackwardCompatibilityConfig bcc = new BackwardCompatibilityConfig(); String key = bcc.check(args[0].trim()); if (!key.endsWith(".")) { String value = config.getProperty(key); if (value == null) { value = ""; } System.out.println(value.trim()); } else { Map<String, String> props = getPropertiesByPrefix(config, key); for (Map.Entry<String, String> prop : props.entrySet()) { System.out.println(prop.getKey() + "=" + prop.getValue().trim()); } } }
KylinConfigCLI { public static void main(String[] args) { if (args.length != 1) { System.err.println("Usage: KylinConfigCLI conf_name"); System.err.println("Example: KylinConfigCLI kylin.server.mode"); System.exit(1); } Properties config = KylinConfig.getInstanceFromEnv().exportToProperties(); BackwardCompatibilityConfig bcc = new BackwardCompatibilityConfig(); String key = bcc.check(args[0].trim()); if (!key.endsWith(".")) { String value = config.getProperty(key); if (value == null) { value = ""; } System.out.println(value.trim()); } else { Map<String, String> props = getPropertiesByPrefix(config, key); for (Map.Entry<String, String> prop : props.entrySet()) { System.out.println(prop.getKey() + "=" + prop.getValue().trim()); } } } }
KylinConfigCLI { public static void main(String[] args) { if (args.length != 1) { System.err.println("Usage: KylinConfigCLI conf_name"); System.err.println("Example: KylinConfigCLI kylin.server.mode"); System.exit(1); } Properties config = KylinConfig.getInstanceFromEnv().exportToProperties(); BackwardCompatibilityConfig bcc = new BackwardCompatibilityConfig(); String key = bcc.check(args[0].trim()); if (!key.endsWith(".")) { String value = config.getProperty(key); if (value == null) { value = ""; } System.out.println(value.trim()); } else { Map<String, String> props = getPropertiesByPrefix(config, key); for (Map.Entry<String, String> prop : props.entrySet()) { System.out.println(prop.getKey() + "=" + prop.getValue().trim()); } } }  }
KylinConfigCLI { public static void main(String[] args) { if (args.length != 1) { System.err.println("Usage: KylinConfigCLI conf_name"); System.err.println("Example: KylinConfigCLI kylin.server.mode"); System.exit(1); } Properties config = KylinConfig.getInstanceFromEnv().exportToProperties(); BackwardCompatibilityConfig bcc = new BackwardCompatibilityConfig(); String key = bcc.check(args[0].trim()); if (!key.endsWith(".")) { String value = config.getProperty(key); if (value == null) { value = ""; } System.out.println(value.trim()); } else { Map<String, String> props = getPropertiesByPrefix(config, key); for (Map.Entry<String, String> prop : props.entrySet()) { System.out.println(prop.getKey() + "=" + prop.getValue().trim()); } } }  static void main(String[] args); }
KylinConfigCLI { public static void main(String[] args) { if (args.length != 1) { System.err.println("Usage: KylinConfigCLI conf_name"); System.err.println("Example: KylinConfigCLI kylin.server.mode"); System.exit(1); } Properties config = KylinConfig.getInstanceFromEnv().exportToProperties(); BackwardCompatibilityConfig bcc = new BackwardCompatibilityConfig(); String key = bcc.check(args[0].trim()); if (!key.endsWith(".")) { String value = config.getProperty(key); if (value == null) { value = ""; } System.out.println(value.trim()); } else { Map<String, String> props = getPropertiesByPrefix(config, key); for (Map.Entry<String, String> prop : props.entrySet()) { System.out.println(prop.getKey() + "=" + prop.getValue().trim()); } } }  static void main(String[] args);  }