@Override
  public void close() {
    synchronized (currentDataFileWriterLock) {
      if (isClosed) {
        throw new IllegalStateException("Attempting to close an already closed AzureBlobAvroWriter");
      }
      allBlobWriterComponents.forEach(blobWriterComponents -> {
        try {
          closeDataFileWriter(blobWriterComponents.dataFileWriter, blobWriterComponents.azureBlobOutputStream,
              blobWriterComponents.blockBlobAsyncClient);
        } catch (IOException e) {
          throw new SamzaException(e);
        }
      });
      isClosed = true;
    }
  }
This method closes all DataFileWriters and output streams associated with all the blobs created.
flush should be explicitly called before close.
{@inheritDoc}
@throws IllegalStateException when closing a closed writer
@throws SamzaException if underlying DataFileWriter.close fails
samza-azure/src/main/java/org/apache/samza/system/azureblob/avro/AzureBlobAvroWriter.java