title: ThreadPoolExecutor: cancel tasks from invokeAll() when one task returns an error
body: <p>I have a threadpool executor doing the same operation for a list of keys coming in batches. so i am using invokeall() method to do the processing for a list of keys in a batch. the usecase is such that if any of the tasks in a batch returns an error, there is no point to continue processing for other keys. So </p>
  
  <ol>
  <li>how can i cancel the tasks of the batch execution once a task has retuned an error.</li>
  <li>but not effect the other batch of keys execution. ie the cancellation should be isolated per batch.</li>
  </ol>
  
  <p>Thanks for your help.</p>