private TSInsertTabletReq genTSInsertTabletReq(Tablet tablet, boolean sorted, boolean isAligned) {
    if (!checkSorted(tablet)) {
      sortTablet(tablet);
    }

    TSInsertTabletReq request = new TSInsertTabletReq();

    for (IMeasurementSchema measurementSchema : tablet.getSchemas()) {
      if (measurementSchema.getMeasurementName() == null) {
        throw new IllegalArgumentException("measurement should be non null value");
      }
      request.addToMeasurements(measurementSchema.getMeasurementName());
      request.addToTypes(measurementSchema.getType().ordinal());
    }

    request.setPrefixPath(tablet.getDeviceId());
    request.setIsAligned(isAligned);
    request.setTimestamps(SessionUtils.getTimeBuffer(tablet));
    request.setValues(SessionUtils.getValueBuffer(tablet));
    request.setSize(tablet.getRowSize());
    return request;
  }
insert the aligned timeseries data of a device.

@param tablet data batch
@param sorted deprecated, whether times in Tablet are in ascending order
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java