protected void writeDataPoint(long timestamp, TsPrimitiveType value, IChunkWriter chunkWriter) {
    if (chunkWriter instanceof ChunkWriterImpl) {
      ChunkWriterImpl chunkWriterImpl = (ChunkWriterImpl) chunkWriter;
      switch (chunkWriterImpl.getDataType()) {
        case TEXT:
        case STRING:
        case BLOB:
          chunkWriterImpl.write(timestamp, value.getBinary());
          break;
        case DOUBLE:
          chunkWriterImpl.write(timestamp, value.getDouble());
          break;
        case BOOLEAN:
          chunkWriterImpl.write(timestamp, value.getBoolean());
          break;
        case INT64:
        case TIMESTAMP:
          chunkWriterImpl.write(timestamp, value.getLong());
          break;
        case INT32:
        case DATE:
          chunkWriterImpl.write(timestamp, value.getInt());
          break;
        case FLOAT:
          chunkWriterImpl.write(timestamp, value.getFloat());
          break;
        default:
          throw new UnsupportedOperationException(
              "Unknown data type " + chunkWriterImpl.getDataType());
      }
    } else {
      AlignedChunkWriterImpl alignedChunkWriter = (AlignedChunkWriterImpl) chunkWriter;
      alignedChunkWriter.write(timestamp, value.getVector());
    }
  }
Update startTime and endTime of the current device in each target resources, and check whether
to flush chunk metadatas or not.

@throws IOException if io errors occurred
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/execute/utils/writer/AbstractCompactionWriter.java