Skip to content

Commit d383aaa

Browse files
committed
refactor: move TSFILE_LOCALE_JVM_OPT into iotdb-common.sh
Drop the separate iotdb-locale.sh and put the filtered placeholder directly in iotdb-common.sh, which is already sourced by start-*.sh before the env scripts run. The env scripts now just append $TSFILE_LOCALE_JVM_OPT when non-empty. Windows still uses a small iotdb-locale.bat since there is no shared common bat to filter.
1 parent 0e9ab54 commit d383aaa

10 files changed

Lines changed: 22 additions & 58 deletions

File tree

distribution/src/assembly/all.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<excludes>
6565
<exclude>ainode-env.*</exclude>
6666
<exclude>**/ainode-env.*</exclude>
67-
<exclude>iotdb-locale.*</exclude>
67+
<exclude>iotdb-common.sh</exclude>
6868
<exclude>**/iotdb-locale.*</exclude>
6969
</excludes>
7070
<fileMode>0755</fileMode>
@@ -73,7 +73,7 @@
7373
<outputDirectory>conf</outputDirectory>
7474
<directory>${project.basedir}/../scripts/conf</directory>
7575
<includes>
76-
<include>iotdb-locale.sh</include>
76+
<include>iotdb-common.sh</include>
7777
<include>windows/iotdb-locale.bat</include>
7878
</includes>
7979
<filtered>true</filtered>

distribution/src/assembly/confignode.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
<directory>${project.basedir}/../scripts/conf</directory>
5050
<outputDirectory>conf</outputDirectory>
5151
<includes>
52-
<include>iotdb-common.*</include>
5352
<include>confignode-env.*</include>
5453
<include>**/confignode-env.*</include>
5554
</includes>
@@ -59,7 +58,7 @@
5958
<directory>${project.basedir}/../scripts/conf</directory>
6059
<outputDirectory>conf</outputDirectory>
6160
<includes>
62-
<include>iotdb-locale.sh</include>
61+
<include>iotdb-common.sh</include>
6362
<include>windows/iotdb-locale.bat</include>
6463
</includes>
6564
<filtered>true</filtered>

distribution/src/assembly/datanode.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,6 @@
5151
</includes>
5252
<fileMode>0755</fileMode>
5353
</fileSet>
54-
<fileSet>
55-
<directory>${project.basedir}/../scripts/conf</directory>
56-
<outputDirectory>conf</outputDirectory>
57-
<includes>
58-
<include>iotdb-locale.sh</include>
59-
<include>windows/iotdb-locale.bat</include>
60-
</includes>
61-
<filtered>true</filtered>
62-
<fileMode>0755</fileMode>
63-
</fileSet>
6454
<fileSet>
6555
<directory>${project.basedir}/../scripts/sbin</directory>
6656
<outputDirectory>sbin</outputDirectory>

integration-test/src/assembly/mpp-test.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<outputDirectory>conf</outputDirectory>
5151
<directory>${project.basedir}/../scripts/conf</directory>
5252
<excludes>
53-
<exclude>iotdb-locale.*</exclude>
53+
<exclude>iotdb-common.sh</exclude>
5454
<exclude>**/iotdb-locale.*</exclude>
5555
</excludes>
5656
<fileMode>0755</fileMode>
@@ -59,7 +59,7 @@
5959
<outputDirectory>conf</outputDirectory>
6060
<directory>${project.basedir}/../scripts/conf</directory>
6161
<includes>
62-
<include>iotdb-locale.sh</include>
62+
<include>iotdb-common.sh</include>
6363
<include>windows/iotdb-locale.bat</include>
6464
</includes>
6565
<filtered>true</filtered>

iotdb-core/confignode/src/assembly/confignode.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
<directory>${project.basedir}/../../scripts/conf</directory>
5050
<outputDirectory>conf</outputDirectory>
5151
<includes>
52-
<include>iotdb-locale.sh</include>
5352
<include>windows/iotdb-locale.bat</include>
5453
</includes>
5554
<filtered>true</filtered>
@@ -82,6 +81,7 @@
8281
<file>
8382
<source>${project.basedir}/../../scripts/conf/iotdb-common.sh</source>
8483
<destName>conf/iotdb-common.sh</destName>
84+
<filtered>true</filtered>
8585
</file>
8686
</files>
8787
</assembly>

