code: public void destroy() {
          logger.trace("{} - Destroy called on Batch", name);
          scheduler.shutdown();
  
          try {
              if (!scheduler.awaitTermination(maxAwaitTimeShutdown, TimeUnit.MILLISECONDS)) {
                  logger.warn(
                          "Could not terminate batch within {}. Forcing shutdown.",
                          DurationFormatUtils.formatDurationWords(
                                  maxAwaitTimeShutdown,
                                  true,
                                  true
                          )
                  );
                  scheduler.shutdownNow();
              }
          } catch (final InterruptedException e) {
              Thread.currentThread().interrupt();
              logger.debug("Interrupted while waiting.", e);
          }
  
          flush();
      }
docs: Destroys this batch.