|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcascading.flow.FlowProcess<Config>
public abstract class FlowProcess<Config>
FlowProcess implementations provide a call-back interface into the current computing system. Each
Operation
is given a reference to a particular implementation, allowing it
to get configuration properties, send a "keep alive" ping, or to set a counter value.
Flow
.
Thus, a call to increment(Enum, long)
may start incrementing from zero if the operation making the call
belongs to a subsequent 'job' or 'step' from any previous operations calling increment.
A FlowProcess is roughly a child of FlowSession
. FlowSession is roughly one to one with a particular Flow
.
And every FlowSession will have one or more FlowProcesses.
FlowSession
Nested Class Summary | |
---|---|
static class |
FlowProcess.NullFlowProcess
|
Field Summary | |
---|---|
static FlowProcess |
NULL
Field NULL is a noop implementation of FlowSession. |
Constructor Summary | |
---|---|
protected |
FlowProcess()
|
protected |
FlowProcess(FlowSession currentSession)
|
Method Summary | |
---|---|
abstract Config |
copyConfig(Config jobConf)
|
abstract FlowProcess |
copyWith(Config config)
|
abstract Map<String,String> |
diffConfigIntoMap(Config defaultConfig,
Config updatedConfig)
|
Boolean |
getBooleanProperty(String key)
Method getBooleanProperty should be used to return configuration parameters from the underlying system. |
boolean |
getBooleanProperty(String key,
boolean defaultValue)
Method getBooleanProperty should be used to return configuration parameters from the underlying system. |
abstract Config |
getConfigCopy()
|
FlowSession |
getCurrentSession()
Method getCurrentSession returns the currentSession of this FlowProcess object. |
abstract int |
getCurrentSliceNum()
Method getCurrentSliceNum returns an integer representing which slice instance currently running. |
String |
getID()
Method getID() returns the current |
Integer |
getIntegerProperty(String key)
Method getIntegerProperty should be used to return configuration parameters from the underlying system. |
int |
getIntegerProperty(String key,
int defaultValue)
Method getIntegerProperty should be used to return configuration parameters from the underlying system. |
abstract int |
getNumProcessSlices()
Method getNumProcessSlices returns the number of parallel slices or tasks allocated for this process execution. |
abstract Object |
getProperty(String key)
Method getProperty should be used to return configuration parameters from the underlying system. |
abstract Collection<String> |
getPropertyKeys()
Method getPropertyKeys returns an immutable collection of all available property key values. |
String |
getStringProperty(String key)
Method getStringProperty should be used to return configuration parameters from the underlying system. |
String |
getStringProperty(String key,
String defaultValue)
Method getStringProperty should be used to return configuration parameters from the underlying system. |
abstract void |
increment(Enum counter,
long amount)
Method increment is used to increment a custom counter. |
abstract void |
increment(String group,
String counter,
long amount)
Method increment is used to increment a custom counter. |
abstract boolean |
isCounterStatusInitialized()
Method isCounterStatusInitialized returns true if it is safe to increment a counter or set a status. |
abstract void |
keepAlive()
Method keepAlive notifies the system that the current process is still alive. |
abstract Config |
mergeMapIntoConfig(Config defaultConfig,
Map<String,String> map)
|
abstract Object |
newInstance(String className)
Method newInstance creates a new object instance from the given className argument delegating to any platform specific instantiation and configuration routines. |
abstract TupleEntryCollector |
openSystemIntermediateForWrite()
|
abstract TupleEntryIterator |
openTapForRead(Tap tap)
Method openTapForRead return a TupleEntryIterator for the given Tap instance. |
abstract TupleEntryCollector |
openTapForWrite(Tap tap)
Method openTapForWrite returns a (@link TupleCollector} for the given Tap instance. |
abstract TupleEntryCollector |
openTrapForWrite(Tap trap)
Method openTrapForWrite returns a (@link TupleCollector} for the given Tap instance. |
void |
setCurrentSession(FlowSession currentSession)
Method setCurrentSession sets the currentSession of this FlowProcess object. |
abstract void |
setStatus(String status)
Method setStatus is used to set the status of the current operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static FlowProcess NULL
Constructor Detail |
---|
protected FlowProcess()
protected FlowProcess(FlowSession currentSession)
Method Detail |
---|
public abstract FlowProcess copyWith(Config config)
public String getID()
public FlowSession getCurrentSession()
public void setCurrentSession(FlowSession currentSession)
currentSession
- the currentSession of this FlowProcess object.public abstract int getNumProcessSlices()
public abstract int getCurrentSliceNum()
0
(zero) is the first slice instance.
public abstract Object getProperty(String key)
key
- of type String
public String getStringProperty(String key)
key
- of type String,
public String getStringProperty(String key, String defaultValue)
key
- of type String,defaultValue
- of type String,
defaultValue
if property is not setpublic Integer getIntegerProperty(String key)
key
- of type String,
public int getIntegerProperty(String key, int defaultValue)
key
- of type String,defaultValue
- of type int,
defaultValue
if property is not setpublic Boolean getBooleanProperty(String key)
key
- of type Boolean, null if property is not set
public boolean getBooleanProperty(String key, boolean defaultValue)
key
- of type StringdefaultValue
- of type boolean
defaultValue
if property is not setpublic abstract Collection<String> getPropertyKeys()
public abstract Object newInstance(String className)
className
-
public abstract void keepAlive()
Operation
takes some moments to complete. Each system is different, so calling
ping every few seconds to every minute or so would be best.
This method will fail silently if the underlying mechanism to notify keepAlive status are not initialized.
public abstract void increment(Enum counter, long amount)
isCounterStatusInitialized()
.
counter
- of type Enumamount
- of type intpublic abstract void increment(String group, String counter, long amount)
isCounterStatusInitialized()
.
group
- of type Stringcounter
- of type Stringamount
- of type intpublic abstract void setStatus(String status)
isCounterStatusInitialized()
.
status
- of type Stringpublic abstract boolean isCounterStatusInitialized()
public abstract TupleEntryIterator openTapForRead(Tap tap) throws IOException
TupleEntryIterator
for the given Tap instance.
Note the returned iterator will return the same instance of TupleEntry
on every call,
thus a copy must be made of either the TupleEntry or the underlying Tuple
instance if they are to be
stored in a Collection.
tap
- of type Tap
IOException
- when there is a failure opening the resourcepublic abstract TupleEntryCollector openTapForWrite(Tap tap) throws IOException
tap
- of type Tap
IOException
- when there is a failure opening the resourcepublic abstract TupleEntryCollector openTrapForWrite(Tap trap) throws IOException
trap
- of type Tap
IOException
- when there is a failure opening the resourcepublic abstract TupleEntryCollector openSystemIntermediateForWrite() throws IOException
IOException
public abstract Config getConfigCopy()
public abstract Config copyConfig(Config jobConf)
public abstract Map<String,String> diffConfigIntoMap(Config defaultConfig, Config updatedConfig)
public abstract Config mergeMapIntoConfig(Config defaultConfig, Map<String,String> map)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |