@NotThreadSafe public class MoveJob extends AbstractJob<MoveJob.MoveTask>
Modifier and Type | Class and Description |
---|---|
class |
MoveJob.MoveTask
Moves blocks in a UFS through an Alluxio worker.
|
Modifier and Type | Field and Description |
---|---|
static com.codahale.metrics.Counter |
JOB_MOVE_FAIL |
static com.codahale.metrics.Counter |
JOB_MOVE_SUCCESS |
static com.codahale.metrics.Counter |
MOVE_FAIL_FILE_COUNT |
static com.codahale.metrics.Counter |
MOVE_FILE_COUNT |
static com.codahale.metrics.Meter |
MOVE_RATE |
static com.codahale.metrics.Counter |
MOVE_SIZE |
static java.util.function.Predicate<FileInfo> |
QUALIFIED_FILE_FILTER |
static String |
TYPE |
mEndTime, mJobId, mRetryTaskList, mStartTime, mState, mTaskIdGenerator, mUser, mWorkerAssignPolicy
Constructor and Description |
---|
MoveJob(String src,
String dst,
boolean overwrite,
Optional<String> user,
String jobId,
OptionalLong bandwidth,
boolean usePartialListing,
boolean verificationEnabled,
boolean checkContent,
Iterable<FileInfo> fileIterable,
Optional<Job.FileFilter> filter)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFailure(String src,
String message,
int code)
Add a block to failure summary.
|
void |
addMovedBytes(long bytes)
Add bytes to total moved bytes.
|
boolean |
addToRetry(Route route)
Add a route to retry later.
|
boolean |
equals(Object o) |
void |
failJob(AlluxioRuntimeException reason)
Set move state to FAILED with given reason.
|
OptionalLong |
getBandwidth()
Get bandwidth.
|
JobDescription |
getDescription() |
long |
getDurationInSec()
Get duration in seconds.
|
List<Route> |
getNextRoutes(int count)
Get next batch of blocks.
|
List<MoveJob.MoveTask> |
getNextTasks(Collection<WorkerInfo> workers)
get next move task.
|
String |
getProgress(JobProgressReportFormat format,
boolean verbose)
Get job progress.
|
String |
getSrc() |
boolean |
hasFailure() |
int |
hashCode() |
void |
initiateVerification()
Initiate a verification pass.
|
boolean |
isCurrentPassDone()
Check whether the current pass is finished.
|
boolean |
isHealthy()
Check whether the job is healthy.
|
boolean |
isVerificationEnabled()
Is verification enabled.
|
boolean |
needVerification()
Is verification enabled.
|
boolean |
processResponse(MoveJob.MoveTask task)
process task result.
|
void |
setJobSuccess()
set job as success.
|
void |
setVerificationEnabled(boolean enableVerification)
Enable verification.
|
Journal.JournalEntry |
toJournalEntry() |
String |
toString() |
void |
updateBandwidth(OptionalLong bandwidth)
Update bandwidth.
|
getEndTime, getJobId, getJobState, getWorkerAssignPolicy, initializeJob, isDone, isRunning, onTaskSubmitFailure, setEndTime, setJobState, setStartTime, setWorkerAssignPolicy
public static final String TYPE
public static final java.util.function.Predicate<FileInfo> QUALIFIED_FILE_FILTER
public static final com.codahale.metrics.Counter JOB_MOVE_SUCCESS
public static final com.codahale.metrics.Counter JOB_MOVE_FAIL
public static final com.codahale.metrics.Counter MOVE_FILE_COUNT
public static final com.codahale.metrics.Counter MOVE_FAIL_FILE_COUNT
public static final com.codahale.metrics.Counter MOVE_SIZE
public static final com.codahale.metrics.Meter MOVE_RATE
public MoveJob(String src, String dst, boolean overwrite, Optional<String> user, String jobId, OptionalLong bandwidth, boolean usePartialListing, boolean verificationEnabled, boolean checkContent, Iterable<FileInfo> fileIterable, Optional<Job.FileFilter> filter)
src
- file sourcedst
- file destinationoverwrite
- whether to overwrite the fileuser
- user for authenticationjobId
- job identifierbandwidth
- bandwidthusePartialListing
- whether to use partial listingverificationEnabled
- whether to verify the job after movedcheckContent
- whether to check contentfileIterable
- file iterablefilter
- file filterpublic String getSrc()
public JobDescription getDescription()
public OptionalLong getBandwidth()
public void updateBandwidth(OptionalLong bandwidth)
bandwidth
- new bandwidthpublic boolean isVerificationEnabled()
public boolean needVerification()
public void setVerificationEnabled(boolean enableVerification)
enableVerification
- whether to enable verificationpublic void failJob(AlluxioRuntimeException reason)
reason
- failure exceptionpublic void setJobSuccess()
Job
public void addMovedBytes(long bytes)
bytes
- bytes to be added to totalpublic String getProgress(JobProgressReportFormat format, boolean verbose)
Job
format
- progress report formatverbose
- whether to include detailed informationpublic boolean isHealthy()
Job
public boolean isCurrentPassDone()
Job
public void initiateVerification()
Job
public List<MoveJob.MoveTask> getNextTasks(Collection<WorkerInfo> workers)
workers
- workers candidatespublic List<Route> getNextRoutes(int count)
count
- number of blockspublic boolean addToRetry(Route route)
route
- the route to retrypublic void addFailure(String src, String message, int code)
src
- the source path of the file that failedmessage
- failure messagecode
- status code for exceptionpublic Journal.JournalEntry toJournalEntry()
public long getDurationInSec()
public boolean processResponse(MoveJob.MoveTask task)
Job
task
- task containing result futurepublic boolean hasFailure()
Copyright © 2023. All Rights Reserved.