@Test public void testSetSystemProperties() { System.setProperty("prop1", "val1"); Config config = ConfigFactory.empty().withValue(GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_SYSTEM_PROPERTY_PREFIX + ".prop2", ConfigValueFactory.fromAnyRef("val2")) .withValue(GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_SYSTEM_PROPERTY_PREFIX + ".prop3", ConfigValueFactory.fromAnyRef("val3")); GobblinClusterUtils.setSystemProperties(config); Assert.assertEquals(System.getProperty("prop1"), "val1"); Assert.assertEquals(System.getProperty("prop2"), "val2"); Assert.assertEquals(System.getProperty("prop3"), "val3"); }
public static void setSystemProperties(Config config) { Properties properties = ConfigUtils.configToProperties(ConfigUtils.getConfig(config, GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_SYSTEM_PROPERTY_PREFIX, ConfigFactory.empty())); for (Map.Entry<Object, Object> entry: properties.entrySet()) { if (entry.getKey().toString().equals(JAVA_TMP_DIR_KEY)) { if (entry.getValue().toString().equalsIgnoreCase(TMP_DIR.YARN_CACHE.toString())) { log.info("Setting tmp directory to: {}", System.getenv(ApplicationConstants.Environment.PWD.key())); System.setProperty(entry.getKey().toString(), System.getenv(ApplicationConstants.Environment.PWD.key())); continue; } } System.setProperty(entry.getKey().toString(), entry.getValue().toString()); } }
GobblinClusterUtils { public static void setSystemProperties(Config config) { Properties properties = ConfigUtils.configToProperties(ConfigUtils.getConfig(config, GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_SYSTEM_PROPERTY_PREFIX, ConfigFactory.empty())); for (Map.Entry<Object, Object> entry: properties.entrySet()) { if (entry.getKey().toString().equals(JAVA_TMP_DIR_KEY)) { if (entry.getValue().toString().equalsIgnoreCase(TMP_DIR.YARN_CACHE.toString())) { log.info("Setting tmp directory to: {}", System.getenv(ApplicationConstants.Environment.PWD.key())); System.setProperty(entry.getKey().toString(), System.getenv(ApplicationConstants.Environment.PWD.key())); continue; } } System.setProperty(entry.getKey().toString(), entry.getValue().toString()); } } }
GobblinClusterUtils { public static void setSystemProperties(Config config) { Properties properties = ConfigUtils.configToProperties(ConfigUtils.getConfig(config, GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_SYSTEM_PROPERTY_PREFIX, ConfigFactory.empty())); for (Map.Entry<Object, Object> entry: properties.entrySet()) { if (entry.getKey().toString().equals(JAVA_TMP_DIR_KEY)) { if (entry.getValue().toString().equalsIgnoreCase(TMP_DIR.YARN_CACHE.toString())) { log.info("Setting tmp directory to: {}", System.getenv(ApplicationConstants.Environment.PWD.key())); System.setProperty(entry.getKey().toString(), System.getenv(ApplicationConstants.Environment.PWD.key())); continue; } } System.setProperty(entry.getKey().toString(), entry.getValue().toString()); } }  }
GobblinClusterUtils { public static void setSystemProperties(Config config) { Properties properties = ConfigUtils.configToProperties(ConfigUtils.getConfig(config, GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_SYSTEM_PROPERTY_PREFIX, ConfigFactory.empty())); for (Map.Entry<Object, Object> entry: properties.entrySet()) { if (entry.getKey().toString().equals(JAVA_TMP_DIR_KEY)) { if (entry.getValue().toString().equalsIgnoreCase(TMP_DIR.YARN_CACHE.toString())) { log.info("Setting tmp directory to: {}", System.getenv(ApplicationConstants.Environment.PWD.key())); System.setProperty(entry.getKey().toString(), System.getenv(ApplicationConstants.Environment.PWD.key())); continue; } } System.setProperty(entry.getKey().toString(), entry.getValue().toString()); } }  static String getHostname(); static Path getAppWorkDirPathFromConfig(Config config, FileSystem fs,
      String applicationName, String applicationId); static String getAppWorkDirPath(String applicationName, String applicationId); static Path getJobStateFilePath(boolean usingStateStore, Path appWorkPath, String jobId); static void setSystemProperties(Config config); static Config getDynamicConfig(Config config); static Config addDynamicConfig(Config config); static FileSystem buildFileSystem(Config config, Configuration conf); }
GobblinClusterUtils { public static void setSystemProperties(Config config) { Properties properties = ConfigUtils.configToProperties(ConfigUtils.getConfig(config, GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_SYSTEM_PROPERTY_PREFIX, ConfigFactory.empty())); for (Map.Entry<Object, Object> entry: properties.entrySet()) { if (entry.getKey().toString().equals(JAVA_TMP_DIR_KEY)) { if (entry.getValue().toString().equalsIgnoreCase(TMP_DIR.YARN_CACHE.toString())) { log.info("Setting tmp directory to: {}", System.getenv(ApplicationConstants.Environment.PWD.key())); System.setProperty(entry.getKey().toString(), System.getenv(ApplicationConstants.Environment.PWD.key())); continue; } } System.setProperty(entry.getKey().toString(), entry.getValue().toString()); } }  static String getHostname(); static Path getAppWorkDirPathFromConfig(Config config, FileSystem fs,
      String applicationName, String applicationId); static String getAppWorkDirPath(String applicationName, String applicationId); static Path getJobStateFilePath(boolean usingStateStore, Path appWorkPath, String jobId); static void setSystemProperties(Config config); static Config getDynamicConfig(Config config); static Config addDynamicConfig(Config config); static FileSystem buildFileSystem(Config config, Configuration conf); static final String JAVA_TMP_DIR_KEY; }