|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kitesdk.morphline.base.AbstractCommand
public abstract class AbstractCommand
Base class for convenient implementation of Command
classes.
Field Summary | |
---|---|
protected org.slf4j.Logger |
LOG
|
Constructor Summary | |
---|---|
protected |
AbstractCommand(CommandBuilder builder,
com.typesafe.config.Config config,
Command parent,
Command child,
MorphlineContext context)
Using the given builder , constructs a command rooted at the given morphline JSON
config . |
protected |
AbstractCommand(com.typesafe.config.Config config,
Command parent,
Command child,
MorphlineContext context)
Deprecated. |
Method Summary | |
---|---|
protected Command |
buildCommand(com.typesafe.config.Config cmdConfig,
Command currentParent,
Command finalChild)
Factory method to create a command rooted at the given cmdConfig. |
protected List<Command> |
buildCommandChain(com.typesafe.config.Config rootConfig,
String configKey,
Command finalChild,
boolean ignoreNotifications)
Factory method to create the chain of commands rooted at the given rootConfig. |
protected void |
doNotify(Record notification)
Processes the given notification on the control plane of the subtree rooted at this command. |
protected boolean |
doProcess(Record record)
Processes the given record on the data plane of this command. |
protected Command |
getChild()
Returns the child of this command. |
protected com.typesafe.config.Config |
getConfig()
Returns the JSON configuration of this command. |
protected Configs |
getConfigs()
Returns a helper for convenient access to the JSON configuration of this command. |
protected MorphlineContext |
getContext()
Returns the context of this command. |
protected com.codahale.metrics.Counter |
getCounter(String... names)
Returns a counter for maintaining main-memory metrics. |
protected com.codahale.metrics.Histogram |
getHistogram(String... names)
Returns a histogram for maintaining main-memory metrics. |
protected com.codahale.metrics.Meter |
getMeter(String... names)
Returns a meter for maintaining main-memory metrics. |
Command |
getParent()
Returns the parent of this command. |
protected com.codahale.metrics.Timer |
getTimer(String... names)
Returns a timer for maintaining main-memory metrics. |
protected boolean |
isMeasuringMetrics()
Returns whether or not metrics should be measured. |
void |
notify(Record notification)
Processes the given notification on the control plane of the subtree rooted at this command. |
boolean |
process(Record record)
Processes the given record on the data plane of this command. |
protected void |
validateArguments()
Helper that checks if the user provided configuration parameters are valid. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.slf4j.Logger LOG
Constructor Detail |
---|
protected AbstractCommand(CommandBuilder builder, com.typesafe.config.Config config, Command parent, Command child, MorphlineContext context)
builder
, constructs a command rooted at the given morphline JSON
config
.
The command will feed records into child
. The command will have
parent
as it's parent. Additional parameters can be passed via the morphline
context
.
@Deprecated protected AbstractCommand(com.typesafe.config.Config config, Command parent, Command child, MorphlineContext context)
Method Detail |
---|
public Command getParent()
Command
getParent
in interface Command
protected Command getChild()
protected com.typesafe.config.Config getConfig()
protected MorphlineContext getContext()
protected Configs getConfigs()
public final void notify(Record notification)
Command
notify
in interface Command
protected void doNotify(Record notification)
public final boolean process(Record record)
Command
process
in interface Command
protected boolean doProcess(Record record)
protected void validateArguments()
protected com.codahale.metrics.Counter getCounter(String... names)
protected com.codahale.metrics.Histogram getHistogram(String... names)
protected com.codahale.metrics.Meter getMeter(String... names)
protected com.codahale.metrics.Timer getTimer(String... names)
protected final boolean isMeasuringMetrics()
protected List<Command> buildCommandChain(com.typesafe.config.Config rootConfig, String configKey, Command finalChild, boolean ignoreNotifications)
ignoreNotifications
- if true indicates don't forward notifications at the end of the chain of commands.
This is a feature that multi-branch commands like tryRules and ifThenElse need to
avoid sending a notification multiple times to finalChild, once from each branch.protected Command buildCommand(com.typesafe.config.Config cmdConfig, Command currentParent, Command finalChild)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |