feat: pass -Dtsfile.locale=zh to JVM under with-zh-locale build#17716
Open
JackieTien97 wants to merge 2 commits into
Open
feat: pass -Dtsfile.locale=zh to JVM under with-zh-locale build#17716JackieTien97 wants to merge 2 commits into
JackieTien97 wants to merge 2 commits into
Conversation
TsFile (apache/tsfile#820) selects its message locale at runtime via the -Dtsfile.locale system property. Wire IoTDB's with-zh-locale build to emit a filtered conf/iotdb-locale.{sh,bat} that the env scripts source on startup, appending -Dtsfile.locale=zh to IOTDB_JMX_OPTS / CONFIGNODE_JMX_OPTS so packaged Chinese builds also get Chinese log/exception messages from tsfile.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17716 +/- ##
============================================
+ Coverage 40.38% 40.40% +0.01%
Complexity 2574 2574
============================================
Files 5179 5179
Lines 349660 349660
Branches 44689 44689
============================================
+ Hits 141217 141272 +55
+ Misses 208443 208388 -55 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
TsFile PR #820 adds runtime i18n for log/exception messages, selected at JVM startup via
-Dtsfile.locale=zh(orLocale.getDefault()). The PR description explicitly asks IoTDB's Chinese build to pass that option from the startup scripts.This change wires the
with-zh-localeMaven profile to do exactly that — packaged Chinese builds now also get Chinese messages from tsfile, with no change required on the user's side.Mechanism
A single small file
conf/iotdb-locale.{sh,bat}holds the JVM option behind a Maven placeholder:\"\"→ no JVM option appended.with-zh-localebuild: filtered to\"-Dtsfile.locale=zh\"→ appended toIOTDB_JMX_OPTS/CONFIGNODE_JMX_OPTS.The existing complex
datanode-env.{sh,bat}andconfignode-env.{sh,bat}are copied unchanged; they eachsource/CALLthe locale file on startup and append\$TSFILE_LOCALE_JVM_OPTonly when non-empty. Filtering is isolated to the tiny new file so the existing scripts'\${item_arr[@]}and@REMpatterns can't be misinterpreted by the Maven filter.Files changed
pom.xml— new propertytsfile.locale.opt(empty by default;-Dtsfile.locale=zhunderwith-zh-locale)scripts/conf/iotdb-locale.sh(new) +scripts/conf/windows/iotdb-locale.bat(new)scripts/conf/datanode-env.sh,scripts/conf/confignode-env.sh, and the Windows.batcounterparts — source the locale fileiotdb-locale.*:iotdb-core/datanode/src/assembly/server.xml,iotdb-core/confignode/src/assembly/confignode.xml,distribution/src/assembly/{datanode,confignode,all}.xml,integration-test/src/assembly/mpp-test.xmlTest plan
iotdb-core/datanodewith default profile — packagedconf/iotdb-locale.shresolves toTSFILE_LOCALE_JVM_OPT=\"\"iotdb-core/datanodewith-P with-zh-locale— packagedconf/iotdb-locale.shresolves toTSFILE_LOCALE_JVM_OPT=\"-Dtsfile.locale=zh\"; same result for the.batiotdb-core/confignode— both.shand.batfilter correctlydatanode-env.shis copied unchanged (filter is scoped toiotdb-locale.*only) and that the new "Apply tsfile locale" block appears in the packaged fileScope note
Covers DataNode and ConfigNode, the heavy tsfile users called out in the tsfile PR. CLI (
start-cli.sh) andscripts/tools/*.shdon't currently source these env files; can be extended separately if needed.Pairs with apache/tsfile#820 — no coordinated release required, since the tsfile JAR ships a single artifact and tsfile falls back to English when the option is absent.