@Override
  protected void releaseResource(final Event event) {
    if (event instanceof EnrichedEvent) {
      ((EnrichedEvent) event)
          .decreaseReferenceCount(AbstractPipeListeningQueue.class.getName(), false);
    }
  }
{@link AbstractPipeListeningQueue} is the encapsulation of the {@link
AbstractSerializableListeningQueue} to enable using reference count to control opening and
closing. This class also enables a {@link PipeTask} to find the snapshots close enough to send if
existed.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/datastructure/queue/listening/AbstractPipeListeningQueue.java