public void listenToTsFile(
      final String dataRegionId,
      final String databaseName,
      final TsFileResource tsFileResource,
      final boolean isLoaded,
      final boolean isGeneratedByPipe) {
    tsFileResource.setGeneratedByPipe(isGeneratedByPipe);
    // We don't judge whether listenToTsFileExtractorCount.get() == 0 here on purpose
    // because extractors may use tsfile events when some exceptions occur in the
    // insert nodes listening process.

    final PipeDataRegionAssigner assigner = dataRegionId2Assigner.get(dataRegionId);

    // only events from registered data region will be extracted
    if (assigner == null) {
      return;
    }

    assigner.publishToAssign(
        PipeRealtimeEventFactory.createRealtimeEvent(
            dataRegionId, assigner.isTableModel(), databaseName, tsFileResource, isLoaded));
  }
PipeInsertionEventListener is a singleton in each data node.

<p>It is used to listen to events from storage engine and publish them to pipe engine.

<p>2 kinds of events are extracted: 1. level-0 tsfile sealed event 2. insertion operation event

<p>All events extracted by this listener will be first published to different
PipeEventDataRegionAssigners (identified by data region id), and then PipeEventDataRegionAssigner
will filter events and assign them to different PipeRealtimeEventDataRegionExtractors.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/extractor/dataregion/realtime/listener/PipeInsertionDataNodeListener.java