public Void call() throws Exception {
  final List<Future<Void>> tasks=new LinkedList<Future<Void>>();
  try {
    for (    IV<?,?> termId : graphs) {
      final FutureTask<Void> ft=new FutureTask<Void>(new DrainIteratorTask(termId));
      tasks.add(ft);
      executor.execute(ft);
    }
    for (    Future<Void> f : tasks) {
      f.get();
    }
  }
 catch (  Throwable ex) {
    for (    Future<Void> f : tasks)     f.cancel(true);
    throw new RuntimeException(ex);
  }
 finally {
    buffer.close();
  }
  return null;
}

public Void call ( ) throws Exception { final List < Future < Void > > tasks = new LinkedList < Future < Void > > ( ) ; try { for ( IV < ? , ? > termId : graphs ) { final FutureTask < Void > ft = new FutureTask < Void > ( new DrainIteratorTask ( termId ) ) ; tasks . add ( ft ) ; executor . execute ( ft ) ; } for ( Future < Void > f : tasks ) { f . get ( ) ; } } catch ( Throwable ex ) { for ( Future < Void > f : tasks ) f . cancel ( true ) ; throw new RuntimeException ( ex ) ; } finally { buffer . close ( ) ; } return null ; }
outer callable submits tasks for execution .
