public class FlowProcessWrapper<Config> extends FlowProcess<Config>
FlowProcess.NullFlowProcess
NULL
Constructor and Description |
---|
FlowProcessWrapper(FlowProcess delegate) |
Modifier and Type | Method and Description |
---|---|
void |
closeTrapCollectors() |
<C> C |
copyConfig(C jobConf) |
FlowProcess |
copyWith(Config object) |
<C> java.util.Map<java.lang.String,java.lang.String> |
diffConfigIntoMap(C defaultConfig,
C updatedConfig) |
Config |
getConfig()
Method getConfig returns the actual instance of the underlying configuration instance.
|
Config |
getConfigCopy() |
long |
getCounterValue(java.lang.Enum counter)
Method getCounterValue is used to retrieve a counter value.
|
long |
getCounterValue(java.lang.String group,
java.lang.String counter)
Method getCounterValue is used to retrieve a counter value.
|
FlowSession |
getCurrentSession()
Method getCurrentSession returns the currentSession of this FlowProcess object.
|
int |
getCurrentSliceNum()
Method getCurrentSliceNum returns an integer representing which slice instance currently running.
|
FlowProcess |
getDelegate() |
java.lang.String |
getID()
Method getID() returns the current
|
int |
getNumProcessSlices()
Method getNumProcessSlices returns the number of parallel slices or tasks allocated
for this process execution.
|
java.lang.Object |
getProperty(java.lang.String key)
Method getProperty should be used to return configuration parameters from the underlying system.
|
java.util.Collection<java.lang.String> |
getPropertyKeys()
Method getPropertyKeys returns an immutable collection of all available property key values.
|
TupleEntryCollector |
getTrapCollectorFor(Tap trap)
Method getTrapCollectorFor will return a new
TupleEntryCollector if one hasn't previously
been created for the given trap Tap. |
void |
increment(java.lang.Enum counter,
long amount)
Method increment is used to increment a custom counter.
|
void |
increment(java.lang.String group,
java.lang.String counter,
long amount)
Method increment is used to increment a custom counter.
|
boolean |
isCounterStatusInitialized()
Method isCounterStatusInitialized returns true if it is safe to increment a counter or set a status.
|
void |
keepAlive()
Method keepAlive notifies the system that the current process is still alive.
|
Config |
mergeMapIntoConfig(Config defaultConfig,
java.util.Map<java.lang.String,java.lang.String> map) |
java.lang.Object |
newInstance(java.lang.String className)
Method newInstance creates a new object instance from the given className argument delegating to any
platform specific instantiation and configuration routines.
|
TupleEntryCollector |
openSystemIntermediateForWrite() |
TupleEntryIterator |
openTapForRead(Tap tap)
Method openTapForRead return a
TupleEntryIterator for the given Tap instance. |
TupleEntryCollector |
openTapForWrite(Tap tap)
Method openTapForWrite returns a (@link TupleCollector} for the given Tap instance.
|
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.
|
void |
setStatus(java.lang.String status)
Method setStatus is used to set the status of the current operation.
|
static FlowProcess |
undelegate(FlowProcess flowProcess) |
getBooleanProperty, getBooleanProperty, getIntegerProperty, getIntegerProperty, getStringProperty, getStringProperty, getTrapCollectors
public FlowProcessWrapper(FlowProcess delegate)
public static FlowProcess undelegate(FlowProcess flowProcess)
public FlowProcess getDelegate()
public FlowProcess copyWith(Config object)
copyWith
in class FlowProcess<Config>
public java.lang.String getID()
FlowProcess
getID
in class FlowProcess<Config>
public FlowSession getCurrentSession()
FlowProcess
getCurrentSession
in class FlowProcess<Config>
public void setCurrentSession(FlowSession currentSession)
FlowProcess
setCurrentSession
in class FlowProcess<Config>
currentSession
- the currentSession of this FlowProcess object.public int getNumProcessSlices()
FlowProcess
getNumProcessSlices
in class FlowProcess<Config>
public int getCurrentSliceNum()
FlowProcess
0
(zero) is the first slice instance.getCurrentSliceNum
in class FlowProcess<Config>
public java.lang.Object getProperty(java.lang.String key)
FlowProcess
getProperty
in class FlowProcess<Config>
key
- of type Stringpublic java.util.Collection<java.lang.String> getPropertyKeys()
FlowProcess
getPropertyKeys
in class FlowProcess<Config>
public java.lang.Object newInstance(java.lang.String className)
FlowProcess
newInstance
in class FlowProcess<Config>
public void keepAlive()
FlowProcess
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.keepAlive
in class FlowProcess<Config>
public void increment(java.lang.Enum counter, long amount)
FlowProcess
FlowProcess.isCounterStatusInitialized()
.increment
in class FlowProcess<Config>
counter
- of type Enumamount
- of type intpublic void increment(java.lang.String group, java.lang.String counter, long amount)
FlowProcess
FlowProcess.isCounterStatusInitialized()
.increment
in class FlowProcess<Config>
group
- of type Stringcounter
- of type Stringamount
- of type intpublic long getCounterValue(java.lang.Enum counter)
FlowProcess
FlowProcess.isCounterStatusInitialized()
.getCounterValue
in class FlowProcess<Config>
counter
- of type Enumpublic long getCounterValue(java.lang.String group, java.lang.String counter)
FlowProcess
FlowProcess.isCounterStatusInitialized()
.getCounterValue
in class FlowProcess<Config>
group
- of type Stringcounter
- of type Stringpublic void setStatus(java.lang.String status)
FlowProcess
FlowProcess.isCounterStatusInitialized()
.setStatus
in class FlowProcess<Config>
status
- of type Stringpublic boolean isCounterStatusInitialized()
FlowProcess
isCounterStatusInitialized
in class FlowProcess<Config>
public TupleEntryIterator openTapForRead(Tap tap) throws java.io.IOException
FlowProcess
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.openTapForRead
in class FlowProcess<Config>
tap
- of type Tapjava.io.IOException
- when there is a failure opening the resourcepublic TupleEntryCollector openTapForWrite(Tap tap) throws java.io.IOException
FlowProcess
openTapForWrite
in class FlowProcess<Config>
tap
- of type Tapjava.io.IOException
- when there is a failure opening the resourcepublic TupleEntryCollector openTrapForWrite(Tap trap) throws java.io.IOException
FlowProcess
openTrapForWrite
in class FlowProcess<Config>
trap
- of type Tapjava.io.IOException
- when there is a failure opening the resourcepublic TupleEntryCollector openSystemIntermediateForWrite() throws java.io.IOException
openSystemIntermediateForWrite
in class FlowProcess<Config>
java.io.IOException
public Config getConfig()
FlowProcess
FlowProcess.getConfigCopy()
for a modifiable instance.getConfig
in class FlowProcess<Config>
public Config getConfigCopy()
getConfigCopy
in class FlowProcess<Config>
public <C> C copyConfig(C jobConf)
copyConfig
in class FlowProcess<Config>
public <C> java.util.Map<java.lang.String,java.lang.String> diffConfigIntoMap(C defaultConfig, C updatedConfig)
diffConfigIntoMap
in class FlowProcess<Config>
public Config mergeMapIntoConfig(Config defaultConfig, java.util.Map<java.lang.String,java.lang.String> map)
mergeMapIntoConfig
in class FlowProcess<Config>
public TupleEntryCollector getTrapCollectorFor(Tap trap)
FlowProcess
TupleEntryCollector
if one hasn't previously
been created for the given trap Tap.getTrapCollectorFor
in class FlowProcess<Config>
public void closeTrapCollectors()
closeTrapCollectors
in class FlowProcess<Config>
Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.