|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.ogsadai.client.toolkit.activity.BaseActivity
uk.org.ogsadai.client.toolkit.activities.block.RandomSplit
public class RandomSplit
An activity that splits an input into N random partitions. The partitions are not necessarily of the same size. A random seed may be provided so that a particular partitioning can be reproduced.
Activity inputs:
data. This can be any type of blocks. Metadata blocks
may precede data blocks.seed. Type: Long. This is an optional
input. This specifies a seed for the random generator so that a particular
partition can be reproduced.Activity outputs:
data. This is the same type as the input data. Two or
more outputs must be provided. Expected name of activity on server:
uk.org.ogsadai.RandomSplit Activity input/output ordering:
seed is consumed before a set of
metadata-data blocks from the data input. Activity contracts: none.
Behaviour:
metadata data1 data2 data3 data4metadata data1 data4metadata data2 data3uk.org.ogsadai.metadata.MetadataWrapper.
uk.org.ogsadai.metadata.MetadataWrapper)
indicates the start of a new dataset. For each dataset, the activity reads a
value from the random seed input (if present).
{' to denote the list begin marker and
'}' to denote the list end marker){ 1 2 3 } { A }
{ 1 2 3 }{ A }
| Field Summary | |
|---|---|
static ActivityName |
DEFAULT_NAME
Default activity name |
| Constructor Summary | |
|---|---|
RandomSplit()
Constructs a new activity. |
|
RandomSplit(ActivityName activityName)
Constructs a new activity with a user-provided name. |
|
| Method Summary | |
|---|---|
void |
addInput(boolean input)
Adds a boolean to the input. |
void |
addInput(java.lang.Boolean input)
Adds a Boolean to the input. |
void |
addInput(byte[] input)
Adds a byte array to the input. |
void |
addInput(java.util.Calendar input)
Adds a Time to the input. |
void |
addInput(char[] input)
Adds a char array to the input. |
void |
addInput(java.util.Date input)
Adds a Date to the input. |
void |
addInput(double input)
Adds a double to the input. |
void |
addInput(java.lang.Double input)
Adds a Double to the input. |
void |
addInput(float input)
Adds a float to the input. |
void |
addInput(java.lang.Float input)
Adds a Float to the input. |
void |
addInput(int input)
Adds an int to the input. |
void |
addInput(java.lang.Integer input)
Adds an Integer to the input. |
void |
addInput(long input)
Adds a long to the input. |
void |
addInput(java.lang.Long input)
Adds a Long to the input. |
void |
addInput(java.lang.String input)
Adds a String to the input. |
void |
addListBeginToInput()
Adds list start marker |
void |
addListEndToInput()
Adds list end marker |
void |
addRandomSeed(long seed)
Adds a random seed to configure the random generator. |
void |
connectDataInput(SingleActivityOutput output)
Connects the data input to the given output. |
void |
connectRandomSeedInput(SingleActivityOutput output)
Connects the data input to the given output. |
protected ActivityInput[] |
getInputs()
Gets the inputs associated with the activity. |
SingleActivityOutput |
getOutput(int index)
Returns the data output at the index. |
protected ActivityOutput[] |
getOutputs()
Gets the outputs associated with the activity. |
void |
setNumberOfOutputs(int count)
Sets number of outputs. |
protected void |
validateIOState()
Validates the state of the activity inputs and outputs. |
| Methods inherited from class uk.org.ogsadai.client.toolkit.activity.BaseActivity |
|---|
buildRequest, getActivityName, getConnectedOutputs, getErrorMessages, getInputDescriptors, getInstanceName, getRequestAndStatusHandler, getServer, getStatus, getWarnings, hasErrorMessages, hasWarnings, processRequestStatus, setActivityName, setServer, toString, validateState, writeToString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ActivityName DEFAULT_NAME
| Constructor Detail |
|---|
public RandomSplit()
public RandomSplit(ActivityName activityName)
activityName - | Method Detail |
|---|
protected ActivityInput[] getInputs()
BaseActivity
getInputs in class BaseActivityprotected ActivityOutput[] getOutputs()
BaseActivity
getOutputs in class BaseActivity
protected void validateIOState()
throws ActivityIOIllegalStateException
BaseActivity
validateIOState in class BaseActivityActivityIOIllegalStateException - if an activity input is not in a valid state.public void setNumberOfOutputs(int count)
count - number of data outputspublic void addInput(java.lang.String input)
input - String value to add to input.public void addInput(char[] input)
input - the inputpublic void addInput(byte[] input)
input - the inputpublic void addInput(java.lang.Float input)
input - the inputpublic void addInput(float input)
input - the inputpublic void addInput(java.lang.Double input)
input - the inputpublic void addInput(double input)
input - the inputpublic void addInput(java.lang.Integer input)
input - the inputpublic void addInput(int input)
input - the inputpublic void addInput(java.lang.Long input)
input - the inputpublic void addInput(long input)
input - the inputpublic void addInput(java.lang.Boolean input)
input - the inputpublic void addInput(boolean input)
input - the inputpublic void addInput(java.util.Date input)
input - the inputpublic void addInput(java.util.Calendar input)
input - the inputpublic void addListBeginToInput()
public void addListEndToInput()
public void connectDataInput(SingleActivityOutput output)
output - public void addRandomSeed(long seed)
seed - public void connectRandomSeedInput(SingleActivityOutput output)
output - public SingleActivityOutput getOutput(int index)
index - index of the output
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||