@ThreadSafe @PublicApi public final class DistributedLoadCommand extends AbstractDistributedJobCommand
DEFAULT_ACTIVE_JOBS, mActiveJobs, mClient, mSubmittedJobAttempts, WAIT_OPTION
mFileSystem, mFsContext
Constructor and Description |
---|
DistributedLoadCommand(FileSystemContext fsContext)
Constructs a new instance to load a file or directory in Alluxio space.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Used to close resources created by commands.
|
String |
getCommandName()
Gets the command name as input from the shell.
|
String |
getDescription() |
org.apache.commons.cli.Options |
getOptions() |
String |
getUsage() |
int |
run(org.apache.commons.cli.CommandLine cl)
Runs the command.
|
Long |
runDistLoad(AlluxioURI filePath,
int replication,
int batchSize,
Set<String> workerSet,
Set<String> excludedWorkerSet,
Set<String> localityIds,
Set<String> excludedLocalityIds,
boolean directCache)
Run the actual distributedLoad command.
|
void |
validateArgs(org.apache.commons.cli.CommandLine cl)
Checks if the arguments are valid or throw InvalidArgumentException.
|
drain, getCompletedCmdCount, getCompletedCount, getFailedCmdCount, getFailedFiles, submit, waitForCmd, waitJob
processHeader, runPlainPath, runWildCardCmd
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSubCommands, hasSubCommand, parseAndValidateArgs
public DistributedLoadCommand(FileSystemContext fsContext)
fsContext
- the filesystem of Alluxiopublic String getCommandName()
Command
public org.apache.commons.cli.Options getOptions()
Options
of the commandpublic void validateArgs(org.apache.commons.cli.CommandLine cl) throws InvalidArgumentException
Command
cl
- the parsed command line for the argumentsInvalidArgumentException
- when arguments are not validpublic String getUsage()
public String getDescription()
public int run(org.apache.commons.cli.CommandLine cl) throws AlluxioException, IOException
Command
cl
- the parsed command line for the argumentsAlluxioException
IOException
public Long runDistLoad(AlluxioURI filePath, int replication, int batchSize, Set<String> workerSet, Set<String> excludedWorkerSet, Set<String> localityIds, Set<String> excludedLocalityIds, boolean directCache)
filePath
- file path to loadreplication
- Number of block replicas of each loaded filebatchSize
- Batch size for loadingworkerSet
- A set of worker hosts to load dataexcludedWorkerSet
- A set of worker hosts can not to load datalocalityIds
- The locality identify setexcludedLocalityIds
- A set of worker locality identify can not to load datadirectCache
- use direct cache request or cache through readpublic void close() throws IOException
Command
IOException
- if closing resources failsCopyright © 2023. All Rights Reserved.