org.apache.lens.lib.query
Class AbstractOutputFormatter

java.lang.Object
  extended by org.apache.lens.lib.query.AbstractOutputFormatter
All Implemented Interfaces:
QueryOutputFormatter
Direct Known Subclasses:
AbstractFileFormatter, WrappedFileFormatter

public abstract class AbstractOutputFormatter
extends Object
implements QueryOutputFormatter

Provides abstract implementation of the query output formatter.

In this it initializes column names, types column object inspectors Also provides methods to construct header from serde


Field Summary
static String HEADER_TYPE
          The Constant HEADER_TYPE.
 
Constructor Summary
AbstractOutputFormatter()
           
 
Method Summary
 LensResultSetMetadata getMetadata()
          Get resultset metadata
 void init(QueryContext ctx, LensResultSetMetadata metadata)
          Initialize the formatter.
 
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, getNumRows, writeFooter, writeHeader
 

Field Detail

HEADER_TYPE

public static final String HEADER_TYPE
The Constant HEADER_TYPE.

See Also:
Constant Field Values
Constructor Detail

AbstractOutputFormatter

public AbstractOutputFormatter()
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
Parameters:
ctx - The QueryContext object
metadata - LensResultSetMetadata object
Throws:
IOException - Signals that an I/O exception has occurred.

getMetadata

public LensResultSetMetadata getMetadata()
Description copied from interface: QueryOutputFormatter
Get resultset metadata

Specified by:
getMetadata in interface QueryOutputFormatter
Returns:
LensResultSetMetadata


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