Package alluxio.cli.fs.command
Class AbstractDistributedJobCommand
- java.lang.Object
-
- alluxio.cli.fs.command.AbstractFileSystemCommand
-
- alluxio.cli.fs.command.AbstractDistributedJobCommand
-
- All Implemented Interfaces:
alluxio.cli.Command,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
DistributedCpCommand,DistributedLoadCommand,DistributedMvCommand
public abstract class AbstractDistributedJobCommand extends AbstractFileSystemCommand
The base class for all the distributed job basedCommandclasses. It provides handling for submitting multiple jobs and handling retries of them.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.commons.cli.OptionASYNC_OPTIONprotected static intDEFAULT_ACTIVE_JOBSprotected intmActiveJobsprotected alluxio.client.job.JobMasterClientmClientprotected java.util.List<JobAttempt>mSubmittedJobAttempts-
Fields inherited from class alluxio.cli.fs.command.AbstractFileSystemCommand
mFileSystem, mFsContext
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDistributedJobCommand(alluxio.client.file.FileSystemContext fsContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddrain()intgetCompletedCmdCount()Gets the number of completed commands.intgetCompletedCount()Gets the number of completed jobs.intgetFailedCmdCount()Gets the number of failed commands.intgetFailedCount()Gets the number of failed jobs.java.util.Set<java.lang.String>getFailedFiles()Gets failed files.voidpostProcessing(long jobControlId)Do post-processing on the command information, including printing file paths and statistics.protected voidprocessFailures(java.lang.String arg, java.util.Set<java.lang.String> failures, java.lang.String logFileLocation)protected longsubmit(alluxio.job.CmdConfig cmdConfig)voidwaitForCmd(long jobControlId)Waits for command to complete.protected voidwaitJob()Waits for at least one job to complete.-
Methods inherited from class alluxio.cli.fs.command.AbstractFileSystemCommand
processHeader, runPlainPath, runWildCardCmd
-
-
-
-
Field Detail
-
DEFAULT_ACTIVE_JOBS
protected static final int DEFAULT_ACTIVE_JOBS
- See Also:
- Constant Field Values
-
ASYNC_OPTION
protected static final org.apache.commons.cli.Option ASYNC_OPTION
-
mSubmittedJobAttempts
protected java.util.List<JobAttempt> mSubmittedJobAttempts
-
mActiveJobs
protected int mActiveJobs
-
mClient
protected final alluxio.client.job.JobMasterClient mClient
-
-
Method Detail
-
drain
protected void drain()
-
submit
protected long submit(alluxio.job.CmdConfig cmdConfig)
-
waitJob
protected void waitJob()
Waits for at least one job to complete.
-
waitForCmd
public void waitForCmd(long jobControlId)
Waits for command to complete.- Parameters:
jobControlId-
-
postProcessing
public void postProcessing(long jobControlId)
Do post-processing on the command information, including printing file paths and statistics.- Parameters:
jobControlId-
-
processFailures
protected void processFailures(java.lang.String arg, java.util.Set<java.lang.String> failures, java.lang.String logFileLocation)
-
getCompletedCount
public int getCompletedCount()
Gets the number of completed jobs.- Returns:
- the number of completed job
-
getFailedCount
public int getFailedCount()
Gets the number of failed jobs.- Returns:
- number of failed jobs
-
getFailedCmdCount
public int getFailedCmdCount()
Gets the number of failed commands.- Returns:
- number of failed commands
-
getCompletedCmdCount
public int getCompletedCmdCount()
Gets the number of completed commands.- Returns:
- the number of completed commands
-
getFailedFiles
public java.util.Set<java.lang.String> getFailedFiles()
Gets failed files.- Returns:
- failed files
-
-