private void updatePointsInsertedMetric(InsertNode insertNode, int pointsInserted) {
    MetricService.getInstance()
        .count(
            pointsInserted,
            Metric.QUANTITY.toString(),
            MetricLevel.CORE,
            Tag.NAME.toString(),
            Metric.POINTS_IN.toString(),
            Tag.DATABASE.toString(),
            tsFileResource.getDatabaseName(),
            Tag.REGION.toString(),
            tsFileResource.getDataRegionId(),
            Tag.TYPE.toString(),
            Metric.MEMTABLE_POINT_COUNT.toString());
    if (!insertNode.isGeneratedByRemoteConsensusLeader()) {
      MetricService.getInstance()
          .count(
              pointsInserted,
              Metric.LEADER_QUANTITY.toString(),
              MetricLevel.CORE,
              Tag.NAME.toString(),
              Metric.POINTS_IN.toString(),
              Tag.DATABASE.toString(),
              tsFileResource.getDatabaseName(),
              Tag.REGION.toString(),
              tsFileResource.getDataRegionId(),
              Tag.TYPE.toString(),
              Metric.MEMTABLE_POINT_COUNT.toString());
    }
  }
This class helps redo wal logs into a TsFile. Notice: You should update time map in {@link
TsFileResource} before using this class to avoid duplicated insertion and this class doesn't
guarantee concurrency safety.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/TsFilePlanRedoer.java