iotdb-core/datanode/src/assembly/server.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
<directory>${project.basedir}/../../scripts/conf</directory>
5050
<outputDirectory>conf</outputDirectory>
5151
<includes>
52-
<include>iotdb-locale.sh</include>
5352
<include>windows/iotdb-locale.bat</include>
5453
</includes>
5554
<filtered>true</filtered>
@@ -80,10 +79,11 @@
8079
<source>${project.basedir}/../node-commons/src/assembly/resources/conf/iotdb-system.properties</source>
8180
<destName>conf/iotdb-system.properties</destName>
8281
</file>
83-
<!-- copy iotdb-common.sh to different script folders-->
82+
<!-- copy iotdb-common.sh to different script folders (filtered for tsfile.locale.opt) -->
8483
<file>
8584
<source>${project.basedir}/../../scripts/conf/iotdb-common.sh</source>
8685
<destName>conf/iotdb-common.sh</destName>
86+
<filtered>true</filtered>
8787
</file>
8888
</files>
8989
</assembly>

scripts/conf/confignode-env.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,10 @@ CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS -Djdk.nio.maxCachedBufferSize=${MAX_CA
322322
CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS -XX:+CrashOnOutOfMemoryError"
323323
CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8"
324324

325-
# Apply tsfile locale option populated by Maven at package time
326-
# (see conf/iotdb-locale.sh; empty in default build, "-Dtsfile.locale=zh" under with-zh-locale).
327-
if [ -f "${CONFIGNODE_CONF}/iotdb-locale.sh" ]; then
328-
. "${CONFIGNODE_CONF}/iotdb-locale.sh"
329-
if [ -n "$TSFILE_LOCALE_JVM_OPT" ]; then
330-
CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS $TSFILE_LOCALE_JVM_OPT"
331-
fi
325+
# Append tsfile locale option populated by Maven at package time
326+
# (see conf/iotdb-common.sh; empty in default build, "-Dtsfile.locale=zh" under with-zh-locale).
327+
if [ -n "$TSFILE_LOCALE_JVM_OPT" ]; then
328+
CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS $TSFILE_LOCALE_JVM_OPT"
332329
fi
333330

334331
# if you want to dump the heap memory while OOM happening, you can use the following command, remember to replace ${heap_dump_dir}/confignode_heapdump.hprof with your own file path and the folder where this file is located needs to be created in advance

scripts/conf/datanode-env.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,10 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:SafepointTimeoutDelay=1000"
339339
IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+SafepointTimeout"
340340
IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8"
341341

342-
# Apply tsfile locale option populated by Maven at package time
343-
# (see conf/iotdb-locale.sh; empty in default build, "-Dtsfile.locale=zh" under with-zh-locale).
344-
if [ -f "${IOTDB_CONF}/iotdb-locale.sh" ]; then
345-
. "${IOTDB_CONF}/iotdb-locale.sh"
346-
if [ -n "$TSFILE_LOCALE_JVM_OPT" ]; then
347-
IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS $TSFILE_LOCALE_JVM_OPT"
348-
fi
342+
# Append tsfile locale option populated by Maven at package time
343+
# (see conf/iotdb-common.sh; empty in default build, "-Dtsfile.locale=zh" under with-zh-locale).
344+
if [ -n "$TSFILE_LOCALE_JVM_OPT" ]; then
345+
IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS $TSFILE_LOCALE_JVM_OPT"
349346
fi
350347

351348
# option below tries to optimize safepoint stw time for large counted loop.

scripts/conf/iotdb-common.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
# under the License.
1919
#
2020

21+
# JVM option for selecting tsfile's runtime locale (log/exception messages).
22+
# Filtered by Maven at package time:
23+
# - Default build: empty (English).
24+
# - `with-zh-locale` profile: "-Dtsfile.locale=zh".
25+
TSFILE_LOCALE_JVM_OPT="@tsfile.locale.opt@"
26+
2127

2228
# this function is for parsing the variables like "A=B" in `start-server.sh -D A=B`
2329
# The command just parse IOTDB-prefixed variables and ignore all other variables

scripts/conf/iotdb-locale.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)