@Test public void testGetAppWorkDirPathFromConfig() throws IOException { FileSystem localFs = FileSystem.getLocal(new Configuration()); FileSystem mockFs = mock(FileSystem.class); when(mockFs.getHomeDirectory()).thenReturn(new Path(DEFAULT_HOME_DIR)); when(mockFs.getUri()).thenReturn(localFs.getUri()); Config config = ConfigFactory.empty().withValue(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR, ConfigValueFactory.fromAnyRef(TEST_WORK_DIR)); Path workDirPath = GobblinClusterUtils.getAppWorkDirPathFromConfig(config, localFs, TEST_APP_NAME, TEST_APP_ID); assertEquals(PathUtils.combinePaths(TEST_WORK_DIR, TEST_APP_NAME, TEST_APP_ID), workDirPath); workDirPath = GobblinClusterUtils .getAppWorkDirPathFromConfig(ConfigFactory.empty(), mockFs, TEST_APP_NAME, TEST_APP_ID); assertEquals(PathUtils.combinePaths(DEFAULT_HOME_DIR, TEST_APP_NAME, TEST_APP_ID), workDirPath); }
public static Path getAppWorkDirPathFromConfig(Config config, FileSystem fs, String applicationName, String applicationId) { if (config.hasPath(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR)) { return new Path(new Path(fs.getUri()), PathUtils.combinePaths(config.getString(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR), getAppWorkDirPath(applicationName, applicationId))); } return new Path(fs.getHomeDirectory(), getAppWorkDirPath(applicationName, applicationId)); }
GobblinClusterUtils { public static Path getAppWorkDirPathFromConfig(Config config, FileSystem fs, String applicationName, String applicationId) { if (config.hasPath(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR)) { return new Path(new Path(fs.getUri()), PathUtils.combinePaths(config.getString(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR), getAppWorkDirPath(applicationName, applicationId))); } return new Path(fs.getHomeDirectory(), getAppWorkDirPath(applicationName, applicationId)); } }
GobblinClusterUtils { public static Path getAppWorkDirPathFromConfig(Config config, FileSystem fs, String applicationName, String applicationId) { if (config.hasPath(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR)) { return new Path(new Path(fs.getUri()), PathUtils.combinePaths(config.getString(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR), getAppWorkDirPath(applicationName, applicationId))); } return new Path(fs.getHomeDirectory(), getAppWorkDirPath(applicationName, applicationId)); }  }
GobblinClusterUtils { public static Path getAppWorkDirPathFromConfig(Config config, FileSystem fs, String applicationName, String applicationId) { if (config.hasPath(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR)) { return new Path(new Path(fs.getUri()), PathUtils.combinePaths(config.getString(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR), getAppWorkDirPath(applicationName, applicationId))); } return new Path(fs.getHomeDirectory(), getAppWorkDirPath(applicationName, applicationId)); }  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 Path getAppWorkDirPathFromConfig(Config config, FileSystem fs, String applicationName, String applicationId) { if (config.hasPath(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR)) { return new Path(new Path(fs.getUri()), PathUtils.combinePaths(config.getString(GobblinClusterConfigurationKeys.CLUSTER_WORK_DIR), getAppWorkDirPath(applicationName, applicationId))); } return new Path(fs.getHomeDirectory(), getAppWorkDirPath(applicationName, applicationId)); }  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; }