protected KylinConfigBase(Properties props, boolean force) { this.properties = force ? props : BCC.check(props); }
final protected void reloadKylinConfig(Properties properties) { this.properties = BCC.check(properties); }
public KylinConfigBase(Properties props) { this.properties = BCC.check(props); }
/** * Use with care, properties should be read-only. This is for testing only. */ final public void setProperty(String key, String value) { logger.info("Kylin Config was updated with {} : {}", key, value); properties.setProperty(BCC.check(key), value); }
public Map<String, String> check(Map<String, String> props) { LinkedHashMap<String, String> result = new LinkedHashMap<>(); for (Entry<String, String> kv : props.entrySet()) { result.put(check(kv.getKey()), kv.getValue()); } return result; }
public Properties check(Properties props) { Properties result = new Properties(); for (Entry<Object, Object> kv : props.entrySet()) { result.setProperty(check((String) kv.getKey()), (String) kv.getValue()); } return result; }
private KylinConfigExt(KylinConfig base, Map<String, String> overrides) { super(base.getRawAllProperties(), true); if (base.getClass() != KylinConfig.class) { throw new IllegalArgumentException(); } this.base = base; this.overrides = BCC.check(overrides); }
private KylinConfigExt(KylinConfigExt ext, Map<String, String> overrides) { super(ext.base.getRawAllProperties(), true); this.base = ext.base; this.overrides = BCC.check(overrides); }
/** * will close the passed in inputstream */ private static void loadPropertiesFromInputStream(InputStream inputStream, OrderedProperties properties) { Preconditions.checkNotNull(properties); try (BufferedReader confReader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"))) { OrderedProperties temp = new OrderedProperties(); temp.load(confReader); temp = BCC.check(temp); properties.putAll(temp); } catch (Exception e) { throw new RuntimeException(e); } }
public OrderedProperties check(OrderedProperties props) { OrderedProperties result = new OrderedProperties(); for (Entry<String, String> kv : props.entrySet()) { result.setProperty(check(kv.getKey()), kv.getValue()); } return result; }
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()); } } }
protected KylinConfigBase(Properties props, boolean force) { this.properties = force ? props : BCC.check(props); }
public KylinConfigBase(Properties props) { this.properties = BCC.check(props); }
/** * Use with care, properties should be read-only. This is for testing only. */ final public void setProperty(String key, String value) { logger.info("Kylin Config was updated with {} : {}", key, value); properties.setProperty(BCC.check(key), value); }
public Properties check(Properties props) { Properties result = new Properties(); for (Entry<Object, Object> kv : props.entrySet()) { result.setProperty(check((String) kv.getKey()), (String) kv.getValue()); } return result; }
public Map<String, String> check(Map<String, String> props) { LinkedHashMap<String, String> result = new LinkedHashMap<>(); for (Entry<String, String> kv : props.entrySet()) { result.put(check(kv.getKey()), kv.getValue()); } return result; }
private KylinConfigExt(KylinConfig base, Map<String, String> overrides) { super(base.getRawAllProperties(), true); if (base.getClass() != KylinConfig.class) { throw new IllegalArgumentException(); } this.base = base; this.overrides = BCC.check(overrides); }
private KylinConfigExt(KylinConfigExt ext, Map<String, String> overrides) { super(ext.base.getRawAllProperties(), true); this.base = ext.base; this.overrides = BCC.check(overrides); }
/** * will close the passed in inputstream */ private static void loadPropertiesFromInputStream(InputStream inputStream, OrderedProperties properties) { Preconditions.checkNotNull(properties); try (BufferedReader confReader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"))) { OrderedProperties temp = new OrderedProperties(); temp.load(confReader); temp = BCC.check(temp); properties.putAll(temp); } catch (Exception e) { throw new RuntimeException(e); } }
public OrderedProperties check(OrderedProperties props) { OrderedProperties result = new OrderedProperties(); for (Entry<String, String> kv : props.entrySet()) { result.setProperty(check(kv.getKey()), kv.getValue()); } return result; }