public abstract class MapReduceBase extends OperationBase implements Map, Reduce
Map and Reduce interface.Operation.OperationType| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MODULE |
| Constructor and Description |
|---|
MapReduceBase() |
| Modifier and Type | Method and Description |
|---|---|
int |
addMap(Map map)
Adds a Map that will be reduced.
|
int |
addReduce(Reduce reduce)
Adds a Reduce for this particular Map.
|
Results |
createResults(boolean completeResult,
boolean processingComplete)
Create the
Results type to be used for reporting results
produced as a result of the processing. |
java.util.Iterator<java.lang.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.
|
java.util.Enumeration<java.lang.String> |
getMapIdentifiers()
Retrieves the set of Map identifiers
|
int |
getNumberOfMaps()
Retrieves the number of registered Map instances
|
int |
getNumberOfReducers()
Retrieves the number of registered Reduce instances
|
java.util.Enumeration<java.lang.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(FormatWriter mFormat) |
int |
removeMap(java.lang.String mapIdentifier)
Removes a Map from the list of Maps that are registered to this reducer.
|
int |
removeReduce(java.lang.String reduceIdentifier)
Removes a given reducer from the list of Reducers for a given Map
function.
|
void |
resetOutputTracker()
This method resets the output tracker associated with the reducer.
|
void |
setReceivedOutputFrom(java.lang.String mapIdentifier)
Mark the receipt of Output from a given Map instance
|
void |
unmarshall(FormatReader mFormat)
Unmarshall the operation from a set of marshalled bytes.
|
void |
writeResults(int synopsisType,
java.lang.String streamSynopsis,
Results results)
Deprecated.
|
void |
writeResults(Results results)
Writes the specified results to the default output stream.
|
void |
writeResults(java.lang.String streamSynopsis,
Results results)
Deprecated.
|
void |
writeResults(Topic topic,
Results results)
Writes the specified results to a specific output stream.
|
dispose, execute, getDomain, getExecutionProfile, getInstanceIdentifier, getOperationIdentifier, getProcessingDirectives, getVersionInformation, hasDatasetCollection, hasExecutionProfile, hasProcessingDirectives, initialize, isInitialized, markInitializationAsComplete, needsInitialization, setAsExecuteFixedNumberOfTimes, setAsExecuteOnce, setAsExecutePeriodically, setAsExecuteWhenDataAvailable, setAsStayAlive, setDatasetCollection, setDomain, setInitializationComplete, setInitializationNeeded, setInstanceIdentifier, setOperationIdentifier, setProcessingDirectives, setTeminationConditionReached, setVersionInformation, terminationConditionReached, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitdispose, execute, getDomain, getExecutionProfile, getInstanceIdentifier, getOperationIdentifier, getProcessingDirectives, getVersionInformation, hasDatasetCollection, hasExecutionProfile, hasProcessingDirectives, initialize, isInitialized, needsInitialization, terminationConditionReached, toStringpublic static final java.lang.String MODULE
public void unmarshall(FormatReader mFormat) throws FormatException
Operationunmarshall in interface Operationunmarshall in class OperationBasemFormat - The byte[] representation of the operation.FormatExceptionpublic void marshall(FormatWriter mFormat) throws FormatException
marshall in interface FormatMarshallermarshall in class OperationBasemFormat - - The format writer to write toFormatException - If there was a problem while writingpublic DatasetCollection getDatasetCollection()
OperationgetDatasetCollection in interface OperationgetDatasetCollection in class OperationBasepublic 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(java.lang.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 java.util.Enumeration<java.lang.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(java.lang.String mapIdentifier)
throws MapReduceException
ReduceremoveMap in interface ReducemapIdentifier - The identifier of the Map to removedMapReduceException - If there are problems removing the Map.public java.util.Enumeration<java.lang.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(java.lang.String mapIdentifier)
ReducesetReceivedOutputFrom in interface ReducemapIdentifier - The ID of the Map from which an output has been received.public java.util.Iterator<java.lang.String> getAwaitingOutputsFrom()
ReducegetAwaitingOutputsFrom in interface Reducepublic void resetOutputTracker()
ReduceresetOutputTracker in interface Reducepublic 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(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(java.lang.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,
java.lang.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.