@Override
 public void run() {
   try {
     while (moreDocumentsExist()) {
       index(inputPipeline.take());
     }
   } catch (Throwable e) {
     throw new RuntimeException(e);
   } finally {
     cleanIndex();
   }
 }