@Override
  public void flush() throws IOException {
    synchronized (currentDataFileWriterLock) {
      if (!isClosed && currentBlobWriterComponents != null) {
        currentBlobWriterComponents.dataFileWriter.flush();
      }
    }
  }
This method flushes all records written in dataFileWriter to the underlying AzureBlobOutputStream.
dataFileWriter.flush then explicitly invokes flush of the AzureBlobOutputStream.
This in turn async uploads content of the output stream as a block and reinits the output stream.
AzureBlobOutputStream.flush is not ensured if dataFileWriter.flush fails.
In such a scenario, the current block is not uploaded and blocks uploaded so far are lost.
{@inheritDoc}
@throws IOException if underlying dataFileWriter.flush fails
samza-azure/src/main/java/org/apache/samza/system/azureblob/avro/AzureBlobAvroWriter.java