|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcascading.pipe.Pipe
cascading.pipe.Group
public class Group
The base class for GroupBy and CoGroup. This class should not be used directly.
GroupBy,
CoGroup,
Serialized Form| Field Summary | |
|---|---|
protected Fields |
declaredFields
Field declaredFields |
protected Map<String,Fields> |
groupFieldsMap
Field groupFieldsMap |
protected Map<String,Fields> |
sortFieldsMap
Field sortFieldsMap |
| Fields inherited from class cascading.pipe.Pipe |
|---|
previous |
| Constructor Summary | |
|---|---|
protected |
Group(Pipe... pipes)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe pipe)
Constructor Group creates a new Group instance where grouping occurs on Fields.ALL fields. |
protected |
Group(Pipe[] pipes,
Fields groupFields)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe[] pipes,
Fields[] groupFields)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe[] pipes,
Fields[] groupFields,
Fields declaredFields,
Joiner joiner)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe[] pipes,
Fields groupFields,
Fields sortFields)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe[] pipes,
Fields groupFields,
Fields sortFields,
boolean reverseOrder)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe pipe,
Fields groupFields)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe pipe,
Fields groupFields,
Fields sortFields)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe pipe,
Fields groupFields,
Fields sortFields,
boolean reverseOrder)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe pipe,
Fields groupFields,
int numSelfJoins)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe pipe,
Fields groupFields,
int numSelfJoins,
Fields declaredFields)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe pipe,
Fields groupFields,
int numSelfJoins,
Fields declaredFields,
Joiner joiner)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe pipe,
Fields groupFields,
int numSelfJoins,
Joiner joiner)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Fields declaredFields)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Fields declaredFields,
Joiner joiner)
Constructor Group creates a new Group instance. |
protected |
Group(Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Joiner joiner)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe... pipes)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe[] pipes,
Fields groupFields)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe[] pipes,
Fields[] groupFields)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe[] pipes,
Fields[] groupFields,
Fields declaredFields)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe[] pipes,
Fields[] groupFields,
Fields declaredFields,
Joiner joiner)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe[] pipe,
Fields groupFields,
Fields sortFields)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe[] pipes,
Fields groupFields,
Fields sortFields,
boolean reverseOrder)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe pipe,
Fields groupFields)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe pipe,
Fields groupFields,
Fields sortFields)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe pipe,
Fields groupFields,
Fields sortFields,
boolean reverseOrder)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe pipe,
Fields groupFields,
int numSelfJoins)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe pipe,
Fields groupFields,
int numSelfJoins,
Fields declaredFields)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe pipe,
Fields groupFields,
int numSelfJoins,
Fields declaredFields,
Joiner joiner)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe pipe,
Fields groupFields,
int numSelfJoins,
Joiner joiner)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Fields declaredFields)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Fields declaredFields,
Joiner joiner)
Constructor Group creates a new Group instance. |
protected |
Group(String groupName,
Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Joiner joiner)
Constructor Group creates a new Group instance. |
| Method Summary | |
|---|---|
void |
collectReduceGrouping(Scope incomingScope,
Scope outgoingScope,
TupleEntry entry,
OutputCollector output)
Method makeReduceGrouping makes a group Tuple[] of the form [ ['grpValue', ...] [ sourceName, [ 'value', ...] ] ] Since this is a join, we must track from which source a given tuple is sourced from so we can cogroup properly at the reduce stage. |
boolean |
equals(Object object)
|
Fields |
getDeclaredFields()
Method getDeclaredFields returns the declaredFields of this Group object. |
Map<String,Fields> |
getGroupingSelectors()
Method getGroupingSelectors returns the groupingSelectors of this Group object. |
String |
getName()
Get the name of this pipe. |
Pipe[] |
getPrevious()
Get all the upstream pipes this pipe is connected to. |
Map<String,Fields> |
getSortingSelectors()
Method getSortingSelectors returns the sortingSelectors of this Group object. |
int |
hashCode()
|
boolean |
isGroupBy()
Method isGroupBy returns true if this Group instance will perform a GroupBy operation. |
boolean |
isSorted()
Method isSorted returns true if this Group instance is sorting values other than the group fields. |
boolean |
isSortReversed()
Method isSortReversed returns true if sorting is reversed. |
Iterator<Tuple> |
iterateReduceValues(FlowProcess flowProcess,
Set<Scope> incomingScopes,
Scope outgoingScope,
Tuple key,
Iterator values)
Method makeReduceValues wrapps the incoming Hadoop value stream as an iterator over Tuple instance. |
Scope |
outgoingScopeFor(Set<Scope> incomingScopes)
Method outgoingScopeFor returns the Scope this FlowElement hands off to the next FlowElement. |
protected void |
printInternal(StringBuffer buffer,
Scope scope)
|
Fields |
resolveFields(Scope scope)
Method resolveFields returns the actual field names represented by the given Scope. |
String |
toString()
|
Tuple |
unwrapGrouping(Tuple tuple)
Method unwrapGrouping tests if the given grouping key Tuple should be unwrapped if this Group instance is sorting. |
| Methods inherited from class cascading.pipe.Pipe |
|---|
getHeads, getTrace, pipes, print, resolveIncomingOperationFields |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final Map<String,Fields> groupFieldsMap
protected Map<String,Fields> sortFieldsMap
protected Fields declaredFields
| Constructor Detail |
|---|
protected Group(Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Fields declaredFields)
lhs - of type PipelhsGroupFields - of type Fieldsrhs - of type PiperhsGroupFields - of type FieldsdeclaredFields - of type Fields
protected Group(Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Fields declaredFields,
Joiner joiner)
lhs - of type PipelhsGroupFields - of type Fieldsrhs - of type PiperhsGroupFields - of type FieldsdeclaredFields - of type Fieldsjoiner - of type CoGrouper
protected Group(Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Joiner joiner)
lhs - of type PipelhsGroupFields - of type Fieldsrhs - of type PiperhsGroupFields - of type Fieldsjoiner - of type CoGrouper
protected Group(Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields)
lhs - of type PipelhsGroupFields - of type Fieldsrhs - of type PiperhsGroupFields - of type Fieldsprotected Group(Pipe... pipes)
pipes - of type Pipe...
protected Group(Pipe[] pipes,
Fields[] groupFields)
pipes - of type Pipe[]groupFields - of type Fields[]
protected Group(String groupName,
Pipe[] pipes,
Fields[] groupFields)
groupName - of type Stringpipes - of type Pipe[]groupFields - of type Fields[]
protected Group(String groupName,
Pipe[] pipes,
Fields[] groupFields,
Fields declaredFields)
groupName - of type Stringpipes - of type Pipe[]groupFields - of type Fields[]declaredFields - of type Fields
protected Group(Pipe[] pipes,
Fields[] groupFields,
Fields declaredFields,
Joiner joiner)
pipes - of type Pipe[]groupFields - of type Fields[]declaredFields - of type Fieldsjoiner - of type CoGrouper
protected Group(String groupName,
Pipe[] pipes,
Fields[] groupFields,
Fields declaredFields,
Joiner joiner)
groupName - of type Stringpipes - of type Pipe[]groupFields - of type Fields[]declaredFields - of type Fieldsjoiner - of type CoGrouper
protected Group(String groupName,
Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Fields declaredFields)
groupName - of type Stringlhs - of type PipelhsGroupFields - of type Fieldsrhs - of type PiperhsGroupFields - of type FieldsdeclaredFields - of type Fields
protected Group(String groupName,
Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Fields declaredFields,
Joiner joiner)
groupName - of type Stringlhs - of type PipelhsGroupFields - of type Fieldsrhs - of type PiperhsGroupFields - of type FieldsdeclaredFields - of type Fieldsjoiner - of type CoGrouper
protected Group(String groupName,
Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields,
Joiner joiner)
groupName - of type Stringlhs - of type PipelhsGroupFields - of type Fieldsrhs - of type PiperhsGroupFields - of type Fieldsjoiner - of type CoGrouper
protected Group(String groupName,
Pipe lhs,
Fields lhsGroupFields,
Pipe rhs,
Fields rhsGroupFields)
groupName - of type Stringlhs - of type PipelhsGroupFields - of type Fieldsrhs - of type PiperhsGroupFields - of type Fields
protected Group(String groupName,
Pipe... pipes)
groupName - of type Stringpipes - of type Pipe...
protected Group(Pipe pipe,
Fields groupFields,
int numSelfJoins,
Fields declaredFields)
pipe - of type PipegroupFields - of type FieldsnumSelfJoins - of type intdeclaredFields - of type Fields
protected Group(Pipe pipe,
Fields groupFields,
int numSelfJoins,
Fields declaredFields,
Joiner joiner)
pipe - of type PipegroupFields - of type FieldsnumSelfJoins - of type intdeclaredFields - of type Fieldsjoiner - of type CoGrouper
protected Group(Pipe pipe,
Fields groupFields,
int numSelfJoins,
Joiner joiner)
pipe - of type PipegroupFields - of type FieldsnumSelfJoins - of type intjoiner - of type CoGrouper
protected Group(Pipe pipe,
Fields groupFields,
int numSelfJoins)
pipe - of type PipegroupFields - of type FieldsnumSelfJoins - of type int
protected Group(String groupName,
Pipe pipe,
Fields groupFields,
int numSelfJoins,
Fields declaredFields)
groupName - of type Stringpipe - of type PipegroupFields - of type FieldsnumSelfJoins - of type intdeclaredFields - of type Fields
protected Group(String groupName,
Pipe pipe,
Fields groupFields,
int numSelfJoins,
Fields declaredFields,
Joiner joiner)
groupName - of type Stringpipe - of type PipegroupFields - of type FieldsnumSelfJoins - of type intdeclaredFields - of type Fieldsjoiner - of type CoGrouper
protected Group(String groupName,
Pipe pipe,
Fields groupFields,
int numSelfJoins,
Joiner joiner)
groupName - of type Stringpipe - of type PipegroupFields - of type FieldsnumSelfJoins - of type intjoiner - of type CoGrouper
protected Group(String groupName,
Pipe pipe,
Fields groupFields,
int numSelfJoins)
groupName - of type Stringpipe - of type PipegroupFields - of type FieldsnumSelfJoins - of type intprotected Group(Pipe pipe)
Fields.ALL fields.
pipe - of type Pipe
protected Group(Pipe pipe,
Fields groupFields)
pipe - of type PipegroupFields - of type Fields
protected Group(String groupName,
Pipe pipe,
Fields groupFields)
groupName - of type Stringpipe - of type PipegroupFields - of type Fields
protected Group(Pipe pipe,
Fields groupFields,
Fields sortFields)
pipe - of type PipegroupFields - of type FieldssortFields - of type Fields
protected Group(String groupName,
Pipe pipe,
Fields groupFields,
Fields sortFields)
groupName - of type Stringpipe - of type PipegroupFields - of type FieldssortFields - of type Fields
protected Group(Pipe pipe,
Fields groupFields,
Fields sortFields,
boolean reverseOrder)
pipe - of type PipegroupFields - of type FieldssortFields - of type FieldsreverseOrder - of type boolean
protected Group(String groupName,
Pipe pipe,
Fields groupFields,
Fields sortFields,
boolean reverseOrder)
groupName - of type Stringpipe - of type PipegroupFields - of type FieldssortFields - of type FieldsreverseOrder - of type boolean
protected Group(Pipe[] pipes,
Fields groupFields)
pipes - of type PipegroupFields - of type Fields
protected Group(String groupName,
Pipe[] pipes,
Fields groupFields)
groupName - of type Stringpipes - of type PipegroupFields - of type Fields
protected Group(Pipe[] pipes,
Fields groupFields,
Fields sortFields)
pipes - of type PipegroupFields - of type FieldssortFields - of type Fields
protected Group(String groupName,
Pipe[] pipe,
Fields groupFields,
Fields sortFields)
groupName - of type Stringpipe - of type PipegroupFields - of type FieldssortFields - of type Fields
protected Group(Pipe[] pipes,
Fields groupFields,
Fields sortFields,
boolean reverseOrder)
pipes - of type PipegroupFields - of type FieldssortFields - of type FieldsreverseOrder - of type boolean
protected Group(String groupName,
Pipe[] pipes,
Fields groupFields,
Fields sortFields,
boolean reverseOrder)
groupName - of type Stringpipes - of type Pipe[]groupFields - of type FieldssortFields - of type FieldsreverseOrder - of type boolean| Method Detail |
|---|
public Fields getDeclaredFields()
public String getName()
Pipe
getName in class Pipepublic Pipe[] getPrevious()
Pipe
getPrevious in class Pipepublic Map<String,Fields> getGroupingSelectors()
public Map<String,Fields> getSortingSelectors()
public boolean isSorted()
public boolean isSortReversed()
public void collectReduceGrouping(Scope incomingScope,
Scope outgoingScope,
TupleEntry entry,
OutputCollector output)
throws IOException
incomingScope - of type ScopeoutgoingScope - of type Scopeentry - of type TupleEntryoutput - of type OutputCollector
IOException - thrown by OutputCollector on collectpublic Tuple unwrapGrouping(Tuple tuple)
tuple - of type Tuple
public Iterator<Tuple> iterateReduceValues(FlowProcess flowProcess,
Set<Scope> incomingScopes,
Scope outgoingScope,
Tuple key,
Iterator values)
Tuple instance.
flowProcess - of type FlowSessionincomingScopes - of type SetoutgoingScope - of type Scopekey - of type WritableComparablevalues - of type Iterator @return Iteratorpublic boolean isGroupBy()
public Scope outgoingScopeFor(Set<Scope> incomingScopes)
FlowElement
outgoingScopeFor in interface FlowElementoutgoingScopeFor in class PipeincomingScopes - of type SetFlowElement#outgoingScopeFor(Set) public Fields resolveFields(Scope scope)
FlowElement
resolveFields in interface FlowElementresolveFields in class Pipescope - of type Scope
FlowElement.resolveFields(Scope)public boolean equals(Object object)
equals in class Pipepublic int hashCode()
hashCode in class Pipepublic String toString()
toString in class Pipe
protected void printInternal(StringBuffer buffer,
Scope scope)
printInternal in class Pipe
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||