public class Controller extends MapReduceBase
Constructor and Description |
---|
Controller()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
checkActivePiece(double[] ratio,
int num)
Calculate the number of active pieces of one worker.
|
int |
checkPieceNumber(double[] ratio,
int num)
Calculate the number that one worker will be split into
|
static byte[] |
combineByte(byte[] message1,
byte[] message2)
Combine two messages into one byte array
|
double[] |
convertTimeToRatio(double[] executionTime) |
java.util.LinkedList<MultiSplitByDensity> |
createResplitMessages(double[] ratio)
From the ratio of work load, get the resplit messages.
|
java.util.LinkedList<byte[]> |
createRestoreMessage(double[] ratio,
Checkpoint[] checkpoints)
From the ratio of work load and checkpoint messages, create the restore messages.
|
void |
execute()
Execute the operation.
|
static byte[] |
getTail(byte[] bytes,
int offset)
Get the last few bytes of a byte array
|
static java.util.LinkedList<EventType> |
parseEvents(byte[] bytes)
Get list of events from a byte array.
|
static byte[] |
pickupEndOfDay(byte[] message)
From a whole message, pick up the END_OF_DAY message
|
static byte[] |
pickupEndOfDay(java.util.LinkedList<EventType> eventList)
Get the end of day event from a list of events.
|
double[] |
pickupOutputVariableValue(byte[] message)
Get output variable values from a byte array.
|
double[] |
pickupOutputVariableValue(java.util.LinkedList<EventType> eventList)
Get the output variable values from a list of events.
|
static void |
printEventMessage(EventType event)
Print out the byte array of an event.
|
addMap, addMapper, addReduce, addReducer, createResults, getAwaitingOutputsFrom, getBytes, getDatasetCollection, getMapIdentifiers, getMapReduceDataset, getNumberOfMaps, getNumberOfReducers, getReduceIdentifiers, isAwaitingOutputs, removeMap, removeMapper, removeReduce, removeReducer, resetOutputTracker, setReceivedOutputFrom, unmarshall, writeResults, writeResults, writeResults
changeToExecuteFixedNumberOfTimes, changeToExecuteOnce, changeToExecutePeriodically, changeToExecuteWhenDataAvailable, changeToStayAlive, dispose, 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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dispose, getDomain, getExecutionProfile, getInstanceIdentifier, getOperationIdentifier, getProcessingDirectives, getVersionInformation, hasDatasetCollection, hasExecutionProfile, hasProcessingDirectives, initialize, isInitialized, needsInitialization, terminationConditionReached, toString
public static void printEventMessage(EventType event)
event
- public static byte[] pickupEndOfDay(java.util.LinkedList<EventType> eventList)
eventList
- MapReduceException
public static byte[] pickupEndOfDay(byte[] message)
message
- The whole messagepublic double[] pickupOutputVariableValue(java.util.LinkedList<EventType> eventList) throws MapReduceException
eventList
- MapReduceException
public double[] pickupOutputVariableValue(byte[] message)
message
- public static byte[] combineByte(byte[] message1, byte[] message2)
message1
- First messagemessage2
- Second messagepublic static byte[] getTail(byte[] bytes, int offset)
bytes
- offset
- public static java.util.LinkedList<EventType> parseEvents(byte[] bytes)
bytes
- public void execute() throws ProcessingException
Operation
execute
in interface Operation
execute
in class OperationBase
ProcessingException
- If there are problems executing the operation in question.public double[] convertTimeToRatio(double[] executionTime)
public java.util.LinkedList<MultiSplitByDensity> createResplitMessages(double[] ratio)
ratio
- public java.util.LinkedList<byte[]> createRestoreMessage(double[] ratio, Checkpoint[] checkpoints)
ratio
- checkpoints
- public int checkPieceNumber(double[] ratio, int num)
ratio
- num
- public int checkActivePiece(double[] ratio, int num)
ratio
- num
-