private SortedListMultiMap<Integer, KeyValuesReader> getKeyValuesReaders() throws Exception { SortedListMultiMap<Integer, KeyValuesReader> readers = new SortedListMultiMap<>(); for( Map.Entry<Integer, List<LogicalInput>> entry : logicalInputs.getEntries() ) { for( LogicalInput logicalInput : entry.getValue() ) readers.put( entry.getKey(), (KeyValuesReader) logicalInput.getReader() ); } return readers; }
private SortedListMultiMap<Integer, KeyValuesReader> getKeyValuesReaders() throws Exception { SortedListMultiMap<Integer, KeyValuesReader> readers = new SortedListMultiMap<>(); for( Map.Entry<Integer, List<LogicalInput>> entry : logicalInputs.getEntries() ) { for( LogicalInput logicalInput : entry.getValue() ) readers.put( entry.getKey(), (KeyValuesReader) logicalInput.getReader() ); } return readers; }
/** * Maps each input to an ordinal on the flowelement. an input may be bound to multiple ordinals. * * @param element */ private SortedListMultiMap<Integer, LogicalInput> createInputMap( FlowElement element ) { String id = FlowElements.id( element ); SortedListMultiMap<Integer, LogicalInput> ordinalMap = new SortedListMultiMap<>(); for( LogicalInput logicalInput : inputMap.values() ) { Configuration configuration = inputConfigMap.get( logicalInput ); String foundID = configuration.get( "cascading.node.source" ); if( Util.isEmpty( foundID ) ) throw new IllegalStateException( "cascading.node.source property not set on source LogicalInput" ); if( !foundID.equals( id ) ) continue; String values = configuration.get( "cascading.node.ordinals", "" ); List<Integer> ordinals = Util.split( Integer.class, ",", values ); for( Integer ordinal : ordinals ) ordinalMap.put( ordinal, logicalInput ); } return ordinalMap; }
/** * Maps each input to an ordinal on the flowelement. an input may be bound to multiple ordinals. * * @param element */ private SortedListMultiMap<Integer, LogicalInput> createInputMap( FlowElement element ) { String id = FlowElements.id( element ); SortedListMultiMap<Integer, LogicalInput> ordinalMap = new SortedListMultiMap<>(); for( LogicalInput logicalInput : inputMap.values() ) { Configuration configuration = inputConfigMap.get( logicalInput ); String foundID = configuration.get( "cascading.node.source" ); if( Util.isEmpty( foundID ) ) throw new IllegalStateException( "cascading.node.source property not set on source LogicalInput" ); if( !foundID.equals( id ) ) continue; String values = configuration.get( "cascading.node.ordinals", "" ); List<Integer> ordinals = Util.split( Integer.class, ",", values ); for( Integer ordinal : ordinals ) ordinalMap.put( ordinal, logicalInput ); } return ordinalMap; }