@NotThreadSafe public class DoraLoadJob extends AbstractJob<DoraLoadJob.DoraLoadTask>
Modifier and Type | Class and Description |
---|---|
class |
DoraLoadJob.DoraLoadTask
Dora load task.
|
Modifier and Type | Field and Description |
---|---|
static com.codahale.metrics.Counter |
JOB_LOAD_FAIL |
static com.codahale.metrics.Counter |
JOB_LOAD_FILE_COUNT |
static com.codahale.metrics.Counter |
JOB_LOAD_FILE_FAIL |
static com.codahale.metrics.Counter |
JOB_LOAD_FILE_SIZE |
static com.codahale.metrics.Meter |
JOB_LOAD_RATE |
static com.codahale.metrics.Counter |
JOB_LOAD_SUCCESS |
static String |
TYPE |
mEndTime, mJobId, mRetryTaskList, mStartTime, mState, mTaskIdGenerator, mUser, mWorkerAssignPolicy
Constructor and Description |
---|
DoraLoadJob(String path,
Optional<String> user,
String jobId,
OptionalLong bandwidth,
boolean usePartialListing,
boolean verificationEnabled,
boolean loadMetadataOnly,
boolean skipIfExists)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFileFailure(String fileUfsPath,
String type,
String message)
Add failed files.
|
boolean |
addFilesToRetry(String path,
String type,
String message)
Add files to retry.
|
void |
addLoadedBytes(long bytes)
Add bytes to total loaded bytes.
|
boolean |
equals(Object o) |
void |
failJob(AlluxioRuntimeException reason)
Set load state to FAILED with given reason.
|
OptionalLong |
getBandwidth()
Get bandwidth.
|
JobDescription |
getDescription() |
long |
getDurationInSec()
Get duration in seconds.
|
List<DoraLoadJob.DoraLoadTask> |
getNextTasks(Collection<WorkerInfo> workers) |
String |
getPath()
Get load file path.
|
String |
getProgress(JobProgressReportFormat format,
boolean verbose)
Get job progress.
|
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 |
needVerification()
Is verification enabled.
|
boolean |
processResponse(DoraLoadJob.DoraLoadTask doraLoadTask)
process task result.
|
void |
setJobSuccess()
set job as success.
|
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 com.codahale.metrics.Counter JOB_LOAD_SUCCESS
public static final com.codahale.metrics.Counter JOB_LOAD_FAIL
public static final com.codahale.metrics.Counter JOB_LOAD_FILE_COUNT
public static final com.codahale.metrics.Counter JOB_LOAD_FILE_FAIL
public static final com.codahale.metrics.Counter JOB_LOAD_FILE_SIZE
public static final com.codahale.metrics.Meter JOB_LOAD_RATE
public DoraLoadJob(String path, Optional<String> user, String jobId, OptionalLong bandwidth, boolean usePartialListing, boolean verificationEnabled, boolean loadMetadataOnly, boolean skipIfExists)
path
- file pathuser
- user for authenticationjobId
- job identifierbandwidth
- bandwidthusePartialListing
- whether to use partial listingverificationEnabled
- whether to verify the job after loadedloadMetadataOnly
- if set to true, only metadata will be loaded without loading
file dataskipIfExists
- skip if existspublic String getPath()
public JobDescription getDescription()
public OptionalLong getBandwidth()
public void updateBandwidth(OptionalLong bandwidth)
bandwidth
- new bandwidthpublic void failJob(AlluxioRuntimeException reason)
reason
- failure exceptionpublic void setJobSuccess()
Job
public void addLoadedBytes(long bytes)
bytes
- bytes to be added to totalpublic boolean addFilesToRetry(String path, String type, String message)
path
- the file pathtype
- the error typemessage
- the error messagepublic void addFileFailure(String fileUfsPath, String type, String message)
fileUfsPath
- message
- type
- public 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<DoraLoadJob.DoraLoadTask> getNextTasks(Collection<WorkerInfo> workers)
workers
- blocker to workerpublic Journal.JournalEntry toJournalEntry()
public long getDurationInSec()
public boolean processResponse(DoraLoadJob.DoraLoadTask doraLoadTask)
Job
doraLoadTask
- task containing result futurepublic boolean hasFailure()
public boolean needVerification()
Copyright © 2023. All Rights Reserved.