@SuppressWarnings({"squid:S3776", "squid:S6541"}) // Suppress high Cognitive Complexity warning
  public void insertTablet(InsertTabletNode insertTabletNode)
      throws BatchProcessException, WriteProcessException {
    StorageEngine.blockInsertionIfReject();
    long startTime = System.nanoTime();
    writeLock("insertTablet");
    PERFORMANCE_OVERVIEW_METRICS.recordScheduleLockCost(System.nanoTime() - startTime);
    try {
      if (deleted) {
        logger.info(
            "Won't insert tablet {}, because region is deleted", insertTabletNode.getSearchIndex());
        return;
      }
      TSStatus[] results = new TSStatus[insertTabletNode.getRowCount()];
      Arrays.fill(results, RpcUtils.SUCCESS_STATUS);
      long[] infoForMetrics = new long[5];
      // infoForMetrics[0]: CreateMemtableBlockTimeCost
      // infoForMetrics[1]: ScheduleMemoryBlockTimeCost
      // infoForMetrics[2]: ScheduleWalTimeCost
      // infoForMetrics[3]: ScheduleMemTableTimeCost
      // infoForMetrics[4]: InsertedPointsNumber
      boolean noFailure = executeInsertTablet(insertTabletNode, results, infoForMetrics);
      updateTsFileProcessorMetric(insertTabletNode, infoForMetrics);

      if (!noFailure) {
        throw new BatchProcessException(results);
      }
    } finally {
      writeUnlock();
    }
  }
Insert a tablet into this database.

@throws BatchProcessException if some of the rows failed to be inserted
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java