public static PronghornStage findStageByPath(GraphManager m,int... path){
  int ordinal=path[0];
  int i=0;
  int limit=m.stageIdToStage.length;
  while (i < limit) {
    if (null != m.stageIdToStage[i]) {
      if (-1 == m.multInputIds[m.stageIdToInputsBeginIdx[m.stageIdToStage[i].stageId]]) {
        if (--ordinal <= 0) {
          return findStageByPath(m,m.stageIdToStage[i],1,path);
        }
      }
    }
    i++;
  }
  throw new UnsupportedOperationException("Unable to find ordinal input stage of " + path[0]);
}

public static PronghornStage findStageByPath ( GraphManager m , int ... path ) { int ordinal = path [ 0 ] ; int i = 0 ; int limit = m . stageIdToStage . length ; while ( i < limit ) { if ( null != m . stageIdToStage [ i ] ) { if ( - 1 == m . multInputIds [ m . stageIdToInputsBeginIdx [ m . stageIdToStage [ i ] . stageId ] ] ) { if ( -- ordinal <= 0 ) { return findStageByPath ( m , m . stageIdToStage [ i ] , 1 , path ) ; } } } i ++ ; } throw new UnsupportedOperationException ( "Unable to find ordinal input stage of " + path [ 0 ] ) ; }
start with ordinal selection of input stages then ordinal selection of each output ring there after . todo : do generic return that extends pronghornstage
