com.cloudera.cdk.morphline.stdio
Class AbstractParser

java.lang.Object
  extended by com.cloudera.cdk.morphline.base.AbstractCommand
      extended by com.cloudera.cdk.morphline.stdio.AbstractParser
All Implemented Interfaces:
Command

public abstract class AbstractParser
extends AbstractCommand

Base class for convenient implementation of morphline parsers.


Field Summary
static String SUPPORTED_MIME_TYPES
           
 
Fields inherited from class com.cloudera.cdk.morphline.base.AbstractCommand
LOG
 
Constructor Summary
AbstractParser(com.typesafe.config.Config config, Command parent, Command child, MorphlineContext context)
           
 
Method Summary
protected  void addSupportedMimeType(String mediaType)
           
protected  Charset detectCharset(Record record, Charset charset)
           
protected  boolean doProcess(Record record)
           
protected abstract  boolean doProcess(Record record, InputStream stream)
           
protected  void incrementNumRecords()
           
static void removeAttachments(Record outputRecord)
           
 
Methods inherited from class com.cloudera.cdk.morphline.base.AbstractCommand
buildCommand, buildCommandChain, doNotify, getChild, getConfig, getConfigs, getContext, getCounter, getHistogram, getMeter, getParent, getTimer, notify, process, validateArguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUPPORTED_MIME_TYPES

public static final String SUPPORTED_MIME_TYPES
See Also:
Constant Field Values
Constructor Detail

AbstractParser

public AbstractParser(com.typesafe.config.Config config,
                      Command parent,
                      Command child,
                      MorphlineContext context)
Method Detail

addSupportedMimeType

protected void addSupportedMimeType(String mediaType)

doProcess

protected boolean doProcess(Record record)
Overrides:
doProcess in class AbstractCommand

doProcess

protected abstract boolean doProcess(Record record,
                                     InputStream stream)
                              throws IOException
Throws:
IOException

incrementNumRecords

protected void incrementNumRecords()

detectCharset

protected Charset detectCharset(Record record,
                                Charset charset)

removeAttachments

public static void removeAttachments(Record outputRecord)


Copyright © 2013 Cloudera. All rights reserved.