public class StageResourceDriver extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
static class |
StageResourceDriver.AccessMode
Represents the access mode for
StageResourceDriver . |
Constructor and Description |
---|
StageResourceDriver(org.apache.hadoop.mapreduce.JobContext context)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
static void |
add(org.apache.hadoop.mapreduce.Job job,
String resourcePath,
String resourceName)
Adds a resource path into the target job object.
|
void |
close() |
static long |
estimateResourceSize(org.apache.hadoop.mapreduce.JobContext context)
Returns the estimated resource data-size.
|
List<org.apache.hadoop.fs.Path> |
findCache(String resourceName)
Returns the paths for the specified resource.
|
static StageResourceDriver.AccessMode |
getAccessMode(org.apache.hadoop.mapreduce.JobContext context)
Returns the access mode for stage resources in the job.
|
org.apache.hadoop.conf.Configuration |
getConfiguration()
Returns the current configuration.
|
static void |
setAccessMode(org.apache.hadoop.mapreduce.JobContext context,
StageResourceDriver.AccessMode mode)
Sets the access mode for stage resources in the job.
|
public StageResourceDriver(org.apache.hadoop.mapreduce.JobContext context) throws IOException
context
- the current job contextIOException
- if failed to initialize this driverIllegalArgumentException
- if the parameter is null
public org.apache.hadoop.conf.Configuration getConfiguration()
public List<org.apache.hadoop.fs.Path> findCache(String resourceName) throws IOException
resourceName
- the target resource nameIOException
- if error occurred while extracting resource pathsIllegalArgumentException
- if the parameter is null
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public static void add(org.apache.hadoop.mapreduce.Job job, String resourcePath, String resourceName) throws IOException
job
- the target jobresourcePath
- the resource path expression (this must be accessible from task execution nodes)resourceName
- the resource nameIOException
- if failed to detect resources on the pathIllegalArgumentException
- if some parameters are null
public static long estimateResourceSize(org.apache.hadoop.mapreduce.JobContext context) throws InterruptedException
context
- the current job contextInterruptedException
- if interrupted whileIllegalArgumentException
- if some parameters were null
public static StageResourceDriver.AccessMode getAccessMode(org.apache.hadoop.mapreduce.JobContext context)
context
- the current job contextpublic static void setAccessMode(org.apache.hadoop.mapreduce.JobContext context, StageResourceDriver.AccessMode mode)
context
- the current job contextmode
- the access modeCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.