|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cascading.pipe.Pipe cascading.pipe.SubAssembly cascading.pipe.assembly.AggregateBy cascading.pipe.assembly.SumBy
public class SumBy
Class SumBy is used to sum values associated with duplicate keys in a tuple stream.
Typically finding the sum of field in a tuple stream relies on aGroupBy
and a Sum
Aggregator
operation.
If all the values to be summed are all null
, the result value is a function of how null is coerced by the
given sumType
. If a primitive type, 0
will be returned. Otherwise null
.
This SubAssembly also uses the SumBy.SumPartials
AggregateBy.Functor
to sum field values before the GroupBy operator to reduce IO over the network.
This strategy is similar to using combiners
, except no sorting or serialization is invoked and results
in a much simpler mechanism.
The threshold
value tells the underlying SumPartials functions how many unique key sums to accumulate
in the LRU cache, before emitting the least recently used entry.
By default, either the value of AggregateBy.AGGREGATE_BY_THRESHOLD
System property or AggregateBy.DEFAULT_THRESHOLD
will be used.
AggregateBy
,
Serialized FormNested Class Summary | |
---|---|
static class |
SumBy.SumPartials
Class SumPartials is a AggregateBy.Functor that is used to sum observed duplicates from the tuple stream. |
Nested classes/interfaces inherited from class cascading.pipe.assembly.AggregateBy |
---|
AggregateBy.CompositeFunction, AggregateBy.Flush, AggregateBy.Functor |
Field Summary | |
---|---|
static int |
DEFAULT_THRESHOLD
Deprecated. |
Fields inherited from class cascading.pipe.assembly.AggregateBy |
---|
AGGREGATE_BY_THRESHOLD, USE_DEFAULT_THRESHOLD |
Fields inherited from class cascading.pipe.Pipe |
---|
configDef, parent, stepConfigDef |
Constructor Summary | |
---|---|
SumBy(Fields valueField,
Fields sumField)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(Fields valueField,
Fields sumField,
Class sumType)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(Pipe[] pipes,
Fields groupingFields,
Fields valueField,
Fields sumField)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(Pipe[] pipes,
Fields groupingFields,
Fields valueField,
Fields sumField,
Class sumType)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(Pipe[] pipes,
Fields groupingFields,
Fields valueField,
Fields sumField,
Class sumType,
int threshold)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(Pipe[] pipes,
Fields groupingFields,
Fields valueField,
Fields sumField,
int threshold)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(Pipe pipe,
Fields groupingFields,
Fields valueField,
Fields sumField)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(Pipe pipe,
Fields groupingFields,
Fields valueField,
Fields sumField,
Class sumType)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(Pipe pipe,
Fields groupingFields,
Fields valueField,
Fields sumField,
Class sumType,
int threshold)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(Pipe pipe,
Fields groupingFields,
Fields valueField,
Fields sumField,
int threshold)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(String name,
Pipe[] pipes,
Fields groupingFields,
Fields valueField,
Fields sumField)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(String name,
Pipe[] pipes,
Fields groupingFields,
Fields valueField,
Fields sumField,
Class sumType)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(String name,
Pipe[] pipes,
Fields groupingFields,
Fields valueField,
Fields sumField,
Class sumType,
int threshold)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(String name,
Pipe[] pipes,
Fields groupingFields,
Fields valueField,
Fields sumField,
int threshold)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(String name,
Pipe pipe,
Fields groupingFields,
Fields valueField,
Fields sumField)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(String name,
Pipe pipe,
Fields groupingFields,
Fields valueField,
Fields sumField,
Class sumType)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(String name,
Pipe pipe,
Fields groupingFields,
Fields valueField,
Fields sumField,
Class sumType,
int threshold)
Constructor SumBy creates a new SumBy instance. |
|
SumBy(String name,
Pipe pipe,
Fields groupingFields,
Fields valueField,
Fields sumField,
int threshold)
Constructor SumBy creates a new SumBy instance. |
Method Summary |
---|
Methods inherited from class cascading.pipe.assembly.AggregateBy |
---|
getAggregators, getArgumentFields, getFieldDeclarations, getFunctors, getGroupBy, getGroupingFields, initialize, initialize, verify |
Methods inherited from class cascading.pipe.SubAssembly |
---|
getName, getPrevious, getTailNames, getTails, setPrevious, setTails, unwind |
Methods inherited from class cascading.pipe.Pipe |
---|
equals, getConfigDef, getHeads, getParent, getStepConfigDef, getTrace, hasConfigDef, hashCode, hasStepConfigDef, id, isEquivalentTo, named, names, outgoingScopeFor, pipes, print, printInternal, resolveIncomingOperationArgumentFields, resolveIncomingOperationPassThroughFields, setParent, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@Deprecated public static final int DEFAULT_THRESHOLD
Constructor Detail |
---|
@ConstructorProperties(value={"valueField","sumField"}) public SumBy(Fields valueField, Fields sumField)
AggregateBy
instance.
valueField
- of type FieldssumField
- of type Fields@ConstructorProperties(value={"pipe","groupingFields","valueField","sumField"}) public SumBy(Pipe pipe, Fields groupingFields, Fields valueField, Fields sumField)
pipe
- of type PipegroupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type Fields@ConstructorProperties(value={"pipe","groupingFields","valueField","sumField","threshold"}) public SumBy(Pipe pipe, Fields groupingFields, Fields valueField, Fields sumField, int threshold)
pipe
- of type PipegroupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type Fieldsthreshold
- of type int@ConstructorProperties(value={"name","pipe","groupingFields","valueField","sumField"}) public SumBy(String name, Pipe pipe, Fields groupingFields, Fields valueField, Fields sumField)
name
- of type Stringpipe
- of type PipegroupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type Fields@ConstructorProperties(value={"name","pipe","groupingFields","valueField","sumField","threshold"}) public SumBy(String name, Pipe pipe, Fields groupingFields, Fields valueField, Fields sumField, int threshold)
name
- of type Stringpipe
- of type PipegroupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type Fieldsthreshold
- of type int@ConstructorProperties(value={"name","pipes","groupingFields","valueField","sumField"}) public SumBy(Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField)
pipes
- of type Pipe[]groupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type Fields@ConstructorProperties(value={"name","pipes","groupingFields","valueField","sumField","threshold"}) public SumBy(Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField, int threshold)
pipes
- of type Pipe[]groupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type Fieldsthreshold
- of type int@ConstructorProperties(value={"name","pipes","groupingFields","valueField","sumField"}) public SumBy(String name, Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField)
name
- of type Stringpipes
- of type Pipe[]groupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type Fields@ConstructorProperties(value={"name","pipes","groupingFields","valueField","sumField","threshold"}) public SumBy(String name, Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField, int threshold)
name
- of type Stringpipes
- of type Pipe[]groupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type Fieldsthreshold
- of type int@ConstructorProperties(value={"valueField","sumField","sumType"}) public SumBy(Fields valueField, Fields sumField, Class sumType)
AggregateBy
instance.
valueField
- of type FieldssumField
- of type FieldssumType
- of type Class@ConstructorProperties(value={"pipe","groupingFields","valueField","sumField","sumType"}) public SumBy(Pipe pipe, Fields groupingFields, Fields valueField, Fields sumField, Class sumType)
pipe
- of type PipegroupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type FieldssumType
- of type Class@ConstructorProperties(value={"pipe","groupingFields","valueField","sumField","sumType","threshold"}) public SumBy(Pipe pipe, Fields groupingFields, Fields valueField, Fields sumField, Class sumType, int threshold)
pipe
- of type PipegroupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type FieldssumType
- of type Classthreshold
- of type int@ConstructorProperties(value={"name","pipe","groupingFields","valueField","sumField","sumType"}) public SumBy(String name, Pipe pipe, Fields groupingFields, Fields valueField, Fields sumField, Class sumType)
name
- of type Stringpipe
- of type PipegroupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type FieldssumType
- of type Class@ConstructorProperties(value={"name","pipe","groupingFields","valueField","sumField","sumType","threshold"}) public SumBy(String name, Pipe pipe, Fields groupingFields, Fields valueField, Fields sumField, Class sumType, int threshold)
name
- of type Stringpipe
- of type PipegroupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type FieldssumType
- of type Classthreshold
- of type int@ConstructorProperties(value={"name","pipes","groupingFields","valueField","sumField","sumType"}) public SumBy(Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField, Class sumType)
pipes
- of type Pipe[]groupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type FieldssumType
- of type Class@ConstructorProperties(value={"name","pipes","groupingFields","valueField","sumField","sumType","threshold"}) public SumBy(Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField, Class sumType, int threshold)
pipes
- of type Pipe[]groupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type FieldssumType
- of type Classthreshold
- of type int@ConstructorProperties(value={"name","pipes","groupingFields","valueField","sumField","sumType"}) public SumBy(String name, Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField, Class sumType)
name
- of type Stringpipes
- of type Pipe[]groupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type FieldssumType
- of type Class@ConstructorProperties(value={"name","pipes","groupingFields","valueField","sumField","sumType","threshold"}) public SumBy(String name, Pipe[] pipes, Fields groupingFields, Fields valueField, Fields sumField, Class sumType, int threshold)
name
- of type Stringpipes
- of type Pipe[]groupingFields
- of type FieldsvalueField
- of type FieldssumField
- of type FieldssumType
- of type Classthreshold
- of type int
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |