org.apache.lens.lib.query
Class AbstractFileFormatter
java.lang.Object
org.apache.lens.lib.query.AbstractOutputFormatter
org.apache.lens.lib.query.AbstractFileFormatter
- All Implemented Interfaces:
- FileFormatter, QueryOutputFormatter
- Direct Known Subclasses:
- HadoopFileFormatter, ZipFileFormatter
public abstract class AbstractFileFormatter
- extends AbstractOutputFormatter
- implements FileFormatter
Abstract implementation of FileFormatter, which gets column details from AbstractOutputFormatter.
AbstractFileFormatter
public AbstractFileFormatter()
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 AbstractOutputFormatter
- Parameters:
ctx - The QueryContext objectmetadata - LensResultSetMetadata object
- Throws:
IOException - Signals that an I/O exception has occurred.
getNumRows
public int getNumRows()
- Description copied from interface:
QueryOutputFormatter
- Get total number of rows in result.
- Specified by:
getNumRows in interface QueryOutputFormatter
- Returns:
- Total number of rows, return -1, if not known
writeHeader
public void writeHeader()
throws IOException
- Description copied from interface:
QueryOutputFormatter
- Write the header.
- Specified by:
writeHeader in interface QueryOutputFormatter
- Throws:
IOException - Signals that an I/O exception has occurred.
writeFooter
public void writeFooter()
throws IOException
- Description copied from interface:
QueryOutputFormatter
- Write the footer.
- Specified by:
writeFooter in interface QueryOutputFormatter
- Throws:
IOException - Signals that an I/O exception has occurred.
getFinalOutputPath
public String getFinalOutputPath()
- Description copied from interface:
QueryOutputFormatter
- Get final location where formatted output is available
- Specified by:
getFinalOutputPath in interface QueryOutputFormatter
- Returns:
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.