public static KylinConfig createKylinConfig(Properties prop) { KylinConfig kylinConfig = new KylinConfig(); kylinConfig.reloadKylinConfig(prop); return kylinConfig; }
public static void setKylinConfigInEnvIfMissing(Properties prop) { synchronized (KylinConfig.class) { if (SYS_ENV_INSTANCE == null) { try { KylinConfig config = new KylinConfig(); config.reloadKylinConfig(prop); logger.info("Resetting SYS_ENV_INSTANCE by a input stream: " + System.identityHashCode(config)); SYS_ENV_INSTANCE = config; } catch (IllegalArgumentException e) { throw new IllegalStateException("Failed to find KylinConfig ", e); } } } }
public synchronized void reloadFromSiteProperties() { reloadKylinConfig(buildSiteProperties()); }
public static KylinConfig getInstanceFromEnv() { synchronized (KylinConfig.class) { KylinConfig config = THREAD_ENV_INSTANCE.get(); if (config != null) { return config; } if (SYS_ENV_INSTANCE == null) { try { //build default ordered properties will only be called once. //This logic no need called by CoProcessor due to it didn't call getInstanceFromEnv. buildDefaultOrderedProperties(); config = new KylinConfig(); config.reloadKylinConfig(buildSiteProperties()); logger.info("Initialized a new KylinConfig from getInstanceFromEnv : " + System.identityHashCode(config)); SYS_ENV_INSTANCE = config; } catch (IllegalArgumentException e) { throw new IllegalStateException("Failed to find KylinConfig ", e); } } return SYS_ENV_INSTANCE; } }
InputStream is = new FileInputStream(uri); Properties prop = streamToProps(is); config.reloadKylinConfig(prop); } catch (IOException e) { throw new RuntimeException(e); InputStream is = IOUtils.toInputStream(propertyText, Charset.defaultCharset()); Properties prop = streamToProps(is); config.reloadKylinConfig(prop); return config; } catch (IOException e) {
public static KylinConfig getKylinConfigFromInputStream(InputStream is) { KylinConfig config = new KylinConfig(); config.reloadKylinConfig(is); return config; }
/** * Find config from environment. The Search process: 1. Check the * $KYLIN_CONF/kylin.properties 2. Check the /etc/kylin/kylin.properties 3. * Check the kylin.properties in classpath * * @return */ private static KylinConfig loadKylinConfig() { InputStream is = getKylinPropertiesAsInputSteam(); if (is == null) { throw new IllegalArgumentException("Failed to load kylin config"); } KylinConfig config = new KylinConfig(); config.reloadKylinConfig(is); return config; }
config = new KylinConfig(); InputStream is = new FileInputStream(uri); config.reloadKylinConfig(is); is.close(); } catch (IOException e) { String propertyText = client.getKylinProperties(); InputStream is = IOUtils.toInputStream(propertyText); config.reloadKylinConfig(is); is.close(); return config;
public static KylinConfig createKylinConfig(Properties prop) { KylinConfig kylinConfig = new KylinConfig(); kylinConfig.reloadKylinConfig(prop); return kylinConfig; }
public static KylinConfig getKylinConfigFromInputStream(InputStream is) { KylinConfig config = new KylinConfig(); config.reloadKylinConfig(is); return config; }
public static void setKylinConfigInEnvIfMissing(Properties prop) { synchronized (KylinConfig.class) { if (SYS_ENV_INSTANCE == null) { try { KylinConfig config = new KylinConfig(); config.reloadKylinConfig(prop); logger.info("Resetting SYS_ENV_INSTANCE by a input stream: " + System.identityHashCode(config)); SYS_ENV_INSTANCE = config; } catch (IllegalArgumentException e) { throw new IllegalStateException("Failed to find KylinConfig ", e); } } } }
public synchronized void reloadFromSiteProperties() { reloadKylinConfig(buildSiteProperties()); }
public static KylinConfig getInstanceFromEnv() { synchronized (KylinConfig.class) { KylinConfig config = THREAD_ENV_INSTANCE.get(); if (config != null) { return config; } if (SYS_ENV_INSTANCE == null) { try { //build default ordered properties will only be called once. //This logic no need called by CoProcessor due to it didn't call getInstanceFromEnv. buildDefaultOrderedProperties(); config = new KylinConfig(); config.reloadKylinConfig(buildSiteProperties()); logger.info("Initialized a new KylinConfig from getInstanceFromEnv : " + System.identityHashCode(config)); SYS_ENV_INSTANCE = config; } catch (IllegalArgumentException e) { throw new IllegalStateException("Failed to find KylinConfig ", e); } } return SYS_ENV_INSTANCE; } }
/** * Find config from environment. The Search process: 1. Check the * $KYLIN_CONF/kylin.properties 2. Check the $KYLIN_HOME/conf/kylin.properties * * @return */ private static KylinConfig loadKylinConfig() { Log4jConfigurer.initLogger(); InputStream is = getKylinPropertiesAsInputSteam(); if (is == null) { throw new IllegalArgumentException("Failed to load kylin config"); } KylinConfig config = new KylinConfig(); config.reloadKylinConfig(is); return config; }
config = new KylinConfig(); InputStream is = new FileInputStream(uri); config.reloadKylinConfig(is); is.close(); } catch (IOException e) { String propertyText = client.getKylinProperties(); InputStream is = IOUtils.toInputStream(propertyText); config.reloadKylinConfig(is); is.close(); return config;
InputStream is = new FileInputStream(uri); Properties prop = streamToProps(is); config.reloadKylinConfig(prop); } catch (IOException e) { throw new RuntimeException(e); InputStream is = IOUtils.toInputStream(propertyText, Charset.defaultCharset()); Properties prop = streamToProps(is); config.reloadKylinConfig(prop); return config; } catch (IOException e) {