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:
LocalGroupByGate, 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  java.util.concurrent.atomic.AtomicInteger count
           
protected  java.util.Comparator<Tuple>[] groupComparators
           
protected  TupleHasher groupHasher
           
protected  java.util.Set<Tuple> keys
           
protected  java.util.Map<Tuple,java.util.Collection<Tuple>>[] keyValues
           
protected  int numIncomingPaths
           
protected  java.util.Map<Duct,java.lang.Integer> posMap
           
protected  java.util.Comparator<Tuple>[] valueComparators
           
 
Fields inherited from class cascading.flow.stream.SpliceGate
flowProcess, grouping, incomingScopes, keyEntry, keyFields, orderedPrevious, outgoingScopes, role, sortFields, splice, tupleEntryIterator, 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  java.util.Set<Tuple> createKeySet()
           
protected  java.util.Map<Tuple,java.util.Collection<Tuple>>[] createKeyValuesArray()
          This lets us just replace an old map and let the gc cleanup, vs clearing each map
protected  java.util.Map<Tuple,java.util.Collection<Tuple>> createTupleMap()
           
protected  Tuple getDelegatedTuple(Tuple object)
          This allows the tuple to honor the hasher and comparators, if any
protected  java.util.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, 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 java.util.Map<Duct,java.lang.Integer> posMap

groupComparators

protected java.util.Comparator<Tuple>[] groupComparators

valueComparators

protected java.util.Comparator<Tuple>[] valueComparators

groupHasher

protected TupleHasher groupHasher

keys

protected java.util.Set<Tuple> keys

keyValues

protected java.util.Map<Tuple,java.util.Collection<Tuple>>[] keyValues

closure

protected MemoryCoGroupClosure closure

numIncomingPaths

protected int numIncomingPaths

count

protected final java.util.concurrent.atomic.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>>

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 java.util.Comparator getKeyComparator()

createKeySet

protected java.util.Set<Tuple> createKeySet()

createKeyValuesArray

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

Returns:

createTupleMap

protected java.util.Map<Tuple,java.util.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-2011 Concurrent, Inc. All Rights Reserved.