Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/build issues outside of china #12600

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
104dc71
fix: Hopefully fixed the build of the cpp-example on windows systems
chrisdutz Aug 17, 2023
0db1a8f
Merge remote-tracking branch 'upstream/master'
chrisdutz Aug 17, 2023
1bdc2cf
Merge remote-tracking branch 'upstream/master'
chrisdutz Aug 18, 2023
0ea9e78
Merge remote-tracking branch 'upstream/master'
chrisdutz Aug 21, 2023
4b79d7a
Merge remote-tracking branch 'upstream/master'
chrisdutz Aug 31, 2023
5e54115
Merge remote-tracking branch 'upstream/master'
chrisdutz Aug 31, 2023
b16c9a0
Merge remote-tracking branch 'upstream/master'
chrisdutz Sep 5, 2023
d162a48
Merge branch 'apache:master' into master
chrisdutz Sep 6, 2023
13ef12e
Merge remote-tracking branch 'upstream/master'
chrisdutz Sep 7, 2023
4f22e11
Merge branch 'apache:master' into master
chrisdutz Sep 8, 2023
bbbf3e3
Merge remote-tracking branch 'upstream/master'
chrisdutz Sep 14, 2023
8a56b00
Merge remote-tracking branch 'upstream/master'
chrisdutz Sep 19, 2023
2ad77a6
Merge remote-tracking branch 'upstream/master'
chrisdutz Oct 17, 2023
383d101
Merge remote-tracking branch 'upstream/master'
chrisdutz Nov 1, 2023
f6f4ac6
Merge remote-tracking branch 'upstream/master'
chrisdutz Nov 7, 2023
e1c6f72
fix: Increase the timeout even more to finally make the build succeed.
chrisdutz Nov 7, 2023
8a18cf3
Merge remote-tracking branch 'upstream/master'
chrisdutz Nov 9, 2023
8b9075a
Merge remote-tracking branch 'upstream/master'
chrisdutz Nov 29, 2023
a6c11a0
Merge remote-tracking branch 'upstream/master'
chrisdutz Nov 29, 2023
18ccb78
Merge remote-tracking branch 'upstream/master'
chrisdutz Jan 3, 2024
1c5d175
Merge remote-tracking branch 'upstream/master'
chrisdutz Jan 8, 2024
d650a88
Merge remote-tracking branch 'upstream/master'
chrisdutz Jan 9, 2024
c84581a
Merge remote-tracking branch 'upstream/master'
chrisdutz Jan 23, 2024
f6e5f1c
Merge remote-tracking branch 'upstream/master'
chrisdutz Jan 30, 2024
bf64c2f
Merge remote-tracking branch 'upstream/master'
chrisdutz Feb 5, 2024
66680d1
Merge remote-tracking branch 'upstream/master'
chrisdutz Mar 13, 2024
9e62ab3
Merge remote-tracking branch 'upstream/master'
chrisdutz Mar 14, 2024
24f7842
fix: Fix the build.
chrisdutz Mar 14, 2024
9012fa9
Merge remote-tracking branch 'refs/remotes/origin/master'
chrisdutz Apr 15, 2024
9e5b39a
Merge remote-tracking branch 'refs/remotes/upstream/master'
chrisdutz Apr 15, 2024
055fc0d
Merge remote-tracking branch 'refs/remotes/upstream/master'
chrisdutz Apr 18, 2024
c08a231
Merge remote-tracking branch 'refs/remotes/upstream/master'
chrisdutz Apr 22, 2024
1134199
Merge remote-tracking branch 'refs/remotes/upstream/master'
chrisdutz May 2, 2024
a835848
Merge remote-tracking branch 'refs/remotes/upstream/master'
chrisdutz May 17, 2024
ac5791a
Merge remote-tracking branch 'refs/remotes/upstream/master'
chrisdutz May 24, 2024
9d7e9bd
Merge remote-tracking branch 'refs/remotes/upstream/master'
chrisdutz May 27, 2024
144d519
fix: Updated the test that were failing outside of china to versions …
chrisdutz May 27, 2024
381c7c1
fix: Applied Spottless rules
chrisdutz May 27, 2024
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 @@ -28,6 +28,7 @@ public class MppJVMConfig implements JVMConfig {
private int initHeapSize;
private int maxHeapSize;
private int maxDirectMemorySize;
private String timezone;

@Override
public JVMConfig setInitHeapSize(int initSize) {
Expand All @@ -52,6 +53,13 @@ public JVMConfig setMaxDirectMemorySize(int maxSize) {
return this;
}

public JVMConfig setTimezone(String timezone) {
if (timezone != null) {
this.timezone = timezone;
}
return this;
}

public int getInitHeapSize() {
return initHeapSize;
}
Expand All @@ -64,6 +72,10 @@ public int getMaxDirectMemorySize() {
return maxDirectMemorySize;
}

public String getTimezone() {
return timezone;
}

private void validate() {
if (initHeapSize > maxHeapSize) {
throw new IllegalArgumentException(
Expand All @@ -81,6 +93,7 @@ public void override(@Nullable MppJVMConfig config) {
this.setInitHeapSize(config.getInitHeapSize());
this.setMaxHeapSize(config.getMaxHeapSize());
this.setMaxDirectMemorySize(config.getMaxDirectMemorySize());
this.setTimezone(config.getTimezone());
}

public static Builder builder() {
Expand Down Expand Up @@ -109,6 +122,11 @@ public Builder setMaxDirectMemorySize(int size) {
return this;
}

public Builder setTimezone(String timezone) {
this.config.setTimezone(timezone);
return this;
}

public MppJVMConfig build() {
config.validate();
return config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ public void start() {
"-Djava.rmi.server.hostname=" + getIp(),
"-Xms" + jvmConfig.getInitHeapSize() + "m",
"-Xmx" + jvmConfig.getMaxHeapSize() + "m",
"-Duser.timezone=" + jvmConfig.getTimezone(),
"-XX:MaxDirectMemorySize=" + jvmConfig.getMaxDirectMemorySize() + "m",
"-Djdk.nio.maxCachedBufferSize=262144",
"-D" + IoTDBConstant.INTEGRATION_TEST_KILL_POINTS + "=" + killPoints.toString(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ protected MppJVMConfig initVMConfig() {
.setMaxHeapSize(EnvUtils.getIntFromSysVar(CONFIG_NODE_MAX_HEAP_SIZE, 256, clusterIndex))
.setMaxDirectMemorySize(
EnvUtils.getIntFromSysVar(CONFIG_NODE_MAX_DIRECT_MEMORY_SIZE, 256, clusterIndex))
.setTimezone("Asia/Shanghai")
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.stream.Stream;

public class IoTDBTestReporter {
Expand All @@ -52,11 +55,13 @@ public static void main(String[] args) throws IOException {
for (String l : lines) {
String[] parts = l.split("\t");
if (parts.length == 2) {
IoTDBTestStat stat = new IoTDBTestStat(parts[1], Double.parseDouble(parts[0]));
NumberFormat f = NumberFormat.getInstance(Locale.getDefault());
double seconds = f.parse(parts[0]).doubleValue();
IoTDBTestStat stat = new IoTDBTestStat(parts[1], seconds);
stats.add(stat);
}
}
} catch (IOException e) {
} catch (IOException | ParseException e) {
IoTDBTestLogger.logger.error("read stats file failed", e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Locale;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -113,22 +114,22 @@ public void testFlushGivenGroup() {

for (int i = 1; i <= 3; i++) {
for (int j = 10; j < 20; j++) {
statement.execute(String.format(insertTemplate, i, j, j, j * 0.1, j));
statement.execute(String.format(Locale.CHINA, insertTemplate, i, j, j, j * 0.1, j));
}
}
statement.execute("FLUSH");

for (int i = 1; i <= 3; i++) {
for (int j = 0; j < 10; j++) {
statement.execute(String.format(insertTemplate, i, j, j, j * 0.1, j));
statement.execute(String.format(Locale.CHINA, insertTemplate, i, j, j, j * 0.1, j));
}
}
statement.execute("FLUSH root.group1");
statement.execute("FLUSH root.group2,root.group3");

for (int i = 1; i <= 3; i++) {
for (int j = 0; j < 30; j++) {
statement.execute(String.format(insertTemplate, i, j, j, j * 0.1, j));
statement.execute(String.format(Locale.CHINA, insertTemplate, i, j, j, j * 0.1, j));
}
}
statement.execute("FLUSH root.group1 TRUE");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Random;

import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -83,8 +84,15 @@ private static String generateInsertionSQL(
boolean boolValue,
String _text) {
return String.format(
Locale.CHINA,
"insert into root.sg.d1(time, s1, s2, s3, s4, s5, s6) values (%d, %d, %d, %f, %f, %s, %s);",
time, intValue32, intValue64, floatValue, doubleValue, boolValue ? "true" : "false", _text);
time,
intValue32,
intValue64,
floatValue,
doubleValue,
boolValue ? "true" : "false",
_text);
}

@BeforeClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
import org.junit.runners.model.InitializationError;
import org.slf4j.Logger;

import java.util.TimeZone;

public class IoTDBTestRunner extends BlockJUnit4ClassRunner {

private static final Logger logger = IoTDBTestLogger.logger;
Expand All @@ -41,6 +43,7 @@ public IoTDBTestRunner(Class<?> testClass) throws InitializationError {

@Override
public void run(RunNotifier notifier) {
TimeZone.setDefault(TimeZone.getTimeZone("Bejing"));
listener = new IoTDBTestListener(this.getName());
notifier.addListener(listener);
super.run(notifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@

import org.apache.iotdb.db.queryengine.execution.operator.process.fill.IFillFilter;

import java.time.Instant;
import java.time.ZoneId;
import java.time.ZoneOffset;

public abstract class AbstractMonthIntervalFillFilter implements IFillFilter {

Expand All @@ -35,12 +33,9 @@ public abstract class AbstractMonthIntervalFillFilter implements IFillFilter {
// non-month part of time duration, its precision is same as current time_precision
protected final long nonMonthDuration;

protected final ZoneOffset zoneOffset;

AbstractMonthIntervalFillFilter(int monthDuration, long nonMonthDuration, ZoneId zone) {
this.monthDuration = monthDuration;
this.nonMonthDuration = nonMonthDuration;
this.zone = zone;
this.zoneOffset = zone.getRules().getOffset(Instant.now());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;

public class MonthIntervalMSFillFilter extends AbstractMonthIntervalFillFilter {

Expand All @@ -33,10 +34,11 @@ public MonthIntervalMSFillFilter(int monthDuration, long nonMonthDuration, ZoneI
public boolean needFill(long time, long previousTime) {
long smaller = Math.min(time, previousTime);
long greater = Math.max(time, previousTime);
Instant instant = Instant.ofEpochMilli(smaller);
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
Instant smallerInstant = Instant.ofEpochMilli(smaller);
LocalDateTime smallerDateTime = LocalDateTime.ofInstant(smallerInstant, zone);
ZoneOffset smallerOffset = zone.getRules().getStandardOffset(smallerInstant);
long epochMilli =
localDateTime.plusMonths(monthDuration).toInstant(zoneOffset).toEpochMilli()
smallerDateTime.plusMonths(monthDuration).toInstant(smallerOffset).toEpochMilli()
+ nonMonthDuration;
return epochMilli >= greater;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.temporal.ChronoField;

public class MonthIntervalNSFillFilter extends AbstractMonthIntervalFillFilter {
Expand All @@ -34,10 +35,15 @@ public MonthIntervalNSFillFilter(int monthDuration, long nonMonthDuration, ZoneI
public boolean needFill(long time, long previousTime) {
long smaller = Math.min(time, previousTime);
long greater = Math.max(time, previousTime);
Instant instant = Instant.ofEpochSecond(smaller / 1_000_000_000L, smaller % 1_000_000_000L);
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
Instant smallerInstant =
Instant.ofEpochSecond(smaller / 1_000_000_000L, smaller % 1_000_000_000L);
LocalDateTime smallerDateTime = LocalDateTime.ofInstant(smallerInstant, zone);
ZoneOffset smallerOffset = zone.getRules().getStandardOffset(smallerInstant);
Instant upper =
localDateTime.plusMonths(monthDuration).plusNanos(nonMonthDuration).toInstant(zoneOffset);
smallerDateTime
.plusMonths(monthDuration)
.plusNanos(nonMonthDuration)
.toInstant(smallerOffset);
long timeInNs =
upper.getLong(ChronoField.NANO_OF_SECOND) + upper.getEpochSecond() * 1_000_000_000L;
return timeInNs >= greater;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.temporal.ChronoField;

import static java.time.temporal.ChronoUnit.MICROS;
Expand All @@ -36,13 +37,14 @@ public MonthIntervalUSFillFilter(int monthDuration, long nonMonthDuration, ZoneI
public boolean needFill(long time, long previousTime) {
long smaller = Math.min(time, previousTime);
long greater = Math.max(time, previousTime);
Instant instant = Instant.ofEpochSecond(smaller / 1_000_000L, smaller % 1_000_000L);
LocalDateTime localDateTime = LocalDateTime.ofInstant(instant, zone);
Instant smallerInstant = Instant.ofEpochSecond(smaller / 1_000_000L, smaller % 1_000_000L);
LocalDateTime smallerDateTime = LocalDateTime.ofInstant(smallerInstant, zone);
ZoneOffset smallerOffset = zone.getRules().getStandardOffset(smallerInstant);
Instant upper =
localDateTime
smallerDateTime
.plusMonths(monthDuration)
.plus(nonMonthDuration, MICROS)
.toInstant(zoneOffset);
.toInstant(smallerOffset);
long timeInUs =
upper.getLong(ChronoField.MICRO_OF_SECOND) + upper.getEpochSecond() * 1_000_000L;
return timeInUs >= greater;
Expand Down
Loading
Loading