org.apache.lens.lib.query
Class LensFileOutputFormat

java.lang.Object
  extended by org.apache.hadoop.mapred.FileOutputFormat<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Text>
      extended by org.apache.lens.lib.query.LensFileOutputFormat
All Implemented Interfaces:
org.apache.hadoop.mapred.OutputFormat<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Text>

public class LensFileOutputFormat
extends org.apache.hadoop.mapred.FileOutputFormat<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Text>

File output format which would write Text values in the charset enconding passed.


Nested Class Summary
static class LensFileOutputFormat.LensRowWriter
          The Class LensRowWriter.
 
Nested classes/interfaces inherited from class org.apache.hadoop.mapred.FileOutputFormat
org.apache.hadoop.mapred.FileOutputFormat.Counter
 
Field Summary
static String NEWLINE
          The Constant NEWLINE.
static String UTF16LE
          The Constant UTF16LE.
static String UTF8
          The Constant UTF8.
 
Constructor Summary
LensFileOutputFormat()
           
 
Method Summary
static LensFileOutputFormat.LensRowWriter createRecordWriter(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.fs.Path tmpWorkPath, org.apache.hadoop.util.Progressable progress, boolean isCompressed, String extn, String encoding)
          Creates the record writer.
static boolean getCompressOutput(org.apache.hadoop.conf.Configuration conf)
          Gets the compress output.
 String getOuptutFileExtn(org.apache.hadoop.conf.Configuration conf)
          Gets the ouptut file extn.
static Class<? extends org.apache.hadoop.io.compress.CompressionCodec> getOutputCompressorClass(org.apache.hadoop.conf.Configuration conf)
          Gets the output compressor class.
 org.apache.hadoop.mapred.RecordWriter<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Text> getRecordWriter(org.apache.hadoop.fs.FileSystem ignored, org.apache.hadoop.mapred.JobConf job, String name, org.apache.hadoop.util.Progressable progress)
           
 String getResultEncoding(org.apache.hadoop.conf.Configuration conf)
          Gets the result encoding.
 
Methods inherited from class org.apache.hadoop.mapred.FileOutputFormat
checkOutputSpecs, getCompressOutput, getOutputCompressorClass, getOutputPath, getPathForCustomFile, getTaskOutputPath, getUniqueName, getWorkOutputPath, setCompressOutput, setOutputCompressorClass, setOutputPath, setWorkOutputPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF8

public static final String UTF8
The Constant UTF8.

See Also:
Constant Field Values

UTF16LE

public static final String UTF16LE
The Constant UTF16LE.

See Also:
Constant Field Values

NEWLINE

public static final String NEWLINE
The Constant NEWLINE.

See Also:
Constant Field Values
Constructor Detail

LensFileOutputFormat

public LensFileOutputFormat()
Method Detail

getRecordWriter

public org.apache.hadoop.mapred.RecordWriter<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Text> getRecordWriter(org.apache.hadoop.fs.FileSystem ignored,
                                                                                                                          org.apache.hadoop.mapred.JobConf job,
                                                                                                                          String name,
                                                                                                                          org.apache.hadoop.util.Progressable progress)
                                                                                                                   throws IOException
Specified by:
getRecordWriter in interface org.apache.hadoop.mapred.OutputFormat<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Text>
Specified by:
getRecordWriter in class org.apache.hadoop.mapred.FileOutputFormat<org.apache.hadoop.io.NullWritable,org.apache.hadoop.io.Text>
Throws:
IOException

createRecordWriter

public static LensFileOutputFormat.LensRowWriter createRecordWriter(org.apache.hadoop.conf.Configuration conf,
                                                                    org.apache.hadoop.fs.Path tmpWorkPath,
                                                                    org.apache.hadoop.util.Progressable progress,
                                                                    boolean isCompressed,
                                                                    String extn,
                                                                    String encoding)
                                                             throws IOException
Creates the record writer.

Parameters:
conf - the conf
tmpWorkPath - the tmp work path
progress - the progress
isCompressed - the is compressed
extn - the extn
encoding - the encoding
Returns:
the lens row writer
Throws:
IOException - Signals that an I/O exception has occurred.

getResultEncoding

public String getResultEncoding(org.apache.hadoop.conf.Configuration conf)
Gets the result encoding.

Parameters:
conf - the conf
Returns:
the result encoding

getOuptutFileExtn

public String getOuptutFileExtn(org.apache.hadoop.conf.Configuration conf)
Gets the ouptut file extn.

Parameters:
conf - the conf
Returns:
the ouptut file extn

getOutputCompressorClass

public static Class<? extends org.apache.hadoop.io.compress.CompressionCodec> getOutputCompressorClass(org.apache.hadoop.conf.Configuration conf)
Gets the output compressor class.

Parameters:
conf - the conf
Returns:
the output compressor class

getCompressOutput

public static boolean getCompressOutput(org.apache.hadoop.conf.Configuration conf)
Gets the compress output.

Parameters:
conf - the conf
Returns:
the compress output


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.