Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ private static void createTemplate()
session.setSchemaTemplate("template1", "root.sg_1");
}

private static final SecureRandom Random = new SecureRandom();

/** Method 1 for insert tablet with aligned timeseries */
private static void insertTabletWithAlignedTimeseriesMethod1()
throws IoTDBConnectionException, StatementExecutionException {
Expand All @@ -355,10 +357,8 @@ private static void insertTabletWithAlignedTimeseriesMethod1()
for (long row = 1; row < 100; row++) {
int rowIndex = tablet.getRowSize();
tablet.addTimestamp(rowIndex, timestamp);
tablet.addValue(
schemaList.get(0).getMeasurementName(), rowIndex, new SecureRandom().nextLong());
tablet.addValue(
schemaList.get(1).getMeasurementName(), rowIndex, new SecureRandom().nextInt());
tablet.addValue(schemaList.get(0).getMeasurementName(), rowIndex, Random.nextLong());
tablet.addValue(schemaList.get(1).getMeasurementName(), rowIndex, Random.nextInt());

if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertAlignedTablet(tablet, true);
Expand Down Expand Up @@ -390,9 +390,9 @@ private static void insertTabletWithAlignedTimeseriesMethod2()
int row = tablet.getRowSize();
tablet.addTimestamp(row, time);

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

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

if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
session.insertAlignedTablet(tablet, true);
Expand Down Expand Up @@ -422,10 +422,10 @@ private static void insertNullableTabletWithAlignedTimeseries()
int row = tablet.getRowSize();
tablet.addTimestamp(row, time);

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

if (time % 5 != 0) {
tablet.addValue(row, 1, new SecureRandom().nextInt());
tablet.addValue(row, 1, Random.nextInt());
}

if (tablet.getRowSize() == tablet.getMaxRowNumber()) {
Expand Down Expand Up @@ -602,7 +602,7 @@ private static void insertTabletsWithAlignedTimeseries()
tablet2.addTimestamp(row2, timestamp);
tablet3.addTimestamp(row3, timestamp);
for (int i = 0; i < 2; i++) {
long value = new SecureRandom().nextLong();
long value = Random.nextLong();
tablet1.addValue(schemaList1.get(i).getMeasurementName(), row1, value);
tablet2.addValue(schemaList2.get(i).getMeasurementName(), row2, value);
tablet3.addValue(schemaList3.get(i).getMeasurementName(), row3, value);
Expand Down Expand Up @@ -658,7 +658,7 @@ private static void insertTabletsWithAlignedTimeseriesWithNullValue()
tablet2.addTimestamp(row2, timestamp);
tablet3.addTimestamp(row3, timestamp);
for (int i = 0; i < 2; i++) {
long value = new SecureRandom().nextLong();
long value = Random.nextLong();
tablet1.addValue(schemaList1.get(i).getMeasurementName(), row1, value);
tablet2.addValue(schemaList2.get(i).getMeasurementName(), row2, value);
tablet3.addValue(schemaList3.get(i).getMeasurementName(), row3, value);
Expand Down
Loading