public static boolean isShouldReplicate(EnrichedEvent enrichedEvent) {
    if (enrichedEvent instanceof TsFileInsertionEvent
        && ((PipeTsFileInsertionEvent) enrichedEvent).isGeneratedByPipeConsensus()) {
      // Only user-generated TsFileInsertionEvent can be replicated. Any tsFile synchronized from a
      // replica should not be replicated again
      return false;
    }
    // Only user-generated TabletInsertionEvent can be replicated.
    return isContainLocalData(enrichedEvent);
  }
Judge whether a given event should be replicated or sent by consensus pipe. Only events that
pass this check can be assigned a specific value for `EnrichedEvent.replicateIndexForIoTV2`

@param enrichedEvent
@return true if event is totally generated by client operation instead of consensus
    replication.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/processor/pipeconsensus/PipeConsensusProcessor.java