@Override public void prepare() { super.prepare(); valueMap = initNewValueMap(); }
@Override public void bind( StreamGraph streamGraph ) { super.bind( streamGraph ); count.set( numIncomingEventingPaths ); // the number of paths incoming latch = new CountDownLatch( numIncomingEventingPaths - 1 ); }
@Override public void initialize() { super.initialize(); initComparators(); keys = createKeySet(); count.set( numIncomingEventingPaths ); // the number of paths incoming }
/** * This lets us just replace an old map and let the gc cleanup, vs clearing each map * * @return of type Map */ protected Map<Tuple, Collection<Tuple>>[] createKeyValuesArray() { // Ducts use identity for equality Map<Tuple, Collection<Tuple>>[] valueMap = new Map[ getNumDeclaredIncomingBranches() ]; int start = isBlockingStreamed() ? 0 : 1; for( int i = start; i < getNumDeclaredIncomingBranches(); i++ ) valueMap[ i ] = createTupleMap(); return valueMap; }
protected Set<Tuple> createKeySet() { return Collections.synchronizedSet( new TreeSet<Tuple>( getKeyComparator() ) ); }
@Override public void complete( Duct previous ) { countDownLatch(); if( count.decrementAndGet() != 0 ) return; collections[ 0 ] = Collections.EMPTY_LIST; for( Tuple keyTuple : keys ) performJoinWith( keyTuple ); keys = createKeySet(); keyValues = createKeyValuesArray(); super.complete( previous ); }
@Override public void prepare() { super.prepare(); keyValues = createKeyValuesArray(); closure = new MemoryCoGroupClosure( flowProcess, splice.getNumSelfJoins(), keyFields, valuesFields ); if( grouping != null && splice.getJoinDeclaredFields() != null && splice.getJoinDeclaredFields().isNone() ) grouping.joinerClosure = closure; }
@Override public void prepare() { super.prepare(); streamedCollection = new ArrayList<Tuple>( Arrays.asList( new Tuple() ) ); // placeholder in collection collections = new Collection[ getNumDeclaredIncomingBranches() ]; collections[ 0 ] = streamedCollection; if( nullsAreNotEqual ) LOG.warn( "HashJoin does not fully support key comparators where null values are not treated equal" ); }