public final class MigrateDefinition extends AbstractVoidJobDefinition<MigrateConfig,ArrayList<MigrateCommand>>
mv
or cp
, the source will not be nested inside the destination when
the destination is a directory. This makes it so that the migrate job is idempotent when the
overwrite flag is set.
Suppose we have this directory structure, where a to e are directories and f1 to f3 are files:
├── a
│ ├── e
│ │ └── f2
│ └── f1
└── b
└── d
└── e
└── f3
Migrating a to b with source deleted (mv
) will result in
├── b
├── d
├── e
│ └── f2
│ └── f3
└── f1
Migrating a to b with source kept (cp
) will result in
├── a
│ ├── e
│ │ └── f2
│ └── f1
└── b
├── d
├── e
│ └── f2
│ └── f3
└── f1Constructor and Description |
---|
MigrateDefinition()
Constructs a new
MigrateDefinition . |
Modifier and Type | Method and Description |
---|---|
Class<MigrateConfig> |
getJobConfigClass() |
SerializableVoid |
runTask(MigrateConfig config,
ArrayList<MigrateCommand> commands,
RunTaskContext context)
Runs the task in the executor.
|
Map<WorkerInfo,ArrayList<MigrateCommand>> |
selectExecutors(MigrateConfig config,
List<WorkerInfo> jobWorkerInfoList,
SelectExecutorsContext context)
Selects the workers to run the task.
|
join
public MigrateDefinition()
MigrateDefinition
.public Map<WorkerInfo,ArrayList<MigrateCommand>> selectExecutors(MigrateConfig config, List<WorkerInfo> jobWorkerInfoList, SelectExecutorsContext context) throws Exception
config
- the job configurationjobWorkerInfoList
- the list of available workers' informationcontext
- the context containing information used to select executorsException
- if any error occurspublic SerializableVoid runTask(MigrateConfig config, ArrayList<MigrateCommand> commands, RunTaskContext context) throws Exception
config
- the job configurationcommands
- the arguments passed incontext
- the context containing information used to execute a taskException
- if any error occurspublic Class<MigrateConfig> getJobConfigClass()
JobConfig
Copyright © 2023. All Rights Reserved.