-
Notifications
You must be signed in to change notification settings - Fork 99
Support TsFile properties and optional table point counting #882
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
Open
jt2594838
wants to merge
10
commits into
develop
Choose a base branch
from
add_property_read_write_interface
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
91734b3
add property read-write interface
jt2594838 395e57a
May record table point count
jt2594838 9524765
Add perf test
jt2594838 5ffa041
Add table point count repair tool
jt2594838 efed191
add point-count tool
jt2594838 9d097aa
add point-count tool
jt2594838 d327fae
supplement usage for other os
jt2594838 339a1f1
supplement usage for other os
jt2594838 888166d
use byte[] for properties
jt2594838 a095b07
use byte[8] for table point count
jt2594838 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
49 changes: 49 additions & 0 deletions
49
java/tools/src/assembly/resources/tools/tsfile-table-point-count.bat
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| @REM | ||
| @REM Licensed to the Apache Software Foundation (ASF) under one | ||
| @REM or more contributor license agreements. See the NOTICE file | ||
| @REM distributed with this work for additional information | ||
| @REM regarding copyright ownership. The ASF licenses this file | ||
| @REM to you under the Apache License, Version 2.0 (the | ||
| @REM "License"); you may not use this file except in compliance | ||
| @REM with the License. You may obtain a copy of the License at | ||
| @REM | ||
| @REM http://www.apache.org/licenses/LICENSE-2.0 | ||
| @REM | ||
| @REM Unless required by applicable law or agreed to in writing, | ||
| @REM software distributed under the License is distributed on an | ||
| @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| @REM KIND, either express or implied. See the License for the | ||
| @REM specific language governing permissions and limitations | ||
| @REM under the License. | ||
| @REM | ||
|
|
||
| @echo off | ||
| setlocal enabledelayedexpansion | ||
|
|
||
| if "%OS%" == "Windows_NT" setlocal | ||
|
|
||
| pushd %~dp0.. | ||
| if NOT DEFINED TSFILE_HOME set TSFILE_HOME=%CD% | ||
| popd | ||
|
|
||
| set JAVA_OPTS=-ea^ | ||
| -DTSFILE_HOME="%TSFILE_HOME%" | ||
|
|
||
| if NOT DEFINED JAVA_HOME goto :err | ||
|
|
||
| echo ------------------------------------------ | ||
| echo Starting TsFile Table Point Count Tool | ||
| echo ------------------------------------------ | ||
|
|
||
| set CLASSPATH="%TSFILE_HOME%\lib\*" | ||
| set MAIN_CLASS=org.apache.tsfile.utils.TsFileTablePointCountTool | ||
|
|
||
| @REM The argument is the TsFile to inspect. The tool rewrites its properties only when table-level | ||
| @REM point-count statistics are missing. | ||
| "%JAVA_HOME%\bin\java" -DTSFILE_HOME=!TSFILE_HOME! !JAVA_OPTS! -cp !CLASSPATH! !MAIN_CLASS! %* | ||
| exit /b %ERRORLEVEL% | ||
|
|
||
| :err | ||
| echo JAVA_HOME environment variable must be set! | ||
| set ret_code=1 | ||
| exit /b %ret_code% |
50 changes: 50 additions & 0 deletions
50
java/tools/src/assembly/resources/tools/tsfile-table-point-count.sh
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
|
|
||
| echo ------------------------------------------ | ||
| echo Starting TsFile Table Point Count Tool | ||
| echo ------------------------------------------ | ||
|
|
||
| if [ -z "${TSFILE_HOME}" ]; then | ||
| export TSFILE_HOME="$(cd "`dirname "$0"`"/..; pwd)" | ||
| fi | ||
|
|
||
| if [ -n "$JAVA_HOME" ]; then | ||
| for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do | ||
| if [ -x "$java" ]; then | ||
| JAVA="$java" | ||
| break | ||
| fi | ||
| done | ||
| else | ||
| JAVA=java | ||
| fi | ||
|
|
||
| if [ -z $JAVA ] ; then | ||
| echo Unable to find java executable. Check JAVA_HOME and PATH environment variables. > /dev/stderr | ||
| exit 1; | ||
| fi | ||
|
|
||
| CLASSPATH=${TSFILE_HOME}/lib/* | ||
| MAIN_CLASS=org.apache.tsfile.utils.TsFileTablePointCountTool | ||
|
|
||
| # The argument is the TsFile to inspect. The tool rewrites its properties only when table-level | ||
| # point-count statistics are missing. | ||
| exec "$JAVA" -DTSFILE_HOME=${TSFILE_HOME} -cp "$CLASSPATH" "$MAIN_CLASS" "$@" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,5 +69,14 @@ | |
| <source>${maven.multiModuleProjectDirectory}/java/tools/src/assembly/resources/tools/arrow2tsfile.bat</source> | ||
| <destName>tools/arrow2tsfile.bat</destName> | ||
| </file> | ||
| <file> | ||
| <source>${maven.multiModuleProjectDirectory}/java/tools/src/assembly/resources/tools/tsfile-table-point-count.sh</source> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Packaging both launchers makes the repair utility directly available from the assembled tools distribution. The shell entry is explicitly marked executable, and the Windows launcher is placed beside it using the same tool name. |
||
| <destName>tools/tsfile-table-point-count.sh</destName> | ||
| <fileMode>0755</fileMode> | ||
| </file> | ||
| <file> | ||
| <source>${maven.multiModuleProjectDirectory}/java/tools/src/assembly/resources/tools/tsfile-table-point-count.bat</source> | ||
| <destName>tools/tsfile-table-point-count.bat</destName> | ||
| </file> | ||
| </files> | ||
| </assembly> | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section documents the tool point-count semantics, invocation, result statuses, in-place replacement behavior, and disk-space and backup considerations. The matching Chinese README and message bundles keep the user experience consistent with the project localization convention.