public void stop() {
    log.info("Stopping the coordinator stream producer.");
    coordinatorStreamSystemProducer.flush(SOURCE);
    coordinatorStreamSystemProducer.stop();
  }
This method stops the writer and closes the coordinator stream producer
samza-core/src/main/java/org/apache/samza/coordinator/stream/CoordinatorStreamWriter.java