@Override
  public synchronized void close() {
    for (final Event event : events) {
      if (event instanceof EnrichedEvent) {
        ((EnrichedEvent) event).clearReferenceCount(this.getClass().getName());
      }
    }
    allocatedMemoryBlock.close();
  }
Try offer {@link Event} into cache if the given {@link Event} is not duplicated.

@param event the given {@link Event}
@return {@link true} if the batch can be transferred
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/pipeconsensus/payload/builder/PipeConsensusTransferBatchReqBuilder.java