public class IOUtils
extends java.lang.Object
Constructor and Description |
---|
IOUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.fs.Path |
getIntermediateVectorPath(org.apache.hadoop.mapreduce.TaskAttemptContext context,
java.lang.String prefix,
int blockId)
Returns a path of intermediate vector file.
|
static <T extends org.apache.hadoop.io.Writable> |
getIntermediateVectorReader(org.apache.hadoop.mapreduce.TaskAttemptContext context,
org.apache.hadoop.fs.Path path,
java.lang.Class<T> valueClass)
Opens the intermediate vector file and returns a reader object to read values from the file.
|
static <T extends org.apache.hadoop.io.Writable> |
getIntermediateVectorReader(org.apache.hadoop.mapreduce.TaskAttemptContext context,
java.lang.String prefix,
int blockId,
java.lang.Class<T> valueClass)
Opens the intermediate vector file and returns a reader object to read values from the file.
|
static <T extends org.apache.hadoop.io.Writable> |
getIntermediateVectorWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context,
org.apache.hadoop.fs.Path path)
Opens an intermediate vector file and returns a writer object to write values to the file.
|
static <T extends org.apache.hadoop.io.Writable> |
getIntermediateVectorWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context,
java.lang.String prefix,
int blockId)
Opens an intermediate vector file and returns a writer object to write values to the file.
|
static org.apache.hadoop.fs.Path |
getLocalTemporaryPath(java.lang.String name)
Returns a path of local temporary file.
|
static org.apache.hadoop.fs.Path |
getLocalTemporaryPath(java.lang.String name,
int id)
Returns a path of local temporary file.
|
static org.apache.hadoop.fs.Path |
getLocalTemporaryPath(java.lang.String name,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
Returns a path of local temporary file.
|
static org.apache.hadoop.io.compress.CompressionCodec |
getPreferredCompressionCodec(org.apache.hadoop.conf.Configuration conf)
Returns a codec object which is preferred.
|
static org.apache.hadoop.io.compress.CompressionCodec |
getPreferredCompressionCodec(org.apache.hadoop.mapreduce.TaskAttemptContext context)
Returns a codec object which is preferred.
|
static java.io.DataInputStream |
getTemporaryFileInputStream(org.apache.hadoop.fs.Path path,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
Opens the given local temporary file and returns an input stream object to read values from the file.
|
static java.io.DataOutputStream |
getTemporaryFileOutputStream(org.apache.hadoop.fs.Path path,
org.apache.hadoop.mapreduce.TaskAttemptContext context)
Creates a local temporary file and returns an output stream object to write values to the file.
|
public static org.apache.hadoop.fs.Path getIntermediateVectorPath(org.apache.hadoop.mapreduce.TaskAttemptContext context, java.lang.String prefix, int blockId) throws java.io.IOException
context
- The current execution contextprefix
- A prefix string of vector file nameblockId
- The id of vector blockjava.io.IOException
public static <T extends org.apache.hadoop.io.Writable> org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.IntWritable,T> getIntermediateVectorWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context, java.lang.String prefix, int blockId) throws java.io.IOException
T
- The type parameter of the values to be writtencontext
- The current execution contextprefix
- A prefix string of vector file nameblockId
- The id of vector blockjava.io.IOException
public static <T extends org.apache.hadoop.io.Writable> org.apache.hadoop.mapreduce.RecordWriter<org.apache.hadoop.io.IntWritable,T> getIntermediateVectorWriter(org.apache.hadoop.mapreduce.TaskAttemptContext context, org.apache.hadoop.fs.Path path) throws java.io.IOException
T
- The type parameter of the values to be writtencontext
- The current execution contextpath
- The path of intermediate vector filejava.io.IOException
public static <T extends org.apache.hadoop.io.Writable> org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.IntWritable,T> getIntermediateVectorReader(org.apache.hadoop.mapreduce.TaskAttemptContext context, java.lang.String prefix, int blockId, java.lang.Class<T> valueClass) throws java.io.IOException
T
- The type parameter of the values to be readcontext
- The current execution contextprefix
- A prefix string of vector file nameblockId
- The id of vector blockvalueClass
- A class of the values to be readjava.io.IOException
public static <T extends org.apache.hadoop.io.Writable> org.apache.hadoop.mapreduce.RecordReader<org.apache.hadoop.io.IntWritable,T> getIntermediateVectorReader(org.apache.hadoop.mapreduce.TaskAttemptContext context, org.apache.hadoop.fs.Path path, java.lang.Class<T> valueClass) throws java.io.IOException
T
- The type parameter of the values to be readcontext
- The current execution contextpath
- The path of intermediate vector filevalueClass
- A class of the values to be readjava.io.IOException
public static org.apache.hadoop.fs.Path getLocalTemporaryPath(java.lang.String name, org.apache.hadoop.mapreduce.TaskAttemptContext context)
name
- The name of temporary filecontext
- The current execution contextpublic static org.apache.hadoop.fs.Path getLocalTemporaryPath(java.lang.String name, int id)
name
- The name of temporary fileid
- A id of temporary filepublic static org.apache.hadoop.fs.Path getLocalTemporaryPath(java.lang.String name)
name
- A name of temporary filepublic static java.io.DataInputStream getTemporaryFileInputStream(org.apache.hadoop.fs.Path path, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws java.io.IOException
path
- The path of local temporary filecontext
- The current execution contextjava.io.IOException
public static java.io.DataOutputStream getTemporaryFileOutputStream(org.apache.hadoop.fs.Path path, org.apache.hadoop.mapreduce.TaskAttemptContext context) throws java.io.IOException
path
- A path of local temporary filecontext
- The current execution contextjava.io.IOException
public static org.apache.hadoop.io.compress.CompressionCodec getPreferredCompressionCodec(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration of current executionpublic static org.apache.hadoop.io.compress.CompressionCodec getPreferredCompressionCodec(org.apache.hadoop.mapreduce.TaskAttemptContext context)
context
- The current execution context