public void waitToFinish(){
  flush();
  if (future != null) {
    try {
      future.get();
    }
 catch (    InterruptedException|ExecutionException e) {
      LOG.error(e.getMessage());
    }
  }
  LOG.info("All tasks done!");
}

public void waitToFinish ( ) { flush ( ) ; if ( future != null ) { try { future . get ( ) ; } catch ( InterruptedException | ExecutionException e ) { LOG . error ( e . getMessage ( ) ) ; } } LOG . info ( "All tasks done!" ) ; }
block the main thread until all of the transactions have finished loading
