Package com.netflix.genie.agent.utils
Class PathUtils
- java.lang.Object
-
- com.netflix.genie.agent.utils.PathUtils
-
public final class PathUtils extends java.lang.Object
Utilities to compose filesystem paths.- Since:
- 4.0.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.nio.file.Path
composePath(java.io.File baseDirectory, java.lang.String... children)
Append an arbitrary set of components to a base path.static java.nio.file.Path
composePath(java.nio.file.Path baseDirectory, java.lang.String... children)
Append an arbitrary set of components to a base path.static java.nio.file.Path
jobAgentLogFilePath(java.io.File jobDirectory)
Compose the path to the agent log file for a job (after it has been relocated inside the job directory).static java.nio.file.Path
jobApplicationDirectoryPath(java.io.File jobDirectory, java.lang.String appId)
Compose the path to an application directory inside a job directory.static java.nio.file.Path
jobApplicationsDirectoryPath(java.io.File jobDirectory)
Compose the path to the applications directory inside a job directory.static java.nio.file.Path
jobClusterDirectoryPath(java.io.File jobDirectory, java.lang.String clusterId)
Compose the path to the cluster directory inside a job directory.static java.nio.file.Path
jobCommandDirectoryPath(java.io.File jobDirectory, java.lang.String commandId)
Compose the path to the command directory inside a job directory.static java.nio.file.Path
jobEntityConfigPath(java.nio.file.Path entityDirectory)
Compose the path to the configurations directory for a given entity.static java.nio.file.Path
jobEntityDependenciesPath(java.nio.file.Path entityDirectory)
Compose the path to the dependencies directory for a given entity.static java.nio.file.Path
jobEntitySetupFilePath(java.nio.file.Path entityDirectory)
Compose the path to the setup file for a given entity.static java.nio.file.Path
jobEnvironmentLogFilePath(java.io.File jobDirectory)
Compose the path to the file where environment variables are dumped after running setup.static java.nio.file.Path
jobGenieDirectoryPath(java.io.File jobDirectory)
Compose the path to the genie directory inside a job directory.static java.nio.file.Path
jobGenieLogsDirectoryPath(java.io.File jobDirectory)
Compose the path to the genie logs directory inside a job directory.static java.nio.file.Path
jobScriptPath(java.io.File jobDirectory)
Compose the path to the job script (a.k.a.static java.nio.file.Path
jobSetupErrorMarkerFilePath(java.io.File jobDirectory)
Compose the path to the marker file left behind if the script fails during setup.static java.nio.file.Path
jobSetupLogFilePath(java.io.File jobDirectory)
Compose the path to the setup log file for a job (sourcing of entities setup files).static java.nio.file.Path
jobStdErrPath(java.io.File jobDirectory)
Compose the path to the standard error log file for a job.static java.nio.file.Path
jobStdOutPath(java.io.File jobDirectory)
Compose the path to the standard output log file for a job.
-
-
-
Method Detail
-
composePath
public static java.nio.file.Path composePath(java.io.File baseDirectory, java.lang.String... children)
Append an arbitrary set of components to a base path.- Parameters:
baseDirectory
- the base directorychildren
- path components- Returns:
- a Path
-
composePath
public static java.nio.file.Path composePath(java.nio.file.Path baseDirectory, java.lang.String... children)
Append an arbitrary set of components to a base path.- Parameters:
baseDirectory
- the base directorychildren
- path components- Returns:
- a Path
-
jobApplicationsDirectoryPath
public static java.nio.file.Path jobApplicationsDirectoryPath(java.io.File jobDirectory)
Compose the path to the applications directory inside a job directory.- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
jobApplicationDirectoryPath
public static java.nio.file.Path jobApplicationDirectoryPath(java.io.File jobDirectory, java.lang.String appId)
Compose the path to an application directory inside a job directory.- Parameters:
jobDirectory
- the job directoryappId
- the application id- Returns:
- a Path
-
jobClusterDirectoryPath
public static java.nio.file.Path jobClusterDirectoryPath(java.io.File jobDirectory, java.lang.String clusterId)
Compose the path to the cluster directory inside a job directory.- Parameters:
jobDirectory
- the job directoryclusterId
- the cluster id- Returns:
- a Path
-
jobCommandDirectoryPath
public static java.nio.file.Path jobCommandDirectoryPath(java.io.File jobDirectory, java.lang.String commandId)
Compose the path to the command directory inside a job directory.- Parameters:
jobDirectory
- the job directorycommandId
- the command id- Returns:
- a Path
-
jobGenieDirectoryPath
public static java.nio.file.Path jobGenieDirectoryPath(java.io.File jobDirectory)
Compose the path to the genie directory inside a job directory.- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
jobGenieLogsDirectoryPath
public static java.nio.file.Path jobGenieLogsDirectoryPath(java.io.File jobDirectory)
Compose the path to the genie logs directory inside a job directory.- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
jobEntityDependenciesPath
public static java.nio.file.Path jobEntityDependenciesPath(java.nio.file.Path entityDirectory)
Compose the path to the dependencies directory for a given entity.- Parameters:
entityDirectory
- the entity base directory- Returns:
- a Path
-
jobEntityConfigPath
public static java.nio.file.Path jobEntityConfigPath(java.nio.file.Path entityDirectory)
Compose the path to the configurations directory for a given entity.- Parameters:
entityDirectory
- the entity base directory- Returns:
- a Path
-
jobEntitySetupFilePath
public static java.nio.file.Path jobEntitySetupFilePath(java.nio.file.Path entityDirectory)
Compose the path to the setup file for a given entity.- Parameters:
entityDirectory
- the entity base directory- Returns:
- a Path
-
jobStdOutPath
public static java.nio.file.Path jobStdOutPath(java.io.File jobDirectory)
Compose the path to the standard output log file for a job.- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
jobStdErrPath
public static java.nio.file.Path jobStdErrPath(java.io.File jobDirectory)
Compose the path to the standard error log file for a job.- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
jobAgentLogFilePath
public static java.nio.file.Path jobAgentLogFilePath(java.io.File jobDirectory)
Compose the path to the agent log file for a job (after it has been relocated inside the job directory).- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
jobSetupLogFilePath
public static java.nio.file.Path jobSetupLogFilePath(java.io.File jobDirectory)
Compose the path to the setup log file for a job (sourcing of entities setup files).- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
jobEnvironmentLogFilePath
public static java.nio.file.Path jobEnvironmentLogFilePath(java.io.File jobDirectory)
Compose the path to the file where environment variables are dumped after running setup.- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
jobScriptPath
public static java.nio.file.Path jobScriptPath(java.io.File jobDirectory)
Compose the path to the job script (a.k.a. run file).- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
jobSetupErrorMarkerFilePath
public static java.nio.file.Path jobSetupErrorMarkerFilePath(java.io.File jobDirectory)
Compose the path to the marker file left behind if the script fails during setup.- Parameters:
jobDirectory
- the job directory- Returns:
- a Path
-
-