@NotThreadSafe public class LoadJob extends Object
Constructor and Description |
---|
LoadJob(String path,
Optional<String> user,
String jobId,
OptionalLong bandwidth,
boolean usePartialListing,
boolean verificationEnabled)
Constructor.
|
LoadJob(String path,
String user,
OptionalLong bandwidth)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addBlockFailure(Block block,
String message,
int code)
Add a block to failure summary.
|
boolean |
addBlockToRetry(Block block)
Add a block to retry later.
|
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.
|
static LoadJob |
fromJournalEntry(Job.LoadJobEntry loadJobEntry)
Get journal entry of the job.
|
OptionalLong |
getBandwidth()
Get bandwidth.
|
int |
getBatchSize()
Get batch size.
|
long |
getCurrentBlockCount()
Get the processed block count in the current loading pass.
|
long |
getDurationInSec()
Get duration in seconds.
|
OptionalLong |
getEndTime()
Get end time.
|
String |
getJobId()
Get uniq tag.
|
LoadJobState |
getJobState()
Get load status.
|
List<Block> |
getNextBatch(FileSystemMaster fileSystemMaster,
int count)
Get next batch of blocks.
|
String |
getPath()
Get load file path.
|
String |
getProgress(LoadProgressReportFormat format,
boolean verbose)
Get load job progress.
|
long |
getTotalBlockCount()
Get the total processed block count for this job.
|
Optional<String> |
getUser()
Get user.
|
int |
hashCode() |
void |
initiateVerification()
Initiate a verification pass.
|
boolean |
isCurrentLoadDone()
Check whether the current loading pass is finished.
|
boolean |
isDone()
Check whether the load job is finished.
|
boolean |
isHealthy()
Check whether the load job is healthy.
|
boolean |
isRunning()
Check whether the load job is still running.
|
boolean |
isVerificationEnabled()
Is verification enabled.
|
void |
setEndTime(long time)
Update end time.
|
void |
setJobState(LoadJobState state)
Set load state.
|
void |
setVerificationEnabled(boolean enableVerification)
Enable verification.
|
Journal.JournalEntry |
toJournalEntry() |
String |
toString() |
void |
updateBandwidth(OptionalLong bandwidth)
Update bandwidth.
|
public LoadJob(String path, String user, OptionalLong bandwidth)
path
- file pathuser
- user for authenticationbandwidth
- bandwidthpublic LoadJob(String path, Optional<String> user, String jobId, OptionalLong bandwidth, boolean usePartialListing, boolean verificationEnabled)
path
- file pathuser
- user for authenticationjobId
- job identifierbandwidth
- bandwidthusePartialListing
- whether to use partial listingverificationEnabled
- whether to verify the job after loadedpublic String getPath()
public OptionalLong getEndTime()
public OptionalLong getBandwidth()
public void setEndTime(long time)
time
- time in mspublic void updateBandwidth(OptionalLong bandwidth)
bandwidth
- new bandwidthpublic boolean isVerificationEnabled()
public void setVerificationEnabled(boolean enableVerification)
enableVerification
- whether to enable verificationpublic LoadJobState getJobState()
public void setJobState(LoadJobState state)
state
- new statepublic String getJobId()
public void failJob(AlluxioRuntimeException reason)
reason
- failure exceptionpublic int getBatchSize()
public void addLoadedBytes(long bytes)
bytes
- bytes to be added to totalpublic String getProgress(LoadProgressReportFormat format, boolean verbose)
format
- report formatverbose
- whether to include error details in the reportpublic long getCurrentBlockCount()
public long getTotalBlockCount()
public boolean isHealthy()
public boolean isRunning()
public boolean isDone()
public boolean isCurrentLoadDone()
public void initiateVerification()
public List<Block> getNextBatch(FileSystemMaster fileSystemMaster, int count)
fileSystemMaster
- file system master to fetch file infoscount
- number of blockspublic boolean addBlockToRetry(Block block)
block
- the block that failed to load thus needing retrypublic void addBlockFailure(Block block, String message, int code)
block
- the block that failed to load and cannot be retriedmessage
- failure messagecode
- status code for exceptionpublic Journal.JournalEntry toJournalEntry()
public static LoadJob fromJournalEntry(Job.LoadJobEntry loadJobEntry)
loadJobEntry
- journal entrypublic long getDurationInSec()
Copyright © 2023. All Rights Reserved.