private static void insertTabletWithAlignedTimeseriesMethod2()
      throws IoTDBConnectionException, StatementExecutionException {
    // The schema of measurements of one device
    // only measurementId and data type in MeasurementSchema take effects in Tablet
    List<IMeasurementSchema> schemaList = new ArrayList<>();
    schemaList.add(new MeasurementSchema("s1", TSDataType.INT64));
    schemaList.add(new MeasurementSchema("s2", TSDataType.INT32));

    Tablet tablet = new Tablet(ROOT_SG1_D1_VECTOR2, schemaList);

    for (long time = 100; time < 200; time++) {
      int row = tablet.getRowSize();
      tablet.addTimestamp(row, time);

      tablet.addValue(row, 0, new SecureRandom().nextLong());

      tablet.addValue(row, 1, new SecureRandom().nextInt());

      if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
        session.insertAlignedTablet(tablet, true);
        tablet.reset();
      }
    }

    if (tablet.getRowSize() != 0) {
      session.insertAlignedTablet(tablet, true);
      tablet.reset();
    }

    session.executeNonQueryStatement(FLUSH);
  }
Method 2 for insert tablet with aligned timeseries
example/session/src/main/java/org/apache/iotdb/AlignedTimeseriesSessionExample.java