protected synchronized boolean onEvent(
      final @NonNull EnrichedEvent event, final Consumer<SubscriptionEvent> consumer)
      throws Exception {
    if (event instanceof TabletInsertionEvent) {
      onTabletInsertionEvent((TabletInsertionEvent) event);
      enrichedEvents.add(event);
    } else if (event instanceof TsFileInsertionEvent) {
      onTsFileInsertionEvent((TsFileInsertionEvent) event);
      enrichedEvents.add(event);
    } else {
      LOGGER.warn(
          "SubscriptionPipeEventBatch {} ignore EnrichedEvent {} when batching.", this, event);
    }
    return onEvent(consumer);
  }
@return {@code true} if there are subscription events consumed.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/subscription/event/batch/SubscriptionPipeEventBatch.java