This project has retired. For details please refer to its Attic page.
FileSerdeFormatter (Lens 2.0.1-beta-incubating API)

org.apache.lens.lib.query
Class FileSerdeFormatter

java.lang.Object
  extended by org.apache.lens.lib.query.AbstractOutputFormatter
      extended by org.apache.lens.lib.query.WrappedFileFormatter
          extended by org.apache.lens.lib.query.FileSerdeFormatter
All Implemented Interfaces:
InMemoryOutputFormatter, QueryOutputFormatter

public class FileSerdeFormatter
extends WrappedFileFormatter
implements InMemoryOutputFormatter

File format which provides implementation for InMemoryOutputFormatter

This is a wrapped formatter, which serializes the rows of the result with configured serde. It would only accept the Serde's whose serialization class is Text


Field Summary
 
Fields inherited from class org.apache.lens.lib.query.WrappedFileFormatter
LOG
 
Fields inherited from class org.apache.lens.lib.query.AbstractOutputFormatter
HEADER_TYPE
 
Constructor Summary
FileSerdeFormatter()
          Instantiates a new file serde formatter.
 
Method Summary
 void init(QueryContext ctx, LensResultSetMetadata metadata)
          Initialize the formatter.
 void writeRow(ResultRow row)
          Write a row of the result.
 
Methods inherited from class org.apache.lens.lib.query.WrappedFileFormatter
close, commit, getEncoding, getFinalOutputPath, getNumRows, getTmpPath, writeFooter, writeHeader
 
Methods inherited from class org.apache.lens.lib.query.AbstractOutputFormatter
getMetadata
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.lens.server.api.query.QueryOutputFormatter
close, commit, getFinalOutputPath, getMetadata, getNumRows, writeFooter, writeHeader
 

Constructor Detail

FileSerdeFormatter

public FileSerdeFormatter()
Instantiates a new file serde formatter.

Method Detail

init

public void init(QueryContext ctx,
                 LensResultSetMetadata metadata)
          throws IOException
Description copied from interface: QueryOutputFormatter
Initialize the formatter.

Specified by:
init in interface QueryOutputFormatter
Overrides:
init in class WrappedFileFormatter
Parameters:
ctx - The QueryContext object
metadata - LensResultSetMetadata object
Throws:
IOException - Signals that an I/O exception has occurred.

writeRow

public void writeRow(ResultRow row)
              throws IOException
Description copied from interface: InMemoryOutputFormatter
Write a row of the result.

Specified by:
writeRow in interface InMemoryOutputFormatter
Parameters:
row - ResultRow object
Throws:
IOException - Signals that an I/O exception has occurred.


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