protected int resamplePaths(final QueryEngine queryEngine,final int limitIn,final int round,final Path[] a,final Map<PathIds,EdgeSample> edgeSamples) throws Exception {
  if (queryEngine == null)   throw new IllegalArgumentException();
  if (limitIn <= 0)   throw new IllegalArgumentException();
  if (round <= 0)   throw new IllegalArgumentException();
  if (a == null)   throw new IllegalArgumentException();
  if (a.length == 0)   throw new IllegalArgumentException();
{
    if (log.isDebugEnabled())     log.debug("Re-sampling in-use vertices.");
    final Map<Vertex,AtomicInteger> vertexLimit=new LinkedHashMap<Vertex,AtomicInteger>();
    for (    Path x : a) {
      final int limit=x.getNewLimit(limitIn);
      final Vertex v=x.vertices[0];
      AtomicInteger theLimit=vertexLimit.get(v);
      if (theLimit == null) {
        vertexLimit.put(v,theLimit=new AtomicInteger());
      }
      theLimit.set(limit);
    }
    sampleVertices(queryEngine,vertexLimit);
  }
  if (log.isDebugEnabled())   log.debug("Re-sampling in-use path segments.");
  int nunderflow=0;
  final List<Callable<Boolean>> tasks=new LinkedList<Callable<Boolean>>();
  for (  Path x : a) {
    tasks.add(new ResamplePathTask(queryEngine,x,limitIn,edgeSamples));
  }
  for (  Callable<Boolean> task : tasks) {
    if (task.call()) {
      nunderflow++;
    }
  }
  return nunderflow;
}

protected int resamplePaths ( final QueryEngine queryEngine , final int limitIn , final int round , final Path [ ] a , final Map < PathIds , EdgeSample > edgeSamples ) throws Exception { if ( queryEngine == null ) throw new IllegalArgumentException ( ) ; if ( limitIn <= 0 ) throw new IllegalArgumentException ( ) ; if ( round <= 0 ) throw new IllegalArgumentException ( ) ; if ( a == null ) throw new IllegalArgumentException ( ) ; if ( a . length == 0 ) throw new IllegalArgumentException ( ) ; { if ( log . isDebugEnabled ( ) ) log . debug ( "Re-sampling in-use vertices." ) ; final Map < Vertex , AtomicInteger > vertexLimit = new LinkedHashMap < Vertex , AtomicInteger > ( ) ; for ( Path x : a ) { final int limit = x . getNewLimit ( limitIn ) ; final Vertex v = x . vertices [ 0 ] ; AtomicInteger theLimit = vertexLimit . get ( v ) ; if ( theLimit == null ) { vertexLimit . put ( v , theLimit = new AtomicInteger ( ) ) ; } theLimit . set ( limit ) ; } sampleVertices ( queryEngine , vertexLimit ) ; } if ( log . isDebugEnabled ( ) ) log . debug ( "Re-sampling in-use path segments." ) ; int nunderflow = 0 ; final List < Callable < Boolean > > tasks = new LinkedList < Callable < Boolean > > ( ) ; for ( Path x : a ) { tasks . add ( new ResamplePathTask ( queryEngine , x , limitIn , edgeSamples ) ) ; } for ( Callable < Boolean > task : tasks ) { if ( task . call ( ) ) { nunderflow ++ ; } } return nunderflow ; }
resample the initial vertices for the specified join paths and then resample the cutoff join for each given join path in path order .
