public abstract class MapReduceBase extends OperationBase implements Map, Reduce
Map and Reduce interface.Operation.OperationType| Modifier and Type | Field and Description |
|---|---|
protected ds.funnel.topic.Topic |
defaultOutputStream |
protected StreamDataset |
mapReduceDataset |
static String |
MODULE |
| Constructor and Description |
|---|
MapReduceBase() |
| Modifier and Type | Method and Description |
|---|---|
int |
addMap(Map map)
Adds a Map that will be reduced.
|
protected void |
addMapper(Map map)
This method is called on a Reduce, once it has been added to a
Map using the Map.addReduce() method. |
int |
addReduce(Reduce reduce)
Adds a Reduce for this particular Map.
|
protected void |
addReducer(Reduce reduce)
This method is called on a Map, once it has been added to a
Reduce using the Reduce.addMap() method. |
Results |
createResults(boolean completeResult,
boolean processingComplete)
Create the
Results type to be used for reporting results
produced as a result of the processing. |
Iterator<String> |
getAwaitingOutputsFrom()
Retrieves the set of Map identifiers from which an Output has not been
received so far.
|
DatasetCollection |
getDatasetCollection()
Retrieve the dataset that is associated with this particular operation.
|
Enumeration<String> |
getMapIdentifiers()
Retrieves the set of Map identifiers
|
protected StreamDataset |
getMapReduceDataset() |
int |
getNumberOfMaps()
Retrieves the number of registered Map instances
|
int |
getNumberOfReducers()
Retrieves the number of registered Reduce instances
|
Enumeration<String> |
getReduceIdentifiers()
Retrieves the set of Reduce identifiers
|
boolean |
isAwaitingOutputs()
Check to see is the Reducer is missing outputs from any of the registered
Maps.
|
void |
marshall(ds.funnel.data.format.FormatWriter mFormat) |
int |
removeMap(String mapIdentifier)
Removes a Map from the list of Maps that are registered to this reducer.
|
protected void |
removeMapper(Map map)
This method is called on a Reduce, once it has been removed from a
Map using the Map.removeReduce() method. |
int |
removeReduce(String reduceIdentifier)
Removes a given reducer from the list of Reducers for a given Map
function.
|
protected void |
removeReducer(Reduce reduce)
This method is called on a Map, once it has been removed from a
Reduce using the Reduce.removeMap() method. |
void |
resetOutputTracker()
This method resets the output tracker associated with the reducer.
|
void |
setReceivedOutputFrom(String mapIdentifier)
Mark the receipt of Output from a given Map instance
|
void |
unmarshall(ds.funnel.data.format.FormatReader mFormat)
Unmarshall the operation from a set of marshalled bytes.
|
void |
writeResults(int synopsisType,
String streamSynopsis,
Results results)
Deprecated.
|
void |
writeResults(Results results)
Writes the specified results to the default output stream.
|
void |
writeResults(String streamSynopsis,
Results results)
Deprecated.
|
void |
writeResults(ds.funnel.topic.Topic topic,
Results results)
Writes the specified results to a specific output stream.
|
changeToExecuteFixedNumberOfTimes, changeToExecuteOnce, changeToExecutePeriodically, changeToExecuteWhenDataAvailable, changeToStayAlive, dispose, execute, getDomain, getExecutionProfile, getInstanceIdentifier, getOperationIdentifier, getProcessingDirectives, getVersionInformation, hasDatasetCollection, hasExecutionProfile, hasProcessingDirectives, initialize, isInitialized, markInitializationAsComplete, needsInitialization, setAsExecuteContinuously, setAsExecuteFixedNumberOfTimes, setAsExecuteOnce, setAsExecutePeriodically, setAsExecuteWhenDataAvailable, setAsStayAlive, setDatasetCollection, setDomain, setInitializationComplete, setInitializationNeeded, setInstanceIdentifier, setOperationIdentifier, setProcessingDirectives, setTeminationConditionReached, setVersionInformation, terminationConditionReached, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdispose, execute, getDomain, getExecutionProfile, getInstanceIdentifier, getOperationIdentifier, getProcessingDirectives, getVersionInformation, hasDatasetCollection, hasExecutionProfile, hasProcessingDirectives, initialize, isInitialized, needsInitialization, terminationConditionReached, toStringpublic static final String MODULE
protected StreamDataset mapReduceDataset
protected ds.funnel.topic.Topic defaultOutputStream
public void unmarshall(ds.funnel.data.format.FormatReader mFormat)
throws ds.funnel.data.format.FormatException
Operationunmarshall in interface Operationunmarshall in class OperationBasemFormat - The byte[] representation of the operation.ds.funnel.data.format.FormatExceptionpublic void marshall(ds.funnel.data.format.FormatWriter mFormat)
throws ds.funnel.data.format.FormatException
marshall in interface ds.funnel.data.format.FormatMarshallermarshall in class OperationBaseds.funnel.data.format.FormatExceptionpublic DatasetCollection getDatasetCollection()
OperationgetDatasetCollection in interface OperationgetDatasetCollection in class OperationBaseprotected StreamDataset getMapReduceDataset()
public int addReduce(Reduce reduce) throws MapReduceException
MapaddReduce in interface Mapreduce - The Reducer that will be added to this MapMapReduceException - If there are problems in adding this Reducepublic int removeReduce(String reduceIdentifier) throws MapReduceException
MapremoveReduce in interface MapreduceIdentifier - The identifier of the Reduce to be removedMapReduceException - If there are problems during removal.public int getNumberOfReducers()
MapgetNumberOfReducers in interface Mappublic Enumeration<String> getReduceIdentifiers()
MapgetReduceIdentifiers in interface Mappublic int addMap(Map map) throws MapReduceException
ReduceaddMap in interface Reducemap - Add a Map instance for this reducerMapReduceExceptionpublic int removeMap(String mapIdentifier) throws MapReduceException
ReduceremoveMap in interface ReducemapIdentifier - The identifier of the Map to removedMapReduceException - If there are problems removing the Map.public Enumeration<String> getMapIdentifiers()
ReducegetMapIdentifiers in interface Reducepublic int getNumberOfMaps()
ReducegetNumberOfMaps in interface ReduceMapspublic boolean isAwaitingOutputs()
ReduceisAwaitingOutputs in interface Reducetrue is the Reducer is still awaiting outputs;
false otherwise.public void setReceivedOutputFrom(String mapIdentifier)
ReducesetReceivedOutputFrom in interface ReducemapIdentifier - The ID of the Map from which an output has been received.public Iterator<String> getAwaitingOutputsFrom()
ReducegetAwaitingOutputsFrom in interface Reducepublic void resetOutputTracker()
ReduceresetOutputTracker in interface Reduceprotected void addReducer(Reduce reduce) throws MapReduceException
Reduce using the Reduce.addMap() method.reduce - MapReduceExceptionprotected void removeReducer(Reduce reduce) throws MapReduceException
Reduce using the Reduce.removeMap() method.reduce - MapReduceExceptionprotected void addMapper(Map map) throws MapReduceException
Map using the Map.addReduce() method.map - MapReduceExceptionprotected void removeMapper(Map map) throws MapReduceException
Map using the Map.removeReduce() method.map - MapReduceExceptionpublic Results createResults(boolean completeResult, boolean processingComplete)
MapReduceResults type to be used for reporting results
produced as a result of the processing.createResults in interface MapReduceResults.public void writeResults(Results results) throws MapReduceException
MapReducewriteResults in interface MapReduceresults - The results to be written.MapReduceException - If there are problems in marshalling or writing these results.public void writeResults(ds.funnel.topic.Topic topic,
Results results)
throws MapReduceException
MapReducewriteResults in interface MapReducetopic - The topic to write results toresults - The results that needs to be writtenMapReduceException - If there are problems in marshalling or writing these results.@Deprecated public void writeResults(String streamSynopsis, Results results) throws MapReduceException
MapReducewriteResults in interface MapReducestreamSynopsis - The synopsis for the streamresults - The results that needs to be writtenMapReduceException - If there are problems in marshalling or writing these results.@Deprecated public void writeResults(int synopsisType, String streamSynopsis, Results results) throws MapReduceException
MapReducewriteResults in interface MapReducesynopsisType - The synopsis type for the stream in questionstreamSynopsis - The synopsis for the streamresults - The results that needs to be writtenMapReduceException - If there are problems in marshalling or writing these results.Copyright © 2015. All rights reserved.