cascading.flow.stream
Class MemorySpliceGate

java.lang.Object
  extended by cascading.flow.stream.Duct<Incoming,Outgoing>
      extended by cascading.flow.stream.Gate<TupleEntry,Grouping<TupleEntry,TupleEntryIterator>>
          extended by cascading.flow.stream.SpliceGate
              extended by cascading.flow.stream.MemorySpliceGate
All Implemented Interfaces:
Collapsing, ElementDuct
Direct Known Subclasses:
MemoryCoGroupGate, MemoryHashJoinGate

public abstract class MemorySpliceGate
extends SpliceGate


Nested Class Summary
protected  class MemorySpliceGate.DelegatedTuple
           
 
Nested classes/interfaces inherited from class cascading.flow.stream.SpliceGate
SpliceGate.Role
 
Field Summary
protected  MemoryCoGroupClosure closure
           
protected  AtomicInteger count
           
protected  Comparator<Tuple>[] groupComparators
           
protected  TupleHasher groupHasher
           
protected  Set<Tuple> keys
           
protected  Map<Tuple,Collection<Tuple>>[] keyValues
           
protected  boolean nullsAreNotEqual
           
protected  int numIncomingPaths
           
protected  Map<Duct,Integer> posMap
           
protected  Comparator<Tuple>[] valueComparators
           
 
Fields inherited from class cascading.flow.stream.SpliceGate
flowProcess, grouping, incomingScopes, keyBuilder, keyEntry, keyFields, orderedPrevious, outgoingScopes, role, sortBuilder, sortFields, splice, tupleEntryIterator, valuesBuilder, valuesFields
 
Fields inherited from class cascading.flow.stream.Gate
allPrevious
 
Fields inherited from class cascading.flow.stream.Duct
next
 
Constructor Summary
MemorySpliceGate(FlowProcess flowProcess, Splice splice)
           
 
Method Summary
 void bind(StreamGraph streamGraph)
           
protected  TupleBuilder createDefaultNarrowBuilder(Fields incomingFields, Fields narrowFields)
           
protected  Set<Tuple> createKeySet()
           
protected  Map<Tuple,Collection<Tuple>>[] createKeyValuesArray()
          This lets us just replace an old map and let the gc cleanup, vs clearing each map
protected  Map<Tuple,Collection<Tuple>> createTupleMap()
           
protected  Tuple getDelegatedTuple(Tuple object)
          This allows the tuple to honor the hasher and comparators, if any
protected  Comparator getKeyComparator()
           
 void initialize()
          Called immediately after bind
protected abstract  boolean isBlockingStreamed()
           
 void prepare()
           
 
Methods inherited from class cascading.flow.stream.SpliceGate
addIncomingScope, addOutgoingScope, cleanup, createNarrowBuilder, createNulledBuilder, equals, getBranchNames, getFlowElement, getIncomingScopes, getOutgoingScopes, handleException, handleReThrowableException, hashCode, hasTrapHandler, makePosMap, orderDucts, setBranchNames, setTrapHandler, toString
 
Methods inherited from class cascading.flow.stream.Gate
getAllPreviousFor
 
Methods inherited from class cascading.flow.stream.Duct
complete, getNext, getNextFor, receive, receiveFirst, start
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

posMap

protected final Map<Duct,Integer> posMap

groupComparators

protected Comparator<Tuple>[] groupComparators

valueComparators

protected Comparator<Tuple>[] valueComparators

groupHasher

protected TupleHasher groupHasher

nullsAreNotEqual

protected boolean nullsAreNotEqual

keys

protected Set<Tuple> keys

keyValues

protected Map<Tuple,Collection<Tuple>>[] keyValues

closure

protected MemoryCoGroupClosure closure

numIncomingPaths

protected int numIncomingPaths

count

protected final AtomicInteger count
Constructor Detail

MemorySpliceGate

public MemorySpliceGate(FlowProcess flowProcess,
                        Splice splice)
Method Detail

bind

public void bind(StreamGraph streamGraph)
Overrides:
bind in class Gate<TupleEntry,Grouping<TupleEntry,TupleEntryIterator>>

createDefaultNarrowBuilder

protected TupleBuilder createDefaultNarrowBuilder(Fields incomingFields,
                                                  Fields narrowFields)
Overrides:
createDefaultNarrowBuilder in class SpliceGate

initialize

public void initialize()
Description copied from class: Duct
Called immediately after bind

Overrides:
initialize in class SpliceGate

prepare

public void prepare()
Overrides:
prepare in class Duct<TupleEntry,Grouping<TupleEntry,TupleEntryIterator>>

getKeyComparator

protected Comparator getKeyComparator()

createKeySet

protected Set<Tuple> createKeySet()

createKeyValuesArray

protected Map<Tuple,Collection<Tuple>>[] createKeyValuesArray()
This lets us just replace an old map and let the gc cleanup, vs clearing each map

Returns:
of type Map

createTupleMap

protected Map<Tuple,Collection<Tuple>> createTupleMap()

getDelegatedTuple

protected final Tuple getDelegatedTuple(Tuple object)
This allows the tuple to honor the hasher and comparators, if any

Parameters:
object - the tuple to wrap
Returns:
a DelegatedTuple instance

isBlockingStreamed

protected abstract boolean isBlockingStreamed()


Copyright © 2007-2015 Concurrent, Inc. All Rights Reserved.