You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tsfile.apache.org by ji...@apache.org on 2025/02/07 10:17:34 UTC
(tsfile) branch remove_code created (now a673c5922)
This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a change to branch remove_code
in repository https://gitbox.apache.org/repos/asf/tsfile.git
at a673c5922 remove everything except docs
This branch includes the following new commits:
new a673c5922 remove everything except docs
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(tsfile) 01/01: remove everything except docs
Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch remove_code
in repository https://gitbox.apache.org/repos/asf/tsfile.git
commit a673c5922ef4bf0863877c42e86dd406a4528bf9
Author: Tian Jiang <jt...@163.com>
AuthorDate: Fri Feb 7 18:17:27 2025 +0800
remove everything except docs
---
.github/workflows/code-coverage.yml | 42 -
.github/workflows/codeql.yml | 79 -
.github/workflows/site-build.yaml | 2 +
.github/workflows/unit-test-cpp-py.yml | 88 -
.github/workflows/unit-test-java.yml | 90 -
Jenkinsfile | 168 -
README-zh.md | 130 -
README.md | 129 -
RELEASE_NOTES.md | 81 -
checkstyle.xml | 250 -
codecov.yml | 54 -
cpp/.clang-format | 226 -
cpp/.gitignore | 7 -
cpp/CMakeLists.txt | 92 -
cpp/README-zh.md | 34 -
cpp/README.md | 86 -
cpp/VersionUpdater.groovy | 42 -
cpp/bench_mark/CMakeLists.txt | 33 -
cpp/bench_mark/bench_mark_src/CMakeLists.txt | 57 -
cpp/bench_mark/bench_mark_src/bench_conf.h | 27 -
cpp/bench_mark/bench_mark_src/bench_mark.cc | 161 -
cpp/bench_mark/bench_mark_src/bench_mark.h | 18 -
cpp/bench_mark/build.sh | 50 -
cpp/build.sh | 140 -
cpp/examples/CMakeLists.txt | 35 -
cpp/examples/build.sh | 32 -
cpp/examples/c_examples/CMakeLists.txt | 22 -
cpp/examples/c_examples/c_examples.c | 133 -
cpp/examples/c_examples/c_examples.h | 31 -
cpp/examples/cpp_examples/CMakeLists.txt | 22 -
cpp/examples/cpp_examples/cpp_examples.h | 33 -
cpp/examples/cpp_examples/demo_read.cpp | 97 -
cpp/examples/cpp_examples/demo_write.cpp | 114 -
cpp/examples/examples.cc | 31 -
cpp/pom.xml | 224 -
cpp/src/CMakeLists.txt | 68 -
cpp/src/common/CMakeLists.txt | 35 -
cpp/src/common/allocator/CMakeLists.txt | 26 -
cpp/src/common/allocator/alloc_base.h | 131 -
cpp/src/common/allocator/byte_stream.h | 1128 ---
cpp/src/common/allocator/mem_alloc.cc | 257 -
cpp/src/common/allocator/my_string.h | 182 -
cpp/src/common/allocator/object_pool.h | 110 -
cpp/src/common/allocator/page_arena.cc | 65 -
cpp/src/common/allocator/page_arena.h | 101 -
cpp/src/common/allocator/stl_allocator.h | 90 -
cpp/src/common/allocator/util_define.h | 152 -
cpp/src/common/config/CMakeLists.txt | 20 -
cpp/src/common/config/config.h | 69 -
cpp/src/common/constant/CMakeLists.txt | 18 -
cpp/src/common/constant/tsfile_constant.h | 45 -
cpp/src/common/container/CMakeLists.txt | 22 -
cpp/src/common/container/array.h | 305 -
cpp/src/common/container/bit_map.cc | 45 -
cpp/src/common/container/bit_map.h | 83 -
cpp/src/common/container/blocking_queue.cc | 57 -
cpp/src/common/container/blocking_queue.h | 44 -
cpp/src/common/container/byte_buffer.h | 127 -
cpp/src/common/container/hash_func.h | 106 -
cpp/src/common/container/hash_node.h | 73 -
cpp/src/common/container/hash_segm.h | 53 -
cpp/src/common/container/hash_table.h | 792 --
cpp/src/common/container/list.h | 150 -
cpp/src/common/container/murmur_hash3.cc | 138 -
cpp/src/common/container/murmur_hash3.h | 75 -
cpp/src/common/container/simple_vector.h | 60 -
cpp/src/common/container/slice.h | 148 -
cpp/src/common/container/sorted_array.h | 329 -
cpp/src/common/datatype/CMakeLists.txt | 18 -
cpp/src/common/datatype/value.h | 249 -
cpp/src/common/db_common.h | 189 -
cpp/src/common/device_id.h | 207 -
cpp/src/common/global.cc | 211 -
cpp/src/common/global.h | 40 -
cpp/src/common/logger/elog.h | 37 -
cpp/src/common/mutex/CMakeLists.txt | 20 -
cpp/src/common/mutex/mutex.h | 75 -
cpp/src/common/path.h | 76 -
cpp/src/common/record.h | 169 -
cpp/src/common/row_record.h | 235 -
cpp/src/common/schema.h | 338 -
cpp/src/common/seq_tvlist.h | 172 -
cpp/src/common/seq_tvlist.inc | 174 -
cpp/src/common/statistic.h | 1115 ---
cpp/src/common/tablet.cc | 315 -
cpp/src/common/tablet.h | 168 -
cpp/src/common/tablet_iterator.h | 78 -
cpp/src/common/tsblock/CMakeLists.txt | 22 -
cpp/src/common/tsblock/tsblock.cc | 310 -
cpp/src/common/tsblock/tsblock.h | 272 -
cpp/src/common/tsblock/tuple_desc.cc | 92 -
cpp/src/common/tsblock/tuple_desc.h | 120 -
.../common/tsblock/vector/fixed_length_vector.h | 82 -
.../common/tsblock/vector/variable_length_vector.h | 87 -
cpp/src/common/tsblock/vector/vector.h | 94 -
cpp/src/common/tsfile_common.cc | 369 -
cpp/src/common/tsfile_common.h | 1140 ---
cpp/src/common/tsfile_mgr.cc | 139 -
cpp/src/common/tsfile_mgr.h | 95 -
cpp/src/compress/CMakeLists.txt | 23 -
cpp/src/compress/compressor.c | 18 -
cpp/src/compress/compressor.h | 51 -
cpp/src/compress/compressor_factory.h | 73 -
cpp/src/compress/gzip_compressor.cc | 289 -
cpp/src/compress/gzip_compressor.h | 154 -
cpp/src/compress/lz4_compressor.cc | 140 -
cpp/src/compress/lz4_compressor.h | 66 -
cpp/src/compress/lzo_compressor.cc | 127 -
cpp/src/compress/lzo_compressor.h | 62 -
cpp/src/compress/snappy_compressor.cc | 115 -
cpp/src/compress/snappy_compressor.h | 63 -
cpp/src/compress/uncompressed_compressor.h | 54 -
cpp/src/cwrapper/CMakeLists.txt | 22 -
cpp/src/cwrapper/TsFile-cwrapper.cc | 853 --
cpp/src/cwrapper/TsFile-cwrapper.h | 235 -
cpp/src/encoding/CMakeLists.txt | 32 -
cpp/src/encoding/bitpack_decoder.h | 191 -
cpp/src/encoding/bitpack_encoder.h | 181 -
cpp/src/encoding/decoder.h | 43 -
cpp/src/encoding/decoder_factory.h | 97 -
cpp/src/encoding/dictionary_decoder.h | 78 -
cpp/src/encoding/dictionary_encoder.h | 106 -
cpp/src/encoding/encode_utils.h | 146 -
cpp/src/encoding/encoder.h | 54 -
cpp/src/encoding/encoder_factory.h | 126 -
cpp/src/encoding/gorilla_decoder.h | 427 -
cpp/src/encoding/gorilla_encoder.h | 481 -
cpp/src/encoding/intpacker.h | 156 -
cpp/src/encoding/plain_decoder.h | 59 -
cpp/src/encoding/plain_encoder.h | 68 -
cpp/src/encoding/ts2diff_decoder.h | 330 -
cpp/src/encoding/ts2diff_encoder.h | 350 -
cpp/src/encoding/zigzag_decoder.h | 200 -
cpp/src/encoding/zigzag_encoder.h | 168 -
cpp/src/file/CMakeLists.txt | 24 -
cpp/src/file/open_file.cc | 112 -
cpp/src/file/open_file.h | 137 -
cpp/src/file/read_file.cc | 159 -
cpp/src/file/read_file.h | 66 -
cpp/src/file/tsfile_io_reader.cc | 718 --
cpp/src/file/tsfile_io_reader.h | 137 -
cpp/src/file/tsfile_io_writer.cc | 876 --
cpp/src/file/tsfile_io_writer.h | 221 -
cpp/src/file/write_file.cc | 140 -
cpp/src/file/write_file.h | 61 -
cpp/src/parser/CMakeLists.txt | 22 -
cpp/src/parser/PathLexer.g4 | 212 -
cpp/src/parser/PathParser.g4 | 67 -
cpp/src/parser/generated/PathLexer.cpp | 470 -
cpp/src/parser/generated/PathLexer.h | 80 -
cpp/src/parser/generated/PathParser.cpp | 850 --
cpp/src/parser/generated/PathParser.h | 222 -
.../parser/generated/PathParserBaseListener.cpp | 24 -
cpp/src/parser/generated/PathParserBaseListener.h | 67 -
cpp/src/parser/generated/PathParserBaseVisitor.cpp | 24 -
cpp/src/parser/generated/PathParserBaseVisitor.h | 69 -
cpp/src/parser/generated/PathParserListener.cpp | 24 -
cpp/src/parser/generated/PathParserListener.h | 60 -
cpp/src/parser/generated/PathParserVisitor.cpp | 24 -
cpp/src/parser/generated/PathParserVisitor.h | 57 -
cpp/src/parser/path_nodes_generator.cpp | 47 -
cpp/src/parser/path_nodes_generator.h | 32 -
cpp/src/parser/path_parser_error.h | 77 -
cpp/src/parser/path_visitor.cpp | 111 -
cpp/src/parser/path_visitor.h | 49 -
cpp/src/reader/CMakeLists.txt | 23 -
cpp/src/reader/aligned_chunk_reader.cc | 634 --
cpp/src/reader/aligned_chunk_reader.h | 172 -
cpp/src/reader/bloom_filter.cc | 268 -
cpp/src/reader/bloom_filter.h | 128 -
cpp/src/reader/chunk_reader.cc | 492 -
cpp/src/reader/chunk_reader.h | 142 -
cpp/src/reader/expression.cc | 213 -
cpp/src/reader/expression.h | 149 -
cpp/src/reader/filter/and_filter.h | 89 -
cpp/src/reader/filter/between.h | 137 -
cpp/src/reader/filter/binary_filter.h | 45 -
cpp/src/reader/filter/eq.h | 72 -
cpp/src/reader/filter/filter.h | 65 -
cpp/src/reader/filter/filter_type.h | 51 -
cpp/src/reader/filter/gt.h | 70 -
cpp/src/reader/filter/gt_eq.h | 71 -
cpp/src/reader/filter/in.h | 57 -
cpp/src/reader/filter/lt.h | 69 -
cpp/src/reader/filter/lt_eq.h | 73 -
cpp/src/reader/filter/not_eq.h | 72 -
cpp/src/reader/filter/object.h | 274 -
cpp/src/reader/filter/or_filter.h | 106 -
cpp/src/reader/filter/time_filter.cc | 46 -
cpp/src/reader/filter/time_filter.h | 53 -
cpp/src/reader/filter/time_operator.cc | 311 -
cpp/src/reader/filter/time_operator.h | 229 -
cpp/src/reader/filter/unary_filter.h | 66 -
cpp/src/reader/ichunk_reader.h | 63 -
cpp/src/reader/qds_with_timegenerator.cc | 421 -
cpp/src/reader/qds_with_timegenerator.h | 142 -
cpp/src/reader/qds_without_timegenerator.cc | 197 -
cpp/src/reader/qds_without_timegenerator.h | 71 -
cpp/src/reader/query_executor.h | 63 -
cpp/src/reader/result_set.h | 96 -
cpp/src/reader/scan_iterator.cc | 258 -
cpp/src/reader/scan_iterator.h | 190 -
cpp/src/reader/tsfile_executor.cc | 117 -
cpp/src/reader/tsfile_executor.h | 59 -
cpp/src/reader/tsfile_reader.cc | 169 -
cpp/src/reader/tsfile_reader.h | 64 -
cpp/src/reader/tsfile_series_scan_iterator.cc | 159 -
cpp/src/reader/tsfile_series_scan_iterator.h | 118 -
cpp/src/utils/CMakeLists.txt | 19 -
cpp/src/utils/db_utils.h | 417 -
cpp/src/utils/errno_define.h | 77 -
cpp/src/utils/injection.h | 68 -
cpp/src/utils/storage_utils.h | 86 -
cpp/src/utils/util_define.h | 145 -
cpp/src/writer/CMakeLists.txt | 24 -
cpp/src/writer/chunk_writer.cc | 166 -
cpp/src/writer/chunk_writer.h | 145 -
cpp/src/writer/page_writer.cc | 200 -
cpp/src/writer/page_writer.h | 194 -
cpp/src/writer/time_chunk_writer.cc | 169 -
cpp/src/writer/time_chunk_writer.h | 109 -
cpp/src/writer/time_page_writer.cc | 170 -
cpp/src/writer/time_page_writer.h | 128 -
cpp/src/writer/tsfile_table_writer.cc | 41 -
cpp/src/writer/tsfile_table_writer.h | 42 -
cpp/src/writer/tsfile_writer.cc | 937 --
cpp/src/writer/tsfile_writer.h | 203 -
cpp/src/writer/value_chunk_writer.cc | 177 -
cpp/src/writer/value_chunk_writer.h | 131 -
cpp/src/writer/value_page_writer.cc | 190 -
cpp/src/writer/value_page_writer.h | 194 -
cpp/test/CMakeLists.txt | 100 -
cpp/test/common/allocator/alloc_base_test.cc | 96 -
cpp/test/common/allocator/byte_stream_test.cc | 286 -
cpp/test/common/allocator/my_string_test.cc | 105 -
cpp/test/common/allocator/page_arena_test.cc | 58 -
cpp/test/common/container/array_test.cc | 168 -
cpp/test/common/container/bit_map_test.cc | 93 -
cpp/test/common/container/byte_buffer_test.cc | 69 -
cpp/test/common/container/list_test.cc | 95 -
cpp/test/common/container/murmur_hash3_test.cc | 57 -
cpp/test/common/container/simple_vector_test.cc | 52 -
cpp/test/common/container/slice_test.cc | 96 -
cpp/test/common/container/sorted_array_test.cc | 157 -
cpp/test/common/datatype/value_test.cc | 127 -
cpp/test/common/record_test.cc | 127 -
cpp/test/common/row_record_test.cc | 156 -
cpp/test/common/schema_test.cc | 54 -
cpp/test/common/statistic_test.cc | 225 -
cpp/test/common/tablet_test.cc | 66 -
cpp/test/common/tsblock/tslock_test.cc | 153 -
cpp/test/common/tsblock/tuple_desc_test.cc | 104 -
.../tsblock/vector/fixed_length_vector_test.cc | 75 -
.../tsblock/vector/variable_length_vector_test.cc | 75 -
cpp/test/common/tsfile_common_test.cc | 478 -
cpp/test/compress/gzip_compressor_test.cc | 130 -
cpp/test/compress/lz4_compressor_test.cc | 129 -
cpp/test/compress/lzo_compressor_test.cc | 129 -
cpp/test/compress/snappy_compressor_test.cc | 129 -
cpp/test/cwrapper/cwrapper_test.cc | 47 -
cpp/test/encoding/bitpack_codec_test.cc | 289 -
cpp/test/encoding/dictionary_codec_test.cc | 101 -
cpp/test/encoding/gorilla_codec_test.cc | 110 -
cpp/test/encoding/inpacker_test.cc | 57 -
cpp/test/encoding/plain_codec_test.cc | 91 -
cpp/test/encoding/ts2diff_codec_test.cc | 103 -
cpp/test/encoding/zigzag_codec_test.cc | 136 -
cpp/test/file/open_file_test.cc | 108 -
cpp/test/file/write_file_test.cc | 114 -
cpp/test/parser/path_name_test.cc | 175 -
cpp/test/reader/tsfile_reader_test.cc | 236 -
cpp/test/utils/db_utils_test.cc | 218 -
cpp/test/writer/chunk_writer_test.cc | 95 -
cpp/test/writer/page_writer_test.cc | 91 -
.../writer/table_view/tsfile_writer_table_test.cc | 147 -
cpp/test/writer/time_chunk_writer_test.cc | 78 -
cpp/test/writer/time_page_writer_test.cc | 85 -
cpp/test/writer/tsfile_writer_test.cc | 743 --
cpp/test/writer/value_chunk_writer_test.cc | 97 -
cpp/test/writer/value_page_writer_test.cc | 108 -
cpp/test_all.sh | 18 -
cpp/third_party/CMakeLists.txt | 24 -
.../antlr4-cpp-runtime-4/CMakeLists.txt | 218 -
cpp/third_party/antlr4-cpp-runtime-4/LICENSE.txt | 52 -
cpp/third_party/antlr4-cpp-runtime-4/README.md | 72 -
cpp/third_party/antlr4-cpp-runtime-4/VERSION | 0
.../antlr4-cpp-runtime-4/cmake/Antlr4Package.md | 136 -
.../cmake/ExternalAntlr4Cpp.cmake | 158 -
.../antlr4-cpp-runtime-4/cmake/FindANTLR.cmake | 124 -
.../antlr4-cpp-runtime-4/cmake/README.md | 157 -
.../cmake/antlr4-generator.cmake.in | 181 -
.../cmake/antlr4-runtime.cmake.in | 10 -
.../antlr4-cpp-runtime-4/demo/CMakeLists.txt | 80 -
.../antlr4-cpp-runtime-4/demo/Linux/main.cpp | 38 -
.../demo/Mac/antlr4-cpp-demo/main.cpp | 38 -
.../demo/Mac/antlrcpp Tests/Info.plist | 24 -
.../demo/Mac/antlrcpp Tests/InputHandlingTests.mm | 172 -
.../demo/Mac/antlrcpp Tests/MiscClassTests.mm | 388 -
.../demo/Mac/antlrcpp Tests/antlrcpp_Tests.mm | 57 -
.../Mac/antlrcpp-demo.xcodeproj/project.pbxproj | 609 --
.../project.xcworkspace/contents.xcworkspacedata | 7 -
.../xcshareddata/IDEWorkspaceChecks.plist | 8 -
.../xcschemes/antlr4-cpp-demo.xcscheme | 102 -
.../xcshareddata/xcschemes/antlrcpp Tests.xcscheme | 56 -
.../antlr4-cpp-runtime-4/demo/Mac/build.sh | 43 -
.../antlr4-cpp-runtime-4/demo/README.md | 13 -
.../antlr4-cpp-runtime-4/demo/TLexer.g4 | 86 -
.../antlr4-cpp-runtime-4/demo/TParser.g4 | 119 -
.../antlr4-cpp-demo/antlr4-cpp-demo-vs2015.vcxproj | 362 -
.../antlr4-cpp-demo-vs2015.vcxproj.filters | 63 -
.../antlr4-cpp-demo/antlr4-cpp-demo.vcxproj | 349 -
.../antlr4-cpp-demo.vcxproj.filters | 63 -
.../demo/Windows/antlr4-cpp-demo/main.cpp | 41 -
.../demo/Windows/antlr4cpp-vs2013.sln | 58 -
.../demo/Windows/antlr4cpp-vs2015.sln | 58 -
.../antlr4-cpp-runtime-4/demo/generate.cmd | 13 -
.../antlr4-cpp-runtime-4/demo/generate.sh | 28 -
.../antlr4-cpp-runtime-4/deploy-macos.sh | 48 -
.../antlr4-cpp-runtime-4/deploy-source.sh | 14 -
.../antlr4-cpp-runtime-4/deploy-windows.cmd | 81 -
.../antlr4-cpp-runtime-4/runtime/CMakeLists.txt | 165 -
.../runtime/antlr4cpp-vs2013.vcxproj | 637 --
.../runtime/antlr4cpp-vs2013.vcxproj.filters | 984 --
.../runtime/antlr4cpp-vs2015.vcxproj | 652 --
.../runtime/antlr4cpp-vs2015.vcxproj.filters | 990 --
.../runtime/antlr4cpp-vs2017.vcxproj | 652 --
.../runtime/antlr4cpp-vs2017.vcxproj.filters | 990 --
.../runtime/antlr4cpp-vs2019.vcxproj | 660 --
.../runtime/antlr4cpp-vs2019.vcxproj.filters | 990 --
.../runtime/antlrcpp-ios/Info.plist | 26 -
.../runtime/antlrcpp-ios/antlrcpp_ios.h | 17 -
.../runtime/antlrcpp.xcodeproj/project.pbxproj | 3040 -------
.../project.xcworkspace/contents.xcworkspacedata | 7 -
.../xcshareddata/IDEWorkspaceChecks.plist | 8 -
.../xcshareddata/xcschemes/antlr4.xcscheme | 76 -
.../xcshareddata/xcschemes/antlr4_ios.xcscheme | 76 -
.../xcshareddata/xcschemes/antlr4_static.xcscheme | 76 -
.../runtime/src/ANTLRErrorListener.cpp | 10 -
.../runtime/src/ANTLRErrorListener.h | 167 -
.../runtime/src/ANTLRErrorStrategy.cpp | 10 -
.../runtime/src/ANTLRErrorStrategy.h | 121 -
.../runtime/src/ANTLRFileStream.cpp | 29 -
.../runtime/src/ANTLRFileStream.h | 30 -
.../runtime/src/ANTLRInputStream.cpp | 169 -
.../runtime/src/ANTLRInputStream.h | 76 -
.../runtime/src/BailErrorStrategy.cpp | 61 -
.../runtime/src/BailErrorStrategy.h | 59 -
.../runtime/src/BaseErrorListener.cpp | 25 -
.../runtime/src/BaseErrorListener.h | 36 -
.../runtime/src/BufferedTokenStream.cpp | 414 -
.../runtime/src/BufferedTokenStream.h | 200 -
.../runtime/src/CharStream.cpp | 11 -
.../antlr4-cpp-runtime-4/runtime/src/CharStream.h | 37 -
.../runtime/src/CommonToken.cpp | 195 -
.../antlr4-cpp-runtime-4/runtime/src/CommonToken.h | 158 -
.../runtime/src/CommonTokenFactory.cpp | 39 -
.../runtime/src/CommonTokenFactory.h | 74 -
.../runtime/src/CommonTokenStream.cpp | 78 -
.../runtime/src/CommonTokenStream.h | 79 -
.../runtime/src/ConsoleErrorListener.cpp | 15 -
.../runtime/src/ConsoleErrorListener.h | 35 -
.../runtime/src/DefaultErrorStrategy.cpp | 333 -
.../runtime/src/DefaultErrorStrategy.h | 466 -
.../runtime/src/DiagnosticErrorListener.cpp | 84 -
.../runtime/src/DiagnosticErrorListener.h | 80 -
.../runtime/src/Exceptions.cpp | 64 -
.../antlr4-cpp-runtime-4/runtime/src/Exceptions.h | 99 -
.../runtime/src/FailedPredicateException.cpp | 51 -
.../runtime/src/FailedPredicateException.h | 32 -
.../runtime/src/InputMismatchException.cpp | 18 -
.../runtime/src/InputMismatchException.h | 24 -
.../antlr4-cpp-runtime-4/runtime/src/IntStream.cpp | 12 -
.../antlr4-cpp-runtime-4/runtime/src/IntStream.h | 224 -
.../runtime/src/InterpreterRuleContext.cpp | 19 -
.../runtime/src/InterpreterRuleContext.h | 45 -
.../antlr4-cpp-runtime-4/runtime/src/Lexer.cpp | 295 -
.../antlr4-cpp-runtime-4/runtime/src/Lexer.h | 209 -
.../runtime/src/LexerInterpreter.cpp | 75 -
.../runtime/src/LexerInterpreter.h | 52 -
.../runtime/src/LexerNoViableAltException.cpp | 36 -
.../runtime/src/LexerNoViableAltException.h | 31 -
.../runtime/src/ListTokenSource.cpp | 92 -
.../runtime/src/ListTokenSource.h | 88 -
.../runtime/src/NoViableAltException.cpp | 46 -
.../runtime/src/NoViableAltException.h | 42 -
.../antlr4-cpp-runtime-4/runtime/src/Parser.cpp | 648 --
.../antlr4-cpp-runtime-4/runtime/src/Parser.h | 467 -
.../runtime/src/ParserInterpreter.cpp | 306 -
.../runtime/src/ParserInterpreter.h | 179 -
.../runtime/src/ParserRuleContext.cpp | 141 -
.../runtime/src/ParserRuleContext.h | 147 -
.../runtime/src/ProxyErrorListener.cpp | 53 -
.../runtime/src/ProxyErrorListener.h | 38 -
.../runtime/src/RecognitionException.cpp | 66 -
.../runtime/src/RecognitionException.h | 98 -
.../runtime/src/Recognizer.cpp | 167 -
.../antlr4-cpp-runtime-4/runtime/src/Recognizer.h | 171 -
.../runtime/src/RuleContext.cpp | 143 -
.../antlr4-cpp-runtime-4/runtime/src/RuleContext.h | 137 -
.../runtime/src/RuleContextWithAltNum.cpp | 27 -
.../runtime/src/RuleContextWithAltNum.h | 32 -
.../runtime/src/RuntimeMetaData.cpp | 53 -
.../runtime/src/RuntimeMetaData.h | 155 -
.../antlr4-cpp-runtime-4/runtime/src/Token.cpp | 9 -
.../antlr4-cpp-runtime-4/runtime/src/Token.h | 124 -
.../runtime/src/TokenFactory.h | 30 -
.../runtime/src/TokenSource.cpp | 9 -
.../antlr4-cpp-runtime-4/runtime/src/TokenSource.h | 85 -
.../runtime/src/TokenStream.cpp | 11 -
.../antlr4-cpp-runtime-4/runtime/src/TokenStream.h | 137 -
.../runtime/src/TokenStreamRewriter.cpp | 425 -
.../runtime/src/TokenStreamRewriter.h | 300 -
.../runtime/src/UnbufferedCharStream.cpp | 211 -
.../runtime/src/UnbufferedCharStream.h | 123 -
.../runtime/src/UnbufferedTokenStream.cpp | 270 -
.../runtime/src/UnbufferedTokenStream.h | 115 -
.../runtime/src/Vocabulary.cpp | 96 -
.../antlr4-cpp-runtime-4/runtime/src/Vocabulary.h | 192 -
.../runtime/src/WritableToken.cpp | 9 -
.../runtime/src/WritableToken.h | 23 -
.../runtime/src/antlr4-common.h | 139 -
.../runtime/src/antlr4-runtime.h | 168 -
.../antlr4-cpp-runtime-4/runtime/src/atn/ATN.cpp | 209 -
.../antlr4-cpp-runtime-4/runtime/src/atn/ATN.h | 124 -
.../runtime/src/atn/ATNConfig.cpp | 111 -
.../runtime/src/atn/ATNConfig.h | 154 -
.../runtime/src/atn/ATNConfigSet.cpp | 228 -
.../runtime/src/atn/ATNConfigSet.h | 110 -
.../runtime/src/atn/ATNDeserializationOptions.cpp | 64 -
.../runtime/src/atn/ATNDeserializationOptions.h | 50 -
.../runtime/src/atn/ATNDeserializer.cpp | 756 --
.../runtime/src/atn/ATNDeserializer.h | 91 -
.../runtime/src/atn/ATNSerializer.cpp | 621 --
.../runtime/src/atn/ATNSerializer.h | 61 -
.../runtime/src/atn/ATNSimulator.cpp | 63 -
.../runtime/src/atn/ATNSimulator.h | 87 -
.../runtime/src/atn/ATNState.cpp | 72 -
.../runtime/src/atn/ATNState.h | 147 -
.../antlr4-cpp-runtime-4/runtime/src/atn/ATNType.h | 20 -
.../src/atn/AbstractPredicateTransition.cpp | 14 -
.../runtime/src/atn/AbstractPredicateTransition.h | 24 -
.../runtime/src/atn/ActionTransition.cpp | 33 -
.../runtime/src/atn/ActionTransition.h | 33 -
.../runtime/src/atn/AmbiguityInfo.cpp | 16 -
.../runtime/src/atn/AmbiguityInfo.h | 68 -
.../runtime/src/atn/ArrayPredictionContext.cpp | 82 -
.../runtime/src/atn/ArrayPredictionContext.h | 43 -
.../runtime/src/atn/AtomTransition.cpp | 31 -
.../runtime/src/atn/AtomTransition.h | 30 -
.../runtime/src/atn/BasicBlockStartState.cpp | 12 -
.../runtime/src/atn/BasicBlockStartState.h | 22 -
.../runtime/src/atn/BasicState.cpp | 12 -
.../runtime/src/atn/BasicState.h | 21 -
.../runtime/src/atn/BlockEndState.cpp | 15 -
.../runtime/src/atn/BlockEndState.h | 24 -
.../runtime/src/atn/BlockStartState.cpp | 9 -
.../runtime/src/atn/BlockStartState.h | 21 -
.../runtime/src/atn/ContextSensitivityInfo.cpp | 14 -
.../runtime/src/atn/ContextSensitivityInfo.h | 47 -
.../runtime/src/atn/DecisionEventInfo.cpp | 14 -
.../runtime/src/atn/DecisionEventInfo.h | 70 -
.../runtime/src/atn/DecisionInfo.cpp | 25 -
.../runtime/src/atn/DecisionInfo.h | 227 -
.../runtime/src/atn/DecisionState.cpp | 17 -
.../runtime/src/atn/DecisionState.h | 30 -
.../runtime/src/atn/EmptyPredictionContext.cpp | 35 -
.../runtime/src/atn/EmptyPredictionContext.h | 27 -
.../runtime/src/atn/EpsilonTransition.cpp | 35 -
.../runtime/src/atn/EpsilonTransition.h | 39 -
.../runtime/src/atn/ErrorInfo.cpp | 15 -
.../runtime/src/atn/ErrorInfo.h | 43 -
.../runtime/src/atn/LL1Analyzer.cpp | 156 -
.../runtime/src/atn/LL1Analyzer.h | 115 -
.../runtime/src/atn/LexerATNConfig.cpp | 84 -
.../runtime/src/atn/LexerATNConfig.h | 44 -
.../runtime/src/atn/LexerATNSimulator.cpp | 626 --
.../runtime/src/atn/LexerATNSimulator.h | 219 -
.../runtime/src/atn/LexerAction.cpp | 9 -
.../runtime/src/atn/LexerAction.h | 66 -
.../runtime/src/atn/LexerActionExecutor.cpp | 107 -
.../runtime/src/atn/LexerActionExecutor.h | 115 -
.../runtime/src/atn/LexerActionType.h | 55 -
.../runtime/src/atn/LexerChannelAction.cpp | 55 -
.../runtime/src/atn/LexerChannelAction.h | 63 -
.../runtime/src/atn/LexerCustomAction.cpp | 62 -
.../runtime/src/atn/LexerCustomAction.h | 87 -
.../runtime/src/atn/LexerIndexedCustomAction.cpp | 63 -
.../runtime/src/atn/LexerIndexedCustomAction.h | 82 -
.../runtime/src/atn/LexerModeAction.cpp | 56 -
.../runtime/src/atn/LexerModeAction.h | 61 -
.../runtime/src/atn/LexerMoreAction.cpp | 47 -
.../runtime/src/atn/LexerMoreAction.h | 57 -
.../runtime/src/atn/LexerPopModeAction.cpp | 47 -
.../runtime/src/atn/LexerPopModeAction.h | 57 -
.../runtime/src/atn/LexerPushModeAction.cpp | 56 -
.../runtime/src/atn/LexerPushModeAction.h | 61 -
.../runtime/src/atn/LexerSkipAction.cpp | 47 -
.../runtime/src/atn/LexerSkipAction.h | 55 -
.../runtime/src/atn/LexerTypeAction.cpp | 56 -
.../runtime/src/atn/LexerTypeAction.h | 55 -
.../runtime/src/atn/LookaheadEventInfo.cpp | 16 -
.../runtime/src/atn/LookaheadEventInfo.h | 42 -
.../runtime/src/atn/LoopEndState.cpp | 12 -
.../runtime/src/atn/LoopEndState.h | 22 -
.../antlr4-cpp-runtime-4/runtime/src/atn/Makefile | 67 -
.../runtime/src/atn/NotSetTransition.cpp | 27 -
.../runtime/src/atn/NotSetTransition.h | 25 -
.../runtime/src/atn/OrderedATNConfigSet.cpp | 12 -
.../runtime/src/atn/OrderedATNConfigSet.h | 20 -
.../runtime/src/atn/ParseInfo.cpp | 102 -
.../runtime/src/atn/ParseInfo.h | 102 -
.../runtime/src/atn/ParserATNSimulator.cpp | 1370 ---
.../runtime/src/atn/ParserATNSimulator.h | 904 --
.../runtime/src/atn/PlusBlockStartState.cpp | 12 -
.../runtime/src/atn/PlusBlockStartState.h | 25 -
.../runtime/src/atn/PlusLoopbackState.cpp | 12 -
.../runtime/src/atn/PlusLoopbackState.h | 22 -
.../src/atn/PrecedencePredicateTransition.cpp | 32 -
.../src/atn/PrecedencePredicateTransition.h | 29 -
.../runtime/src/atn/PredicateEvalInfo.cpp | 17 -
.../runtime/src/atn/PredicateEvalInfo.h | 62 -
.../runtime/src/atn/PredicateTransition.cpp | 34 -
.../runtime/src/atn/PredicateTransition.h | 39 -
.../runtime/src/atn/PredictionContext.cpp | 662 --
.../runtime/src/atn/PredictionContext.h | 268 -
.../runtime/src/atn/PredictionMode.cpp | 201 -
.../runtime/src/atn/PredictionMode.h | 436 -
.../runtime/src/atn/ProfilingATNSimulator.cpp | 179 -
.../runtime/src/atn/ProfilingATNSimulator.h | 60 -
.../runtime/src/atn/RangeTransition.cpp | 30 -
.../runtime/src/atn/RangeTransition.h | 29 -
.../runtime/src/atn/RuleStartState.cpp | 16 -
.../runtime/src/atn/RuleStartState.h | 25 -
.../runtime/src/atn/RuleStopState.cpp | 12 -
.../runtime/src/atn/RuleStopState.h | 25 -
.../runtime/src/atn/RuleTransition.cpp | 37 -
.../runtime/src/atn/RuleTransition.h | 40 -
.../runtime/src/atn/SemanticContext.cpp | 377 -
.../runtime/src/atn/SemanticContext.h | 222 -
.../runtime/src/atn/SetTransition.cpp | 32 -
.../runtime/src/atn/SetTransition.h | 30 -
.../runtime/src/atn/SingletonPredictionContext.cpp | 81 -
.../runtime/src/atn/SingletonPredictionContext.h | 36 -
.../runtime/src/atn/StarBlockStartState.cpp | 12 -
.../runtime/src/atn/StarBlockStartState.h | 21 -
.../runtime/src/atn/StarLoopEntryState.cpp | 15 -
.../runtime/src/atn/StarLoopEntryState.h | 35 -
.../runtime/src/atn/StarLoopbackState.cpp | 19 -
.../runtime/src/atn/StarLoopbackState.h | 21 -
.../runtime/src/atn/TokensStartState.cpp | 12 -
.../runtime/src/atn/TokensStartState.h | 21 -
.../runtime/src/atn/Transition.cpp | 44 -
.../runtime/src/atn/Transition.h | 76 -
.../runtime/src/atn/WildcardTransition.cpp | 25 -
.../runtime/src/atn/WildcardTransition.h | 25 -
.../antlr4-cpp-runtime-4/runtime/src/dfa/DFA.cpp | 127 -
.../antlr4-cpp-runtime-4/runtime/src/dfa/DFA.h | 91 -
.../runtime/src/dfa/DFASerializer.cpp | 67 -
.../runtime/src/dfa/DFASerializer.h | 32 -
.../runtime/src/dfa/DFAState.cpp | 100 -
.../runtime/src/dfa/DFAState.h | 144 -
.../runtime/src/dfa/LexerDFASerializer.cpp | 20 -
.../runtime/src/dfa/LexerDFASerializer.h | 23 -
.../runtime/src/misc/InterpreterDataReader.cpp | 124 -
.../runtime/src/misc/InterpreterDataReader.h | 31 -
.../runtime/src/misc/Interval.cpp | 89 -
.../runtime/src/misc/Interval.h | 84 -
.../runtime/src/misc/IntervalSet.cpp | 521 --
.../runtime/src/misc/IntervalSet.h | 198 -
.../runtime/src/misc/MurmurHash.cpp | 134 -
.../runtime/src/misc/MurmurHash.h | 82 -
.../runtime/src/misc/Predicate.cpp | 4 -
.../runtime/src/misc/Predicate.h | 21 -
.../runtime/src/support/Any.cpp | 13 -
.../antlr4-cpp-runtime-4/runtime/src/support/Any.h | 180 -
.../runtime/src/support/Arrays.cpp | 43 -
.../runtime/src/support/Arrays.h | 110 -
.../runtime/src/support/BitSet.h | 76 -
.../runtime/src/support/CPPUtils.cpp | 245 -
.../runtime/src/support/CPPUtils.h | 82 -
.../runtime/src/support/Casts.h | 33 -
.../runtime/src/support/Declarations.h | 163 -
.../runtime/src/support/Guid.cpp | 270 -
.../runtime/src/support/Guid.h | 154 -
.../runtime/src/support/StringUtils.cpp | 46 -
.../runtime/src/support/StringUtils.h | 76 -
.../runtime/src/tree/AbstractParseTreeVisitor.h | 128 -
.../runtime/src/tree/ErrorNode.cpp | 9 -
.../runtime/src/tree/ErrorNode.h | 19 -
.../runtime/src/tree/ErrorNodeImpl.cpp | 23 -
.../runtime/src/tree/ErrorNodeImpl.h | 33 -
.../runtime/src/tree/IterativeParseTreeWalker.cpp | 71 -
.../runtime/src/tree/IterativeParseTreeWalker.h | 53 -
.../runtime/src/tree/ParseTree.cpp | 15 -
.../runtime/src/tree/ParseTree.h | 102 -
.../runtime/src/tree/ParseTreeListener.cpp | 9 -
.../runtime/src/tree/ParseTreeListener.h | 39 -
.../runtime/src/tree/ParseTreeProperty.h | 50 -
.../runtime/src/tree/ParseTreeVisitor.cpp | 9 -
.../runtime/src/tree/ParseTreeVisitor.h | 57 -
.../runtime/src/tree/ParseTreeWalker.cpp | 49 -
.../runtime/src/tree/ParseTreeWalker.h | 55 -
.../runtime/src/tree/TerminalNode.cpp | 9 -
.../runtime/src/tree/TerminalNode.h | 32 -
.../runtime/src/tree/TerminalNodeImpl.cpp | 57 -
.../runtime/src/tree/TerminalNodeImpl.h | 33 -
.../runtime/src/tree/Trees.cpp | 241 -
.../antlr4-cpp-runtime-4/runtime/src/tree/Trees.h | 78 -
.../runtime/src/tree/pattern/Chunk.cpp | 9 -
.../runtime/src/tree/pattern/Chunk.h | 44 -
.../runtime/src/tree/pattern/ParseTreeMatch.cpp | 69 -
.../runtime/src/tree/pattern/ParseTreeMatch.h | 132 -
.../runtime/src/tree/pattern/ParseTreePattern.cpp | 64 -
.../runtime/src/tree/pattern/ParseTreePattern.h | 105 -
.../src/tree/pattern/ParseTreePatternMatcher.cpp | 371 -
.../src/tree/pattern/ParseTreePatternMatcher.h | 185 -
.../runtime/src/tree/pattern/RuleTagToken.cpp | 77 -
.../runtime/src/tree/pattern/RuleTagToken.h | 117 -
.../runtime/src/tree/pattern/TagChunk.cpp | 39 -
.../runtime/src/tree/pattern/TagChunk.h | 86 -
.../runtime/src/tree/pattern/TextChunk.cpp | 28 -
.../runtime/src/tree/pattern/TextChunk.h | 51 -
.../runtime/src/tree/pattern/TokenTagToken.cpp | 36 -
.../runtime/src/tree/pattern/TokenTagToken.h | 80 -
.../runtime/src/tree/xpath/XPath.cpp | 154 -
.../runtime/src/tree/xpath/XPath.h | 86 -
.../runtime/src/tree/xpath/XPathElement.cpp | 31 -
.../runtime/src/tree/xpath/XPathElement.h | 40 -
.../runtime/src/tree/xpath/XPathLexer.cpp | 173 -
.../runtime/src/tree/xpath/XPathLexer.g4 | 64 -
.../runtime/src/tree/xpath/XPathLexer.h | 56 -
.../runtime/src/tree/xpath/XPathLexer.tokens | 12 -
.../src/tree/xpath/XPathLexerErrorListener.cpp | 13 -
.../src/tree/xpath/XPathLexerErrorListener.h | 22 -
.../src/tree/xpath/XPathRuleAnywhereElement.cpp | 20 -
.../src/tree/xpath/XPathRuleAnywhereElement.h | 27 -
.../runtime/src/tree/xpath/XPathRuleElement.cpp | 30 -
.../runtime/src/tree/xpath/XPathRuleElement.h | 26 -
.../src/tree/xpath/XPathTokenAnywhereElement.cpp | 20 -
.../src/tree/xpath/XPathTokenAnywhereElement.h | 25 -
.../runtime/src/tree/xpath/XPathTokenElement.cpp | 33 -
.../runtime/src/tree/xpath/XPathTokenElement.h | 26 -
.../tree/xpath/XPathWildcardAnywhereElement.cpp | 23 -
.../src/tree/xpath/XPathWildcardAnywhereElement.h | 23 -
.../src/tree/xpath/XPathWildcardElement.cpp | 24 -
.../runtime/src/tree/xpath/XPathWildcardElement.h | 23 -
cpp/third_party/google_snappy/AUTHORS | 1 -
cpp/third_party/google_snappy/CMakeLists.txt | 439 -
cpp/third_party/google_snappy/COPYING | 54 -
cpp/third_party/google_snappy/README.md | 165 -
.../google_snappy/cmake/SnappyConfig.cmake.in | 33 -
cpp/third_party/google_snappy/cmake/config.h.in | 69 -
cpp/third_party/google_snappy/snappy-internal.h | 424 -
cpp/third_party/google_snappy/snappy-sinksource.cc | 121 -
cpp/third_party/google_snappy/snappy-sinksource.h | 182 -
.../google_snappy/snappy-stubs-internal.cc | 42 -
.../google_snappy/snappy-stubs-internal.h | 531 --
.../google_snappy/snappy-stubs-public.h.in | 63 -
cpp/third_party/google_snappy/snappy.cc | 2646 ------
cpp/third_party/google_snappy/snappy.h | 257 -
cpp/third_party/lz4/CMakeLists.txt | 3 -
cpp/third_party/lz4/lz4.c | 3162 -------
cpp/third_party/lz4/lz4.h | 1000 ---
cpp/third_party/lzokay/CMakeLists.txt | 3 -
cpp/third_party/lzokay/LICENSE | 22 -
cpp/third_party/lzokay/lzokay.cpp | 647 --
cpp/third_party/lzokay/lzokay.hpp | 79 -
cpp/third_party/zlib-1.2.13/CMakeLists.txt | 192 -
cpp/third_party/zlib-1.2.13/ChangeLog | 1590 ----
cpp/third_party/zlib-1.2.13/FAQ | 368 -
cpp/third_party/zlib-1.2.13/INDEX | 68 -
cpp/third_party/zlib-1.2.13/LICENSE | 22 -
cpp/third_party/zlib-1.2.13/Makefile | 5 -
cpp/third_party/zlib-1.2.13/Makefile.in | 404 -
cpp/third_party/zlib-1.2.13/README | 118 -
cpp/third_party/zlib-1.2.13/adler32.c | 186 -
cpp/third_party/zlib-1.2.13/amiga/Makefile.pup | 69 -
cpp/third_party/zlib-1.2.13/amiga/Makefile.sas | 68 -
cpp/third_party/zlib-1.2.13/compress.c | 86 -
cpp/third_party/zlib-1.2.13/configure | 922 --
cpp/third_party/zlib-1.2.13/contrib/README.contrib | 57 -
.../zlib-1.2.13/contrib/ada/buffer_demo.adb | 106 -
cpp/third_party/zlib-1.2.13/contrib/ada/mtest.adb | 156 -
cpp/third_party/zlib-1.2.13/contrib/ada/read.adb | 156 -
cpp/third_party/zlib-1.2.13/contrib/ada/readme.txt | 65 -
cpp/third_party/zlib-1.2.13/contrib/ada/test.adb | 463 -
.../zlib-1.2.13/contrib/ada/zlib-streams.adb | 225 -
.../zlib-1.2.13/contrib/ada/zlib-streams.ads | 114 -
.../zlib-1.2.13/contrib/ada/zlib-thin.adb | 141 -
.../zlib-1.2.13/contrib/ada/zlib-thin.ads | 450 -
cpp/third_party/zlib-1.2.13/contrib/ada/zlib.adb | 701 --
cpp/third_party/zlib-1.2.13/contrib/ada/zlib.ads | 328 -
cpp/third_party/zlib-1.2.13/contrib/ada/zlib.gpr | 20 -
cpp/third_party/zlib-1.2.13/contrib/blast/Makefile | 8 -
cpp/third_party/zlib-1.2.13/contrib/blast/README | 4 -
cpp/third_party/zlib-1.2.13/contrib/blast/blast.c | 466 -
cpp/third_party/zlib-1.2.13/contrib/blast/blast.h | 83 -
cpp/third_party/zlib-1.2.13/contrib/blast/test.pk | Bin 8 -> 0 bytes
cpp/third_party/zlib-1.2.13/contrib/blast/test.txt | 1 -
.../zlib-1.2.13/contrib/delphi/ZLib.pas | 557 --
.../zlib-1.2.13/contrib/delphi/ZLibConst.pas | 11 -
.../zlib-1.2.13/contrib/delphi/readme.txt | 76 -
.../zlib-1.2.13/contrib/delphi/zlibd32.mak | 99 -
.../zlib-1.2.13/contrib/dotzlib/DotZLib.build | 33 -
.../zlib-1.2.13/contrib/dotzlib/DotZLib.chm | Bin 72726 -> 0 bytes
.../zlib-1.2.13/contrib/dotzlib/DotZLib.sln | 21 -
.../contrib/dotzlib/DotZLib/AssemblyInfo.cs | 58 -
.../contrib/dotzlib/DotZLib/ChecksumImpl.cs | 202 -
.../contrib/dotzlib/DotZLib/CircularBuffer.cs | 83 -
.../contrib/dotzlib/DotZLib/CodecBase.cs | 198 -
.../contrib/dotzlib/DotZLib/Deflater.cs | 106 -
.../zlib-1.2.13/contrib/dotzlib/DotZLib/DotZLib.cs | 288 -
.../contrib/dotzlib/DotZLib/DotZLib.csproj | 141 -
.../contrib/dotzlib/DotZLib/GZipStream.cs | 301 -
.../contrib/dotzlib/DotZLib/Inflater.cs | 105 -
.../contrib/dotzlib/DotZLib/UnitTests.cs | 274 -
.../zlib-1.2.13/contrib/dotzlib/LICENSE_1_0.txt | 23 -
.../zlib-1.2.13/contrib/dotzlib/readme.txt | 58 -
.../zlib-1.2.13/contrib/gcc_gvmat64/gvmat64.S | 574 --
.../zlib-1.2.13/contrib/infback9/README | 1 -
.../zlib-1.2.13/contrib/infback9/infback9.c | 615 --
.../zlib-1.2.13/contrib/infback9/infback9.h | 37 -
.../zlib-1.2.13/contrib/infback9/inffix9.h | 107 -
.../zlib-1.2.13/contrib/infback9/inflate9.h | 47 -
.../zlib-1.2.13/contrib/infback9/inftree9.c | 324 -
.../zlib-1.2.13/contrib/infback9/inftree9.h | 61 -
.../zlib-1.2.13/contrib/iostream/test.cpp | 24 -
.../zlib-1.2.13/contrib/iostream/zfstream.cpp | 329 -
.../zlib-1.2.13/contrib/iostream/zfstream.h | 128 -
.../zlib-1.2.13/contrib/iostream2/zstream.h | 307 -
.../zlib-1.2.13/contrib/iostream2/zstream_test.cpp | 25 -
.../zlib-1.2.13/contrib/iostream3/README | 35 -
cpp/third_party/zlib-1.2.13/contrib/iostream3/TODO | 17 -
.../zlib-1.2.13/contrib/iostream3/test.cc | 50 -
.../zlib-1.2.13/contrib/iostream3/zfstream.cc | 479 -
.../zlib-1.2.13/contrib/iostream3/zfstream.h | 466 -
.../zlib-1.2.13/contrib/minizip/Makefile | 29 -
.../zlib-1.2.13/contrib/minizip/Makefile.am | 45 -
.../contrib/minizip/MiniZip64_Changes.txt | 6 -
.../zlib-1.2.13/contrib/minizip/MiniZip64_info.txt | 74 -
.../zlib-1.2.13/contrib/minizip/configure.ac | 32 -
.../zlib-1.2.13/contrib/minizip/crypt.h | 132 -
.../zlib-1.2.13/contrib/minizip/ioapi.c | 257 -
.../zlib-1.2.13/contrib/minizip/ioapi.h | 210 -
.../zlib-1.2.13/contrib/minizip/iowin32.c | 467 -
.../zlib-1.2.13/contrib/minizip/iowin32.h | 28 -
.../zlib-1.2.13/contrib/minizip/make_vms.com | 25 -
.../zlib-1.2.13/contrib/minizip/miniunz.c | 659 --
.../zlib-1.2.13/contrib/minizip/miniunzip.1 | 63 -
.../zlib-1.2.13/contrib/minizip/minizip.1 | 46 -
.../zlib-1.2.13/contrib/minizip/minizip.c | 521 --
.../zlib-1.2.13/contrib/minizip/minizip.pc.in | 12 -
.../zlib-1.2.13/contrib/minizip/mztools.c | 291 -
.../zlib-1.2.13/contrib/minizip/mztools.h | 37 -
.../zlib-1.2.13/contrib/minizip/unzip.c | 2130 -----
.../zlib-1.2.13/contrib/minizip/unzip.h | 437 -
cpp/third_party/zlib-1.2.13/contrib/minizip/zip.c | 2002 -----
cpp/third_party/zlib-1.2.13/contrib/minizip/zip.h | 367 -
.../zlib-1.2.13/contrib/pascal/example.pas | 599 --
.../zlib-1.2.13/contrib/pascal/readme.txt | 76 -
.../zlib-1.2.13/contrib/pascal/zlibd32.mak | 99 -
.../zlib-1.2.13/contrib/pascal/zlibpas.pas | 276 -
cpp/third_party/zlib-1.2.13/contrib/puff/Makefile | 42 -
cpp/third_party/zlib-1.2.13/contrib/puff/README | 63 -
cpp/third_party/zlib-1.2.13/contrib/puff/puff.c | 840 --
cpp/third_party/zlib-1.2.13/contrib/puff/puff.h | 35 -
.../zlib-1.2.13/contrib/puff/pufftest.c | 165 -
cpp/third_party/zlib-1.2.13/contrib/puff/zeros.raw | Bin 2517 -> 0 bytes
.../zlib-1.2.13/contrib/testzlib/testzlib.c | 275 -
.../zlib-1.2.13/contrib/testzlib/testzlib.txt | 10 -
cpp/third_party/zlib-1.2.13/contrib/untgz/Makefile | 14 -
.../zlib-1.2.13/contrib/untgz/Makefile.msc | 17 -
cpp/third_party/zlib-1.2.13/contrib/untgz/untgz.c | 674 --
.../zlib-1.2.13/contrib/vstudio/readme.txt | 75 -
.../contrib/vstudio/vc10/miniunz.vcxproj | 310 -
.../contrib/vstudio/vc10/miniunz.vcxproj.filters | 22 -
.../contrib/vstudio/vc10/minizip.vcxproj | 307 -
.../contrib/vstudio/vc10/minizip.vcxproj.filters | 22 -
.../contrib/vstudio/vc10/testzlib.vcxproj | 412 -
.../contrib/vstudio/vc10/testzlib.vcxproj.filters | 55 -
.../contrib/vstudio/vc10/testzlibdll.vcxproj | 310 -
.../vstudio/vc10/testzlibdll.vcxproj.filters | 22 -
.../zlib-1.2.13/contrib/vstudio/vc10/zlib.rc | 32 -
.../contrib/vstudio/vc10/zlibstat.vcxproj | 449 -
.../contrib/vstudio/vc10/zlibstat.vcxproj.filters | 74 -
.../zlib-1.2.13/contrib/vstudio/vc10/zlibvc.def | 158 -
.../zlib-1.2.13/contrib/vstudio/vc10/zlibvc.sln | 135 -
.../contrib/vstudio/vc10/zlibvc.vcxproj | 633 --
.../contrib/vstudio/vc10/zlibvc.vcxproj.filters | 115 -
.../contrib/vstudio/vc11/miniunz.vcxproj | 314 -
.../contrib/vstudio/vc11/minizip.vcxproj | 311 -
.../contrib/vstudio/vc11/testzlib.vcxproj | 418 -
.../contrib/vstudio/vc11/testzlibdll.vcxproj | 314 -
.../zlib-1.2.13/contrib/vstudio/vc11/zlib.rc | 32 -
.../contrib/vstudio/vc11/zlibstat.vcxproj | 456 -
.../zlib-1.2.13/contrib/vstudio/vc11/zlibvc.def | 158 -
.../zlib-1.2.13/contrib/vstudio/vc11/zlibvc.sln | 117 -
.../contrib/vstudio/vc11/zlibvc.vcxproj | 664 --
.../contrib/vstudio/vc12/miniunz.vcxproj | 316 -
.../contrib/vstudio/vc12/minizip.vcxproj | 313 -
.../contrib/vstudio/vc12/testzlib.vcxproj | 422 -
.../contrib/vstudio/vc12/testzlibdll.vcxproj | 316 -
.../zlib-1.2.13/contrib/vstudio/vc12/zlib.rc | 32 -
.../contrib/vstudio/vc12/zlibstat.vcxproj | 459 -
.../zlib-1.2.13/contrib/vstudio/vc12/zlibvc.def | 158 -
.../zlib-1.2.13/contrib/vstudio/vc12/zlibvc.sln | 119 -
.../contrib/vstudio/vc12/zlibvc.vcxproj | 668 --
.../contrib/vstudio/vc14/miniunz.vcxproj | 316 -
.../contrib/vstudio/vc14/minizip.vcxproj | 313 -
.../contrib/vstudio/vc14/testzlib.vcxproj | 422 -
.../contrib/vstudio/vc14/testzlibdll.vcxproj | 316 -
.../zlib-1.2.13/contrib/vstudio/vc14/zlib.rc | 32 -
.../contrib/vstudio/vc14/zlibstat.vcxproj | 459 -
.../zlib-1.2.13/contrib/vstudio/vc14/zlibvc.def | 158 -
.../zlib-1.2.13/contrib/vstudio/vc14/zlibvc.sln | 119 -
.../contrib/vstudio/vc14/zlibvc.vcxproj | 668 --
.../zlib-1.2.13/contrib/vstudio/vc9/miniunz.vcproj | 565 --
.../zlib-1.2.13/contrib/vstudio/vc9/minizip.vcproj | 562 --
.../contrib/vstudio/vc9/testzlib.vcproj | 796 --
.../contrib/vstudio/vc9/testzlibdll.vcproj | 565 --
.../zlib-1.2.13/contrib/vstudio/vc9/zlib.rc | 32 -
.../contrib/vstudio/vc9/zlibstat.vcproj | 781 --
.../zlib-1.2.13/contrib/vstudio/vc9/zlibvc.def | 158 -
.../zlib-1.2.13/contrib/vstudio/vc9/zlibvc.sln | 144 -
.../zlib-1.2.13/contrib/vstudio/vc9/zlibvc.vcproj | 1100 ---
cpp/third_party/zlib-1.2.13/crc32.c | 1125 ---
cpp/third_party/zlib-1.2.13/crc32.h | 9446 --------------------
cpp/third_party/zlib-1.2.13/deflate.c | 2217 -----
cpp/third_party/zlib-1.2.13/deflate.h | 346 -
cpp/third_party/zlib-1.2.13/doc/algorithm.txt | 209 -
cpp/third_party/zlib-1.2.13/doc/crc-doc.1.0.pdf | Bin 776142 -> 0 bytes
cpp/third_party/zlib-1.2.13/doc/rfc1950.txt | 619 --
cpp/third_party/zlib-1.2.13/doc/rfc1951.txt | 955 --
cpp/third_party/zlib-1.2.13/doc/rfc1952.txt | 675 --
cpp/third_party/zlib-1.2.13/doc/txtvsbin.txt | 107 -
.../zlib-1.2.13/examples/README.examples | 54 -
cpp/third_party/zlib-1.2.13/examples/enough.c | 597 --
cpp/third_party/zlib-1.2.13/examples/fitblk.c | 233 -
cpp/third_party/zlib-1.2.13/examples/gun.c | 702 --
cpp/third_party/zlib-1.2.13/examples/gzappend.c | 504 --
cpp/third_party/zlib-1.2.13/examples/gzjoin.c | 449 -
cpp/third_party/zlib-1.2.13/examples/gzlog.c | 1061 ---
cpp/third_party/zlib-1.2.13/examples/gzlog.h | 91 -
cpp/third_party/zlib-1.2.13/examples/gznorm.c | 470 -
cpp/third_party/zlib-1.2.13/examples/zlib_how.html | 545 --
cpp/third_party/zlib-1.2.13/examples/zpipe.c | 205 -
cpp/third_party/zlib-1.2.13/examples/zran.c | 479 -
cpp/third_party/zlib-1.2.13/examples/zran.h | 40 -
cpp/third_party/zlib-1.2.13/gzclose.c | 25 -
cpp/third_party/zlib-1.2.13/gzguts.h | 219 -
cpp/third_party/zlib-1.2.13/gzlib.c | 639 --
cpp/third_party/zlib-1.2.13/gzread.c | 650 --
cpp/third_party/zlib-1.2.13/gzwrite.c | 677 --
cpp/third_party/zlib-1.2.13/infback.c | 644 --
cpp/third_party/zlib-1.2.13/inffast.c | 323 -
cpp/third_party/zlib-1.2.13/inffast.h | 11 -
cpp/third_party/zlib-1.2.13/inffixed.h | 94 -
cpp/third_party/zlib-1.2.13/inflate.c | 1595 ----
cpp/third_party/zlib-1.2.13/inflate.h | 126 -
cpp/third_party/zlib-1.2.13/inftrees.c | 304 -
cpp/third_party/zlib-1.2.13/inftrees.h | 62 -
cpp/third_party/zlib-1.2.13/make_vms.com | 867 --
cpp/third_party/zlib-1.2.13/msdos/Makefile.bor | 115 -
cpp/third_party/zlib-1.2.13/msdos/Makefile.dj2 | 104 -
cpp/third_party/zlib-1.2.13/msdos/Makefile.emx | 69 -
cpp/third_party/zlib-1.2.13/msdos/Makefile.msc | 112 -
cpp/third_party/zlib-1.2.13/msdos/Makefile.tc | 100 -
cpp/third_party/zlib-1.2.13/nintendods/Makefile | 126 -
cpp/third_party/zlib-1.2.13/nintendods/README | 5 -
cpp/third_party/zlib-1.2.13/old/Makefile.emx | 69 -
cpp/third_party/zlib-1.2.13/old/Makefile.riscos | 151 -
cpp/third_party/zlib-1.2.13/old/README | 3 -
cpp/third_party/zlib-1.2.13/old/descrip.mms | 48 -
cpp/third_party/zlib-1.2.13/old/os2/Makefile.os2 | 136 -
cpp/third_party/zlib-1.2.13/old/os2/zlib.def | 51 -
cpp/third_party/zlib-1.2.13/old/visual-basic.txt | 160 -
cpp/third_party/zlib-1.2.13/os400/README400 | 48 -
cpp/third_party/zlib-1.2.13/os400/bndsrc | 127 -
cpp/third_party/zlib-1.2.13/os400/make.sh | 366 -
cpp/third_party/zlib-1.2.13/os400/zlib.inc | 527 --
cpp/third_party/zlib-1.2.13/qnx/package.qpg | 141 -
cpp/third_party/zlib-1.2.13/test/example.c | 602 --
cpp/third_party/zlib-1.2.13/test/infcover.c | 671 --
cpp/third_party/zlib-1.2.13/test/minigzip.c | 651 --
cpp/third_party/zlib-1.2.13/treebuild.xml | 112 -
cpp/third_party/zlib-1.2.13/trees.c | 1181 ---
cpp/third_party/zlib-1.2.13/trees.h | 128 -
cpp/third_party/zlib-1.2.13/uncompr.c | 93 -
cpp/third_party/zlib-1.2.13/watcom/watcom_f.mak | 43 -
cpp/third_party/zlib-1.2.13/watcom/watcom_l.mak | 43 -
cpp/third_party/zlib-1.2.13/win32/DLL_FAQ.txt | 397 -
cpp/third_party/zlib-1.2.13/win32/Makefile.bor | 109 -
cpp/third_party/zlib-1.2.13/win32/Makefile.gcc | 177 -
cpp/third_party/zlib-1.2.13/win32/Makefile.msc | 159 -
cpp/third_party/zlib-1.2.13/win32/README-WIN32.txt | 103 -
cpp/third_party/zlib-1.2.13/win32/VisualC.txt | 3 -
cpp/third_party/zlib-1.2.13/win32/zlib.def | 97 -
cpp/third_party/zlib-1.2.13/win32/zlib1.rc | 40 -
cpp/third_party/zlib-1.2.13/zconf.h.cmakein | 549 --
cpp/third_party/zlib-1.2.13/zconf.h.in | 547 --
cpp/third_party/zlib-1.2.13/zconf.h.included | 547 --
cpp/third_party/zlib-1.2.13/zlib.3 | 149 -
cpp/third_party/zlib-1.2.13/zlib.3.pdf | Bin 19366 -> 0 bytes
cpp/third_party/zlib-1.2.13/zlib.h | 1935 ----
cpp/third_party/zlib-1.2.13/zlib.map | 100 -
cpp/third_party/zlib-1.2.13/zlib.pc.cmakein | 13 -
cpp/third_party/zlib-1.2.13/zlib.pc.in | 13 -
cpp/third_party/zlib-1.2.13/zlib2ansi | 152 -
cpp/third_party/zlib-1.2.13/zutil.c | 327 -
cpp/third_party/zlib-1.2.13/zutil.h | 275 -
java/common/pom.xml | 60 -
.../org/apache/tsfile/annotations/TableModel.java | 33 -
.../org/apache/tsfile/annotations/TreeModel.java | 33 -
.../org/apache/tsfile/annotations/TsFileApi.java | 26 -
.../apache/tsfile/block/TsBlockBuilderStatus.java | 70 -
.../org/apache/tsfile/block/column/Column.java | 211 -
.../apache/tsfile/block/column/ColumnBuilder.java | 108 -
.../tsfile/block/column/ColumnBuilderStatus.java | 91 -
.../apache/tsfile/block/column/ColumnEncoding.java | 72 -
.../java/org/apache/tsfile/enums/TSDataType.java | 490 -
.../java/org/apache/tsfile/utils/Accountable.java | 25 -
.../main/java/org/apache/tsfile/utils/Binary.java | 128 -
.../main/java/org/apache/tsfile/utils/BitMap.java | 261 -
.../java/org/apache/tsfile/utils/Constants.java | 105 -
.../java/org/apache/tsfile/utils/PooledBinary.java | 175 -
.../org/apache/tsfile/utils/RamUsageEstimator.java | 583 --
.../org/apache/tsfile/utils/TsPrimitiveType.java | 709 --
.../tsfile/write/UnSupportedDataTypeException.java | 31 -
java/examples/pom.xml | 80 -
java/examples/readme.md | 84 -
.../src/main/java/org/apache/tsfile/Constant.java | 37 -
.../main/java/org/apache/tsfile/DataGenerator.java | 52 -
.../org/apache/tsfile/TsFileForceAppendWrite.java | 124 -
.../main/java/org/apache/tsfile/TsFileRead.java | 117 -
.../java/org/apache/tsfile/TsFileSequenceRead.java | 239 -
.../tsfile/TsFileWriteAlignedWithTSRecord.java | 108 -
.../tsfile/TsFileWriteAlignedWithTablet.java | 156 -
.../org/apache/tsfile/TsFileWriteWithTSRecord.java | 104 -
.../org/apache/tsfile/TsFileWriteWithTablet.java | 114 -
.../tsfile/v4/ITsFileReaderAndITsFileWriter.java | 156 -
.../tsfile/v4/WriteTabletWithITsFileWriter.java | 122 -
java/pom.xml | 106 -
java/tools/README-zh.md | 126 -
java/tools/README.md | 127 -
java/tools/pom.xml | 110 -
.../assembly/resources/conf/logback-cvs2tsfile.xml | 52 -
.../src/assembly/resources/tools/csv2tsfile.bat | 49 -
.../src/assembly/resources/tools/csv2tsfile.sh | 53 -
java/tools/src/assembly/tools.xml | 55 -
.../org/apache/tsfile/tools/DateTimeUtils.java | 514 --
.../java/org/apache/tsfile/tools/SchemaParser.java | 282 -
.../java/org/apache/tsfile/tools/TsFileTool.java | 590 --
.../org/apache/tsfile/tools/TsfiletoolsTest.java | 225 -
java/tsfile/README-zh.md | 167 -
java/tsfile/README.md | 169 -
java/tsfile/format-changelist.md | 56 -
java/tsfile/pom.xml | 293 -
.../antlr4/org/apache/tsfile/parser/PathLexer.g4 | 212 -
.../antlr4/org/apache/tsfile/parser/PathParser.g4 | 67 -
java/tsfile/src/main/codegen/config.fmpp | 21 -
.../src/main/codegen/dataModel/AllFilter.tdd | 57 -
.../codegen/templates/FilterOperatorsTemplate.ftl | 1474 ---
.../src/main/codegen/templates/FilterTemplate.ftl | 92 -
.../java/org/apache/tsfile/common/cache/Cache.java | 31 -
.../org/apache/tsfile/common/cache/LRUCache.java | 72 -
.../apache/tsfile/common/conf/TSFileConfig.java | 695 --
.../tsfile/common/conf/TSFileDescriptor.java | 205 -
.../tsfile/common/constant/JsonFormatConstant.java | 44 -
.../tsfile/common/constant/QueryConstant.java | 33 -
.../tsfile/common/constant/TsFileConstant.java | 52 -
.../java/org/apache/tsfile/common/regexp/DFA.java | 101 -
.../tsfile/common/regexp/DenseDfaMatcher.java | 215 -
.../apache/tsfile/common/regexp/FjsMatcher.java | 223 -
.../apache/tsfile/common/regexp/LikeMatcher.java | 261 -
.../apache/tsfile/common/regexp/LikePattern.java | 84 -
.../org/apache/tsfile/common/regexp/Matcher.java | 24 -
.../java/org/apache/tsfile/common/regexp/NFA.java | 184 -
.../apache/tsfile/common/regexp/NfaMatcher.java | 176 -
.../apache/tsfile/common/regexp/pattern/Any.java | 44 -
.../tsfile/common/regexp/pattern/Literal.java | 37 -
.../tsfile/common/regexp/pattern/Pattern.java | 22 -
.../tsfile/common/regexp/pattern/ZeroOrMore.java | 27 -
.../tsfile/compatibility/BufferDeserializer.java | 26 -
.../tsfile/compatibility/CompatibilityUtils.java | 83 -
.../tsfile/compatibility/DeserializeConfig.java | 106 -
.../tsfile/compatibility/StreamDeserializer.java | 27 -
.../org/apache/tsfile/compress/ICompressor.java | 469 -
.../org/apache/tsfile/compress/IUnCompressor.java | 404 -
.../tsfile/encoding/bitpacking/IntPacker.java | 163 -
.../tsfile/encoding/bitpacking/LongPacker.java | 177 -
.../tsfile/encoding/decoder/BitmapDecoder.java | 221 -
.../apache/tsfile/encoding/decoder/Decoder.java | 220 -
.../encoding/decoder/DeltaBinaryDecoder.java | 251 -
.../tsfile/encoding/decoder/DictionaryDecoder.java | 86 -
.../decoder/DoublePrecisionChimpDecoder.java | 50 -
.../encoding/decoder/DoublePrecisionDecoderV1.java | 117 -
.../encoding/decoder/DoublePrecisionDecoderV2.java | 53 -
.../tsfile/encoding/decoder/DoubleRLBEDecoder.java | 198 -
.../encoding/decoder/DoubleSprintzDecoder.java | 139 -
.../tsfile/encoding/decoder/FloatDecoder.java | 180 -
.../tsfile/encoding/decoder/FloatRLBEDecoder.java | 197 -
.../encoding/decoder/FloatSprintzDecoder.java | 141 -
.../tsfile/encoding/decoder/GorillaDecoderV1.java | 128 -
.../tsfile/encoding/decoder/GorillaDecoderV2.java | 123 -
.../tsfile/encoding/decoder/IntChimpDecoder.java | 156 -
.../tsfile/encoding/decoder/IntGorillaDecoder.java | 90 -
.../tsfile/encoding/decoder/IntRLBEDecoder.java | 196 -
.../tsfile/encoding/decoder/IntRleDecoder.java | 124 -
.../tsfile/encoding/decoder/IntSprintzDecoder.java | 129 -
.../tsfile/encoding/decoder/IntZigzagDecoder.java | 94 -
.../tsfile/encoding/decoder/LongChimpDecoder.java | 155 -
.../encoding/decoder/LongGorillaDecoder.java | 89 -
.../tsfile/encoding/decoder/LongRLBEDecoder.java | 197 -
.../tsfile/encoding/decoder/LongRleDecoder.java | 119 -
.../encoding/decoder/LongSprintzDecoder.java | 127 -
.../tsfile/encoding/decoder/LongZigzagDecoder.java | 101 -
.../tsfile/encoding/decoder/PlainDecoder.java | 88 -
.../encoding/decoder/RegularDataDecoder.java | 285 -
.../apache/tsfile/encoding/decoder/RleDecoder.java | 237 -
.../decoder/SinglePrecisionChimpDecoder.java | 50 -
.../encoding/decoder/SinglePrecisionDecoderV1.java | 113 -
.../encoding/decoder/SinglePrecisionDecoderV2.java | 53 -
.../tsfile/encoding/decoder/SprintzDecoder.java | 54 -
.../tsfile/encoding/encoder/BitmapEncoder.java | 131 -
.../encoding/encoder/DeltaBinaryEncoder.java | 336 -
.../tsfile/encoding/encoder/DictionaryEncoder.java | 116 -
.../encoder/DoublePrecisionChimpEncoder.java | 55 -
.../encoding/encoder/DoublePrecisionEncoderV1.java | 117 -
.../encoding/encoder/DoublePrecisionEncoderV2.java | 55 -
.../apache/tsfile/encoding/encoder/DoubleRLBE.java | 293 -
.../encoding/encoder/DoubleSprintzEncoder.java | 162 -
.../apache/tsfile/encoding/encoder/Encoder.java | 111 -
.../tsfile/encoding/encoder/FloatEncoder.java | 189 -
.../apache/tsfile/encoding/encoder/FloatRLBE.java | 273 -
.../encoding/encoder/FloatSprintzEncoder.java | 156 -
.../tsfile/encoding/encoder/GorillaEncoderV1.java | 85 -
.../tsfile/encoding/encoder/GorillaEncoderV2.java | 105 -
.../tsfile/encoding/encoder/IntChimpEncoder.java | 188 -
.../tsfile/encoding/encoder/IntGorillaEncoder.java | 158 -
.../apache/tsfile/encoding/encoder/IntRLBE.java | 280 -
.../tsfile/encoding/encoder/IntRleEncoder.java | 129 -
.../tsfile/encoding/encoder/IntSprintzEncoder.java | 158 -
.../tsfile/encoding/encoder/IntZigzagEncoder.java | 101 -
.../tsfile/encoding/encoder/LongChimpEncoder.java | 199 -
.../encoding/encoder/LongGorillaEncoder.java | 158 -
.../apache/tsfile/encoding/encoder/LongRLBE.java | 276 -
.../tsfile/encoding/encoder/LongRleEncoder.java | 122 -
.../encoding/encoder/LongSprintzEncoder.java | 159 -
.../tsfile/encoding/encoder/LongZigzagEncoder.java | 112 -
.../tsfile/encoding/encoder/PlainEncoder.java | 142 -
.../org/apache/tsfile/encoding/encoder/RLBE.java | 61 -
.../encoding/encoder/RegularDataEncoder.java | 364 -
.../apache/tsfile/encoding/encoder/RleEncoder.java | 331 -
.../apache/tsfile/encoding/encoder/SDTEncoder.java | 438 -
.../encoder/SinglePrecisionChimpEncoder.java | 55 -
.../encoding/encoder/SinglePrecisionEncoderV1.java | 113 -
.../encoding/encoder/SinglePrecisionEncoderV2.java | 55 -
.../tsfile/encoding/encoder/SprintzEncoder.java | 70 -
.../tsfile/encoding/encoder/TSEncodingBuilder.java | 433 -
.../java/org/apache/tsfile/encoding/fire/Fire.java | 56 -
.../org/apache/tsfile/encoding/fire/IntFire.java | 52 -
.../org/apache/tsfile/encoding/fire/LongFire.java | 48 -
.../apache/tsfile/encrypt/EncryptParameter.java | 38 -
.../org/apache/tsfile/encrypt/EncryptUtils.java | 241 -
.../java/org/apache/tsfile/encrypt/IDecryptor.java | 66 -
.../java/org/apache/tsfile/encrypt/IEncrypt.java | 33 -
.../java/org/apache/tsfile/encrypt/IEncryptor.java | 66 -
.../org/apache/tsfile/encrypt/NoDecryptor.java | 43 -
.../org/apache/tsfile/encrypt/NoEncryptor.java | 43 -
.../org/apache/tsfile/encrypt/UNENCRYPTED.java | 43 -
.../tsfile/exception/IllegalDeviceIDException.java | 27 -
.../exception/NotCompatibleTsFileException.java | 33 -
.../tsfile/exception/NotImplementedException.java | 33 -
.../tsfile/exception/NullFieldException.java | 31 -
.../tsfile/exception/PathParseException.java | 27 -
.../StopReadTsFileByInterruptException.java | 24 -
.../tsfile/exception/TsFileRuntimeException.java | 41 -
...eReaderTimeseriesMetadataIteratorException.java | 27 -
.../TsFileStatisticsMistakesException.java | 27 -
.../tsfile/exception/cache/CacheException.java | 26 -
.../CompressionTypeNotSupportedException.java | 39 -
.../compress/GZIPCompressOverflowException.java | 27 -
.../encoding/TsFileDecodingException.java | 34 -
.../encoding/TsFileEncodingException.java | 35 -
.../tsfile/exception/encrypt/EncryptException.java | 30 -
.../encrypt/EncryptKeyLengthNotMatchException.java | 31 -
.../filter/QueryFilterOptimizationException.java | 27 -
.../exception/filter/StatisticsClassException.java | 35 -
.../filter/UnSupportFilterDataTypeException.java | 27 -
.../exception/read/FileVersionTooOldException.java | 32 -
.../tsfile/exception/read/NoColumnException.java | 27 -
.../exception/read/ReadProcessException.java | 35 -
.../read/UnsupportedOrderingException.java | 27 -
.../exception/write/ConflictDataTypeException.java | 30 -
.../tsfile/exception/write/NoDeviceException.java | 30 -
.../exception/write/NoMeasurementException.java | 30 -
.../tsfile/exception/write/NoTableException.java | 27 -
.../tsfile/exception/write/PageException.java | 38 -
.../write/TsFileNotCompleteException.java | 29 -
.../write/UnknownColumnTypeException.java | 35 -
.../exception/write/WriteProcessException.java | 38 -
.../apache/tsfile/file/IMetadataIndexEntry.java | 38 -
.../java/org/apache/tsfile/file/MetaMarker.java | 74 -
.../tsfile/file/header/ChunkGroupHeader.java | 134 -
.../org/apache/tsfile/file/header/ChunkHeader.java | 368 -
.../org/apache/tsfile/file/header/PageHeader.java | 186 -
.../metadata/AbstractAlignedChunkMetadata.java | 198 -
.../AbstractAlignedTimeSeriesMetadata.java | 203 -
.../tsfile/file/metadata/AlignedChunkMetadata.java | 58 -
.../file/metadata/AlignedTimeSeriesMetadata.java | 72 -
.../tsfile/file/metadata/ChunkGroupMetadata.java | 43 -
.../apache/tsfile/file/metadata/ChunkMetadata.java | 413 -
.../apache/tsfile/file/metadata/ColumnSchema.java | 48 -
.../tsfile/file/metadata/ColumnSchemaBuilder.java | 67 -
.../file/metadata/DeviceMetadataIndexEntry.java | 100 -
.../tsfile/file/metadata/IChunkMetadata.java | 69 -
.../org/apache/tsfile/file/metadata/IDeviceID.java | 182 -
.../org/apache/tsfile/file/metadata/IMetadata.java | 44 -
.../tsfile/file/metadata/ITimeSeriesMetadata.java | 50 -
.../tsfile/file/metadata/LogicalTableSchema.java | 83 -
.../metadata/MeasurementMetadataIndexEntry.java | 99 -
.../file/metadata/MetadataIndexConstructor.java | 192 -
.../tsfile/file/metadata/MetadataIndexNode.java | 172 -
.../apache/tsfile/file/metadata/PlainDeviceID.java | 210 -
.../tsfile/file/metadata/StringArrayDeviceID.java | 316 -
.../file/metadata/TableDeviceChunkMetadata.java | 44 -
.../metadata/TableDeviceTimeSeriesMetadata.java | 56 -
.../apache/tsfile/file/metadata/TableSchema.java | 330 -
.../tsfile/file/metadata/TimeseriesMetadata.java | 397 -
.../tsfile/file/metadata/TsFileMetadata.java | 311 -
.../file/metadata/enums/CompressionType.java | 97 -
.../tsfile/file/metadata/enums/EncryptionType.java | 84 -
.../file/metadata/enums/MetadataIndexNodeType.java | 99 -
.../tsfile/file/metadata/enums/TSEncoding.java | 163 -
.../idcolumn/FourOrHigherLevelDBExtractor.java | 47 -
.../metadata/idcolumn/ThreeLevelDBExtractor.java | 50 -
.../metadata/idcolumn/TwoLevelDBExtractor.java | 57 -
.../file/metadata/statistics/BinaryStatistics.java | 208 -
.../file/metadata/statistics/BlobStatistics.java | 126 -
.../metadata/statistics/BooleanStatistics.java | 214 -
.../file/metadata/statistics/DateStatistics.java | 29 -
.../file/metadata/statistics/DoubleStatistics.java | 261 -
.../file/metadata/statistics/FloatStatistics.java | 249 -
.../metadata/statistics/IntegerStatistics.java | 249 -
.../file/metadata/statistics/LongStatistics.java | 258 -
.../file/metadata/statistics/Statistics.java | 445 -
.../file/metadata/statistics/StringStatistics.java | 250 -
.../file/metadata/statistics/TimeStatistics.java | 136 -
.../metadata/statistics/TimestampStatistics.java | 29 -
.../tsfile/fileSystem/FSFactoryProducer.java | 57 -
.../java/org/apache/tsfile/fileSystem/FSPath.java | 37 -
.../java/org/apache/tsfile/fileSystem/FSType.java | 26 -
.../fileInputFactory/FileInputFactory.java | 29 -
.../fileInputFactory/HDFSInputFactory.java | 61 -
.../fileInputFactory/HybridFileInputFactory.java | 62 -
.../fileInputFactory/LocalFSInputFactory.java | 34 -
.../fileInputFactory/OSFileInputFactory.java | 59 -
.../fileOutputFactory/FileOutputFactory.java | 27 -
.../fileOutputFactory/HDFSOutputFactory.java | 60 -
.../fileOutputFactory/HybridFileOutputFactory.java | 61 -
.../fileOutputFactory/LocalFSOutputFactory.java | 50 -
.../fileOutputFactory/OSFileOutputFactory.java | 58 -
.../tsfile/fileSystem/fsFactory/FSFactory.java | 150 -
.../tsfile/fileSystem/fsFactory/HDFSFactory.java | 269 -
.../fileSystem/fsFactory/HybridFSFactory.java | 165 -
.../fileSystem/fsFactory/LocalFSFactory.java | 142 -
.../tsfile/fileSystem/fsFactory/OSFSFactory.java | 271 -
.../java/org/apache/tsfile/read/TimeValuePair.java | 102 -
.../read/TsFileAlignedSeriesReaderIterator.java | 119 -
.../org/apache/tsfile/read/TsFileCheckStatus.java | 31 -
.../apache/tsfile/read/TsFileDeviceIterator.java | 224 -
.../java/org/apache/tsfile/read/TsFileReader.java | 69 -
.../apache/tsfile/read/TsFileRestorableReader.java | 71 -
.../apache/tsfile/read/TsFileSequenceReader.java | 2976 ------
...leSequenceReaderTimeseriesMetadataIterator.java | 269 -
.../apache/tsfile/read/UnClosedTsFileReader.java | 64 -
.../org/apache/tsfile/read/common/BatchData.java | 943 --
.../tsfile/read/common/BatchDataFactory.java | 44 -
.../java/org/apache/tsfile/read/common/Chunk.java | 203 -
.../tsfile/read/common/DescReadBatchData.java | 86 -
.../tsfile/read/common/DescReadWriteBatchData.java | 522 --
.../java/org/apache/tsfile/read/common/Field.java | 287 -
.../tsfile/read/common/IBatchDataIterator.java | 37 -
.../java/org/apache/tsfile/read/common/Path.java | 282 -
.../org/apache/tsfile/read/common/RowRecord.java | 138 -
.../apache/tsfile/read/common/SignalBatchData.java | 44 -
.../org/apache/tsfile/read/common/TimeRange.java | 404 -
.../org/apache/tsfile/read/common/TimeSeries.java | 59 -
.../apache/tsfile/read/common/block/TsBlock.java | 628 --
.../tsfile/read/common/block/TsBlockBuilder.java | 348 -
.../tsfile/read/common/block/TsBlockUtil.java | 127 -
.../block/column/BinaryArrayColumnEncoder.java | 93 -
.../read/common/block/column/BinaryColumn.java | 282 -
.../common/block/column/BinaryColumnBuilder.java | 160 -
.../read/common/block/column/BooleanColumn.java | 250 -
.../common/block/column/BooleanColumnBuilder.java | 164 -
.../block/column/ByteArrayColumnEncoder.java | 63 -
.../read/common/block/column/ColumnEncoder.java | 123 -
.../common/block/column/ColumnEncoderFactory.java | 51 -
.../read/common/block/column/ColumnFactory.java | 48 -
.../read/common/block/column/ColumnUtil.java | 113 -
.../read/common/block/column/DictionaryColumn.java | 605 --
.../block/column/DictionaryColumnEncoder.java | 68 -
.../read/common/block/column/DictionaryId.java | 79 -
.../read/common/block/column/DoubleColumn.java | 251 -
.../common/block/column/DoubleColumnBuilder.java | 179 -
.../read/common/block/column/FloatColumn.java | 265 -
.../common/block/column/FloatColumnBuilder.java | 169 -
.../block/column/Int32ArrayColumnEncoder.java | 117 -
.../block/column/Int64ArrayColumnEncoder.java | 104 -
.../tsfile/read/common/block/column/IntColumn.java | 293 -
.../read/common/block/column/IntColumnBuilder.java | 169 -
.../read/common/block/column/LongColumn.java | 265 -
.../common/block/column/LongColumnBuilder.java | 169 -
.../read/common/block/column/NullColumn.java | 175 -
.../block/column/RunLengthColumnEncoder.java | 56 -
.../block/column/RunLengthEncodedColumn.java | 272 -
.../read/common/block/column/TimeColumn.java | 223 -
.../common/block/column/TimeColumnBuilder.java | 156 -
.../read/common/block/column/TsBlockSerde.java | 130 -
.../read/common/parser/PathNodesGenerator.java | 103 -
.../tsfile/read/common/parser/PathParseError.java | 63 -
.../tsfile/read/common/parser/PathVisitor.java | 105 -
.../tsfile/read/common/type/AbstractIntType.java | 90 -
.../tsfile/read/common/type/AbstractLongType.java | 90 -
.../tsfile/read/common/type/AbstractType.java | 28 -
.../read/common/type/AbstractVarcharType.java | 60 -
.../apache/tsfile/read/common/type/BinaryType.java | 40 -
.../apache/tsfile/read/common/type/BlobType.java | 79 -
.../tsfile/read/common/type/BooleanType.java | 78 -
.../apache/tsfile/read/common/type/DateType.java | 41 -
.../apache/tsfile/read/common/type/DoubleType.java | 108 -
.../apache/tsfile/read/common/type/FloatType.java | 108 -
.../apache/tsfile/read/common/type/IntType.java | 41 -
.../apache/tsfile/read/common/type/LongType.java | 41 -
.../apache/tsfile/read/common/type/RowType.java | 170 -
.../apache/tsfile/read/common/type/StringType.java | 41 -
.../tsfile/read/common/type/TimestampType.java | 41 -
.../org/apache/tsfile/read/common/type/Type.java | 119 -
.../apache/tsfile/read/common/type/TypeEnum.java | 42 -
.../tsfile/read/common/type/TypeFactory.java | 87 -
.../tsfile/read/common/type/UnknownType.java | 87 -
.../read/controller/CachedChunkLoaderImpl.java | 146 -
.../tsfile/read/controller/DeviceMetaIterator.java | 133 -
.../tsfile/read/controller/IChunkLoader.java | 40 -
.../read/controller/IChunkMetadataLoader.java | 31 -
.../tsfile/read/controller/IMetadataQuerier.java | 91 -
.../read/controller/MetadataQuerierByFileImpl.java | 312 -
.../tsfile/read/expression/ExpressionTree.java | 76 -
.../tsfile/read/expression/ExpressionType.java | 48 -
.../tsfile/read/expression/IBinaryExpression.java | 31 -
.../apache/tsfile/read/expression/IExpression.java | 32 -
.../tsfile/read/expression/IUnaryExpression.java | 29 -
.../tsfile/read/expression/QueryExpression.java | 103 -
.../read/expression/impl/BinaryExpression.java | 189 -
.../read/expression/impl/GlobalTimeExpression.java | 99 -
.../expression/impl/SingleSeriesExpression.java | 107 -
.../read/expression/util/ExpressionOptimizer.java | 240 -
.../read/filter/PredicateRemoveNotRewriter.java | 50 -
.../read/filter/basic/BinaryLogicalFilter.java | 68 -
.../read/filter/basic/CompareNullFilter.java | 48 -
.../apache/tsfile/read/filter/basic/Filter.java | 252 -
.../tsfile/read/filter/basic/OperatorType.java | 79 -
.../tsfile/read/filter/basic/TimeFilter.java | 153 -
.../tsfile/read/filter/basic/ValueFilter.java | 203 -
.../tsfile/read/filter/factory/FilterFactory.java | 79 -
.../tsfile/read/filter/factory/TimeFilterApi.java | 101 -
.../tsfile/read/filter/factory/ValueFilterApi.java | 438 -
.../apache/tsfile/read/filter/operator/And.java | 202 -
.../tsfile/read/filter/operator/GroupByFilter.java | 155 -
.../read/filter/operator/GroupByMonthFilter.java | 270 -
.../apache/tsfile/read/filter/operator/Not.java | 230 -
.../org/apache/tsfile/read/filter/operator/Or.java | 264 -
.../read/filter/operator/TimeFilterOperators.java | 632 --
.../filter/operator/ValueIsNotNullOperator.java | 143 -
.../read/filter/operator/ValueIsNullOperator.java | 139 -
.../read/query/dataset/AbstractResultSet.java | 186 -
.../query/dataset/DataSetWithTimeGenerator.java | 100 -
.../query/dataset/DataSetWithoutTimeGenerator.java | 192 -
.../tsfile/read/query/dataset/QueryDataSet.java | 266 -
.../tsfile/read/query/dataset/ResultSet.java | 91 -
.../read/query/dataset/ResultSetMetadata.java | 33 -
.../read/query/dataset/ResultSetMetadataImpl.java | 63 -
.../tsfile/read/query/dataset/TableResultSet.java | 88 -
.../tsfile/read/query/dataset/TreeResultSet.java | 54 -
.../query/executor/ExecutorWithTimeGenerator.java | 128 -
.../tsfile/read/query/executor/QueryExecutor.java | 30 -
.../read/query/executor/TableQueryExecutor.java | 163 -
.../tsfile/read/query/executor/TsFileExecutor.java | 213 -
.../read/query/executor/task/DeviceQueryTask.java | 73 -
.../query/executor/task/DeviceTaskIterator.java | 62 -
.../read/query/timegenerator/TimeGenerator.java | 139 -
.../query/timegenerator/TsFileTimeGenerator.java | 65 -
.../read/query/timegenerator/node/AndNode.java | 106 -
.../read/query/timegenerator/node/LeafNode.java | 93 -
.../tsfile/read/query/timegenerator/node/Node.java | 31 -
.../read/query/timegenerator/node/NodeType.java | 27 -
.../read/query/timegenerator/node/OrNode.java | 119 -
.../apache/tsfile/read/reader/IBatchReader.java | 33 -
.../apache/tsfile/read/reader/IChunkReader.java | 36 -
.../org/apache/tsfile/read/reader/IPageReader.java | 49 -
.../apache/tsfile/read/reader/IPointReader.java | 37 -
.../tsfile/read/reader/LocalTsFileInput.java | 124 -
.../org/apache/tsfile/read/reader/TsFileInput.java | 134 -
.../reader/block/DeviceOrderedTsBlockReader.java | 96 -
.../reader/block/SingleDeviceTsBlockReader.java | 414 -
.../tsfile/read/reader/block/TsBlockReader.java | 48 -
.../reader/chunk/AbstractAlignedChunkReader.java | 282 -
.../read/reader/chunk/AbstractChunkReader.java | 83 -
.../read/reader/chunk/AlignedChunkReader.java | 101 -
.../chunk/AlignedChunkReaderWithoutStatistics.java | 45 -
.../tsfile/read/reader/chunk/ChunkReader.java | 247 -
.../reader/chunk/ChunkReaderWithoutStatistics.java | 37 -
.../tsfile/read/reader/chunk/TableChunkReader.java | 90 -
.../reader/page/AbstractAlignedPageReader.java | 373 -
.../tsfile/read/reader/page/AlignedPageReader.java | 221 -
.../page/LazyLoadAlignedPagePointReader.java | 105 -
.../tsfile/read/reader/page/LazyLoadPageData.java | 81 -
.../apache/tsfile/read/reader/page/PageReader.java | 433 -
.../tsfile/read/reader/page/TablePageReader.java | 137 -
.../tsfile/read/reader/page/TimePageReader.java | 118 -
.../tsfile/read/reader/page/ValuePageReader.java | 622 --
.../reader/series/AbstractFileSeriesReader.java | 110 -
.../read/reader/series/EmptyFileSeriesReader.java | 57 -
.../read/reader/series/FileSeriesReader.java | 89 -
.../reader/series/FileSeriesReaderByTimestamp.java | 169 -
.../read/reader/series/PaginationController.java | 101 -
.../tsfile/read/v4/DeviceTableModelReader.java | 116 -
.../org/apache/tsfile/read/v4/ITsFileReader.java | 47 -
.../apache/tsfile/read/v4/TsFileReaderBuilder.java | 49 -
.../java/org/apache/tsfile/utils/BloomFilter.java | 148 -
.../java/org/apache/tsfile/utils/BytesUtils.java | 944 --
.../java/org/apache/tsfile/utils/DateUtils.java | 89 -
.../main/java/org/apache/tsfile/utils/FSUtils.java | 153 -
.../org/apache/tsfile/utils/FilePathUtils.java | 128 -
.../org/apache/tsfile/utils/FilterDeserialize.java | 392 -
.../main/java/org/apache/tsfile/utils/Loader.java | 59 -
.../org/apache/tsfile/utils/MeasurementGroup.java | 65 -
.../org/apache/tsfile/utils/Murmur128Hash.java | 184 -
.../main/java/org/apache/tsfile/utils/Pair.java | 99 -
.../org/apache/tsfile/utils/Preconditions.java | 39 -
.../java/org/apache/tsfile/utils/PublicBAOS.java | 160 -
.../tsfile/utils/ReadWriteForEncodingUtils.java | 353 -
.../org/apache/tsfile/utils/ReadWriteIOUtils.java | 1294 ---
.../org/apache/tsfile/utils/StringContainer.java | 394 -
.../java/org/apache/tsfile/utils/TimeDuration.java | 193 -
.../apache/tsfile/utils/TsFileGeneratorUtils.java | 486 -
.../org/apache/tsfile/utils/TsFileSketchTool.java | 727 --
.../java/org/apache/tsfile/utils/TsFileUtils.java | 58 -
.../java/org/apache/tsfile/utils/WriteUtils.java | 64 -
.../java/org/apache/tsfile/write/TsFileWriter.java | 767 --
.../write/chunk/AlignedChunkGroupWriterImpl.java | 443 -
.../tsfile/write/chunk/AlignedChunkWriterImpl.java | 567 --
.../apache/tsfile/write/chunk/ChunkWriterImpl.java | 530 --
.../tsfile/write/chunk/IChunkGroupWriter.java | 97 -
.../apache/tsfile/write/chunk/IChunkWriter.java | 63 -
.../chunk/NonAlignedChunkGroupWriterImpl.java | 239 -
.../write/chunk/TableChunkGroupWriterImpl.java | 36 -
.../apache/tsfile/write/chunk/TimeChunkWriter.java | 359 -
.../tsfile/write/chunk/ValueChunkWriter.java | 463 -
.../org/apache/tsfile/write/page/PageWriter.java | 341 -
.../apache/tsfile/write/page/TimePageWriter.java | 217 -
.../apache/tsfile/write/page/ValuePageWriter.java | 382 -
.../org/apache/tsfile/write/record/TSRecord.java | 145 -
.../org/apache/tsfile/write/record/Tablet.java | 1321 ---
.../write/record/datapoint/BooleanDataPoint.java | 63 -
.../tsfile/write/record/datapoint/DataPoint.java | 160 -
.../write/record/datapoint/DateDataPoint.java | 62 -
.../write/record/datapoint/DoubleDataPoint.java | 63 -
.../write/record/datapoint/FloatDataPoint.java | 63 -
.../write/record/datapoint/IntDataPoint.java | 63 -
.../write/record/datapoint/LongDataPoint.java | 63 -
.../write/record/datapoint/StringDataPoint.java | 64 -
.../tsfile/write/schema/IMeasurementSchema.java | 102 -
.../tsfile/write/schema/MeasurementSchema.java | 458 -
.../tsfile/write/schema/MeasurementSchemaType.java | 38 -
.../org/apache/tsfile/write/schema/Schema.java | 166 -
.../tsfile/write/schema/TimeseriesSchema.java | 272 -
.../write/schema/VectorMeasurementSchema.java | 425 -
.../write/v4/AbstractTableModelTsFileWriter.java | 272 -
.../tsfile/write/v4/DeviceTableModelWriter.java | 107 -
.../org/apache/tsfile/write/v4/ITsFileWriter.java | 35 -
.../tsfile/write/v4/TsFileWriterBuilder.java | 70 -
.../write/writer/FlushChunkMetadataListener.java | 33 -
.../write/writer/ForceAppendTsFileWriter.java | 87 -
.../apache/tsfile/write/writer/IDataWriter.java | 21 -
.../tsfile/write/writer/LocalTsFileOutput.java | 106 -
.../write/writer/RestorableTsFileIOWriter.java | 297 -
.../apache/tsfile/write/writer/TsFileIOWriter.java | 833 --
.../write/writer/TsFileIOWriterEndFileTest.java | 51 -
.../apache/tsfile/write/writer/TsFileOutput.java | 94 -
.../write/writer/tsmiterator/DiskTSMIterator.java | 136 -
.../write/writer/tsmiterator/TSMIterator.java | 150 -
.../org/apache/tsfile/common/LRUCacheTest.java | 55 -
.../common/block/BinaryArrayColumnEncoderTest.java | 82 -
.../common/block/ByteArrayColumnEncoderTest.java | 79 -
.../tsfile/common/block/ColumnEncoderTest.java | 144 -
.../common/block/DictionaryColumnEncodingTest.java | 77 -
.../common/block/Int32ArrayColumnEncoderTest.java | 119 -
.../common/block/Int64ArrayColumnEncoderTest.java | 122 -
.../tsfile/common/block/NullColumnUnitTest.java | 90 -
.../common/block/RunLengthColumnEncoderTest.java | 104 -
.../tsfile/common/block/TsBlockSerdeTest.java | 188 -
.../apache/tsfile/common/block/TsBlockTest.java | 457 -
.../tsfile/common/conf/TSFileDescriptorTest.java | 85 -
.../tsfile/compatibility/CompatibilityTest.java | 94 -
.../org/apache/tsfile/compress/CompressTest.java | 145 -
.../java/org/apache/tsfile/compress/GZIPTest.java | 98 -
.../java/org/apache/tsfile/compress/LZ4Test.java | 131 -
.../java/org/apache/tsfile/compress/LZMA2Test.java | 104 -
.../org/apache/tsfile/compress/SnappyTest.java | 101 -
.../java/org/apache/tsfile/compress/ZstdTest.java | 109 -
.../org/apache/tsfile/constant/TestConstant.java | 34 -
.../org/apache/tsfile/encoding/SDTEncoderTest.java | 177 -
.../tsfile/encoding/bitpacking/IntPackerTest.java | 79 -
.../tsfile/encoding/bitpacking/LongPackerTest.java | 131 -
.../tsfile/encoding/decoder/BitmapDecoderTest.java | 97 -
.../tsfile/encoding/decoder/ChimpDecoderTest.java | 594 --
.../encoding/decoder/DictionaryDecoderTest.java | 86 -
.../tsfile/encoding/decoder/FloatDecoderTest.java | 266 -
.../encoding/decoder/GorillaDecoderV1Test.java | 258 -
.../encoding/decoder/GorillaDecoderV2Test.java | 594 --
.../tsfile/encoding/decoder/IntRleDecoderTest.java | 217 -
.../encoding/decoder/IntZigzagDecoderTest.java | 99 -
.../encoding/decoder/LongRleDecoderTest.java | 221 -
.../encoding/decoder/LongZigzagDecoderTest.java | 94 -
.../tsfile/encoding/decoder/RLBEDecoderTest.java | 261 -
.../encoding/decoder/SprintzDecoderTest.java | 593 --
.../delta/DeltaBinaryEncoderIntegerTest.java | 110 -
.../decoder/delta/DeltaBinaryEncoderLongTest.java | 201 -
.../regular/RegularDataEncoderIntegerTest.java | 157 -
.../regular/RegularDataEncoderLongTest.java | 252 -
.../org/apache/tsfile/encrypt/EncryptTest.java | 341 -
.../tsfile/exception/TsFileExceptionTest.java | 187 -
.../apache/tsfile/file/header/PageHeaderTest.java | 108 -
.../tsfile/file/metadata/ChunkMetadataTest.java | 70 -
.../apache/tsfile/file/metadata/IDeviceIDTest.java | 153 -
.../file/metadata/MetadataIndexNodeTest.java | 51 -
.../file/metadata/TimeseriesMetadataTest.java | 138 -
.../TreeDeviceIdColumnValueExtractorTest.java | 170 -
.../tsfile/file/metadata/TsFileMetadataTest.java | 112 -
.../metadata/statistics/BooleanStatisticsTest.java | 83 -
.../metadata/statistics/DoubleStatisticsTest.java | 94 -
.../metadata/statistics/FloatStatisticsTest.java | 94 -
.../metadata/statistics/IntegerStatisticsTest.java | 93 -
.../metadata/statistics/LongStatisticsTest.java | 99 -
.../file/metadata/statistics/StatisticsTest.java | 183 -
.../metadata/statistics/StringStatisticsTest.java | 86 -
.../tsfile/file/metadata/utils/TestHelper.java | 84 -
.../apache/tsfile/file/metadata/utils/Utils.java | 105 -
.../org/apache/tsfile/read/ExpressionTest.java | 65 -
.../org/apache/tsfile/read/GetAllDevicesTest.java | 95 -
...easurementChunkMetadataListMapIteratorTest.java | 204 -
.../apache/tsfile/read/ReadInPartitionTest.java | 233 -
.../test/java/org/apache/tsfile/read/ReadTest.java | 409 -
.../tsfile/read/TimePlainEncodeReadTest.java | 416 -
.../tsfile/read/TimeSeriesMetadataReadTest.java | 96 -
.../tsfile/read/TsFileDeviceIteratorTest.java | 141 -
.../org/apache/tsfile/read/TsFileReaderTest.java | 556 --
.../tsfile/read/TsFileRestorableReaderTest.java | 65 -
.../tsfile/read/TsFileSequenceReaderTest.java | 265 -
...quenceReaderTimeseriesMetadataIteratorTest.java | 62 -
.../read/TsFileV4ReadWriteInterfacesTest.java | 121 -
.../tsfile/read/UnClosedTsFileReaderTest.java | 74 -
.../apache/tsfile/read/common/BatchDataTest.java | 84 -
.../org/apache/tsfile/read/common/ColumnTest.java | 608 --
.../org/apache/tsfile/read/common/FieldTest.java | 32 -
.../org/apache/tsfile/read/common/PathTest.java | 224 -
.../apache/tsfile/read/common/TimeRangeTest.java | 492 -
.../tsfile/read/controller/ChunkLoaderTest.java | 67 -
.../controller/IMetadataQuerierByFileImplTest.java | 150 -
.../tsfile/read/filter/BinaryOperatorsTest.java | 172 -
.../tsfile/read/filter/BooleanOperatorsTest.java | 160 -
.../tsfile/read/filter/FilterSerializeTest.java | 440 -
.../apache/tsfile/read/filter/FilterTestUtil.java | 107 -
.../tsfile/read/filter/GroupByFilterTest.java | 127 -
.../tsfile/read/filter/GroupByMonthFilterTest.java | 278 -
.../read/filter/IExpressionOptimizerTest.java | 308 -
.../read/filter/MinTimeMaxTimeFilterTest.java | 211 -
.../tsfile/read/filter/NullOperatorsTest.java | 41 -
.../tsfile/read/filter/NumericalOperatorsTest.java | 149 -
.../apache/tsfile/read/filter/OperatorTest.java | 191 -
.../filter/PredicateRemoveNotRewriterTest.java | 160 -
.../tsfile/read/filter/StatisticsFilterTest.java | 496 -
.../tsfile/read/filter/TsBlockFilterTest.java | 185 -
.../apache/tsfile/read/query/ResultSetTest.java | 281 -
.../read/query/executor/QueryExecutorTest.java | 165 -
.../tsfile/read/query/timegenerator/NodeTest.java | 100 -
.../read/query/timegenerator/ReadWriteTest.java | 196 -
.../query/timegenerator/ReaderByTimestampTest.java | 109 -
.../timegenerator/TimeGeneratorReadEmptyTest.java | 160 -
.../timegenerator/TimeGeneratorReadWriteTest.java | 196 -
.../query/timegenerator/TimeGeneratorTest.java | 98 -
.../TsFileGeneratorForSeriesReaderByTimestamp.java | 280 -
.../AlignedChunkReaderWithoutStatisticsTest.java | 122 -
.../read/reader/AlignedPageReaderPushDownTest.java | 549 --
.../apache/tsfile/read/reader/ChunkReaderTest.java | 109 -
.../reader/ChunkReaderWithoutStatisticsTest.java | 110 -
.../tsfile/read/reader/FakedBatchReader.java | 55 -
.../tsfile/read/reader/FakedMultiBatchReader.java | 59 -
.../reader/LazyLoadAlignedPagePointReaderTest.java | 170 -
.../tsfile/read/reader/PageReaderPushDownTest.java | 147 -
.../apache/tsfile/read/reader/PageReaderTest.java | 314 -
.../org/apache/tsfile/read/reader/ReaderTest.java | 139 -
.../read/reader/TsFileReaderEmptyChunkTest.java | 183 -
.../read/reader/chunk/TableChunkReaderTest.java | 108 -
.../apache/tsfile/tableview/PerformanceTest.java | 373 -
.../apache/tsfile/tableview/TableSchemaTest.java | 140 -
.../org/apache/tsfile/tableview/TableViewTest.java | 540 --
.../java/org/apache/tsfile/utils/BitMapTest.java | 107 -
.../org/apache/tsfile/utils/BloomFilterTest.java | 66 -
.../org/apache/tsfile/utils/BytesUtilsTest.java | 430 -
.../org/apache/tsfile/utils/DateUtilsTest.java | 114 -
.../org/apache/tsfile/utils/EncodingUtils.java | 41 -
.../org/apache/tsfile/utils/FileGenerator.java | 362 -
.../org/apache/tsfile/utils/FilePathUtilsTest.java | 100 -
.../java/org/apache/tsfile/utils/FileUtils.java | 83 -
.../org/apache/tsfile/utils/FileUtilsTest.java | 51 -
.../java/org/apache/tsfile/utils/PairTest.java | 72 -
.../utils/ReadWriteForEncodingUtilsTest.java | 61 -
.../apache/tsfile/utils/ReadWriteIOUtilsTest.java | 222 -
.../tsfile/utils/ReadWriteStreamUtilsTest.java | 163 -
.../tsfile/utils/ReadWriteToBytesUtilsTest.java | 66 -
.../java/org/apache/tsfile/utils/RecordUtils.java | 121 -
.../org/apache/tsfile/utils/RecordUtilsTest.java | 187 -
.../apache/tsfile/utils/StringContainerTest.java | 175 -
.../org/apache/tsfile/utils/TimeDurationTest.java | 73 -
.../tsfile/utils/TsFileGeneratorForTest.java | 339 -
.../org/apache/tsfile/utils/TsFileUtilsTest.java | 72 -
.../apache/tsfile/utils/TsPrimitiveTypeTest.java | 78 -
.../java/org/apache/tsfile/utils/TypeCastTest.java | 161 -
.../tsfile/write/DefaultSchemaTemplateTest.java | 112 -
.../tsfile/write/MetadataIndexConstructorTest.java | 506 --
.../java/org/apache/tsfile/write/PerfTest.java | 234 -
.../org/apache/tsfile/write/ReadPageInMemTest.java | 189 -
...SameMeasurementsWithDifferentDataTypesTest.java | 215 -
.../apache/tsfile/write/TsFileIOWriterTest.java | 231 -
.../tsfile/write/TsFileIntegrityCheckingTool.java | 253 -
.../apache/tsfile/write/TsFileReadWriteTest.java | 261 -
.../apache/tsfile/write/TsFileWriteApiTest.java | 974 --
.../org/apache/tsfile/write/TsFileWriterTest.java | 350 -
.../java/org/apache/tsfile/write/WriteTest.java | 289 -
.../org/apache/tsfile/write/record/TabletTest.java | 300 -
.../write/schema/converter/SchemaBuilderTest.java | 153 -
.../write/writer/AlignedChunkWriterImplTest.java | 181 -
.../write/writer/ForceAppendTsFileWriterTest.java | 123 -
.../writer/MeasurementSchemaSerializeTest.java | 57 -
.../apache/tsfile/write/writer/PageWriterTest.java | 220 -
.../write/writer/RestorableTsFileIOWriterTest.java | 507 --
.../tsfile/write/writer/TestTsFileOutput.java | 75 -
.../tsfile/write/writer/TimeChunkWriterTest.java | 165 -
.../tsfile/write/writer/TimePageWriterTest.java | 171 -
.../writer/TsFileIOWriterMemoryControlTest.java | 1364 ---
.../tsfile/write/writer/ValueChunkWriterTest.java | 109 -
.../tsfile/write/writer/ValuePageWriterTest.java | 291 -
.../write/writer/VectorMeasurementSchemaStub.java | 138 -
java/tsfile/src/test/resources/logback.xml | 124 -
java/tsfile/src/test/resources/v3TsFile | Bin 378 -> 0 bytes
jenkins.pom | 67 -
pom.xml | 1081 ---
python/README-zh.md | 34 -
python/README.md | 66 -
python/VersionUpdater.groovy | 41 -
python/examlpes.py | 82 -
python/pom.xml | 207 -
python/requirements.txt | 25 -
python/setup.py | 122 -
python/test.py | 165 -
python/tsfile/__init__.py | 18 -
python/tsfile/tsfile.pxd | 104 -
python/tsfile/tsfile.py | 145 -
python/tsfile/tsfile_pywrapper.pyx | 348 -
1572 files changed, 2 insertions(+), 290527 deletions(-)
diff --git a/.github/workflows/code-coverage.yml b/.github/workflows/code-coverage.yml
deleted file mode 100644
index ef9524e1e..000000000
--- a/.github/workflows/code-coverage.yml
+++ /dev/null
@@ -1,42 +0,0 @@
-name: Code Coverage
-on:
- push:
- branches:
- - develop
- - rc/*
- paths-ignore:
- - 'docs/**'
- pull_request:
- branches:
- - develop
- - rc/*
- paths-ignore:
- - 'docs/**'
-
-jobs:
- codecov:
- runs-on: ubuntu-22.04
- if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'apache/tsfile' || github.event_name == 'push'
-
- steps:
- - uses: actions/checkout@v4
- - name: Cache Maven packages
- uses: actions/cache@v4
- with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2-
- - name: Generate code coverage reports
- run: |
- sudo apt-get install lcov
- ./mvnw -B -P with-java,with-cpp,with-python,with-code-coverage clean verify
- lcov --capture --directory cpp/target/build/test --output-file cpp/target/build/test/coverage.info
- lcov --remove cpp/target/build/test/coverage.info '*/tsfile/cpp/test/*' --output-file cpp/target/build/test/coverage_filtered.info
- genhtml cpp/target/build/test/coverage_filtered.info --output-directory cpp/target/build/test/coverage_report
- rm -rf cpp/target/build/test/CMakeFiles/TsFile_Test.dir
- rm -rf cpp/target/build/test/coverage.info
- - name: Upload coverage reports to codecov
- uses: codecov/codecov-action@v5
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
- files: java/tsfile/target/jacoco-merged-reports/jacoco.xml,cpp/target/build/test/coverage_report/index.html
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
deleted file mode 100644
index 4ae549952..000000000
--- a/.github/workflows/codeql.yml
+++ /dev/null
@@ -1,79 +0,0 @@
-# For most projects, this workflow file will not need changing; you simply need
-# to commit it to your repository.
-#
-# You may wish to alter this file to override the set of languages analyzed,
-# or to provide custom queries or build logic.
-#
-# ******** NOTE ********
-# We have attempted to detect the languages in your repository. Please check
-# the `language` matrix defined below to confirm you have the correct set of
-# supported CodeQL languages.
-#
-name: "CodeQL"
-
-on:
- push:
- branches:
- - develop
- - rc/*
- paths-ignore:
- - 'docs/**'
-
-jobs:
- analyze:
- name: Analyze (${{ matrix.language }})
- # Runner size impacts CodeQL analysis time. To learn more, please see:
- # - https://gh.io/recommended-hardware-resources-for-running-codeql
- # - https://gh.io/supported-runners-and-hardware-resources
- # - https://gh.io/using-larger-runners (GitHub.com only)
- # Consider using larger runners or machines with greater resources for possible analysis time improvements.
- runs-on: ${{ (matrix.language == 'c-cpp' && 'macos-latest') || 'ubuntu-latest' }}
- timeout-minutes: ${{ 360 }}
- permissions:
- # required for all workflows
- security-events: write
-
- # required to fetch internal or private CodeQL packs
- packages: read
-
- # only required for workflows in private repositories
- actions: read
- contents: read
-
- strategy:
- fail-fast: false
- matrix:
- include:
- - language: c-cpp
- build-mode: autobuild
- - language: java-kotlin
- build-mode: none # This mode only analyzes Java. Set this to 'autobuild' or 'manual' to analyze Kotlin too.
- - language: python
- build-mode: none
- # CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
- # Use `c-cpp` to analyze code written in C, C++ or both
- # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
- # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
- # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
- # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
- # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
- # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- # Initializes the CodeQL tools for scanning.
- - name: Initialize CodeQL
- uses: github/codeql-action/init@v3
- with:
- languages: ${{ matrix.language }}
- build-mode: ${{ matrix.build-mode }}
- - name: Manual build
- if: matrix.build-mode == 'manual'
- run: |
- .\mvnw.cmd clean package -P with-cpp
-
- - name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@v3
- with:
- category: "/language:${{matrix.language}}"
diff --git a/.github/workflows/site-build.yaml b/.github/workflows/site-build.yaml
index a9ecf0f7b..b9184af1b 100644
--- a/.github/workflows/site-build.yaml
+++ b/.github/workflows/site-build.yaml
@@ -4,11 +4,13 @@ on:
push:
branches:
- develop
+ - 'docs/**'
paths:
- 'docs/**'
pull_request:
branches:
- develop
+ - 'docs/**'
paths:
- 'docs/**'
# allow manually run the action:
diff --git a/.github/workflows/unit-test-cpp-py.yml b/.github/workflows/unit-test-cpp-py.yml
deleted file mode 100644
index f4833e1f1..000000000
--- a/.github/workflows/unit-test-cpp-py.yml
+++ /dev/null
@@ -1,88 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Unit-Test-Cpp-Py
-
-on:
- push:
- branches:
- - develop
- - iotdb
- - rc/*
- paths-ignore:
- - 'docs/**'
- - 'java/**'
- pull_request:
- branches:
- - develop
- - iotdb
- - rc/*
- paths-ignore:
- - 'docs/**'
- - 'java/**'
- # Enable manually starting builds, and allow forcing updating of SNAPSHOT dependencies.
- workflow_dispatch:
- inputs:
- forceUpdates:
- description: "Forces a snapshot update"
- required: false
- default: 'false'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-env:
- MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
-
-jobs:
- unit-test:
- strategy:
- fail-fast: false
- max-parallel: 15
- matrix:
- os: [ ubuntu-latest, macos-latest, windows-latest ]
- runs-on: ${{ matrix.os }}
-
- steps:
-
- - name: Checkout repository
- uses: actions/checkout@v4
-
- # Setup caching of the artifacts in the .m2 directory, so they don't have to
- # all be downloaded again for every build.
- - name: Cache Maven packages
- uses: actions/cache@v4
- with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2-
-
- # On Windows systems the 'mvnw' script needs an additional ".cmd" appended.
- - name: Calculate platform suffix
- id: platform_suffix
- uses: actions/github-script@v7.0.1
- env:
- OS: ${{ matrix.os }}
- with:
- script: |
- const { OS } = process.env
- if (OS.includes("windows")) {
- core.setOutput('platform_suffix', `.cmd`)
- } else {
- core.setOutput('platform_suffix', ``)
- }
-
- # Run the actual maven build including all tests.
- - name: Build and test with Maven
- shell: bash
- run: |
- ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} -P with-cpp,with-python clean verify
-
- - name: Upload whl Artifact
- uses: actions/upload-artifact@v4
- with:
- name: tsfile-${{ runner.os }}-whl
- path: python/dist/tsfile-*.whl
- retention-days: 1
diff --git a/.github/workflows/unit-test-java.yml b/.github/workflows/unit-test-java.yml
deleted file mode 100644
index 2e0cbf484..000000000
--- a/.github/workflows/unit-test-java.yml
+++ /dev/null
@@ -1,90 +0,0 @@
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Unit-Test-Java
-
-on:
- push:
- branches:
- - develop
- - iotdb
- - rc/*
- paths-ignore:
- - 'docs/**'
- - 'cpp/**'
- - 'python/**'
- pull_request:
- branches:
- - develop
- - iotdb
- - rc/*
- paths-ignore:
- - 'docs/**'
- - 'cpp/**'
- - 'python/**'
- # Enable manually starting builds, and allow forcing updating of SNAPSHOT dependencies.
- workflow_dispatch:
- inputs:
- forceUpdates:
- description: "Forces a snapshot update"
- required: false
- default: 'false'
-
-concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
-
-env:
- MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
- DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
-
-jobs:
- unit-test:
- strategy:
- fail-fast: false
- max-parallel: 15
- matrix:
- java: [ 8, 17, 21 ]
- os: [ ubuntu-latest, macos-latest, windows-latest ]
- runs-on: ${{ matrix.os }}
-
- steps:
-
- - name: Checkout repository
- uses: actions/checkout@v4
-
- - name: Set up JDK ${{ matrix.java }}
- uses: actions/setup-java@v4
- with:
- distribution: corretto
- java-version: ${{ matrix.java }}
-
- # Setup caching of the artifacts in the .m2 directory, so they don't have to
- # all be downloaded again for every build.
- - name: Cache Maven packages
- uses: actions/cache@v4
- with:
- path: ~/.m2
- key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
- restore-keys: ${{ runner.os }}-m2-
-
- # On Windows systems the 'mvnw' script needs an additional ".cmd" appended.
- - name: Calculate platform suffix
- id: platform_suffix
- uses: actions/github-script@v7.0.1
- env:
- OS: ${{ matrix.os }}
- with:
- script: |
- const { OS } = process.env
- if (OS.includes("windows")) {
- core.setOutput('platform_suffix', `.cmd`)
- } else {
- core.setOutput('platform_suffix', ``)
- }
-
- # Run the actual maven build including all tests.
- - name: Build and test with Maven
- shell: bash
- run: |
- ./mvnw${{ steps.platform_suffix.outputs.platform_suffix }} -P with-java clean verify
diff --git a/Jenkinsfile b/Jenkinsfile
deleted file mode 100644
index c45b117a5..000000000
--- a/Jenkinsfile
+++ /dev/null
@@ -1,168 +0,0 @@
-#!groovy
-
-/*
- * 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.
- */
-
-pipeline {
-
- agent {
- node {
- label 'ubuntu'
- }
- }
-
- environment {
- // Testfails will be handled by the jenkins junit steps and mark the build as unstable.
- MVN_TEST_FAIL_IGNORE = '-Dmaven.test.failure.ignore=true'
- }
-
- tools {
- maven 'maven_3_latest'
- jdk 'jdk_11_latest'
- }
-
- options {
- timeout(time: 1, unit: 'HOURS')
- // When we have test-fails e.g. we don't need to run the remaining steps
- skipStagesAfterUnstable()
- }
-
- stages {
- stage('Initialization') {
- steps {
- echo 'Building Branch: ' + env.BRANCH_NAME
- echo 'Using PATH = ' + env.PATH
- }
- }
-
- stage('Checkout') {
- steps {
- echo 'Checking out branch ' + env.BRANCH_NAME
- checkout scm
- }
- }
-
- stage('Build and UT') {
- when {
- expression {
- env.BRANCH_NAME ==~ "(develop)|(rel/.*) |(jenkins-.*)"
- }
- }
- steps {
- echo 'Building and Unit Test...'
- sh "mvn ${MVN_TEST_FAIL_IGNORE} -P with-java clean install"
- }
- post {
- always {
- junit(testResults: '**/surefire-reports/*.xml', allowEmptyResults: true)
- junit(testResults: '**/failsafe-reports/*.xml', allowEmptyResults: true)
- }
- }
- }
-
- stage('Deploy Prepare') {
- when {
- expression {
- env.BRANCH_NAME ==~ "(develop)"
- }
- }
- steps {
- echo 'Deploy Prepare'
- // We'll deploy to a relative directory so we can
- // deploy new versions only if the entire build succeeds
- sh "mvn -T 1C -DaltDeploymentRepository=snapshot-repo::default::file:./local-snapshots-dir clean deploy -DskipTests"
- }
- }
-
- stage('Deploy') {
- when {
- expression {
- env.BRANCH_NAME ==~ "(develop)"
- }
- }
- steps {
- echo 'Deploying'
- // Deploy the artifacts using the wagon-maven-plugin.
- sh 'mvn -f jenkins.pom -X -P deploy-snapshots wagon:upload -P get-jar-with-dependencies'
- }
- }
-
- stage('Cleanup') {
- steps {
- echo 'Cleaning up the workspace'
- deleteDir()
- }
- }
- }
-
- // Send out notifications on unsuccessful builds.
- post {
- // If this build failed, send an email to the list.
- failure {
- script {
- if(env.BRANCH_NAME == "develop") {
- emailext(
- subject: "[BUILD-FAILURE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
- body: """
-BUILD-FAILURE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
-
-Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
-""",
- to: "dev@tsfile.apache.org"
- )
- }
- }
- }
-
- // If this build didn't fail, but there were failing tests, send an email to the list.
- unstable {
- script {
- if(env.BRANCH_NAME == "develop") {
- emailext(
- subject: "[BUILD-UNSTABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
- body: """
-BUILD-UNSTABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
-
-Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]</a>"
-""",
- to: "dev@tsfile.apache.org"
- )
- }
- }
- }
-
- // Send an email, if the last build was not successful and this one is.
- success {
- script {
- if ((env.BRANCH_NAME == "develop") && (currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
- emailext (
- subject: "[BUILD-STABLE]: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]'",
- body: """
-BUILD-STABLE: Job '${env.JOB_NAME} [${env.BRANCH_NAME}] [${env.BUILD_NUMBER}]':
-
-Is back to normal.
-""",
- to: "dev@tsfile.apache.org"
- )
- }
- }
- }
- }
-
-}
diff --git a/README-zh.md b/README-zh.md
deleted file mode 100644
index 8bcd39d98..000000000
--- a/README-zh.md
+++ /dev/null
@@ -1,130 +0,0 @@
-<!--
-
- 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.
-
--->
-
-[English](./README.md) | [中文](./README-zh.md)
-# TsFile Document
-<pre>
-___________ ___________.__.__
-\__ ___/____\_ _____/|__| | ____
- | | / ___/| __) | | | _/ __ \
- | | \___ \ | \ | | |_\ ___/
- |____|/____ >\___ / |__|____/\___ > version 2.1.0
- \/ \/ \/
-</pre>
-[](https://codecov.io/github/apache/tsfile)
-[](http://search.maven.org/#search|gav|1|g:"org.apache.tsfile")
-
-## 简介
-
-TsFile是一种为时间序列数据设计的列式存储文件格式,它支持高效压缩、高读写吞吐量,并且兼容多种框架,如Spark和Flink。TsFile很容易集成到物联网大数据处理框架中。
-
-时序数据即时间序列数据,是指带时间标签(按照时间的顺序变化,即时间序列化)的数据,其来源多元、数据量庞大,可广泛应用于物联网、智能制造、金融分析等领域。在数据驱动的当下,时序数据的重要性不言而喻。
-
-尽管时序数据如此普遍且重要,但长期以来,时序数据的管理都缺乏标准化的文件格式。TsFile 的出现为用户管理时序数据提供了统一的文件格式。
-
-[点击查看更多](https://www.timecho.com/archives/tian-bu-shi-chang-kong-bai-apache-tsfile-ru-he-chong-xin-ding-yi-shi-xu-shu-ju-guan-li)
-
-
-## TsFile 特性
-
-TsFile 通过自研实现了时序数据高效率管理、高灵活传输,并支持多类软件深度集成。其特性包括:
-
-- 时序模型:专门为物联网设计的数据模型,每个时间序列与特定设备相关联,所有设备通过分层结构相互连接;
-
-- 跨语言独立使用:可以使用多种语言的 SDK 直接读写 TsFile,使得一些轻量级的数据读写场景成为可能。
-
-- 高效写入和压缩:为时间序列量身定制的列式存储格式,将数据按设备进行组织,并保证每个序列的数据连续存储,最小化存储空间。相比 CSV,压缩比可提升 90% 以上。
-
-- 高查询性能:通过设备、物理量和时间维度索引,TsFile 实现了基于特定时间范围的时序数据快速过滤和查询。相比通用文件格式,查询吞吐可提升 2-10 倍。
-
-- 开放集成:TsFile 是时序数据库 IoTDB 的底层存储文件格式,可与 IoTDB 形成可插拔的存算分离架构。TsFile 支持与 Spark、Flink 等大数据软件建立无缝生态集成,从而确保跨不同数据处理环境的兼容性和互操作性,实现时序数据跨生态深度分析。
-
-## TsFile 基本概念
-
-TsFile 可管理多个设备的时序数据。每个设备可具有不同的物理量。
-
-每个设备的每个物理量对应一条时间序列。
-
-TsFile 数据模型(Schema)定义了所有设备物理量的集合,如下表所示(m1 ~ m5)
-
-| Time | deviceId | m1 | m2 | m3 | m4 | m5 |
-|------|----------|----|----|----|----|----|
-| 1 | device1 | 1 | 2 | 3 | | |
-| 2 | device1 | 1 | 2 | 3 | | |
-| 3 | device2 | 1 | | 3 | 4 | 5 |
-| 4 | device2 | 1 | | 3 | 4 | 5 |
-| 5 | device3 | 1 | 2 | 3 | 4 | 5 |
-
-其中 Time 和 deviceId 为内置字段,无需定义,可直接写入。
-
-## TsFile 设计原理
-
-### 文件结构
-
-下为 Apache TsFile 的文件结构。
-
-- Page:一段连续的时序数据,存储的基本单元,按时间升序排序,时间戳和值各有单独的列进行存储。
-
-- Chunk:由同一序列的多个连续的 Page 组成,一个文件同一个序列可以存储多个 Chunk。
-
-- ChunkGroup:由一个设备的一至多个 Chunk 组成,多个 Chunk 可共享一列时间存储(多值模型)。
-
-- Index:TsFile 末尾的元数据文件包含序列内部时间维度的索引和序列间的索引信息。
-
-
-
-### 编码和压缩
-
-TsFile 通过采用二阶差分编码、游程编码(RLE)、位压缩和 Snappy 等先进的编码和压缩技术,优化时序数据的存储和访问,并支持对时间戳列和数据值列进行单独编码,以实现更好的数据处理效能。
-
-其独特之处在于编码算法专为时序数据特性设计,聚焦在时间属性和数据之间的相关性。
-
-TsFile、CSV 和 Parquet 三种文件格式的比较
-
-| 维度 | TsFile | CSV | Parquet |
-|---------|--------|-----|---------|
-| 数据模型 | 物联网时序 | 无 | 嵌套 |
-| 写入模式 | 批, 行 | 行 | 行 |
-| 压缩 | 有 | 无 | 有 |
-| 读取模式 | 查询, 扫描 | 扫描 | 查询 |
-| 序列索引 | 有 | 无 | 无 |
-| 时间索引 | 有 | 无 | 无 |
-
-基于对时序数据应用需求的深刻理解,TsFile 有助于实现时序数据高压缩比和实时访问速度,并为企业进一步构建高效、可扩展、灵活的数据分析平台提供底层文件技术支撑。
-
-| 数据类型 | 推荐编码 | 推荐压缩算法 |
-|---------|------------|--------|
-| INT32 | TS_2DIFF | LZ4 |
-| INT64 | TS_2DIFF | LZ4 |
-| FLOAT | GORILLA | LZ4 |
-| DOUBLE | GORILLA | LZ4 |
-| BOOLEAN | RLE | LZ4 |
-| TEXT | DICTIONARY | LZ4 |
-
-更多类型的编码和压缩方式参见[文档](https://iotdb.apache.org/zh/UserGuide/latest/Basic-Concept/Encoding-and-Compression.html)
-
-## 开发和使用 TsFile
-
-[Java](./java/tsfile/README-zh.md)
-
-[C++](./cpp/README-zh.md)
-
-[Python](./python/README-zh.md)
diff --git a/README.md b/README.md
deleted file mode 100644
index cbfb2bc23..000000000
--- a/README.md
+++ /dev/null
@@ -1,129 +0,0 @@
-<!--
-
- 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.
-
--->
-
-[English](./README.md) | [中文](./README-zh.md)
-# TsFile Document
-<pre>
-___________ ___________.__.__
-\__ ___/____\_ _____/|__| | ____
- | | / ___/| __) | | | _/ __ \
- | | \___ \ | \ | | |_\ ___/
- |____|/____ >\___ / |__|____/\___ > version 2.1.0
- \/ \/ \/
-</pre>
-[](https://codecov.io/github/apache/tsfile)
-[](http://search.maven.org/#search|gav|1|g:"org.apache.tsfile")
-
-## Introduction
-
-TsFile is a columnar storage file format designed for time series data, which supports efficient compression, high throughput of read and write, and compatibility with various frameworks, such as Spark and Flink. It is easy to integrate TsFile into IoT big data processing frameworks.
-
-Time series data is becoming increasingly important in a wide range of applications, including IoT, intelligent control, finance, log analysis, and monitoring systems.
-
-TsFile is the first existing standard file format for time series data. Despite the widespread presence and significance of temporal data, there has been a longstanding absence of standardized file formats for its management. The advent of TsFile introduces a unified file format to facilitate users in managing temporal data.
-
-[Click for More Information](https://www.timecho-global.com/archives/apache-tsfile-time-series-data-storage-redefined)
-
-## TsFile Features
-
-TsFile offers several distinctive features and benefits:
-
-- Multi Language Independent Use: Multiple language SDK can be used to directly read and write TsFile, making it possible for some lightweight data reading and writing scenarios.
-
-- Efficient Writing and Compression: A column storage format tailored for time series, organizing data by device and ensuring continuous storage of data for each sequence, minimizing storage space. Compared to CSV, the compression ratio can be increased by more than 90%.
-
-- High Query Performance: By indexing devices, measurement, and time dimensions, TsFile implements fast filtering and querying of temporal data based on specific time ranges. Compared to general file formats, query throughput can be increased by 2-10 times.
-
-- Open Integration: TsFile is the underlying storage file format of the temporal database IoTDB, which can form a pluggable storage computing separation architecture with IoTDB. TsFile supports compatibility with Spark Flink and other big data software establish seamless ecosystem integration to ensure compatibility and interoperability across different data processing environments, and achieve deep analysis of temporal data across ecosystems.
-
-## TsFile Basic Concepts
-
-TsFile can manage the time series data of multiple devices. Each device can have different measurement.
-
-Each measurement of each device corresponds to a time series.
-
-The TsFile Scheme defines a set of measurement for all devices, as shown in the table below (m1~m5)
-
-| Time | deviceId | m1 | m2 | m3 | m4 | m5 |
-|------|----------|----|----|----|----|----|
-| 1 | device1 | 1 | 2 | 3 | | |
-| 2 | device1 | 1 | 2 | 3 | | |
-| 3 | device2 | 1 | | 3 | 4 | 5 |
-| 4 | device2 | 1 | | 3 | 4 | 5 |
-| 5 | device3 | 1 | 2 | 3 | 4 | 5 |
-
-Among them, Time and deviceId are built-in fields that do not need to be defined and can be written directly.
-
-## TsFile Design
-
-### File Structure
-
-TsFile adopts a columnar storage design, similar to other file formats, primarily to optimize time-series data's storage efficiency and query performance. This design aligns with the nature of time series data, which often involves large volumes of similar data types recorded over time. However, TsFile was developed particularly with a structure of page, chunk, chunk group, and index:
-
-- Page: The basic unit for storing time series data, sorted by time in ascending order with separate columns for timestamps and values.
-
-- Chunk: Comprising metadata headers and several pages, each chunk belongs to one time series, with variable sizes allowing for different compression and encoding methods.
-
-- Chunk Group: Multiple chunks within a chunk group belong to one or multiple series of a device written in the same period, facilitating efficient query processing.
-
-- Index: The file metadata at the end of TsFile contains a chunk-level index and file-level statistics for efficient data access.
-
-
-
-## Encoding and Compression
-
-TsFile employs advanced encoding and compression techniques to optimize storage and access for time series data. It uses methods like run-length encoding (RLE), bit-packing, and Snappy for efficient compression, allowing separate encoding of timestamp and value columns for better data processing. Its unique encoding algorithms are designed specifically for the characteristics of time series data in IoT scenarios, focusing on regular time intervals and the correlation among series.
-
-Its uniqueness lies in the encoding algorithm designed specifically for time series data characteristics, focusing on the correlation between time attributes and data.
-
-The table below compares 3 file formats in different dimensions.
-
-TsFile, CSV and Parquet in Comparison
-
-| Dimension | TsFile | CSV | Parquet |
-|-----------------|--------------|-------|---------|
-| Data Model | IoT | Plain | Nested |
-| Write Mode | Tablet, Line | Line | Line |
-| Compression | Yes | No | Yes |
-| Read Mode | Query, Scan | Scan | Query |
-| Index on Series | Yes | No | No |
-| Index on Time | Yes | No | No |
-
-Its development facilitates efficient data encoding, compression, and access, reflecting a deep understanding of industry needs, pioneering a path toward efficient, scalable, and flexible data analytics platforms.
-
-| Data Type | Recommended Encoding | Recommended Compression |
-|---------|------------|--------|
-| INT32 | TS_2DIFF | LZ4 |
-| INT64 | TS_2DIFF | LZ4 |
-| FLOAT | GORILLA | LZ4 |
-| DOUBLE | GORILLA | LZ4 |
-| BOOLEAN | RLE | LZ4 |
-| TEXT | DICTIONARY | LZ4 |
-
-more see [Docs](https://iotdb.apache.org/UserGuide/latest/Basic-Concept/Encoding-and-Compression.html)
-
-## Build and Use TsFile
-
-[Java](./java/tsfile/README.md)
-
-[C++](./cpp/README.md)
-
-[Python](./python/README.md)
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
deleted file mode 100644
index 8b557d78d..000000000
--- a/RELEASE_NOTES.md
+++ /dev/null
@@ -1,81 +0,0 @@
-<!--
-
- 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.
-
--->
-# Apache TsFile 2.0.0
-
-## New Feature
-- TsFile V4 for Table Model by @jt2594838 in #196
-- Support dictionary encoding for STRING data type. by @jt2594838 in #238
-- Modify default timestamp encoding by @shuwenwei in #309
-- Tsfile java interfaces v4 by @shuwenwei in #307
-- Convert column name and table name to lower case by @shuwenwei in #322
-- Add type cast interfaces in TsDataType by @jt2594838 in #332
-
-## Improvement/Bugfix
-- Fix allSatisfy bug in InFilter by @JackieTien97 in #219
-- Fix bug in the conversion of int types to timestamp. by @FearfulTomcat27 in #223
-- Fix getValue method in Tablet doesn't support Date and Timestamp type by @HTHou in #243
-- Fix error when write aligned tablet with null date by @HTHou in #250
-- Fix tablet isNull method not correct by @HTHou in #255
-- Fixed the issue that the time of the first data item written to TSFile by measurement cannot be a negative number by @luoluoyuyu in #297
-- Fix float encoder overflow by @HTHou in #342
-
-# Apache TsFile 1.1.0
-
-## New Feature
-- Support new data types: STRING, BLOB, TIMESTAMP, DATE by @Cpaulyz in #76
-- Add an equivalent .getLongs() method to .getTimes() in TimeColumn. by @Sh-Zh-7 in #61
-- Return all columns in TsBlock class by @Sh-Zh-7 in #80
-
-## Improvement/Bugfix
-
-- Fix value filter allSatisfy bug by @liuminghui233 in #41
-- Fix error log caused by ClosedByInterruptException by @shuwenwei in #47
-- Fix the mistaken argument in LZ4 Uncompressor by @jt2594838 in #57
-- Remove duplicate lookups in dictionary encoder by @MrQuansy in #54
-- Optimize SeriesScanUtil by memorizing the order time and satisfied information for each Seq and Unseq Resource by @JackieTien97 in #58
-- Fix TsBlockBuilder bug in AlignedPageReader and PageReader. by @JackieTien97 in #77
-- Fix ZstdUncompressor by @lancelly in #132
-- fix RLBE Encoding for float and double by @gzh23 in #143
-- Fix uncompress page data by @shuwenwei in #161
-- Fix encoder and decoder construction of RLBE by @jt2594838 in #162
-- Fix aligned TimeValuePair npe by @shuwenwei in #173
-- Fix StringStatistics data type by @shuwenwei in #177
-- Fix bug in the conversion of int types to timestamp. by @FearfulTomcat27 in #224
-- Fix error when write aligned tablet with null date by @HTHou in #251
-
-# Apache TsFile 1.0.0
-
-## New Features
-
-- Support registering devices
-- Support registering measurements
-- Support adding additional measurements
-- Support writing timeseries data without pre-defined schema
-- Support writing timeseries data with pre-defined schema
-- Support writing with tsRecord
-- Support writing with Tablet
-- Support writing data into a closed TsFile
-- Support query timeseries data without any filter
-- Support query timeseries data with time filter
-- Support query timeseries data with value filter
-- Support BOOLEAN, INT32, INT64, FLOAT, DOUBLE, TEXT data types
-- Support PLAIN, DICTIONARY, RLE, TS_2DIFF, GORILLA, ZIGZAG, CHIMP, SPRINTZ, RLBE encoding algorithm
-- Support UNCOMPRESSED, SNAPPY, GZIP, LZ4, ZSTD, LZMA2 compression algorithm
diff --git a/checkstyle.xml b/checkstyle.xml
deleted file mode 100644
index f1f100e69..000000000
--- a/checkstyle.xml
+++ /dev/null
@@ -1,250 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
-
-<!--
-
- 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.
-
--->
-<!--
- Checkstyle configuration that checks the Google coding conventions from Google Java Style
- that can be found at https://google.github.io/styleguide/javaguide.html.
- Checkstyle is very configurable. Be sure to read the documentation at
- http://checkstyle.sf.net (or in your downloaded distribution).
- To completely disable a check, just comment it out or delete it from the file.
- Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
- -->
-<module name="Checker">
- <property name="charset" value="UTF-8"/>
- <property name="severity" value="warning"/>
- <property name="fileExtensions" value="java, properties, xml"/>
- <!-- Checks for whitespace -->
- <!-- See http://checkstyle.sf.net/config_whitespace.html -->
- <module name="BeforeExecutionExclusionFileFilter">
- <property name="fileNamePattern" value="target(\\|/).*\.java$"/>
- </module>
- <module name="FileTabCharacter">
- <property name="eachLine" value="true"/>
- </module>
- <module name="LineLength">
- <property name="max" value="100"/>
- <property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
- </module>
- <module name="SuppressWarningsFilter"/>
- <module name="TreeWalker">
- <module name="SuppressWarningsHolder"/>
- <!--ERROR severity rules, each Java file should obey this -->
- <module name="AvoidStarImport">
- <property name="severity" value="error"/>
- </module>
- <module name="RegexpSinglelineJava">
- <property name="id" value="unsafeThreadSchedule"/>
- <property name="format" value="schedule(AtFixedRate|WithFixedDelay)\("/>
- <property name="severity" value="error"/>
- <property name="ignoreComments" value="true"/>
- <property name="message" value="Using ScheduledExecutorService::schedule(AtFixedRate|WithFixedDelay) directly is unsafe, please use ScheduledExecutorUtil::(unsafely|safely)Schedule(AtFixedRate|WithFixedDelay) instead."/>
- </module>
- <module name="RegexpSinglelineJava">
- <property name="id" value="invalidPlanNodeTypeUsage"/>
- <property name="format" value="PlanNodeType\.[a-zA-Z_]*\.ordinal\("/>
- <property name="severity" value="error"/>
- <property name="ignoreComments" value="true"/>
- <property name="message" value="Please use PlanNodeType::getNodeType instead."/>
- </module>
- <!--WARNING severity rules, which may be promoted to error level-->
- <module name="OuterTypeFilename"/>
- <module name="IllegalTokenText">
- <property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
- <property name="format" value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
- <property name="message" value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
- </module>
- <module name="AvoidEscapedUnicodeCharacters">
- <property name="allowEscapesForControlCharacters" value="true"/>
- <property name="allowByTailComment" value="true"/>
- <property name="allowNonPrintableEscapes" value="true"/>
- </module>
- <module name="OneTopLevelClass"/>
- <module name="NoLineWrap"/>
- <module name="EmptyBlock">
- <property name="option" value="TEXT"/>
- <property name="tokens" value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
- </module>
- <module name="NeedBraces"/>
- <module name="LeftCurly"/>
- <module name="RightCurly">
- <property name="id" value="RightCurlySame"/>
- <property name="tokens" value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_DO"/>
- </module>
- <module name="RightCurly">
- <property name="id" value="RightCurlyAlone"/>
- <property name="option" value="alone"/>
- <property name="tokens" value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT, INSTANCE_INIT"/>
- </module>
- <module name="WhitespaceAround">
- <property name="allowEmptyConstructors" value="true"/>
- <property name="allowEmptyMethods" value="true"/>
- <property name="allowEmptyTypes" value="true"/>
- <property name="allowEmptyLoops" value="true"/>
- <message key="ws.notFollowed" value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
- <message key="ws.notPreceded" value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
- </module>
- <module name="OneStatementPerLine"/>
- <module name="MultipleVariableDeclarations"/>
- <module name="ArrayTypeStyle"/>
- <module name="MissingSwitchDefault"/>
- <module name="FallThrough"/>
- <module name="UpperEll"/>
- <module name="ModifierOrder"/>
- <module name="EmptyLineSeparator">
- <property name="allowNoEmptyLineBetweenFields" value="true"/>
- </module>
- <module name="SeparatorWrap">
- <property name="id" value="SeparatorWrapDot"/>
- <property name="tokens" value="DOT"/>
- <property name="option" value="nl"/>
- </module>
- <module name="SeparatorWrap">
- <property name="id" value="SeparatorWrapComma"/>
- <property name="tokens" value="COMMA"/>
- <property name="option" value="EOL"/>
- </module>
- <module name="SeparatorWrap">
- <!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
- <property name="id" value="SeparatorWrapEllipsis"/>
- <property name="tokens" value="ELLIPSIS"/>
- <property name="option" value="EOL"/>
- </module>
- <module name="SeparatorWrap">
- <!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
- <property name="id" value="SeparatorWrapArrayDeclarator"/>
- <property name="tokens" value="ARRAY_DECLARATOR"/>
- <property name="option" value="EOL"/>
- </module>
- <module name="SeparatorWrap">
- <property name="id" value="SeparatorWrapMethodRef"/>
- <property name="tokens" value="METHOD_REF"/>
- <property name="option" value="nl"/>
- </module>
- <module name="PackageName">
- <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
- <message key="name.invalidPattern" value="Package name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="TypeName">
- <message key="name.invalidPattern" value="Type name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="MemberName">
- <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
- <message key="name.invalidPattern" value="Member name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="ParameterName">
- <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
- <message key="name.invalidPattern" value="Parameter name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="LambdaParameterName">
- <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
- <message key="name.invalidPattern" value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="CatchParameterName">
- <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
- <message key="name.invalidPattern" value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="LocalVariableName">
- <property name="tokens" value="VARIABLE_DEF"/>
- <property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
- <message key="name.invalidPattern" value="Local variable name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="ClassTypeParameterName">
- <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
- <message key="name.invalidPattern" value="Class type name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="MethodTypeParameterName">
- <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
- <message key="name.invalidPattern" value="Method type name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="InterfaceTypeParameterName">
- <property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
- <message key="name.invalidPattern" value="Interface type name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="NoFinalizer"/>
- <module name="GenericWhitespace">
- <message key="ws.followed" value="GenericWhitespace ''{0}'' is followed by whitespace."/>
- <message key="ws.preceded" value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
- <message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
- <message key="ws.notPreceded" value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
- </module>
- <module name="Indentation">
- <property name="basicOffset" value="2"/>
- <property name="braceAdjustment" value="0"/>
- <property name="caseIndent" value="2"/>
- <property name="throwsIndent" value="4"/>
- <property name="lineWrappingIndentation" value="4"/>
- <property name="arrayInitIndent" value="2"/>
- </module>
- <module name="AbbreviationAsWordInName">
- <property name="ignoreFinal" value="false"/>
- <property name="allowedAbbreviationLength" value="1"/>
- </module>
- <module name="OverloadMethodsDeclarationOrder"/>
- <module name="VariableDeclarationUsageDistance"/>
- <module name="MethodParamPad"/>
- <module name="NoWhitespaceBefore">
- <property name="tokens" value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
- <property name="allowLineBreaks" value="true"/>
- </module>
- <module name="ParenPad"/>
- <module name="OperatorWrap">
- <property name="option" value="NL"/>
- <property name="tokens" value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR, LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
- </module>
- <module name="AnnotationLocation">
- <property name="id" value="AnnotationLocationMostCases"/>
- <property name="tokens" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
- </module>
- <module name="AnnotationLocation">
- <property name="id" value="AnnotationLocationVariables"/>
- <property name="tokens" value="VARIABLE_DEF"/>
- <property name="allowSamelineMultipleAnnotations" value="true"/>
- </module>
- <module name="NonEmptyAtclauseDescription"/>
- <module name="JavadocTagContinuationIndentation"/>
- <module name="SummaryJavadoc">
- <property name="forbiddenSummaryFragments" value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
- </module>
- <module name="JavadocParagraph"/>
- <module name="AtclauseOrder">
- <property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
- <property name="target" value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
- </module>
- <module name="JavadocMethod">
- <property name="allowMissingParamTags" value="true"/>
- <property name="validateThrows" value="true"/>
- <property name="allowMissingReturnTag" value="true"/>
- <property name="allowedAnnotations" value="Override, Test"/>
- </module>
- <module name="MethodName">
- <property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
- <message key="name.invalidPattern" value="Method name ''{0}'' must match pattern ''{1}''."/>
- </module>
- <module name="SingleLineJavadoc">
- <property name="ignoreInlineTags" value="false"/>
- </module>
- <module name="EmptyCatchBlock">
- <property name="exceptionVariableName" value="expected"/>
- </module>
- <module name="CommentsIndentation"/>
- </module>
-</module>
diff --git a/codecov.yml b/codecov.yml
deleted file mode 100644
index 7c21286fc..000000000
--- a/codecov.yml
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# 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.
-#
-
-coverage:
- precision: 2
- round: down
- range: "50...100"
-
- status:
- project: yes
- patch: no
- changes: no
-
-parsers:
- jacoco:
- partials_as_hits: true #false by default
- gcov:
- branch_detection:
- conditional: yes
- loop: yes
- method: no
- macro: no
-
-ignore:
- - "**/pom.xml"
- - "**/*.md"
- - "**/*.sh"
- - "**/*.cmd"
- - "**/*.bat"
- - "**/*.yml"
- - "*_test.cc"
- - ".mvn"
- - "mvnw"
- - "NOTICE"
- - "NOTICE-binary"
- - "License"
- - "LICENSE-binary"
- - "DISCLAIMER"
diff --git a/cpp/.clang-format b/cpp/.clang-format
deleted file mode 100644
index 26651a2cd..000000000
--- a/cpp/.clang-format
+++ /dev/null
@@ -1,226 +0,0 @@
----
-Language: Cpp
-# BasedOnStyle: Google
-AccessModifierOffset: -1
-AlignAfterOpenBracket: Align
-AlignArrayOfStructures: None
-AlignConsecutiveMacros: None
-AlignConsecutiveAssignments: None
-AlignConsecutiveBitFields: None
-AlignConsecutiveDeclarations: None
-AlignEscapedNewlines: Left
-AlignOperands: Align
-AlignTrailingComments: true
-AllowAllArgumentsOnNextLine: true
-AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortEnumsOnASingleLine: true
-AllowShortBlocksOnASingleLine: Never
-AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: All
-AllowShortLambdasOnASingleLine: All
-AllowShortIfStatementsOnASingleLine: WithoutElse
-AllowShortLoopsOnASingleLine: true
-AlwaysBreakAfterDefinitionReturnType: None
-AlwaysBreakAfterReturnType: None
-AlwaysBreakBeforeMultilineStrings: true
-AlwaysBreakTemplateDeclarations: Yes
-AttributeMacros:
- - __capability
-BinPackArguments: true
-BinPackParameters: true
-BraceWrapping:
- AfterCaseLabel: false
- AfterClass: false
- AfterControlStatement: Never
- AfterEnum: false
- AfterFunction: false
- AfterNamespace: false
- AfterObjCDeclaration: false
- AfterStruct: false
- AfterUnion: false
- AfterExternBlock: false
- BeforeCatch: false
- BeforeElse: false
- BeforeLambdaBody: false
- BeforeWhile: false
- IndentBraces: false
- SplitEmptyFunction: true
- SplitEmptyRecord: true
- SplitEmptyNamespace: true
-BreakBeforeBinaryOperators: None
-BreakBeforeConceptDeclarations: true
-BreakBeforeBraces: Attach
-BreakBeforeInheritanceComma: false
-BreakInheritanceList: BeforeColon
-BreakBeforeTernaryOperators: true
-BreakConstructorInitializersBeforeComma: false
-BreakConstructorInitializers: BeforeColon
-BreakAfterJavaFieldAnnotations: false
-BreakStringLiterals: true
-ColumnLimit: 80
-CommentPragmas: '^ IWYU pragma:'
-QualifierAlignment: Leave
-CompactNamespaces: false
-ConstructorInitializerIndentWidth: 4
-ContinuationIndentWidth: 4
-Cpp11BracedListStyle: true
-DeriveLineEnding: true
-DerivePointerAlignment: true
-DisableFormat: false
-EmptyLineAfterAccessModifier: Never
-EmptyLineBeforeAccessModifier: LogicalBlock
-ExperimentalAutoDetectBinPacking: false
-PackConstructorInitializers: NextLine
-BasedOnStyle: ''
-ConstructorInitializerAllOnOneLineOrOnePerLine: false
-AllowAllConstructorInitializersOnNextLine: true
-FixNamespaceComments: true
-ForEachMacros:
- - foreach
- - Q_FOREACH
- - BOOST_FOREACH
-IfMacros:
- - KJ_IF_MAYBE
-IncludeBlocks: Regroup
-IncludeCategories:
- - Regex: '^<ext/.*\.h>'
- Priority: 2
- SortPriority: 0
- CaseSensitive: false
- - Regex: '^<.*\.h>'
- Priority: 1
- SortPriority: 0
- CaseSensitive: false
- - Regex: '^<.*'
- Priority: 2
- SortPriority: 0
- CaseSensitive: false
- - Regex: '.*'
- Priority: 3
- SortPriority: 0
- CaseSensitive: false
-IncludeIsMainRegex: '([-_](test|unittest))?$'
-IncludeIsMainSourceRegex: ''
-IndentAccessModifiers: false
-IndentCaseLabels: true
-IndentCaseBlocks: false
-IndentGotoLabels: true
-IndentPPDirectives: None
-IndentExternBlock: AfterExternBlock
-IndentRequires: false
-IndentWidth: 4
-IndentWrappedFunctionNames: false
-InsertTrailingCommas: None
-JavaScriptQuotes: Leave
-JavaScriptWrapImports: true
-KeepEmptyLinesAtTheStartOfBlocks: false
-LambdaBodyIndentation: Signature
-MacroBlockBegin: ''
-MacroBlockEnd: ''
-MaxEmptyLinesToKeep: 1
-NamespaceIndentation: None
-ObjCBinPackProtocolList: Never
-ObjCBlockIndentWidth: 2
-ObjCBreakBeforeNestedBlockParam: true
-ObjCSpaceAfterProperty: false
-ObjCSpaceBeforeProtocolList: true
-PenaltyBreakAssignment: 2
-PenaltyBreakBeforeFirstCallParameter: 1
-PenaltyBreakComment: 300
-PenaltyBreakFirstLessLess: 120
-PenaltyBreakOpenParenthesis: 0
-PenaltyBreakString: 1000
-PenaltyBreakTemplateDeclaration: 10
-PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 200
-PenaltyIndentedWhitespace: 0
-PointerAlignment: Left
-PPIndentWidth: -1
-RawStringFormats:
- - Language: Cpp
- Delimiters:
- - cc
- - CC
- - cpp
- - Cpp
- - CPP
- - 'c++'
- - 'C++'
- CanonicalDelimiter: ''
- BasedOnStyle: google
- - Language: TextProto
- Delimiters:
- - pb
- - PB
- - proto
- - PROTO
- EnclosingFunctions:
- - EqualsProto
- - EquivToProto
- - PARSE_PARTIAL_TEXT_PROTO
- - PARSE_TEST_PROTO
- - PARSE_TEXT_PROTO
- - ParseTextOrDie
- - ParseTextProtoOrDie
- - ParseTestProto
- - ParsePartialTestProto
- CanonicalDelimiter: pb
- BasedOnStyle: google
-ReferenceAlignment: Pointer
-ReflowComments: true
-RemoveBracesLLVM: false
-SeparateDefinitionBlocks: Leave
-ShortNamespaceLines: 1
-SortIncludes: CaseSensitive
-SortJavaStaticImport: Before
-SortUsingDeclarations: true
-SpaceAfterCStyleCast: false
-SpaceAfterLogicalNot: false
-SpaceAfterTemplateKeyword: true
-SpaceBeforeAssignmentOperators: true
-SpaceBeforeCaseColon: false
-SpaceBeforeCpp11BracedList: false
-SpaceBeforeCtorInitializerColon: true
-SpaceBeforeInheritanceColon: true
-SpaceBeforeParens: ControlStatements
-SpaceBeforeParensOptions:
- AfterControlStatements: true
- AfterForeachMacros: true
- AfterFunctionDefinitionName: false
- AfterFunctionDeclarationName: false
- AfterIfMacros: true
- AfterOverloadedOperator: false
- BeforeNonEmptyParentheses: false
-SpaceAroundPointerQualifiers: Default
-SpaceBeforeRangeBasedForLoopColon: true
-SpaceInEmptyBlock: false
-SpaceInEmptyParentheses: false
-SpacesBeforeTrailingComments: 2
-SpacesInAngles: Never
-SpacesInConditionalStatement: false
-SpacesInContainerLiterals: true
-SpacesInCStyleCastParentheses: false
-SpacesInLineCommentPrefix:
- Minimum: 1
- Maximum: -1
-SpacesInParentheses: false
-SpacesInSquareBrackets: false
-SpaceBeforeSquareBrackets: false
-BitFieldColonSpacing: Both
-Standard: Auto
-StatementAttributeLikeMacros:
- - Q_EMIT
-StatementMacros:
- - Q_UNUSED
- - QT_REQUIRE_VERSION
-TabWidth: 8
-UseCRLF: false
-UseTab: Never
-WhitespaceSensitiveMacros:
- - STRINGIZE
- - PP_STRINGIZE
- - BOOST_PP_STRINGIZE
- - NS_SWIFT_NAME
- - CF_SWIFT_NAME
-...
-
diff --git a/cpp/.gitignore b/cpp/.gitignore
deleted file mode 100644
index fe3949b96..000000000
--- a/cpp/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-build/
-.idea/
-.cproject
-.project
-.settings/
-.vscode/
-cmake-build-debug/
\ No newline at end of file
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
deleted file mode 100755
index 8f402dd9a..000000000
--- a/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-cmake_minimum_required(VERSION 3.11)
-project(TsFile_CPP)
-
-cmake_policy(SET CMP0079 NEW)
-set(TsFile_CPP_VERSION 2.1.0.dev)
-set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -Wall -Werror")
-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=maybe-uninitialized")
-endif()
-message("cmake using: USE_CPP11=${USE_CPP11}")
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-
-if(DEFINED ENV{CXX})
- set(CMAKE_CXX_COMPILER $ENV{CXX})
- message("cmake using: CXX=${CMAKE_CXX_COMPILER}")
-endif()
-
-if(DEFINED ENV{CC})
- set(CMAKE_C_COMPILER $ENV{CC})
- message("cmake using: CC=${CMAKE_C_COMPILER}")
-endif()
-
-message("cmake using: DEBUG_SE=${DEBUG_SE}")
-if (${DEBUG_SE})
- add_definitions(-DDEBUG_SE=1)
- message("add_definitions -DDEBUG_SE=1")
-endif()
-
-if (${COV_ENABLED})
- add_definitions(-DCOV_ENABLED=1)
- message("add_definitions -DCOV_ENABLED=1")
-endif()
-
-message("build type: ${BUILD_TYPE}")
-if (CMAKE_BUILD_TYPE STREQUAL "Debug")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g")
- set(CMAKE_CXX_FLAGS_DEBUG" ${CMAKE_CXX_FLAGS} -O0 -g")
-elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -g") # disable -g
- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS}")
-elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -g")
- set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS}")
-elseif (CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -fdata-sections -Os")
- set(LDFLAGS "-Wl,--gc-sections")
- set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS}")
-endif()
-message("CMAKE DEBUG: CMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}")
-
-set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
-set(PROJECT_INCLUDE_DIR ${PROJECT_INCLUDE_DIR}
- ${PROJECT_SOURCE_DIR}/src
- ${PROJECT_SOURCE_DIR}/third_party/lz4
- ${PROJECT_SOURCE_DIR}/third_party/lzokay
- ${PROJECT_SOURCE_DIR}/third_party/zlib-1.2.13
- ${PROJECT_BINARY_DIR}/third_party/zlib-1.2.13
-)
-
-set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
-include_directories(${PROJECT_INCLUDE_DIR})
-
-include_directories(${PROJECT_SOURCE_DIR}/third_party/antlr4-cpp-runtime-4/runtime/src)
-
-add_subdirectory(third_party)
-
-add_subdirectory(src)
-
-add_subdirectory(test)
-if(TESTS_ENABLED)
- add_dependencies(TsFile_Test tsfile)
-endif()
-
diff --git a/cpp/README-zh.md b/cpp/README-zh.md
deleted file mode 100644
index 6a26f2b95..000000000
--- a/cpp/README-zh.md
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
-
- 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.
-
--->
-
-# TsFile C++ Document
-<pre>
-___________ ___________.__.__
-\__ ___/____\_ _____/|__| | ____
- | | / ___/| __) | | | _/ __ \
- | | \___ \ | \ | | |_\ ___/
- |____|/____ >\___ / |__|____/\___ > version 2.1.0
- \/ \/ \/
-</pre>
-
-## 使用
-
-## 开发
\ No newline at end of file
diff --git a/cpp/README.md b/cpp/README.md
deleted file mode 100644
index 5a663b300..000000000
--- a/cpp/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-<!--
-
- 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.
-
--->
-
-# TsFile C++ Document
-
-<pre>
-___________ ___________.__.__
-\__ ___/____\_ _____/|__| | ____
- | | / ___/| __) | | | _/ __ \
- | | \___ \ | \ | | |_\ ___/
- |____|/____ >\___ / |__|____/\___ > version 2.1.0
- \/ \/ \/
-</pre>
-
-
-## Introduction
-
-
-This directory contains the C++ implementation of TsFile. The C++ version currently supports the query and write functions of TsFile, including time filtering queries.
-
-The source code can be found in the `./src` directory. C/C++ examples are located in the `./examples` directory, and a benchmark for TsFile_cpp can be found in the `./bench_mark` directory. Additionally, a C function wrapper is available in the `./src/cwrapper` directory, which the Python tool relies on.
-
-## How to make contributions
-
-We use `clang-format` to ensure that our C++ code adheres to a consistent set of rules defined in `./clang-format`. This is similar to the Google style.
-
-**Feature List**:
-
-- [ ] Add unit tests for the reader, writer, compression, etc.
-- [ ] Add unit tests for the C wrapper.
-- [ ] Support multiple data flushes.
-- [ ] Support aligned timeseries.
-- [ ] Support table description in tsfile.
-- [ ] Retrieve all table schemas/names.
-- [ ] Implement automatic flush.
-- [ ] Support out-of-order data writing.
-- [ ] Support TsFile V4. Note: TsFile CPP does not implement support for the table model, therefore there are differences in file output compared to the Java version.
-
-**Bug List**:
-
-- [ ] Flushing without writing after registering a timeseries will cause a core dump.
-- [ ] Misalignment in memory may lead to a bus error.
-
-We welcome any bug reports. You can open an issue with a title starting with [CPP] to describe the bug, like: https://github.com/apache/tsfile/issues/94
-
-## Build
-
-### Requirements
-
-```bash
-sudo apt-get update
-sudo apt-get install -y cmake make g++ clang-format
-```
-
-To build tsfile, you can run: `bash build.sh`. If you have Maven tools, you can run: `mvn package -P with-cpp clean verify`. Then, you can find the shared object at `./build`.
-
-Before you submit your code to GitHub, please ensure that the `mvn` compilation is correct.
-
-If you compile using MinGW on windows and encounter an error, you can try replacing MinGW with the following version that we have tried without problems:
-
-* GCC 14.2.0 (with **POSIX** threads) + LLVM/Clang/LLD/LLDB 18.1.8 + MinGW-w64 12.0.0 UCRT - release 1
-* GCC 12.2.0 + LLVM/Clang/LLD/LLDB 16.0.0 + MinGW-w64 10.0.0 (UCRT) - release 5
-* GCC 12.2.0 + LLVM/Clang/LLD/LLDB 16.0.0 + MinGW-w64 10.0.0 (MSVCRT) - release 5
-* GCC 11.2.0 + MinGW-w64 10.0.0 (MSVCRT) - release 1
-
-## Use TsFile
-
-You can find examples on how to read and write data in `demo_read.cpp` and `demo_write.cpp` located under `./examples/cpp_examples`. There are also examples under `./examples/c_examples`on how to use a C-style API to read and write data in a C environment. You can run `bash build.sh` under `./examples` to generate an executable output under `./examples/build`.
\ No newline at end of file
diff --git a/cpp/VersionUpdater.groovy b/cpp/VersionUpdater.groovy
deleted file mode 100644
index 49cbc6504..000000000
--- a/cpp/VersionUpdater.groovy
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// Synchronize the version in CMakeLists.txt and the one used in the maven pom.
-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-
-def cppProjectFile = new File(project.basedir, "CMakeLists.txt")
-def currentMavenVersion = project.version as String
-def currentCppVersion = currentMavenVersion
-if(currentMavenVersion.contains("-SNAPSHOT")) {
- currentCppVersion = currentMavenVersion.split("-SNAPSHOT")[0] + ".dev"
-}
-println "Current Project Version in Maven: " + currentMavenVersion
-
-def match = cppProjectFile.text =~ /set\(TsFile_CPP_VERSION\s+(.+?)\)/
-def cppProjectFileVersion = match[0][1]
-println "Current Project Version in CMake: " + cppProjectFileVersion
-
-if (cppProjectFileVersion != currentCppVersion) {
- cppProjectFile.text = cppProjectFile.text.replace("set(TsFile_CPP_VERSION " + cppProjectFileVersion + ")", "set(TsFile_CPP_VERSION " + currentCppVersion + ")")
- println "Version in CMakeLists.txt updated from " + cppProjectFileVersion + " to " + currentCppVersion
- // TODO: When releasing, we might need to manually add this file to the release preparation commit.
-} else {
- println "Version in CMakeLists.txt is up to date"
-}
diff --git a/cpp/bench_mark/CMakeLists.txt b/cpp/bench_mark/CMakeLists.txt
deleted file mode 100644
index 6db63999c..000000000
--- a/cpp/bench_mark/CMakeLists.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-message("Running in bench_mark directory")
-if(DEFINED ENV{CXX})
- set(CMAKE_CXX_COMPILER $ENV{CXX})
-endif()
-
-set(CMAKE_CXX_FLAGS "$ENV{CXX_FLAGS} -Wall -Werror")
-
-if (${USE_CPP11})
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- set(CMAKE_CXX_STANDARD 11)
-else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
-endif()
-
-add_subdirectory(bench_mark_src)
\ No newline at end of file
diff --git a/cpp/bench_mark/bench_mark_src/CMakeLists.txt b/cpp/bench_mark/bench_mark_src/CMakeLists.txt
deleted file mode 100644
index dbad71f91..000000000
--- a/cpp/bench_mark/bench_mark_src/CMakeLists.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-cmake_minimum_required(VERSION 3.1)
-project(libtsfile_bench_mark_project)
-message("Running in bench_mark/bench_mark_src directory")
-if(DEFINED ENV{CXX})
- set(CMAKE_CXX_COMPILER $ENV{CXX})
-endif()
-
-set(SDK_BENCH_MARK_DIR ${PROJECT_SOURCE_DIR}/)
-message("PROJECT DIR: ${SDK_BENCH_MARK_DIR}")
-set(SDK_INCLUDE_DIR_DEBUG ${SKD_BENCHH_MARK_DIR}../../build/Debug/bin/libtsfile_sdk/include)
-set(SDK_INCLUDE_DIR_RELEASE ${SKD_BENCHH_MARK_DIR}../../build/Release/bin/libtsfile_sdk/include)
-set(SDK_LIB_DIR_DEBUG ${SKD_BENCHH_MARK_DIR}../../build/Debug/bin/libtsfile_sdk/lib)
-set(SDK_LIB_DIR_RELEASE ${SKD_BENCHH_MARK_DIR}../../build/Release/bin/libtsfile_sdk/lib)
-
-if (USE_SDK_DEBUG)
- SET(SKD_INCLUDE_DIR ${SDK_INCLUDE_DIR_DEBUG})
- SET(SDK_LIB_DIR ${SDK_LIB_DIR_DEBUG})
- SET(CMAKE_CXX_FLAGS "-g -O0")
-else()
- SET(SKD_INCLUDE_DIR ${SDK_INCLUDE_DIR_RELEASE})
- SET(SDK_LIB_DIR ${SDK_LIB_DIR_RELEASE})
- SET(CMAKE_CXX_FLAGS "-O3")
-endif()
-
-include_directories(${SKD_INCLUDE_DIR})
-set(MAKE_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/../../src)
-include_directories(${MAKE_INCLUDE})
-message("MAKE_INCLUDE: ${MAKE_INCLUDE}")
-message("SDK_INCLUDE_DIR: ${SKD_INCLUDE_DIR}")
-message("SDK_LIB_DIR: ${SDK_LIB_DIR}")
-
-link_directories(${SDK_LIB_DIR})
-find_library(my_tsfile_lib NAMES tsfile PATHS ${SDK_LIB_DIR} NO_DEFAULT_PATH REQUIRED)
-add_executable(bench_mark_src bench_mark.cc)
-target_link_libraries(bench_mark_src ${my_tsfile_lib})
-
-
-
-
diff --git a/cpp/bench_mark/bench_mark_src/bench_conf.h b/cpp/bench_mark/bench_mark_src/bench_conf.h
deleted file mode 100644
index 486d0b14f..000000000
--- a/cpp/bench_mark/bench_mark_src/bench_conf.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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.
- */
-
-#include <vector>
-
-namespace bench {
-int LOOP_NUM = 100000;
-int THREAD_NUM = 1;
-int TIMESERIES_NUM = 50;
-std::vector<int> TYPE_LIST = {0, 0, 1, 0, 1};
-} // namespace bench
diff --git a/cpp/bench_mark/bench_mark_src/bench_mark.cc b/cpp/bench_mark/bench_mark_src/bench_mark.cc
deleted file mode 100644
index 09c9eb98f..000000000
--- a/cpp/bench_mark/bench_mark_src/bench_mark.cc
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * 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.
- */
-#include <chrono>
-#include <cmath>
-#include <iostream>
-#include <numeric>
-#include <string>
-
-#include "bench_conf.h"
-#include "common/db_common.h"
-#include "common/global.h"
-#include "common/path.h"
-#include "writer/tsfile_writer.h"
-
-std::vector<int> register_timeseries(storage::TsFileWriter& writer,
- int timeseries_num,
- std::vector<int> type_list) {
- auto start = std::chrono::high_resolution_clock::now();
- int sum = std::accumulate(type_list.begin(), type_list.end(), 0);
- std::vector<float> ratio_list;
- for (int i = 0; i < type_list.size(); i++) {
- ratio_list.push_back((float)type_list[i] / sum);
- }
- std::vector<int> type_num;
- for (int i = 0; i < common::TSDataType::TEXT - 1; i++) {
- type_num.push_back((int)std::ceil(timeseries_num * ratio_list[i]));
- }
- type_num.push_back(timeseries_num -
- std::accumulate(type_num.begin(), type_num.end(), 0));
- writer.open("/tmp/tsfile_test.tsfile", O_CREAT | O_RDWR, 0644);
- int ind = 0;
- int ret = 0;
- int type = 0;
- for (auto num : type_num) {
- for (int i = 0; i < num; i++) {
- std::string device_name = "root.db001.dev" + std::to_string(ind);
- std::string measurement_name = "m" + std::to_string(ind);
- ret = writer.register_timeseries(
- device_name, measurement_name, (common::TSDataType)type,
- common::TSEncoding::PLAIN,
- common::CompressionType::UNCOMPRESSED);
- ind++;
- }
- std::cout << "register finished for TsDataType"
- << common::s_data_type_names[type]
- << " timeseries num: " << num << std::endl;
- type++;
- }
- auto end = std::chrono::high_resolution_clock::now();
- std::chrono::duration<double> elapsed = end - start;
- std::cout << "register " << timeseries_num << "timeseries in file"
- << "./test_data/tsfile_test.tsfile" << std::endl;
- std::cout << "register timeseries cost time: " << elapsed.count() << "s"
- << std::endl;
- return type_num;
-}
-
-void test_writer_benchmark(storage::TsFileWriter& writer, int loop_num,
- std::vector<int> type_num) {
- std::cout << "start writing data" << std::endl;
- auto start = std::chrono::high_resolution_clock::now();
- int type = 0;
- for (int i = 0; i < loop_num; i++) {
- int ind = 0;
- for (auto num : type_num) {
- for (int j = 0; j < num; j++) {
- std::string device_name =
- "root.db001.dev" + std::to_string(ind);
- std::string measurement_name = "m" + std::to_string(ind);
- long long currentTimeStamp = i;
- storage::TsRecord record(currentTimeStamp, device_name, 1);
- switch (type) {
- case common::INT32: {
- storage::DataPoint point(measurement_name, 10000 + i);
- record.points_.push_back(point);
- break;
- }
- case common::INT64: {
- storage::DataPoint point(measurement_name,
- int64_t(10000 + i));
- record.points_.push_back(point);
- break;
- }
- case common::BOOLEAN: {
- storage::DataPoint point(measurement_name, i / 2 == 0);
- record.points_.push_back(point);
- break;
- }
- case common::FLOAT: {
- storage::DataPoint point(measurement_name, (float)i);
- record.points_.push_back(point);
- break;
- }
- case common::DOUBLE: {
- storage::DataPoint point(measurement_name, (double)i);
- record.points_.push_back(point);
- break;
- }
- }
- int ret = writer.write_record(record);
- ASSERT(ret == 0);
- ind++;
- }
- type++;
- }
- }
-
- auto end = std::chrono::high_resolution_clock::now();
- std::chrono::duration<double> elapsed = end - start;
- int timeseries_num = std::accumulate(type_num.begin(), type_num.end(), 0);
- std::cout << "writer loop: " << loop_num
- << " timeseries num: " << timeseries_num << " records in file"
- << "./test_data/tsfile_test.tsfile" << std::endl;
- std::cout << "total num of points: " << loop_num * timeseries_num
- << std::endl;
- std::cout << "writer data cost time: " << elapsed.count() << "s"
- << std::endl;
- std::cout << "writer data speed:"
- << loop_num * timeseries_num / elapsed.count() << " points/s"
- << std::endl;
- writer.flush();
- writer.close();
- auto end_flush = std::chrono::high_resolution_clock::now();
- std::chrono::duration<double> elapsed_flush = end_flush - end;
- std::cout << "flush data cost time: " << elapsed_flush.count() << "s"
- << std::endl;
-}
-
-int main() {
- std::cout << "LibTsFile benchmark" << std::endl;
- std::cout << "LOOP_NUM:" << bench::LOOP_NUM << std::endl;
- std::cout << "THREAD_NUM:" << bench::THREAD_NUM << std::endl;
- std::cout << "TIMESERIES_NUM:" << bench::TIMESERIES_NUM << std::endl;
- std::cout << "TYPE_LIST: " << bench::TYPE_LIST[0] << ":"
- << bench::TYPE_LIST[1] << ":" << bench::TYPE_LIST[2] << ":"
- << bench::TYPE_LIST[3] << ":" << bench::TYPE_LIST[4] << ":"
- << bench::TYPE_LIST[5] << std::endl;
- std::cout << "init tsfile config value" << std::endl;
- common::init_config_value();
- storage::TsFileWriter writer;
- auto type_num =
- register_timeseries(writer, bench::TIMESERIES_NUM, bench::TYPE_LIST);
- test_writer_benchmark(writer, bench::LOOP_NUM, type_num);
- return 0;
-}
diff --git a/cpp/bench_mark/bench_mark_src/bench_mark.h b/cpp/bench_mark/bench_mark_src/bench_mark.h
deleted file mode 100644
index e3bbd95d6..000000000
--- a/cpp/bench_mark/bench_mark_src/bench_mark.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * 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.
- */
diff --git a/cpp/bench_mark/build.sh b/cpp/bench_mark/build.sh
deleted file mode 100644
index e0e4b0cb6..000000000
--- a/cpp/bench_mark/build.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# 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.
-#
-
-build_type=Debug
-env_for_cyber=0
-use_cpp11=1
-
-if [[ ${env_for_cyber} -eq 1 ]]
-then
- export PATH=$PATH:~/dev/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabi/bin
- export CROSS_COMPILE=arm-linux-gnueabi-
- export ARCH=arm
- export CC=${CROSS_COMPILE}gcc
- export CXX=${CROSS_COMPILE}g++
- echo "set up gcc for cyber"
-fi
-
-
-if [ ${build_type} = "Debug" ]
-then
- mkdir -p build/Debug
- cd build/Debug
- use_sdk_debug=1
-else
- mkdir -p build/Release
- cd build/Release
- use_sdk_debug=0
-fi
-
-echo "use_sdk_debug=${use_sdk_debug}"
-cmake ../../ \
- -DUSE_SDK_DEBUG=$use_sdk_debug \
- -DUSE_CPP11=$use_cpp11
-make
diff --git a/cpp/build.sh b/cpp/build.sh
deleted file mode 100644
index e7d4d01f2..000000000
--- a/cpp/build.sh
+++ /dev/null
@@ -1,140 +0,0 @@
-#
-# 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.
-#
-
-# build_type=MinSizeRel
-build_type=Release
-build_test=0
-build_bench=0
-use_cpp11=1
-enable_cov=0
-debug_se=0
-run_cov_only=0
-
-shell_dir=$(cd "$(dirname "$0")";pwd)
-
-function print_config()
-{
- echo "build_type=$build_type"
- echo "build_test=$build_test"
- echo "use_cpp11=$use_cpp11"
- echo "enable_cov=$enable_cov"
- echo "enable_asan=$enable_asan"
-}
-
-function run_test_for_cov()
-{
- # sh ${shell_dir}/scripts/regression_unittest.sh
- sh ${shell_dir}/test/libtsfile_test/run_sdk_tests.sh
-}
-
-parse_options()
-{
- while test $# -gt 0
- do
- case "$1" in
- clean)
- do_clean=1;;
- run_cov)
- run_cov_only=1;;
- -t=*)
- build_type=`get_key_value "$1"`;;
- -t)
- shift
- build_type=`get_key_value "$1"`;;
- -a=*)
- enable_asan=`get_key_value "$1"`;;
- -a)
- shift
- enable_asan=`get_key_value "$1"`;;
- -c=*)
- enable_cov=`get_key_value "$1"`;;
- -c)
- shift
- enable_cov=`get_key_value "$1"`;;
- #-h | --help)
- # usage
- # exit 0;;
- #*)
- # echo "Unknown option '$1'"
- # exit 1;;
- esac
- shift
- done
-}
-
-parse_options $*
-print_config
-
-if [[ ${run_cov_only} -eq 1 ]]
-then
- do_cov
- # exit after run coverage test.
- exit
-fi
-
-if [ ${build_test} -eq 1 ]
-then
- compile_gtest
- echo "building status: build gtest success."
-fi
-
-echo "build using: build_type=$build_type"
-if [ ${build_type} == "Debug" ]
-then
- mkdir -p build/Debug
- cd build/Debug
-elif [ ${build_type} == "Release" ]
-then
- mkdir -p build/Release
- cd build/Release
-elif [ ${build_type} == "RelWithDebInfo" ]
-then
- mkdir -p build/relwithdebinfo
- cd build/relwithdebinfo
-elif [ ${build_type} == "MinSizeRel" ]
-then
- mkdir -p build/minsizerel
- cd build/minsizerel
-else
- echo ""
- echo "unknow build type: ${build_type}, valid build types(case intensive): Debug, Release, RelWithDebInfo, MinSizeRel"
- echo ""
- exit 1
-fi
-
-cmake ../../ \
- -DGTEST=$gtest_project_dir \
- -DZLIB=$zlib_project_dir/install \
- -DLZ4LIB=$lz4lib_project_dir \
- -DBUILD_TEST=$build_test \
- -DCMAKE_BUILD_TYPE=$build_type \
- -DUSE_CPP11=$use_cpp11 \
- -DENABLE_COV=$enable_cov \
- -DDEBUG_SE=$debug_se \
- -DBUILD_TSFILE_ONLY=$build_tsfile_only
-
-VERBOSE=1 make
-VERBOSE=1 make install
-
-
-
-
-
-
-
diff --git a/cpp/examples/CMakeLists.txt b/cpp/examples/CMakeLists.txt
deleted file mode 100644
index 4b433c96e..000000000
--- a/cpp/examples/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-cmake_minimum_required(VERSION 3.10)
-project(examples)
-message("Running in exampes directory")
-
-set(SDK_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/../src/)
-message("SDK_INCLUDE_DIR: ${SDK_INCLUDE_DIR}")
-set(SDK_LIB_DIR_RELEASE ${PROJECT_SOURCE_DIR}/../build/Release/lib)
-message("SDK_LIB_DIR_RELEASE: ${SDK_LIB_DIR_RELEASE}")
-
-include_directories(${SDK_INCLUDE_DIR})
-find_library(my_tsfile_lib NAMES tsfile PATHS ${SDK_LIB_DIR_RELEASE} NO_DEFAULT_PATH REQUIRED)
-
-add_subdirectory(cpp_examples)
-add_subdirectory(c_examples)
-
-add_executable(examples examples.cc)
-target_link_libraries(examples ${my_tsfile_lib} cpp_examples_obj c_examples_obj)
\ No newline at end of file
diff --git a/cpp/examples/build.sh b/cpp/examples/build.sh
deleted file mode 100644
index bf4a3c456..000000000
--- a/cpp/examples/build.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# 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.
-#
-build_type=Debug
-use_cpp11=1
-if [ ${build_type} = "Debug" ]
-then
- mkdir -p build/Debug
- cd build/Debug
-else
- mkdir -p build/Release
- cd build/Release
-fi
-
-
-cmake ../../ -DUSE_CPP11=$use_cpp11
-make
\ No newline at end of file
diff --git a/cpp/examples/c_examples/CMakeLists.txt b/cpp/examples/c_examples/CMakeLists.txt
deleted file mode 100644
index a1cf714e2..000000000
--- a/cpp/examples/c_examples/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-
-message("Running in examples/c_examples directory")
-aux_source_directory(. c_SRC_LIST)
-add_library(c_examples_obj OBJECT ${c_SRC_LIST})
diff --git a/cpp/examples/c_examples/c_examples.c b/cpp/examples/c_examples/c_examples.c
deleted file mode 100644
index 8e5f8d2d4..000000000
--- a/cpp/examples/c_examples/c_examples.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * 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.
- */
-
-#include "c_examples.h"
-
-#include <fcntl.h>
-#include <malloc.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#define HANDLE_ERROR(err_no) \
- do { \
- if (err_no != 0) { \
- printf("get err no: %d", err_no); \
- return err_no; \
- } \
- } while (0)
-
-ErrorCode write_tsfile() {
- ErrorCode err_code;
- CTsFileWriter writer;
- if (access("c_rw.tsfile", 0) == 0) {
- if (remove("test.tsfile") != 0) {
- printf("Failed to delete test.tsfile file\n");
- return -1;
- }
- }
- writer = ts_writer_open("c_rw.tsfile", &err_code);
- if (NULL == writer) {
- return err_code;
- }
- ColumnSchema columnSchema;
- columnSchema.name = "temperature";
- columnSchema.column_def = TS_TYPE_INT32;
- err_code =
- tsfile_register_table_column(writer, "test_table", &columnSchema);
- HANDLE_ERROR(err_code);
- TableSchema tableSchema;
- tableSchema.column_num = 3;
- tableSchema.table_name = "test_table";
- tableSchema.column_schema =
- (ColumnSchema **)malloc(tableSchema.column_num * sizeof(TableSchema *));
- tableSchema.column_schema[0] = (ColumnSchema *)malloc(sizeof(ColumnSchema));
- tableSchema.column_schema[0]->column_def = TS_TYPE_DOUBLE;
- tableSchema.column_schema[0]->name = "level";
- tableSchema.column_schema[1] = (ColumnSchema *)malloc(sizeof(ColumnSchema));
- tableSchema.column_schema[1]->column_def = TS_TYPE_BOOLEAN;
- tableSchema.column_schema[1]->name = "up";
- tableSchema.column_schema[2] = (ColumnSchema *)malloc(sizeof(ColumnSchema));
- tableSchema.column_schema[2]->column_def = TS_TYPE_FLOAT;
- tableSchema.column_schema[2]->name = "humi";
- err_code = tsfile_register_table(writer, &tableSchema);
- free(tableSchema.column_schema[0]);
- free(tableSchema.column_schema[1]);
- free(tableSchema.column_schema[2]);
- free(tableSchema.column_schema);
- HANDLE_ERROR(err_code);
- printf("register table success\n");
- TsFileRowData rowData = create_tsfile_row("test_table", 1, 4);
- insert_data_into_tsfile_row_double(rowData, "level", 10);
- insert_data_into_tsfile_row_float(rowData, "humi", 10.0f);
- insert_data_into_tsfile_row_boolean(rowData, "up", true);
- insert_data_into_tsfile_row_int32(rowData, "temperature", 10);
- err_code = tsfile_write_row_data(writer, rowData);
-
- rowData = create_tsfile_row("test_table", 2, 4);
- insert_data_into_tsfile_row_double(rowData, "level", 12);
- err_code = tsfile_write_row_data(writer, rowData);
-
- for (int ind = 10; ind < 2000; ind++) {
- rowData = create_tsfile_row("test_table", ind, 4);
- insert_data_into_tsfile_row_double(rowData, "level", 12 + ind);
- insert_data_into_tsfile_row_float(rowData, "humi", 12.0f + ind);
- insert_data_into_tsfile_row_boolean(rowData, "up", true);
- insert_data_into_tsfile_row_int32(rowData, "temperature", 12 + ind);
- err_code = tsfile_write_row_data(writer, rowData);
- }
- printf("writer row data success\n");
- HANDLE_ERROR(err_code);
- HANDLE_ERROR(tsfile_flush_data(writer));
- printf("flush data success\n");
- HANDLE_ERROR(ts_writer_close(writer));
- printf("close writer success\n");
- return 0;
-}
-
-ErrorCode read_tsfile() {
- ErrorCode err_code;
- CTsFileReader reader;
- reader = ts_reader_open("c_rw.tsfile", &err_code);
- if (NULL == reader) {
- return err_code;
- }
- const char *columns[] = {"temperature", "level", "up", "humi"};
- // TimeFilterExpression* exp = create_andquery_timefilter();
- // TimeFilterExpression* time_filter = create_time_filter("test_table",
- // "temperature", GT, 11); TimeFilterExpression* time_filter2 =
- // create_time_filter("test_table", "humi", GT, 10); TimeFilterExpression*
- // time_filter3 = create_time_filter("test_table", "level", LE, 20);
- // add_time_filter_to_and_query(exp, time_filter);
- // add_time_filter_to_and_query(exp, time_filter2);
- // add_time_filter_to_and_query(exp, time_filter3);
-
- QueryDataRet ret = ts_reader_query(reader, "test_table", columns, 4, NULL);
- printf("query success\n");
- DataResult *result = ts_next(ret, 20);
- if (result == NULL) {
- printf("get result failed\n");
- return -1;
- }
- print_data_result(result);
- // destory_time_filter_query(exp);
- HANDLE_ERROR(destory_query_dataret(ret));
- HANDLE_ERROR(destory_tablet(result));
- return 0;
-}
diff --git a/cpp/examples/c_examples/c_examples.h b/cpp/examples/c_examples/c_examples.h
deleted file mode 100644
index 3f63803f0..000000000
--- a/cpp/examples/c_examples/c_examples.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-
-#include "cwrapper/TsFile-cwrapper.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-ErrorCode write_tsfile();
-ErrorCode read_tsfile();
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/cpp/examples/cpp_examples/CMakeLists.txt b/cpp/examples/cpp_examples/CMakeLists.txt
deleted file mode 100644
index a2ac8d435..000000000
--- a/cpp/examples/cpp_examples/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-
-message("Running in examples/cpp_examples directory")
-aux_source_directory(. cpp_SRC_LIST)
-add_library(cpp_examples_obj OBJECT ${cpp_SRC_LIST})
diff --git a/cpp/examples/cpp_examples/cpp_examples.h b/cpp/examples/cpp_examples/cpp_examples.h
deleted file mode 100644
index b2e52aad2..000000000
--- a/cpp/examples/cpp_examples/cpp_examples.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.
- */
-
-#include "common/db_common.h"
-#include "common/path.h"
-#include "common/record.h"
-#include "common/row_record.h"
-#include "common/schema.h"
-#include "reader/expression.h"
-#include "reader/filter/filter.h"
-#include "reader/qds_with_timegenerator.h"
-#include "reader/qds_without_timegenerator.h"
-#include "reader/tsfile_reader.h"
-#include "writer/tsfile_writer.h"
-
-int demo_read();
-int demo_write();
diff --git a/cpp/examples/cpp_examples/demo_read.cpp b/cpp/examples/cpp_examples/demo_read.cpp
deleted file mode 100644
index 8fab33f99..000000000
--- a/cpp/examples/cpp_examples/demo_read.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.
- */
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include "cpp_examples.h"
-
-std::string field_to_string(storage::Field *value) {
- if (value->type_ == common::TEXT) {
- return std::string(value->value_.sval_);
- } else {
- std::stringstream ss;
- switch (value->type_) {
- case common::BOOLEAN:
- ss << (value->value_.bval_ ? "true" : "false");
- break;
- case common::INT32:
- ss << value->value_.ival_;
- break;
- case common::INT64:
- ss << value->value_.lval_;
- break;
- case common::FLOAT:
- ss << value->value_.fval_;
- break;
- case common::DOUBLE:
- ss << value->value_.dval_;
- break;
- case common::NULL_TYPE:
- ss << "NULL";
- break;
- default:
- ASSERT(false);
- break;
- }
- return ss.str();
- }
-}
-
-int demo_read() {
- std::cout << "begin to read tsfile from demo_ts.tsfile" << std::endl;
- std::string device_name = "root.db001.dev001";
- std::string measurement_name = "m001";
- storage::Path p1(device_name, measurement_name);
- std::vector<storage::Path> select_list;
- select_list.push_back(p1);
- storage::QueryExpression *query_expr =
- storage::QueryExpression::create(select_list, nullptr);
-
- common::init_config_value();
- storage::TsFileReader reader;
- int ret = reader.open("cpp_rw.tsfile");
-
- std::cout << "begin to query expr" << std::endl;
- ASSERT(ret == 0);
- storage::ResultSet *qds = nullptr;
- ret = reader.query(query_expr, qds);
-
- storage::RowRecord *record;
- std::cout << "begin to dump data from tsfile ---" << std::endl;
- int row_cout = 0;
- do {
- if (qds->next()) {
- std::cout << "dump QDS : " << record->get_timestamp() << ",";
- record = qds->get_row_record();
- if (record) {
- int size = record->get_fields()->size();
- for (int i = 0; i < size; ++i) {
- std::cout << field_to_string(record->get_field(i)) << ",";
- }
- std::cout << std::endl;
- row_cout++;
- }
- } else {
- break;
- }
- } while (true);
-
- return (0);
-}
diff --git a/cpp/examples/cpp_examples/demo_write.cpp b/cpp/examples/cpp_examples/demo_write.cpp
deleted file mode 100644
index 17c5cb6ba..000000000
--- a/cpp/examples/cpp_examples/demo_write.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * 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.
- */
-
-#include <time.h>
-
-#include <iostream>
-#include <random>
-#include <string>
-
-#include "cpp_examples.h"
-
-using namespace storage;
-
-long getNowTime() { return time(nullptr); }
-
-static std::string generate_random_string(int length) {
- std::random_device rd;
- std::mt19937 gen(rd());
- std::uniform_int_distribution<> dis(0, 61);
-
- const std::string chars =
- "0123456789"
- "abcdefghijklmnopqrstuvwxyz"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-
- std::string random_string;
-
- for (int i = 0; i < length; ++i) {
- random_string += chars[dis(gen)];
- }
-
- return random_string;
-}
-
-int demo_write() {
- TsFileWriter* tsfile_writer_ = new TsFileWriter();
- libtsfile_init();
- std::string file_name_ = std::string("tsfile_writer_test_") +
- generate_random_string(10) +
- std::string(".tsfile");
- int flags = O_WRONLY | O_CREAT | O_TRUNC;
-#ifdef _WIN32
- flags |= O_BINARY;
-#endif
- mode_t mode = 0666;
- tsfile_writer_->open(file_name_, flags, mode);
- remove(file_name_.c_str());
- const int device_num = 50;
- const int measurement_num = 50;
- std::vector<MeasurementSchema> schema_vec[50];
- for (int i = 0; i < device_num; i++) {
- std::string device_name = "test_device" + std::to_string(i);
- schema_vec[i].reserve(measurement_num);
- for (int j = 0; j < measurement_num; j++) {
- std::string measure_name = "measurement" + std::to_string(j);
- schema_vec[i].emplace_back(
- MeasurementSchema(measure_name, common::TSDataType::INT32,
- common::TSEncoding::PLAIN,
- common::CompressionType::UNCOMPRESSED));
- tsfile_writer_->register_timeseries(device_name, schema_vec[i][j]);
- }
- }
-
- std::cout << "input tablet size" << std::endl;
- int tablet_size;
- std::cin >> tablet_size;
-
- int max_rows = 100000;
- int cur_row = 0;
- long start = getNowTime();
- for (; cur_row < max_rows;) {
- if (cur_row + tablet_size > max_rows) {
- tablet_size = max_rows - cur_row;
- }
- for (int i = 0; i < device_num; i++) {
- std::string device_name = "test_device" + std::to_string(i);
- Tablet tablet(device_name, &schema_vec[i], tablet_size);
- tablet.init();
- for (int row = 0; row < tablet_size; row++) {
- tablet.set_timestamp(row, 16225600 + cur_row + row);
- }
- for (int j = 0; j < measurement_num; j++) {
- for (int row = 0; row < tablet_size; row++) {
- tablet.set_value(row, j, row + cur_row);
- }
- }
- tsfile_writer_->write_tablet(tablet);
- tsfile_writer_->flush();
- }
- cur_row += tablet_size;
- std::cout << "finish writing " << cur_row << " rows" << std::endl;
- }
-
- tsfile_writer_->close();
- long end = getNowTime();
- printf("interval waitForResults is %ld \n", end - start);
- return 0;
-}
diff --git a/cpp/examples/examples.cc b/cpp/examples/examples.cc
deleted file mode 100644
index 845d3f78a..000000000
--- a/cpp/examples/examples.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-
-#include "c_examples/c_examples.h"
-#include "cpp_examples/cpp_examples.h"
-
-int main() {
- // C++ examples
- demo_write();
- demo_read();
- // C examples
- write_tsfile();
- read_tsfile();
- return 0;
-}
\ No newline at end of file
diff --git a/cpp/pom.xml b/cpp/pom.xml
deleted file mode 100644
index 6aeedcaa5..000000000
--- a/cpp/pom.xml
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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
-
- https://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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.tsfile</groupId>
- <artifactId>tsfile-parent</artifactId>
- <version>2.1.0-SNAPSHOT</version>
- </parent>
- <artifactId>tsfile-cpp</artifactId>
- <packaging>pom</packaging>
- <name>TsFile: C++</name>
- <properties>
- <!-- Tell Sonar where to find the sources -->
- <sonar.sources>common,examples,tsfile</sonar.sources>
- <sonar.cfamily.build-wrapper-output>${project.build.directory}/build-wrapper-output</sonar.cfamily.build-wrapper-output>
- <cmake.addition.option>-DCOV_ENABLED=OFF</cmake.addition.option>
- </properties>
- <build>
- <sourceDirectory>${project.basedir}</sourceDirectory>
- <plugins>
- <!--
- Do the actual build.
- -->
- <plugin>
- <groupId>com.googlecode.cmake-maven-project</groupId>
- <artifactId>cmake-maven-plugin</artifactId>
- <executions>
- <!-- Generate the configuration for the main compilation -->
- <!--execution>
- <id>cmake-generate-compile</id>
- <phase>compile</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- <!- Compile the main code ->
- <execution>
- <id>cmake-execute-compile</id>
- <phase>compile</phase>
- <goals>
- <goal>compile</goal>
- </goals>
- </execution-->
- <!-- Generate the configuration for the test compilation -->
- <execution>
- <id>cmake-generate-test-compile</id>
- <phase>generate-test-sources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- <configuration>
- <options>
- <option>-DBUILD_PHASE=test-compile</option>
- <option>${cmake.addition.option}</option>
- </options>
- <sourcePath/>
- <targetPath/>
- </configuration>
- </execution>
- <!-- Compile the test code -->
- <execution>
- <id>cmake-execute-test-compile</id>
- <phase>test-compile</phase>
- <goals>
- <goal>compile</goal>
- </goals>
- </execution>
- <!-- Execute the tests -->
- <execution>
- <id>cmake-run-tests</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <buildDirectory>${project.build.directory}/build/test</buildDirectory>
- </configuration>
- </execution>
- </executions>
- <configuration>
- <!--
- Actually the path to the CMakeList.txt file which then again
- tells to tool where to find the sources.
- -->
- <sourcePath>${project.basedir}</sourcePath>
- <!--
- Path to where the build configuration is generated
- (This directory is then used in the compile step to actually perform the build)
- -->
- <targetPath>${project.build.directory}/build</targetPath>
- <!--
- Name of the generator the compile step will be executing.
- -->
- <generator>${cmake.generator}</generator>
- <!-- The directory where the "generate" step generated the build configuration -->
- <projectDirectory>${project.build.directory}/build</projectDirectory>
- </configuration>
- </plugin>
- <!-- Overwrite test config-->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.gmaven</groupId>
- <artifactId>groovy-maven-plugin</artifactId>
- <version>2.1.1</version>
- <executions>
- <!-- rename the cmake binary and generate a script that adds the sonar build-wrapper -->
- <execution>
- <id>sync-project-version</id>
- <phase>process-sources</phase>
- <goals>
- <goal>execute</goal>
- </goals>
- <configuration>
- <source>${project.basedir}/VersionUpdater.groovy</source>
- </configuration>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.apache.groovy</groupId>
- <artifactId>groovy</artifactId>
- <version>${groovy.version}</version>
- </dependency>
- </dependencies>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>linux-install-uuid-dev</id>
- <activation>
- <os>
- <family>unix</family>
- <name>Linux</name>
- </os>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.1.1</version>
- <executions>
- <execution>
- <id>install-uuid-dev</id>
- <phase>validate</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <executable>bash</executable>
- <arguments>
- <argument>-c</argument>
- <argument>sudo apt-get update && sudo apt-get install -y uuid-dev</argument>
- </arguments>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- <profile>
- <id>with-code-coverage</id>
- <properties>
- <cmake.addition.option>-DCOV_ENABLED=ON</cmake.addition.option>
- </properties>
- </profile>
- <!-- When running on jenkins, download the sonar build-wrapper, so we can do a code analysis -->
- <profile>
- <id>jenkins-build</id>
- <!-- This is needed by the groovy hack script -->
- <properties>
- <cmake.root>${project.build.directory}/dependency/cmake/bin</cmake.root>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>com.googlecode.maven-download-plugin</groupId>
- <artifactId>download-maven-plugin</artifactId>
- <executions>
- <!-- Get the build-wrapper from our sonarcloud server -->
- <execution>
- <id>get-build-wrapper</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>wget</goal>
- </goals>
- <configuration>
- <skipCache>true</skipCache>
- <url>https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip</url>
- <unpack>true</unpack>
- <outputDirectory>${project.build.directory}</outputDirectory>
- <skipCache>true</skipCache>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt
deleted file mode 100644
index ecacad70a..000000000
--- a/cpp/src/CMakeLists.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-message("Running in src diectory")
-if (${COV_ENABLED})
- add_compile_options(-fprofile-arcs -ftest-coverage)
-endif ()
-add_definitions(-DANTLR4CPP_STATIC)
-set(ANTLR4_WITH_STATIC_CRT OFF)
-add_subdirectory(parser)
-add_subdirectory(common)
-add_subdirectory(compress)
-add_subdirectory(cwrapper)
-add_subdirectory(encoding)
-add_subdirectory(file)
-add_subdirectory(reader)
-add_subdirectory(utils)
-add_subdirectory(writer)
-
-set(COMPRESSION_LIBS snappy LZ4 lzokay zlibstatic)
-target_link_libraries(parser_obj antlr4_static)
-target_link_libraries(compress_obj ${COMPRESSION_LIBS})
-target_link_libraries(common_obj ${COMPRESSION_LIBS})
-target_link_libraries(read_obj ${COMPRESSION_LIBS})
-target_link_libraries(write_obj ${COMPRESSION_LIBS})
-
-add_library(tsfile SHARED)
-if (${COV_ENABLED})
- message("Enable code cov...")
- target_link_libraries(tsfile common_obj compress_obj cwrapper_obj file_obj read_obj write_obj parser_obj -lgcov)
-else()
- message("Disable code cov...")
- target_link_libraries(tsfile common_obj compress_obj cwrapper_obj file_obj read_obj write_obj parser_obj)
-endif()
-
-set(LIBTSFILE_PROJECT_VERSION ${TsFile_CPP_VERSION})
-set(LIBTSFILE_SO_VERSION ${TsFile_CPP_VERSION})
-set_target_properties(tsfile PROPERTIES VERSION ${LIBTSFILE_PROJECT_VERSION})
-set_target_properties(tsfile PROPERTIES SOVERSION ${LIBTSFILE_SO_VERSION})
-
-set(LIBTSFILE_SDK_DIR ${LIBRARY_OUTPUT_PATH})
-install(TARGETS tsfile LIBRARY DESTINATION ${LIBTSFILE_SDK_DIR})
-
-# set(CMAKE_PREFIX_PATH ../../third-party/lz4-dev/lib)
-# set(LZ4_LIB_DIR ../../third-party/lz4-dev/lib)
-# find_library(my_lz4_lib NAMES lz4 PATHS ${LZ4_LIB_DIR} NO_DEFAULT_PATH REQUIRED)
-# link_directories(${LZ4_LIB_DIR})
-# target_link_libraries(tsfile ${my_lz4_lib})
-
-# if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-# add_custom_command(TARGET tsfile POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change `otool -L ${LIBRARY_OUTPUT_PATH}/libtsfile.dylib | grep liblz4 | sed 's/dylib.*/dylib/g'` ${my_lz4_lib} ${LIBRARY_OUTPUT_PATH}/libtsfile.dylib)
-# add_custom_command(TARGET tsfile POST_BUILD COMMAND ${CMAKE_INSTALL_NAME_TOOL} -change `otool -L ${LIBRARY_OUTPUT_PATH}/libtsfile.dylib | grep libz | sed 's/dylib.*/dylib/g'` ${my_z_lib} ${LIBRARY_OUTPUT_PATH}/libtsfile.dylib)
-# endif()
diff --git a/cpp/src/common/CMakeLists.txt b/cpp/src/common/CMakeLists.txt
deleted file mode 100644
index 7087d03dc..000000000
--- a/cpp/src/common/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-message("Running in src/common directory")
-
-aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} common_SRC_LIST)
-aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/allocator common_allocator_SRC_LIST)
-aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/container common_container_SRC_LIST)
-aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/tsblock common_tsblock_SRC_LIST)
-aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/mutex common_mutex_SRC_LIST)
-aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/datatype common_datatype_SRC_LIST)
-
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-add_library(common_obj OBJECT ${common_SRC_LIST}
- ${common_allocator_SRC_LIST}
- ${common_container_SRC_LIST}
- ${common_tsblock_SRC_LIST}
- ${common_mutex_SRC_LIST}
- ${common_datatype_SRC_LIST})
-
diff --git a/cpp/src/common/allocator/CMakeLists.txt b/cpp/src/common/allocator/CMakeLists.txt
deleted file mode 100644
index e66bd2129..000000000
--- a/cpp/src/common/allocator/CMakeLists.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-
-message("Running in src/common/allocator directory")
-
-message("CMAKE_CURRENT_SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}")
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} common_allocator_SRC_LIST)
-add_library(common_allocator OBJECT ${common_allocator_SRC_LIST})
-
diff --git a/cpp/src/common/allocator/alloc_base.h b/cpp/src/common/allocator/alloc_base.h
deleted file mode 100644
index 1ff55e193..000000000
--- a/cpp/src/common/allocator/alloc_base.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef COMMON_ALLOCATOR_ALLOC_BASE_H
-#define COMMON_ALLOCATOR_ALLOC_BASE_H
-
-#include <stddef.h>
-
-#include <cstring>
-
-#include "utils/util_define.h"
-
-namespace common {
-
-enum AllocModID {
- __FIRST_MOD_ID = 0,
- // if you are sure you will not consume too much memory, you can use
- // MOD_DEFAULT.
- MOD_DEFAULT = 0,
- MOD_MEMTABLE = 1,
- MOD_SCHEMA = 2,
- MOD_SQL = 3,
- MOD_NET = 4,
- MOD_NET_DATA = 5,
- MOD_TVLIST_DATA = 6,
- MOD_TVLIST_OBJ = 7,
- MOD_TSBLOCK = 8,
- MOD_CONTAINER = 9,
- MOD_TSSTORE_OBJ = 10,
- MOD_FLUSH_TASK_OBJ = 11,
- MOD_PAGE_WRITER_OUTPUT_STREAM = 12,
- MOD_CW_PAGES_DATA = 13,
- MOD_CHUNK_WRITER_OBJ = 14,
- MOD_STATISTIC_OBJ = 15,
- MOD_ENCODER_OBJ = 16,
- MOD_DECODER_OBJ = 17,
- MOD_TSFILE_WRITER_META = 18,
- MOD_TSFILE_WRITE_STREAM = 19,
- MOD_TIMESERIES_INDEX_OBJ = 20,
- MOD_BLOOM_FILTER = 21,
- MOD_OPEN_FILE_OBJ = 22,
- MOD_TSFILE_READER = 23,
- MOD_CHUNK_READER = 24,
- MOD_COMPRESSOR_OBJ = 25,
- MOD_ARRAY = 26,
- MOD_HASH_TABLE = 27,
- MOD_WRITER_INDEX_NODE = 28,
- MOD_TS2DIFF_OBJ = 29,
- MOD_BITENCODE_OBJ = 30,
- MOD_DICENCODE_OBJ = 31,
- MOD_ZIGZAG_OBJ = 32,
- __LAST_MOD_ID = 33, // prev + 1,
- __MAX_MOD_ID = 127, // leave 1 bit to detect header size
-};
-
-extern const char *g_mod_names[__LAST_MOD_ID];
-
-/* very basic alloc/free interface in C style */
-void *mem_alloc(uint32_t size, AllocModID mid);
-void mem_free(void *ptr);
-void *mem_realloc(void *ptr, uint32_t size);
-
-class ModStat {
- public:
- ModStat() : stat_arr_(NULL) {}
-
- static ModStat &get_instance() {
- /*
- * This is the singleton of Mod Memory Statistic.
- * gms is short for Global Mod Statistic
- */
- static ModStat gms;
- return gms;
- }
- void init();
- void destroy();
- INLINE void update_alloc(AllocModID mid, int32_t size) {
- // ASSERT(mid < __LAST_MOD_ID);
- // ATOMIC_FAA(get_item(mid), size);
- }
- void update_free(AllocModID mid, uint32_t size) {
- // ASSERT(mid < __LAST_MOD_ID);
- // ATOMIC_FAA(get_item(mid), 0 - size);
- }
- void print_stat();
-
-#ifdef ENABLE_TEST
- int32_t TEST_get_stat(int8_t mid) { return ATOMIC_FAA(get_item(mid), 0); }
-#endif
-
- private:
- INLINE int32_t *get_item(int8_t mid) {
- return &(stat_arr_[mid * (ITEM_SIZE / sizeof(int32_t))]);
- }
-
- private:
- static const int32_t ITEM_SIZE = CACHE_LINE_SIZE;
- static const int32_t ITEM_COUNT = __LAST_MOD_ID;
- int32_t *stat_arr_;
-
- STATIC_ASSERT((ITEM_SIZE % sizeof(int32_t) == 0), ModStat_ITEM_SIZE_ERROR);
-};
-
-/* base allocator */
-class BaseAllocator {
- public:
- void *alloc(uint32_t size, AllocModID mid) { return mem_alloc(size, mid); }
- void free(void *ptr) { mem_free(ptr); }
-};
-
-extern BaseAllocator g_base_allocator;
-
-} // end namespace common
-
-#endif // COMMON_ALLOCATOR_ALLOC_BASE_H
diff --git a/cpp/src/common/allocator/byte_stream.h b/cpp/src/common/allocator/byte_stream.h
deleted file mode 100644
index bf46d9d7d..000000000
--- a/cpp/src/common/allocator/byte_stream.h
+++ /dev/null
@@ -1,1128 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef COMMON_ALLOCATOR_BYTE_STREAM_H
-#define COMMON_ALLOCATOR_BYTE_STREAM_H
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <iostream>
-#include <string>
-
-#include "common/allocator/alloc_base.h"
-#include "common/allocator/my_string.h"
-#include "utils/errno_define.h"
-
-namespace common {
-
-template <typename T>
-class OptionalAtomic {
- public:
- OptionalAtomic(T t, bool enable_atomic = false)
- : val_(t), enable_atomic_(enable_atomic) {}
-
- FORCE_INLINE T load() const {
- if (UNLIKELY(enable_atomic_)) {
- return ATOMIC_LOAD(&val_);
- } else {
- return val_;
- }
- }
-
- FORCE_INLINE void store(const T t) {
- if (UNLIKELY(enable_atomic_)) {
- ATOMIC_STORE(&val_, t);
- } else {
- val_ = t;
- }
- }
-
- FORCE_INLINE T atomic_faa(const T increament) {
- if (UNLIKELY(enable_atomic_)) {
- return ATOMIC_FAA(&val_, increament);
- } else {
- T old_val = val_;
- val_ = val_ + increament;
- return old_val;
- }
- }
-
- FORCE_INLINE T atomic_aaf(const T increament) {
- if (UNLIKELY(enable_atomic_)) {
- return ATOMIC_AAF(&val_, increament);
- } else {
- val_ = val_ + increament;
- return val_;
- }
- }
-
- FORCE_INLINE bool enable_atomic() const { return enable_atomic_; }
-
- private:
- T val_;
- bool enable_atomic_;
-};
-
-FORCE_INLINE int32_t float_to_int(float f) {
- // return *((int32_t*)(&f));
- // return *(reinterpret_cast<int32_t*>(&f));
- union fi {
- int i_;
- float f_;
- };
-
- fi my_fi;
- my_fi.f_ = f;
- return my_fi.i_; // By mimicking the java jdk's implementation, it's
- // essentially the same as line 75.
-}
-
-FORCE_INLINE float int_to_float(int32_t i) {
- // return *((float *)(&i));
- union fi {
- int i_;
- float f_;
- };
-
- fi my_fi;
- my_fi.i_ = i;
- return my_fi.f_;
-}
-
-FORCE_INLINE void float_to_bytes(float f, uint8_t bytes[4]) {
- /*
- * See:
- * floatToBytes in BytesUtils.java of IoTDB project and
- * Java_java_lang_Float_intBitsToFloat in JDK project
- */
- if (UNLIKELY(f != f)) { // this is NaN
- // IEEE754: 0x7FC00000 for NanN
- bytes[0] = 0x7F;
- bytes[1] = 0xC0;
- bytes[2] = 0x00;
- bytes[3] = 0x00;
- return;
- }
-
- // follow jdk implementation style.
- union {
- int i;
- float f;
- } u;
-
- u.f = f;
-
- bytes[3] = (uint8_t)(u.i);
- bytes[2] = (uint8_t)(u.i >> 8);
- bytes[1] = (uint8_t)(u.i >> 16);
- bytes[0] = (uint8_t)(u.i >> 24);
-}
-
-FORCE_INLINE float bytes_to_float(uint8_t bytes[4]) {
- int32_t i = bytes[3];
- i &= 0xFF;
- i |= bytes[2] << 8;
- i &= 0xFFFF;
- i |= bytes[1] << 16;
- i &= 0xFFFFFF;
- i |= bytes[0] << 24;
-
- union {
- int i;
- float f;
- } u;
-
- u.i = i;
- return u.f;
-}
-
-FORCE_INLINE int64_t double_to_long(double d) {
- // return *((int64_t*)(&d));
- union dl {
- double d_;
- int64_t l_;
- };
- dl my_dl;
- my_dl.d_ = d;
- return my_dl.l_;
-}
-
-FORCE_INLINE double long_to_double(int64_t l) {
- // return *((double *)(&l));
- union dl {
- double d_;
- int64_t l_;
- };
- dl my_dl;
- my_dl.l_ = l;
- return my_dl.d_;
-}
-
-FORCE_INLINE void double_to_bytes(double d, uint8_t bytes[8]) {
- if (UNLIKELY(d != d)) {
- // NaN, 0x7FF8000000000000L
- memset(bytes, 0, 8);
- bytes[0] = 0x7F;
- bytes[1] = 0xF8;
- return;
- }
- // follow jdk implementation style.
- union {
- long long l;
- double d;
- } u;
-
- u.d = d;
-
- bytes[7] = (uint8_t)u.l;
- bytes[6] = (uint8_t)(u.l >> 8);
- bytes[5] = (uint8_t)(u.l >> 16);
- bytes[4] = (uint8_t)(u.l >> 24);
- bytes[3] = (uint8_t)(u.l >> 32);
- bytes[2] = (uint8_t)(u.l >> 40);
- bytes[1] = (uint8_t)(u.l >> 48);
- bytes[0] = (uint8_t)(u.l >> 56);
-}
-
-FORCE_INLINE double bytes_to_double(uint8_t bytes[8]) {
- int64_t value = bytes[7];
- value &= 0xFFl;
- value |= ((int64_t)bytes[6]) << 8;
- value &= 0xFFFFl;
- value |= ((int64_t)bytes[5]) << 16;
- value &= 0xFFFFFFl;
- value |= ((int64_t)bytes[4]) << 24;
- value &= 0xFFFFFFFFl;
- value |= ((int64_t)bytes[3]) << 32;
- value &= 0xFFFFFFFFFFl;
- value |= ((int64_t)bytes[2]) << 40;
- value &= 0xFFFFFFFFFFFFl;
- value |= ((int64_t)bytes[1]) << 48;
- value &= 0xFFFFFFFFFFFFFFl;
- value |= ((int64_t)bytes[0]) << 56;
-
- // follow jdk implementation style.
- union {
- long long l;
- double d;
- } u;
-
- u.l = value;
- return u.d;
-}
-
-// TODO define a WrappedByteStream class
-
-// auto extend buffer for serialization
-class ByteStream {
- private:
- struct Page {
- OptionalAtomic<Page *> next_; // 9 bytes
- uint8_t *buf_; // 8 bytes
-
- explicit Page(bool enable_atomic) : next_(nullptr, enable_atomic) {
- buf_ = (uint8_t
- *)(this +
- 1); // I think it should add 17, because the Page
- // class is 9+8=17 bytes. No, adding one to a
- // pointer is not adding a byte, but adding the
- // length of the byte corresponding to the type
- // pointed to by the pointer, and adding one
- // here is actually adding 17 bytes. No problem.
- }
- Page(bool enable_atomic, uint8_t *wrapped_buf)
- : next_(nullptr, enable_atomic), buf_(wrapped_buf) {}
- };
-
- public:
- ByteStream(uint32_t page_size, AllocModID mid, bool enable_atomic = false,
- BaseAllocator &allocator = g_base_allocator)
- : allocator_(allocator),
- head_(nullptr, enable_atomic),
- tail_(nullptr, enable_atomic),
- read_page_(nullptr),
- total_size_(0, enable_atomic),
- read_pos_(0),
- marked_read_pos_(0),
- page_size_(page_size),
- mid_(mid),
- wrapped_page_(false, nullptr) {
- // assert(page_size >= 16); // commented out by gxh on 2023.03.09
- }
-
- // TODO use a specific construct function to mark it as wrapped use.
- // for wrap plain buffer to ByteStream
- ByteStream()
- : allocator_(g_base_allocator),
- head_(nullptr, false),
- tail_(nullptr, false),
- read_page_(nullptr),
- total_size_(0, false),
- read_pos_(0),
- marked_read_pos_(0),
- page_size_(0),
- mid_(MOD_DEFAULT),
- wrapped_page_(false, nullptr) {}
-
- ~ByteStream() { destroy(); }
-
- /* ================ Part 0: wrap from outside buffer ================ */
- // if you wrap a buffer as a ByteStream, you should
- // manage the outside buffer yourself.
- void wrap_from(const char *buf, int32_t buf_len) {
- wrapped_page_.next_.store(nullptr);
- wrapped_page_.buf_ = (uint8_t *)buf;
-
- page_size_ = buf_len;
- head_.store(&wrapped_page_);
- tail_.store(&wrapped_page_);
- total_size_.store(buf_len);
- marked_read_pos_ = 0;
- read_pos_ = 0;
- read_page_ = nullptr;
- }
- FORCE_INLINE bool is_wrapped() const {
- return head_.load() == &wrapped_page_;
- }
- char *get_wrapped_buf() { return (char *)wrapped_page_.buf_; }
- void clear_wrapped_buf() { wrapped_page_.buf_ = nullptr; }
-
- /* ================ Part 1: basic ================ */
- FORCE_INLINE uint32_t remaining_size() const {
- ASSERT(total_size_.load() >= read_pos_);
- return total_size_.load() - read_pos_;
- }
- FORCE_INLINE bool has_remaining() const { return remaining_size() > 0; }
-
- FORCE_INLINE void mark_read_pos() { marked_read_pos_ = read_pos_; }
- FORCE_INLINE uint32_t get_mark_len() const {
- ASSERT(marked_read_pos_ <= read_pos_);
- return read_pos_ - marked_read_pos_;
- }
-
- void destroy() { reset(); }
- void reset() {
- // if this ByteStream is wrapped from a plain buffer
- // do not free the outside buffer.
- if (!is_wrapped()) {
- Page *p = head_.load();
- while (p) {
- p = head_.load()->next_.load();
- allocator_.free(head_.load());
- head_.store(p);
- }
- }
- head_.store(nullptr);
- tail_.store(nullptr);
- read_page_ = nullptr;
- total_size_.store(0);
- read_pos_ = 0;
- }
-
- // never used TODO
- void shallow_clone_from(ByteStream &other) {
- this->page_size_ = other.page_size_;
- this->mid_ = other.mid_;
- this->head_.store(other.head_.load());
- this->tail_.store(other.tail_.load());
- this->total_size_.store(other.total_size_.load());
- }
-
- FORCE_INLINE uint32_t total_size() const { return total_size_.load(); }
- FORCE_INLINE uint32_t read_pos() const { return read_pos_; };
- FORCE_INLINE void wrapped_buf_advance_read_pos(uint32_t size) {
- if (size + read_pos_ > total_size_.load()) {
- read_pos_ = total_size_.load();
- } else {
- read_pos_ += size;
- }
- }
-
- /* ================ Part 2: write_xxx and read_xxx ================ */
- // writer @buf with length @len into this bytestream
- int write_buf(const uint8_t *buf, const uint32_t len) {
- int ret = common::E_OK;
- uint32_t write_len = 0;
- while (write_len < len) {
- if (RET_FAIL(prepare_space())) {
- std::cout << "write_buf error " << ret << std::endl;
- return ret;
- }
- uint32_t remainder = page_size_ - (total_size_.load() % page_size_);
- uint32_t copy_len =
- remainder < (len - write_len) ? remainder : (len - write_len);
- memcpy(tail_.load()->buf_ + total_size_.load() % page_size_,
- buf + write_len, copy_len);
- total_size_.atomic_aaf(copy_len);
- write_len += copy_len;
- }
- return ret;
- }
-
- // reader @want_len bytes to @buf, @read_len indicates real len we reader.
- // if ByteStream do not have so many bytes, it will return E_PARTIAL_READ if
- // no other error occure.
- int read_buf(uint8_t *buf, const uint32_t want_len, uint32_t &read_len) {
- int ret = common::E_OK;
- bool partial_read = (read_pos_ + want_len > total_size_.load());
- uint32_t want_len_limited =
- partial_read ? (total_size_.load() - read_pos_) : want_len;
- read_len = 0;
- while (read_len < want_len_limited) {
- if (RET_FAIL(check_space())) {
- return ret;
- }
- uint32_t remainder = page_size_ - (read_pos_ % page_size_);
- uint32_t copy_len = remainder < want_len_limited - read_len
- ? remainder
- : want_len_limited - read_len;
- memcpy(buf + read_len, read_page_->buf_ + (read_pos_ % page_size_),
- copy_len);
- read_len += copy_len;
- read_pos_ += copy_len;
- }
- return partial_read ? common::E_PARTIAL_READ : common::E_OK;
- }
-
- FORCE_INLINE int write_buf(const char *buf, const uint32_t len) {
- return write_buf((const uint8_t *)buf, len);
- }
- FORCE_INLINE int read_buf(char *buf, const uint32_t want_len,
- uint32_t &read_len) {
- return read_buf((uint8_t *)buf, want_len, read_len);
- }
- FORCE_INLINE int read_buf(char *buf, const int32_t want_len,
- int32_t &read_len) {
- return read_buf((uint8_t *)buf, (uint32_t &)want_len,
- (uint32_t &)read_len);
- }
-
- void purge_prev_pages(int purge_page_count = INT32_MAX) {
- Page *cur = head_.load();
- while (cur != tail_.load() && purge_page_count-- > 0) {
- Page *next = cur->next_.load();
- allocator_.free(cur);
- cur = next;
- }
- head_.store(cur);
- }
-
- /* ================ Part 3: writing internal buffers ================ */
- /*
- * use @acquire_buf function to get a buf, caller will fill the buf, and
- * after filling, caller use @buffer_used to notice ByteStream to update
- * internal variables.
- *
- * Note: it should be used in single thread.
- */
- struct Buffer {
- char *buf_;
- uint32_t len_;
-
- Buffer() : buf_(nullptr), len_(0) {}
- };
-
- Buffer acquire_buf() {
- Buffer b;
- if (common::E_OK != prepare_space()) {
- return b;
- }
- b.buf_ =
- (char *)(tail_.load()->buf_ + (total_size_.load() % page_size_));
- b.len_ = page_size_ - (total_size_.load() % page_size_);
- return b;
- }
-
- void buffer_used(uint32_t used_bytes) {
- ASSERT(used_bytes >= 1);
- // would not span page
- ASSERT((total_size_.load() / page_size_) ==
- ((total_size_.load() + used_bytes - 1) / page_size_));
- total_size_.atomic_aaf(used_bytes);
- }
-
- /* ================ Part 4: reading internal buffers ================ */
- /*
- * one-shot reader iterator
- * Do not use it if the host_ is still writing
- */
- struct BufferIterator {
- const ByteStream &host_;
- Page *cur_;
- Page *end_;
- int64_t total_size_;
- BufferIterator(const ByteStream &bs) : host_(bs) {
- cur_ = bs.head_.load();
- end_ = bs.tail_.load();
- total_size_ = bs.total_size_.load();
- }
-
- Buffer get_next_buf() {
- Buffer b;
- if (cur_ != nullptr) {
- b.buf_ = (char *)cur_->buf_;
- if (cur_ == end_ &&
- host_.total_size_.load() % host_.page_size_ != 0) {
- b.len_ = host_.total_size_.load() % host_.page_size_;
- } else {
- b.len_ = host_.page_size_;
- }
- ASSERT(b.len_ > 0);
- cur_ = cur_->next_.load();
- }
- return b;
- }
- };
- BufferIterator init_buffer_iterator() const {
- return BufferIterator(*this);
- }
-
- /*
- * producer-consumer mode reader iterator
- * Note:
- * the host ByteStream should be configured as atomically.
- */
- struct Consumer {
- const ByteStream &host_;
- Page *cur_;
- uint32_t read_offset_within_cur_page_;
- int64_t total_end_offset_; // for DEBUG
-
- Consumer(const ByteStream &bs) : host_(bs) {
- ASSERT(bs.head_.enable_atomic());
- cur_ = nullptr;
- read_offset_within_cur_page_ = 0;
- total_end_offset_ = 0;
- }
-
- Buffer get_next_buf(ByteStream &host) {
- Buffer b;
- if (UNLIKELY(host.head_.load() == nullptr)) {
- // host is empty, return empty buffer.
- return b;
- }
- if (UNLIKELY(cur_ == nullptr)) {
- // this consumer did not initialiazed.
- cur_ = host_.head_.load();
- read_offset_within_cur_page_ = 0;
- }
-
- // get tail position <tail_, total_size_> atomically
- Page *host_end = nullptr;
- uint32_t host_total_size = 0;
- while (true) {
- host_end = host_.tail_.load();
- host_total_size = host_.total_size_.load();
- if (host_end == host_.tail_.load()) {
- break;
- }
- }
-
- while (true) {
- if (cur_ == host_end) {
- if (host_total_size % host_.page_size_ == 0) {
- if (read_offset_within_cur_page_ == host_.page_size_) {
- return b;
- } else {
- b.buf_ = ((char *)(cur_->buf_)) +
- read_offset_within_cur_page_;
- b.len_ =
- host_.page_size_ - read_offset_within_cur_page_;
- read_offset_within_cur_page_ = host_.page_size_;
- total_end_offset_ += b.len_;
- return b;
- }
- } else {
- if (read_offset_within_cur_page_ ==
- (host_total_size % host_.page_size_)) {
- return b;
- } else {
- b.buf_ = ((char *)(cur_->buf_)) +
- read_offset_within_cur_page_;
- b.len_ = (host_total_size % host_.page_size_) -
- read_offset_within_cur_page_;
- read_offset_within_cur_page_ =
- (host_total_size % host_.page_size_);
- total_end_offset_ += b.len_;
- return b;
- }
- }
- } else {
- if (read_offset_within_cur_page_ == host_.page_size_) {
- cur_ = cur_->next_.load();
- read_offset_within_cur_page_ = 0;
- } else {
- b.buf_ = ((char *)(cur_->buf_)) +
- read_offset_within_cur_page_;
- b.len_ =
- host_.page_size_ - read_offset_within_cur_page_;
- cur_ = cur_->next_.load();
- read_offset_within_cur_page_ = 0;
- total_end_offset_ += b.len_;
- return b;
- }
- }
- }
- ASSERT(b.len_ < (1 << 30));
- return b;
- }
- };
-
- private:
- FORCE_INLINE int prepare_space() {
- int ret = common::E_OK;
- if (UNLIKELY(tail_.load() == nullptr ||
- total_size_.load() % page_size_ == 0)) {
- Page *p = nullptr;
- if (RET_FAIL(alloc_page(p))) {
- return ret;
- }
- } else {
- // do nothing
- }
- return ret;
- }
-
- FORCE_INLINE int check_space() {
- if (UNLIKELY(read_pos_ >= total_size_.load())) {
- return common::E_OUT_OF_RANGE;
- }
- if (UNLIKELY(read_page_ == nullptr)) {
- read_page_ = head_.load();
- } else if (UNLIKELY(read_pos_ % page_size_ == 0)) {
- read_page_ = read_page_->next_.load();
- }
- if (UNLIKELY(read_page_ == nullptr)) {
- return common::E_OUT_OF_RANGE;
- }
- return common::E_OK;
- }
-
- FORCE_INLINE int alloc_page(Page *&p) {
- int ret = common::E_OK;
- char *buf = (char *)allocator_.alloc(page_size_ + sizeof(Page), mid_);
- if (UNLIKELY(buf == nullptr)) {
- ret = common::E_OOM;
- } else {
- p = new (buf) Page(head_.enable_atomic());
- p->next_.store(nullptr);
- if (head_.load()) {
- tail_.load()->next_.store(p);
- tail_.store(p);
- } else {
- head_.store(p);
- tail_.store(p);
- }
- }
- // printf("\nByteStream alloc_page, this=%p, new_page=%p\n", this, p);
- return ret;
- }
-
- DISALLOW_COPY_AND_ASSIGN(ByteStream);
-
- private:
- BaseAllocator &allocator_;
- OptionalAtomic<Page *> head_;
- OptionalAtomic<Page *> tail_;
- Page *read_page_; // only one thread is allow to reader this ByteStream
- OptionalAtomic<uint32_t> total_size_; // total size in byte
- uint32_t read_pos_; // current reader position
- uint32_t marked_read_pos_; // current reader position
- uint32_t page_size_;
- AllocModID mid_;
- Page wrapped_page_;
-};
-
-FORCE_INLINE int merge_byte_stream(ByteStream &sea, ByteStream &river,
- bool purge_river = false) {
- int ret = common::E_OK;
- ByteStream::BufferIterator buf_iter = river.init_buffer_iterator();
- while (true) {
- ByteStream::Buffer buf = buf_iter.get_next_buf();
- if (buf.buf_ == nullptr) {
- break;
- } else {
- if (RET_FAIL(sea.write_buf(buf.buf_, buf.len_))) {
- break;
- }
- }
- if (purge_river) {
- river.purge_prev_pages(1);
- }
- }
- return ret;
-}
-
-FORCE_INLINE int copy_bs_to_buf(ByteStream &bs, char *src_buf,
- uint32_t src_buf_len) {
- ByteStream::BufferIterator buf_iter = bs.init_buffer_iterator();
- uint32_t copyed_len = 0;
- while (true) {
- ByteStream::Buffer buf = buf_iter.get_next_buf();
- if (buf.buf_ == nullptr) {
- break;
- } else {
- if (src_buf_len - copyed_len < buf.len_) {
- return E_BUF_NOT_ENOUGH;
- }
- memcpy(src_buf + copyed_len, buf.buf_, buf.len_);
- copyed_len += buf.len_;
- }
- }
- return E_OK;
-}
-
-FORCE_INLINE uint32_t get_var_uint_size(
- uint32_t
- ui32) // return: the length of usigned number after varint encoding.
-{
- uint32_t bytes = 0;
- while ((ui32 & 0xFFFFFF80) != 0) {
- bytes++;
- ui32 = ui32 >> 7;
- }
- return ++bytes;
-}
-
-#if DEBUG_SE
-FORCE_INLINE void DEBUG_print_byte_stream(const char *print_tag,
- ByteStream &b) {
- const int32_t WRAP_COUNT = 16;
- int32_t print_char_count = 0;
- ByteStream::BufferIterator buf_iter = b.init_buffer_iterator();
- while (true) {
- ByteStream::Buffer buf = buf_iter.get_next_buf();
- if (buf.buf_ == nullptr) {
- break;
- } else {
- // print_hex(buf.buf_, buf.len_);
- printf("\n %s: buf.buf_=%p, buf.len_=%u\n", print_tag, buf.buf_,
- buf.len_);
- for (uint32_t i = 0; i < buf.len_; i++) {
- if (print_char_count++ % WRAP_COUNT == 0) {
- printf("\n %s offset=0x%05x : ", print_tag,
- print_char_count - 1);
- }
- printf("%02x ", (uint8_t)buf.buf_[i]);
- }
- }
- }
- printf("\n\n");
-}
-
-FORCE_INLINE void DEBUG_hex_dump_buf(const char *print_tag, const char *buf,
- int32_t len) {
- const int32_t WRAP_COUNT = 16;
- for (int i = 0; i < len; i++) {
- if (i % WRAP_COUNT == 0) {
- printf("\n%s", print_tag);
- }
- printf("%02x ", (uint8_t)(buf[i]));
- }
- printf("\n");
-}
-#endif // ifndef NDEBUG
-
-class SerializationUtil {
- public:
- FORCE_INLINE static int write_ui8(uint8_t ui8, ByteStream &out) {
- return out.write_buf(&ui8, 1);
- }
- FORCE_INLINE static int write_ui16(uint16_t ui16, ByteStream &out) {
- uint8_t buf[2];
- buf[0] = (uint8_t)((ui16 >> 8) & 0xFF);
- buf[1] = (uint8_t)((ui16)&0xFF);
- return out.write_buf(buf, 2);
- }
- FORCE_INLINE static int write_ui32(uint32_t ui32, ByteStream &out) {
- uint8_t buf[4];
- buf[0] = (uint8_t)((ui32 >> 24) & 0xFF);
- buf[1] = (uint8_t)((ui32 >> 16) & 0xFF);
- buf[2] = (uint8_t)((ui32 >> 8) & 0xFF);
- buf[3] = (uint8_t)((ui32)&0xFF);
- return out.write_buf(buf, 4);
- }
- FORCE_INLINE static int write_ui64(uint64_t ui64, ByteStream &out) {
- // big-endian: most signification byte at smaller address
- // refer to tsfile.utils.BytesUtil
- uint8_t buf[8];
- buf[0] = (uint8_t)((ui64 >> 56) & 0xFF);
- buf[1] = (uint8_t)((ui64 >> 48) & 0xFF);
- buf[2] = (uint8_t)((ui64 >> 40) & 0xFF);
- buf[3] = (uint8_t)((ui64 >> 32) & 0xFF);
- buf[4] = (uint8_t)((ui64 >> 24) & 0xFF);
- buf[5] = (uint8_t)((ui64 >> 16) & 0xFF);
- buf[6] = (uint8_t)((ui64 >> 8) & 0xFF);
- buf[7] = (uint8_t)((ui64)&0xFF);
- return out.write_buf(buf, 8);
- }
-
- FORCE_INLINE static int read_ui8(uint8_t &ui8, ByteStream &in) {
- int ret = common::E_OK;
- char buf[1];
- uint32_t read_len = 0;
- ret = in.read_buf(buf, 1, read_len);
- ui8 = (uint8_t)buf[0];
- return ret;
- }
- FORCE_INLINE static int read_ui16(uint16_t &ui16, ByteStream &in) {
- int ret = common::E_OK;
- uint8_t buf[2];
- uint32_t read_len = 0;
- if (RET_FAIL(in.read_buf(buf, 2, read_len))) {
- return ret;
- }
- ui16 = buf[0];
- ui16 = (ui16 << 8) | buf[1];
- return ret;
- }
- FORCE_INLINE static int read_ui32(uint32_t &ui32, ByteStream &in) {
- int ret = common::E_OK;
- uint8_t buf[4];
- uint32_t read_len = 0;
- if (RET_FAIL(in.read_buf(buf, 4, read_len))) {
- return ret;
- }
- ui32 = buf[0];
- ui32 = (ui32 << 8) | (buf[1] & 0xFF);
- ui32 = (ui32 << 8) | (buf[2] & 0xFF);
- ui32 = (ui32 << 8) | (buf[3] & 0xFF);
- return ret;
- }
- FORCE_INLINE static int read_ui64(uint64_t &ui64, ByteStream &in) {
- int ret = common::E_OK;
- uint8_t buf[8];
- uint32_t read_len = 0;
- if (RET_FAIL(in.read_buf(buf, 8, read_len))) {
- return ret;
- }
- ui64 = buf[0];
- ui64 = (ui64 << 8) | (buf[1] & 0xFF);
- ui64 = (ui64 << 8) | (buf[2] & 0xFF);
- ui64 = (ui64 << 8) | (buf[3] & 0xFF);
- ui64 = (ui64 << 8) | (buf[4] & 0xFF);
- ui64 = (ui64 << 8) | (buf[5] & 0xFF);
- ui64 = (ui64 << 8) | (buf[6] & 0xFF);
- ui64 = (ui64 << 8) | (buf[7] & 0xFF);
- return ret;
- }
- // caller guarantee buffer has at least 1 byte
- FORCE_INLINE static uint8_t read_ui8(char *buffer) {
- return *(uint8_t *)buffer;
- }
-
- // caller guarantee buffer has at least 2 bytes
- FORCE_INLINE static uint16_t read_ui16(char *buffer) {
- uint8_t *buf = (uint8_t *)buffer;
- uint16_t ui16 = buf[0];
- ui16 = (ui16 << 8) | (buf[1] & 0xFF);
- return ui16;
- }
- // caller guarantee buffer has at least 4 bytes
- FORCE_INLINE static uint32_t read_ui32(char *buffer) {
- uint8_t *buf = (uint8_t *)buffer;
- uint32_t ui32 = buf[0];
- ui32 = (ui32 << 8) | (buf[1] & 0xFF);
- ui32 = (ui32 << 8) | (buf[2] & 0xFF);
- ui32 = (ui32 << 8) | (buf[3] & 0xFF);
- return ui32;
- }
- // caller guarantee buffer has at least 8 bytes
- FORCE_INLINE static uint64_t read_ui64(char *buffer) {
- uint8_t *buf = (uint8_t *)buffer;
- uint64_t ui64 = buf[0];
- ui64 = (ui64 << 8) | (buf[1] & 0xFF);
- ui64 = (ui64 << 8) | (buf[2] & 0xFF);
- ui64 = (ui64 << 8) | (buf[3] & 0xFF);
- ui64 = (ui64 << 8) | (buf[4] & 0xFF);
- ui64 = (ui64 << 8) | (buf[5] & 0xFF);
- ui64 = (ui64 << 8) | (buf[6] & 0xFF);
- ui64 = (ui64 << 8) | (buf[7] & 0xFF);
- return ui64;
- }
-
- FORCE_INLINE static int write_float(float f, ByteStream &out) {
- uint8_t bytes[4];
- float_to_bytes(f, bytes);
- return out.write_buf(bytes, 4);
- }
- FORCE_INLINE static int read_float(float &f, ByteStream &in) {
- int ret = common::E_OK;
- uint8_t bytes[4];
- uint32_t read_len = 0;
- if (RET_FAIL(in.read_buf(bytes, 4, read_len))) {
- } else if (read_len != 4) {
- ret = common::E_BUF_NOT_ENOUGH;
- } else {
- f = bytes_to_float(bytes);
- }
- return ret;
- }
- FORCE_INLINE static float read_float(char *buffer) {
- uint8_t *buf = (uint8_t *)buffer;
- return bytes_to_float(buf);
- }
- FORCE_INLINE static int write_double(double d, ByteStream &out) {
- uint8_t bytes[8];
- double_to_bytes(d, bytes);
- return out.write_buf(bytes, 8);
- }
- FORCE_INLINE static int read_double(double &d, ByteStream &in) {
- int ret = common::E_OK;
- uint32_t read_len = 0;
- uint8_t bytes[8];
- if (RET_FAIL(in.read_buf(bytes, 8, read_len))) {
- } else if (read_len != 8) {
- ret = common::E_BUF_NOT_ENOUGH;
- } else {
- d = bytes_to_double(bytes);
- }
- return ret;
- }
- FORCE_INLINE static double read_double(char *buffer) {
- uint8_t *buf = (uint8_t *)buffer;
- return bytes_to_double(buf);
- }
-
- FORCE_INLINE static int write_i8(int8_t i8, ByteStream &out) {
- return write_ui8((uint8_t)i8, out);
- }
- FORCE_INLINE static int write_i16(int16_t i16, ByteStream &out) {
- return write_ui16((uint16_t)i16, out);
- }
- FORCE_INLINE static int write_i32(int32_t i32, ByteStream &out) {
- return write_ui32((uint32_t)i32, out);
- }
- FORCE_INLINE static int write_i64(int64_t i64, ByteStream &out) {
- return write_ui64((uint64_t)i64, out);
- }
-
- FORCE_INLINE static int read_i8(int8_t &i8, ByteStream &in) {
- return read_ui8((uint8_t &)i8, in);
- }
- FORCE_INLINE static int read_i16(int16_t &i16, ByteStream &in) {
- return read_ui16((uint16_t &)i16, in);
- }
- FORCE_INLINE static int read_i32(int32_t &i32, ByteStream &in) {
- return read_ui32((uint32_t &)i32, in);
- }
- FORCE_INLINE static int read_i64(int64_t &i64, ByteStream &in) {
- return read_ui64((uint64_t &)i64, in);
- }
-
- // TODO more test on var_xxx
- FORCE_INLINE static int do_write_var_uint(uint32_t ui32, ByteStream &out) {
- int ret = common::E_OK;
- while ((ui32 & 0xFFFFFF80) != 0) {
- if (RET_FAIL(write_ui8((ui32 & 0x7F) | 0x80, out))) {
- return ret;
- }
- ui32 = ui32 >> 7;
- }
- return write_ui8(ui32 & 0x7F, out);
- }
- FORCE_INLINE static int do_write_var_uint(uint32_t ui32, char *out_buf,
- const uint32_t out_buf_len) {
- uint32_t offset = 0;
- while ((ui32 & 0xFFFFFF80) != 0) {
- if (offset >= out_buf_len) {
- return common::E_BUF_NOT_ENOUGH;
- }
- *(out_buf + offset) = (ui32 & 0x7F) | 0x80;
- ui32 = ui32 >> 7;
- offset++;
- }
- if (offset >= out_buf_len) {
- return common::E_BUF_NOT_ENOUGH;
- }
- *(out_buf + offset) = (ui32 & 0x7F);
- return common::E_OK;
- }
- FORCE_INLINE static int do_read_var_uint(uint32_t &ui32, ByteStream &in) {
- // Follow readUnsignedVarInt in ReadWriteForEncodingUtils.java
- int ret = common::E_OK;
- ui32 = 0;
- int i = 0;
- uint8_t ui8 = 0;
- if (RET_FAIL(read_ui8(ui8, in))) {
- return ret;
- }
- while (ui8 != 0xF && (ui8 & 0x80) != 0) {
- ui32 = ui32 | ((ui8 & 0x7F) << i);
- i = i + 7;
- if (RET_FAIL(read_ui8(ui8, in))) {
- return ret;
- }
- }
- ui32 = ui32 | (ui8 << i);
- return ret;
- }
- FORCE_INLINE static int do_read_var_uint(uint32_t &ui32, char *in_buf,
- int in_buf_len, int *ret_offset) {
- ui32 = 0;
- int i = 0;
- uint8_t ui8 = 0;
- int offset = 0;
- if (offset < in_buf_len) {
- ui8 = *(uint8_t *)(in_buf + offset);
- offset++;
- } else {
- return common::E_BUF_NOT_ENOUGH;
- }
- while (ui8 != 0xF && (ui8 & 0x80) != 0) {
- ui32 = ui32 | ((ui8 & 0x7F) << i);
- i = i + 7;
- if (offset < in_buf_len) {
- ui8 = *(uint8_t *)(in_buf + offset);
- offset++;
- } else {
- return common::E_BUF_NOT_ENOUGH;
- }
- }
- ui32 = ui32 | (ui8 << i);
- if (ret_offset != nullptr) {
- *ret_offset = offset;
- }
- return common::E_OK;
- }
- FORCE_INLINE static int write_var_int(int32_t i32, ByteStream &out) {
- // TODO 8byte to 4byte.
- // but in IoTDB java, it has only write_var_uint(i32)
- i32 = i32 << 1;
- return do_write_var_uint((uint32_t)i32, out);
- }
- FORCE_INLINE static int read_var_int(int32_t &i32, ByteStream &in) {
- int ret = common::E_OK;
- uint32_t ui32;
- if (RET_FAIL(do_read_var_uint(ui32, in))) {
- } else {
- i32 = (int32_t)(ui32 >> 1);
- }
- return ret;
- }
- FORCE_INLINE static int write_var_uint(uint32_t ui32, ByteStream &out) {
- return do_write_var_uint(ui32, out);
- }
- FORCE_INLINE static int write_var_uint(uint32_t ui32, char *out_buf,
- const uint32_t out_buf_len) {
- return do_write_var_uint(ui32, out_buf, out_buf_len);
- }
- FORCE_INLINE static int read_var_uint(uint32_t &ui32, ByteStream &in) {
- return do_read_var_uint(ui32, in);
- }
- FORCE_INLINE static int read_var_uint(uint32_t &ui32, char *in_buf,
- int in_buf_len,
- int *ret_offset = nullptr) {
- return do_read_var_uint(ui32, in_buf, in_buf_len, ret_offset);
- }
-
- FORCE_INLINE static int write_str(const std::string &str, ByteStream &out) {
- int ret = common::E_OK;
- if (RET_FAIL(write_var_int(((int32_t)str.size()), out))) {
- } else if (RET_FAIL(out.write_buf(str.c_str(), str.size()))) {
- }
- return ret;
- }
- FORCE_INLINE static int read_str(std::string &str, ByteStream &in) {
- int ret = common::E_OK;
- int32_t len = 0;
- int32_t read_len = 0;
- if (RET_FAIL(read_var_int(len, in))) {
- } else {
- char *tmp_buf = (char *)malloc(len + 1);
- tmp_buf[len] = '\0';
- if (RET_FAIL(in.read_buf(tmp_buf, len, read_len))) {
- } else if (len != read_len) {
- ret = E_BUF_NOT_ENOUGH;
- } else {
- str = std::string(tmp_buf);
- }
- free(tmp_buf);
- }
- return ret;
- }
- FORCE_INLINE static int write_mystring(const String &str, ByteStream &out) {
- int ret = common::E_OK;
- if (RET_FAIL(write_var_int(str.len_, out))) {
- } else if (RET_FAIL(out.write_buf(str.buf_, str.len_))) {
- }
- return ret;
- }
- FORCE_INLINE static int read_mystring(String &str, common::PageArena *pa,
- ByteStream &in) {
- int ret = common::E_OK;
- int32_t len = 0;
- int32_t read_len = 0;
- if (RET_FAIL(read_var_int(len, in))) {
- } else {
- char *buf = (char *)pa->alloc(len);
- if (IS_NULL(buf)) {
- ret = common::E_OOM;
- } else {
- if (RET_FAIL(in.read_buf(buf, len, read_len))) {
- } else if (len != read_len) {
- ret = E_BUF_NOT_ENOUGH;
- } else {
- str.buf_ = buf;
- str.len_ = len;
- }
- }
- }
- return ret;
- }
- FORCE_INLINE static int write_char(char ch, ByteStream &out) {
- return write_ui8(ch, out);
- }
- FORCE_INLINE static int read_char(char &ch, ByteStream &in) {
- return read_ui8((uint8_t &)ch, in);
- }
-};
-
-FORCE_INLINE bool deserialize_buf_not_enough(int ret) {
- return ret == E_OUT_OF_RANGE || ret == E_PARTIAL_READ;
-}
-FORCE_INLINE char *get_bytes_from_bytestream(ByteStream &bs) {
- if (bs.total_size() == 0) {
- return nullptr;
- }
- uint32_t size = bs.total_size();
- char *ret_buf = (char *)malloc(size);
- if (ret_buf == nullptr) {
- return nullptr;
- }
-
- ByteStream::BufferIterator buf_iter = bs.init_buffer_iterator();
- uint32_t offset = 0;
- while (true) {
- ByteStream::Buffer buf = buf_iter.get_next_buf();
- if (buf.buf_ == nullptr) {
- break;
- } else {
- assert(offset + buf.len_ <= size);
- memcpy(ret_buf + offset, buf.buf_, buf.len_);
- offset += buf.len_;
- }
- }
- assert(offset == size);
- return ret_buf;
-}
-
-} // end namespace common
-#endif // COMMON_ALLOCATOR_BYTE_STREAM_H
diff --git a/cpp/src/common/allocator/mem_alloc.cc b/cpp/src/common/allocator/mem_alloc.cc
deleted file mode 100644
index a1e16d9bd..000000000
--- a/cpp/src/common/allocator/mem_alloc.cc
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef _WIN32
-#include <execinfo.h>
-#endif
-#include <string.h>
-
-#include <iostream>
-
-#include "alloc_base.h"
-#include "common/logger/elog.h"
-#include "stdio.h"
-#include "stdlib.h"
-#include "utils/util_define.h"
-
-namespace common {
-
-const char *g_mod_names[__LAST_MOD_ID] = {
- /* 0 */ "DEFAULT",
- /* 1 */ "MEMTABLE",
- /* 2 */ "SCHEMA",
- /* 3 */ "SQL",
- /* 4 */ "NET",
- /* 5 */ "NET_DATA",
- /* 6 */ "TVLIST_DATA",
- /* 7 */ "TVLIST_OBJ",
- /* 8 */ "TSBLOCK",
- /* 9 */ "CONTAINER",
- /* 10 */ "TSSTORE_OBJ",
- /* 11 */ "FLUSH_TASK_OBJ",
- /* 12 */ "PAGE_WRITER_OUTPUT_STREAM",
- /* 13 */ "CW_PAGES_DATA",
- /* 14 */ "CHUNK_WRITER_OBJ",
- /* 15 */ "STATISTIC_OBJ",
- /* 16 */ "ENCODER_OBJ",
- /* 17 */ "DECODER_OBJ",
- /* 18 */ "TSFILE_WRITER_META",
- /* 19 */ "TSFILE_WRITE_STREAM",
- /* 20 */ "TIMESERIES_INDEX_OBJ",
- /* 21 */ "BLOOM_FILTER",
- /* 22 */ "OPEN_FILE_OBJ",
- /* 23 */ "TSFILE_READER",
- /* 24 */ "CHUNK_READER",
- /* 25 */ "COMPRESSOR_OBJ",
- /* 26 */ "ARRAY",
- /* 27 */ "HASH_TABLE",
-};
-
-const uint32_t HEADER_SIZE_4B = 4;
-const uint32_t HEADER_SIZE_8B = 8;
-
-void *mem_alloc(uint32_t size, AllocModID mid) {
- // use 7bit at most
- ASSERT(mid <= 127);
-
- if (size <= 0xFFFFFF) {
- // use 3B size + 1B mod
- char *p = (char *)malloc(size + HEADER_SIZE_4B);
- if (UNLIKELY(p == nullptr)) {
- return nullptr;
- } else {
- uint32_t header = (size << 8) | ((uint32_t)mid);
- *((uint32_t *)p) = header;
- ModStat::get_instance().update_alloc(mid, size);
- // cppcheck-suppress memleak
- // cppcheck-suppress unmatchedSuppression
- return p + HEADER_SIZE_4B;
- }
- } else {
- char *p = (char *)malloc(size + HEADER_SIZE_8B);
- if (UNLIKELY(p == nullptr)) {
- std::cout << "alloc big filed for size " << size + HEADER_SIZE_4B
- << std::endl;
- return nullptr;
- } else {
- uint64_t large_size = size;
- uint64_t header = ((large_size) << 8) | (((uint32_t)mid) | (0x80));
- uint32_t low4b = (uint32_t)(header & 0xFFFFFFFF);
- uint32_t high4b = (uint32_t)(header >> 32);
- *(uint32_t *)p = high4b;
- *(uint32_t *)(p + 4) = low4b;
- ModStat::get_instance().update_alloc(mid, size);
- // cppcheck-suppress unmatchedSuppression
- // cppcheck-suppress memleak
- return p + HEADER_SIZE_8B;
- }
- }
-}
-
-#ifndef _WIN32
-void printCallers() {
- int layers = 0, i = 0;
- char **symbols = NULL;
-
- const int64_t MAX_FRAMES = 32;
-
- void *frames[MAX_FRAMES];
- memset(frames, 0, sizeof(frames));
- layers = backtrace(frames, MAX_FRAMES);
- for (i = 0; i < layers; i++) {
- printf("Layer %d: %p\n", i, frames[i]);
- }
- printf("------------------\n");
-
- symbols = backtrace_symbols(frames, layers);
- if (symbols) {
- for (i = 0; i < layers; i++) {
- printf("SYMBOL layer %d: %s\n", i, symbols[i]);
- }
- free(symbols);
- } else {
- printf("Failed to parse function names\n");
- }
-}
-#endif
-
-void mem_free(void *ptr) {
- // try as 4Byte header
- char *p = (char *)ptr;
- uint32_t header = *(uint32_t *)(p - HEADER_SIZE_4B);
- if ((header & 0x80) == 0) {
- // 4Byte header
- uint32_t size = header >> 8;
- AllocModID mid = (AllocModID)(header & 0x7F);
- ModStat::get_instance().update_free(mid, size);
- ::free(p - HEADER_SIZE_4B);
- } else {
- // 8Byte header
- uint64_t header8b = ((uint64_t)(*(uint32_t *)(p - 4))) |
- ((uint64_t)(*(uint32_t *)(p - 8)) << 32);
- AllocModID mid = (AllocModID)(header8b & 0x7F);
- uint32_t size = (uint32_t)(header8b >> 8);
- ModStat::get_instance().update_free(mid, size);
- ::free(p - HEADER_SIZE_8B);
- }
-}
-
-void *mem_realloc(void *ptr, uint32_t size) {
- AllocModID mid_org;
- uint32_t size_org;
- char *p = (char *)ptr;
- uint32_t header_org =
- *(uint32_t *)(p - HEADER_SIZE_4B); // try as 4Byte header
- if ((header_org & 0x80) == 0) {
- // header_org is 4byte
- size_org = header_org >> 8;
- mid_org = (AllocModID)(header_org & 0x7F);
- if (size <= 0xFFFFFF) {
- p = (char *)realloc(p - HEADER_SIZE_4B, size + HEADER_SIZE_4B);
- if (UNLIKELY(p == nullptr)) {
- return nullptr;
- } else {
- uint32_t header =
- (size << 8) | ((uint32_t)mid_org); // size changed
- *((uint32_t *)p) = header;
- ModStat::get_instance().update_alloc(
- mid_org, int32_t(size) - int32_t(size_org));
- return p + HEADER_SIZE_4B;
- }
- } else { // size > 0xFFFFFF, realloc(os_p, size + header_len)
- p = (char *)realloc(p - HEADER_SIZE_4B, size + HEADER_SIZE_8B);
- if (UNLIKELY(p == nullptr)) {
- return nullptr;
- } else {
- std::memmove(p + HEADER_SIZE_8B, p + HEADER_SIZE_4B, size_org);
- // reconstruct 8-byte header
- uint64_t large_size = size;
- uint64_t header =
- ((large_size) << 8) | (((uint32_t)mid_org) | (0x80));
- uint32_t low4b = (uint32_t)(header & 0xFFFFFFFF);
- uint32_t high4b = (uint32_t)(header >> 32);
- *(uint32_t *)p = high4b;
- *(uint32_t *)(p + 4) = low4b;
- ModStat::get_instance().update_alloc(
- mid_org, int32_t(size) - int32_t(size_org));
- return p + HEADER_SIZE_8B;
- }
- }
- } else { // header_org is 8byte
- uint64_t header =
- ((uint64_t)(*(uint32_t *)(p - 4))) |
- ((uint64_t)(*(uint32_t *)(p - 8)) << 32); // 8Byte header
- mid_org = (AllocModID)(header & 0x7F);
- size_org = (uint32_t)(header >> 8);
- if (size <= 0xFFFFFF) {
- uint32_t save_data =
- *(uint32_t *)(p - HEADER_SIZE_8B + HEADER_SIZE_4B + size);
- p = (char *)realloc(p - HEADER_SIZE_8B, size + HEADER_SIZE_4B);
- if (UNLIKELY(p == nullptr)) {
- return nullptr;
- } else {
- std::memmove(p + HEADER_SIZE_4B, p + HEADER_SIZE_8B,
- size - HEADER_SIZE_4B);
- // reconstruct 4-byte header
- uint32_t header4b = (size << 8) | (((uint32_t)mid_org));
- *((uint32_t *)p) = header4b;
- // reconstruct data
- *(uint32_t *)((char *)p + size - 4) = save_data;
- ModStat::get_instance().update_alloc(
- mid_org, int32_t(size) - int32_t(size_org));
- return p + HEADER_SIZE_4B;
- }
- } else {
- p = (char *)realloc(p - HEADER_SIZE_8B, size + HEADER_SIZE_8B);
- if (UNLIKELY(p == nullptr)) {
- return nullptr;
- } else {
- uint64_t large_size = size;
- uint64_t header8b =
- ((large_size) << 8) | (((uint32_t)mid_org) | (0x80));
- uint32_t low4b = (uint32_t)(header8b & 0xFFFFFFFF);
- uint32_t high4b = (uint32_t)(header8b >> 32);
- *(uint32_t *)p = high4b;
- *(uint32_t *)(p + 4) = low4b;
- ModStat::get_instance().update_alloc(
- mid_org, int32_t(size) - int32_t(size_org));
- return p + HEADER_SIZE_8B;
- }
- }
- }
-}
-
-void ModStat::init() {
- stat_arr_ = (int32_t *)(::malloc(ITEM_SIZE * ITEM_COUNT));
- for (int8_t i = 0; i < __LAST_MOD_ID; i++) {
- int32_t *item = get_item(i);
- *item = 0;
- }
-}
-
-void ModStat::destroy() { ::free(stat_arr_); }
-
-// TODO return to SQL
-void ModStat::print_stat() {
- //
-}
-
-BaseAllocator g_base_allocator;
-
-} // end namespace common
\ No newline at end of file
diff --git a/cpp/src/common/allocator/my_string.h b/cpp/src/common/allocator/my_string.h
deleted file mode 100644
index ad8bee710..000000000
--- a/cpp/src/common/allocator/my_string.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_ALLOCATOR_MY_STRING_H
-#define COMMON_ALLOCATOR_MY_STRING_H
-
-#include <string.h>
-
-#include <iostream>
-
-#include "common/allocator/page_arena.h"
-#include "utils/errno_define.h"
-
-namespace common {
-
-// String that use PageArena
-struct String {
- char *buf_;
- uint32_t len_;
-
- String() : buf_(nullptr), len_(0) {}
- String(char *buf, uint32_t len) : buf_(buf), len_(len) {}
- FORCE_INLINE bool is_null() const { return buf_ == nullptr && len_ == 0; }
- FORCE_INLINE void reset() {
- len_ = 0;
- buf_ = nullptr;
- }
- FORCE_INLINE int dup_from(const std::string &str, common::PageArena &pa) {
- len_ = str.size();
- if (UNLIKELY(len_ == 0)) {
- return common::E_OK;
- }
- buf_ = pa.alloc(len_);
- if (IS_NULL(buf_)) {
- return common::E_OOM;
- }
- memcpy(buf_, str.c_str(), len_);
- return common::E_OK;
- }
-
- FORCE_INLINE bool operator==(const String &other) const {
- return equal_to(other);
- }
-
- FORCE_INLINE int dup_from(const String &str, common::PageArena &pa) {
- len_ = str.len_;
- if (UNLIKELY(len_ == 0)) {
- return common::E_OK;
- }
- buf_ = pa.alloc(len_);
- if (IS_NULL(buf_)) {
- return common::E_OOM;
- }
- memcpy(buf_, str.buf_, len_);
- return common::E_OK;
- }
- FORCE_INLINE int build_from(const String &s1, const String &s2,
- common::PageArena &pa) {
- len_ = s1.len_ + s2.len_;
- buf_ = pa.alloc(len_);
- if (IS_NULL(buf_)) {
- return common::E_OOM;
- }
- memcpy(buf_, s1.buf_, s1.len_);
- memcpy(buf_ + s1.len_, s2.buf_, s2.len_);
- return common::E_OK;
- }
- FORCE_INLINE void shallow_copy_from(const String &src) {
- buf_ = src.buf_;
- len_ = src.len_;
- }
- FORCE_INLINE bool equal_to(const String &that) const {
- return (len_ == 0 && that.len_ == 0) ||
- ((len_ == that.len_) && (0 == memcmp(buf_, that.buf_, len_)));
- }
-
- // FORCE_INLINE bool equal_to(const std::string &that)
- // {
- // return (len_ == 0 && that.size() == 0)
- // || ((len_ == that.len_) && (0 == memcmp(buf_, that.c_str(),
- // len_)));
- // }
-
- // strict less than. If @this equals to @that, return false.
- FORCE_INLINE bool less_than(const String &that) const {
- if (len_ == 0 || that.len_ == 0) {
- return false;
- }
- uint32_t min_len = std::min(len_, that.len_);
- int cmp_res = memcmp(buf_, that.buf_, min_len);
- if (cmp_res < 0) {
- return true;
- } else if (cmp_res > 0) {
- return false;
- } else {
- return len_ < that.len_;
- }
- }
-
- // return = 0, if this = that
- // return < 0, if this < that
- // return > 0, if this > that
- FORCE_INLINE int compare(const String &that) const {
- if (len_ == 0 || that.len_ == 0) {
- return 0;
- }
- uint32_t min_len = std::min(len_, that.len_);
- int cmp_res = memcmp(buf_, that.buf_, min_len);
- if (cmp_res == 0) {
- return len_ - that.len_;
- } else {
- return cmp_res;
- }
- }
-
- FORCE_INLINE void max(const String &that, common::PageArena &pa) {
- if (compare(that) < 0) {
- this->dup_from(that, pa);
- }
- }
-
- FORCE_INLINE void min(const String &that, common::PageArena &pa) {
- if (compare(that) > 0) {
- this->dup_from(that, pa);
- }
- }
-
- bool operator<(const String &other) const {
- if (this->is_null() && other.is_null()) {
- return false;
- }
- if (this->is_null()) {
- return true;
- }
- if (other.is_null()) {
- return false;
- }
-
- int min_len = std::min(this->len_, other.len_);
- int cmp = std::memcmp(this->buf_, other.buf_, min_len);
- if (cmp != 0) {
- return cmp < 0;
- }
-
- return this->len_ < other.len_;
- }
- std::string to_std_string() const { return std::string(buf_, len_); }
-
-#ifndef NDEBUG
- friend std::ostream &operator<<(std::ostream &os, const String &s) {
- os << s.len_ << "@";
- for (uint32_t i = 0; i < s.len_; i++) {
- os << s.buf_[i];
- }
- return os;
- }
-#endif // ifndef NDEBUG
-};
-
-struct StringLessThan {
- FORCE_INLINE bool operator()(const String &s1, const String &s2) const {
- return s1.less_than(s2);
- }
-};
-
-} // end namespace common
-#endif // COMMON_ALLOCATOR_MY_STRING_H
diff --git a/cpp/src/common/allocator/object_pool.h b/cpp/src/common/allocator/object_pool.h
deleted file mode 100644
index 721823a21..000000000
--- a/cpp/src/common/allocator/object_pool.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef COMMON_ALLOCTOR_OBJECT_POOL_H
-#define COMMON_ALLOCTOR_OBJECT_POOL_H
-
-#include "common/allocator/alloc_base.h"
-#include "common/mutex/mutex.h"
-
-namespace common {
-
-template <class T>
-class ObjectPool {
- private:
- struct ObjectPoolNode {
- T data_;
- ObjectPoolNode *next_;
-
- ObjectPoolNode() : data_(), next_(nullptr) {}
- };
-
- public:
- /*
- * max_cache_count is a soft limitation:
- */
- ObjectPool(const uint32_t max_cache_count, const AllocModID mid,
- BaseAllocator &allocator = g_base_allocator)
- : max_cache_count_(max_cache_count),
- cur_alloc_count_(0),
- mid_(mid),
- allocator_(allocator),
- mutex_(),
- head_(nullptr) {
- assert(max_cache_count > 1);
- }
-
- ~ObjectPool() { destroy(); }
-
- void destroy() {
- ObjectPoolNode *cur = head_;
- while (cur) {
- head_ = cur->next_;
- allocator_.free(cur);
- cur = head_;
- cur_alloc_count_--;
- }
- ASSERT(cur_alloc_count_ == 0);
- }
-
- T *alloc() {
- T *ret_obj = nullptr;
- common::MutexGuard g(mutex_);
- if (head_) {
- ret_obj = &(head_->data_);
- head_ = head_->next_;
- return ret_obj;
- } else {
- void *buf = allocator_.alloc(sizeof(ObjectPoolNode), mid_);
- if (UNLIKELY(buf == nullptr)) {
- return nullptr;
- }
- cur_alloc_count_++;
- ret_obj = &(new (buf) ObjectPoolNode)->data_;
- return ret_obj;
- }
- }
-
- void free(T *obj) {
- ASSERT(obj != nullptr);
- common::MutexGuard g(mutex_);
- if (cur_alloc_count_ > max_cache_count_) {
- allocator_.free(obj);
- cur_alloc_count_--;
- ASSERT(cur_alloc_count_ >= 0);
- } else {
- ObjectPoolNode *n = (ObjectPoolNode *)obj;
- n->next_ = head_;
- head_ = n;
- }
- }
-
- uint32_t get_cur_alloc_count() const { return cur_alloc_count_; }
-
- private:
- uint32_t max_cache_count_;
- uint32_t cur_alloc_count_;
- AllocModID mid_;
- BaseAllocator allocator_;
- common::Mutex mutex_;
- ObjectPoolNode *head_; // freelist head
-};
-
-} // namespace common
-#endif // COMMON_ALLOCTOR_OBJECT_POOL_H
diff --git a/cpp/src/common/allocator/page_arena.cc b/cpp/src/common/allocator/page_arena.cc
deleted file mode 100644
index 731b0b0ba..000000000
--- a/cpp/src/common/allocator/page_arena.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-#include "page_arena.h"
-
-#include <stdio.h>
-
-#include <new>
-
-namespace common {
-
-char *PageArena::alloc(uint32_t size) {
- if (LIKELY(size <= page_size_)) {
- Page *cur_page = dummy_head_.next_;
- if (LIKELY(cur_page != nullptr)) {
- char *ret_ptr = cur_page->alloc(size);
- if (LIKELY(ret_ptr != nullptr)) {
- return ret_ptr;
- }
- }
-
- /*
- * cur_page is null OR can not alloc @size from cur_page,
- * then alloc new page
- */
- void *ptr = base_allocator_.alloc(page_size_ + sizeof(Page), mid_);
- if (UNLIKELY(ptr == nullptr)) {
- return nullptr;
- }
- Page *new_page = new (ptr) Page(page_size_, cur_page);
- dummy_head_.next_ = new_page;
- return new_page->alloc(size);
- } else {
- void *ptr = base_allocator_.alloc(size + sizeof(Page), mid_);
- Page *new_page = new (ptr) Page(dummy_head_.next_);
- dummy_head_.next_ = new_page;
- return reinterpret_cast<char *>(new_page) + sizeof(Page);
- }
-}
-
-void PageArena::reset() {
- Page *p = dummy_head_.next_;
- while (p) {
- dummy_head_.next_ = p->next_;
- base_allocator_.free(p);
- p = dummy_head_.next_;
- }
-}
-
-} // end namespace common
\ No newline at end of file
diff --git a/cpp/src/common/allocator/page_arena.h b/cpp/src/common/allocator/page_arena.h
deleted file mode 100644
index b8053cfb6..000000000
--- a/cpp/src/common/allocator/page_arena.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef COMMON_ALLOCATOR_PAGE_ARENA_H
-#define COMMON_ALLOCATOR_PAGE_ARENA_H
-
-#include "alloc_base.h"
-
-namespace common {
-
-/*
- * Not Thread Safe
- */
-class PageArena {
- public:
- explicit PageArena(BaseAllocator &base_allocator = g_base_allocator)
- : page_size_(0),
- mid_(__FIRST_MOD_ID),
- base_allocator_(base_allocator),
- dummy_head_() {}
- ~PageArena() { destroy(); }
- void init(uint32_t page_size, AllocModID mid) {
- page_size_ = page_size;
- mid_ = mid;
- }
-
- char *alloc(uint32_t size);
- FORCE_INLINE void destroy() { reset(); }
- void reset();
-
-#ifdef ENABLE_TEST
- int TEST_get_page_count() const {
- int count = 0;
- Page *p = dummy_head_.next_;
- while (p) {
- p = p->next_;
- count++;
- }
- return count;
- }
-#endif
-
- private:
- class Page {
- public:
- Page() : next_(nullptr), page_end_(nullptr), cur_alloc_(nullptr) {}
- explicit Page(Page *next_page)
- : next_(next_page), page_end_(nullptr), cur_alloc_(nullptr) {}
- Page(uint32_t page_size, Page *next_page) {
- next_ = next_page;
- cur_alloc_ =
- (char *)this + sizeof(Page); // equals to (char*)(this+1)
- page_end_ = cur_alloc_ + page_size;
- }
- INLINE char *alloc(uint32_t size) {
- if (cur_alloc_ + size > page_end_) {
- return nullptr;
- } else {
- char *ret = cur_alloc_;
- cur_alloc_ += size;
- return ret;
- // char *ret = cur_alloc_;
- // cur_alloc_ += size;
- // int address = reinterpret_cast<uintptr_t>(cur_alloc_);
- // int new_addr = (address + 3) & (~3);
- // cur_alloc_ = reinterpret_cast<char *>(new_addr);
- // return ret;
- }
- }
-
- public:
- Page *next_;
- char *page_end_;
- char *cur_alloc_; // buf_'s current offset
- };
-
- private:
- uint32_t page_size_;
- AllocModID mid_;
- BaseAllocator &base_allocator_;
- Page dummy_head_;
-};
-
-} // end namespace common
-#endif // COMMON_ALLOCATOR_PAGE_ARENA_H
diff --git a/cpp/src/common/allocator/stl_allocator.h b/cpp/src/common/allocator/stl_allocator.h
deleted file mode 100644
index e85839850..000000000
--- a/cpp/src/common/allocator/stl_allocator.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef COMMON_ALLOCATOR_STL_ALLOCATOR_H
-#define COMMON_ALLOCATOR_STL_ALLOCATOR_H
-
-#include "alloc_base.h"
-
-namespace common {
-
-template <class T, AllocModID Mid, class TAllocator = BaseAllocator>
-class StlAllocator {
- public:
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef T *pointer;
- typedef const T *const_pointer;
- typedef T &reference;
- typedef const T &const_reference;
- typedef T value_type;
-
- /*
- * rebind provides a way to obtain an allocator for a different type.
- * For example, std::list will alloc object Node<T> beside alloc object T.
- */
- template <class U>
- struct rebind {
- typedef StlAllocator<U, Mid, TAllocator> other;
- };
-
- StlAllocator() {}
- StlAllocator(const StlAllocator &) {}
-
- template <class T2, AllocModID Mid2>
- StlAllocator(const StlAllocator<T2, Mid2, TAllocator> &) {}
-
- StlAllocator(TAllocator base_allocator) : base_allocator_(base_allocator) {}
-
- pointer address(reference x) const { return &x; }
- const_pointer address(const_reference x) { return &x; }
-
- pointer allocate(size_type n, const void *hint = 0) {
- return (pointer)base_allocator_.alloc(n * sizeof(T), Mid);
- };
- void deallocate(void *p, size_type) { base_allocator_.free(p); }
- size_type max_size() const { return uint32_t(-1); }
-
- void construct(pointer p, const T &val) { new ((T *)p) T(val); }
- void destroy(pointer p) { p->~T(); }
-
- private:
- TAllocator base_allocator_;
-};
-
-/*
- * According to the manual, allocator is stateless.
- * Although we define a base_allocator_ here, but base_allocator_ is also
- * stateless. so '==' is always true and '!=' is always false. refer to
- * https://en.cppreference.com/w/cpp/memory/allocator/operator_cmp.
- */
-template <class T1, AllocModID Mid1, class T2, AllocModID Mid2>
-bool operator==(const StlAllocator<T1, Mid1> &a1,
- const StlAllocator<T2, Mid2> &a2) {
- return true;
-}
-
-template <class T1, AllocModID Mid1, class T2, AllocModID Mid2>
-bool operator!=(const StlAllocator<T1, Mid1> &a1,
- const StlAllocator<T2, Mid2> &a2) {
- return false;
-}
-
-} // end namespace common
-#endif // COMMON_ALLOCATOR_STL_ALLOCATOR_H
diff --git a/cpp/src/common/allocator/util_define.h b/cpp/src/common/allocator/util_define.h
deleted file mode 100644
index 0526c08b0..000000000
--- a/cpp/src/common/allocator/util_define.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * This file defines some basic macros
- */
-
-#ifndef COMMON_UTIL_DEFINE_H
-#define COMMON_UTIL_DEFINE_H
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-/* ======== cmake config define ======== */
-
-/* ======== unsued ======== */
-#define UNUSED(v) ((void)(v))
-
-/* ======== inline ======== */
-#ifdef __GNUC__
-#define FORCE_INLINE inline __attribute__((always_inline))
-#else
-#define FORCE_INLINE inline
-#endif // __GNUC__
-
-#ifdef BUILD_FOR_SMALL_BINARY
-#define INLINE FORCE_INLINE
-#else
-#define INLINE
-#endif // BUILD_FOR_SMALL_BINARY
-
-/* ======== likely ======== */
-#if defined(__GNUC__) && __GNUC__ >= 4
-#define LIKELY(x) (__builtin_expect((x), 1))
-#define UNLIKELY(x) (__builtin_expect((x), 0))
-#else
-#define LIKELY(x) (x)
-#define UNLIKELY(x) (x)
-#endif // __GNUC__ >= 4
-
-/* ======== nullptr ======== */
-#if __cplusplus < 201103L
-#ifndef nullptr
-#define nullptr NULL
-#endif
-#define OVERRIDE
-#else
-#define OVERRIDE override
-#endif // __cplusplus < 201103L
-
-/* ======== cache line ======== */
-#ifndef CACHE_LINE_SIZE
-#define CACHE_LINE_SIZE 64
-#endif // CACHE_LINE_SIZE
-
-/* ======== assert ======== */
-#ifdef NDEBUG
-#define ASSERT(condition) ((void)0)
-#else
-#define ASSERT(condition) assert((condition))
-#endif // NDEBUG
-
-/* ======== statis assert ======== */
-/*
- * To be compatible with C++ before C++11,
- * @msg should be a single word (use -/_ to concat)
- * such as This_should_be_TRUE
- */
-#if __cplusplus < 201103L
-// TODO only define this when DEBUG
-#define STATIC_ASSERT(cond, msg) \
- typedef char static_assertion_##msg[(cond) ? 1 : -1] __attribute__((unused))
-#else
-#define STATIC_ASSERT(cond, msg) static_assert((cond), #msg)
-#endif // __cplusplus < 201103L
-
-/* ======== atomic operation ======== */
-#define ATOMIC_FAA(val_addr, addv) \
- __atomic_fetch_add((val_addr), (addv), __ATOMIC_SEQ_CST)
-#define ATOMIC_AAF(val_addr, addv) \
- __atomic_add_fetch((val_addr), (addv), __ATOMIC_SEQ_CST)
-/*
- * It implements an atomic compare and exchange operation.
- * This compares the contents of *ptr with the contents of *expected.
- * - If equal, the operation is a reader-modify-writer operation that writes
- * desired into *ptr.
- * - If they are not equal, the operation is a reader and the current contents
- * of *ptr are written into *expected
- */
-#define ATOMIC_CAS(val_addr, expected, desired) \
- __atomic_compare_exchange_n((val_addr), (expected), (desired), \
- /* weak = */ false, \
- /* success_memorder = */ __ATOMIC_SEQ_CST, \
- /* failure_memorder = */ __ATOMIC_SEQ_CST)
-#define ATOMIC_LOAD(val_addr) __atomic_load_n((val_addr), __ATOMIC_SEQ_CST)
-#define ATOMIC_STORE(val_addr, val) \
- __atomic_store_n((val_addr), (val), __ATOMIC_SEQ_CST)
-
-/* ======== align ======== */
-#define ALIGNED(a) __attribute__((aligned(a)))
-#define ALIGNED_4 ALIGNED(4)
-#define ALIGNED_8 ALIGNED(8)
-
-/* ======== disallow copy and assign ======== */
-#if __cplusplus < 201103L
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&); \
- void operator=(const TypeName&)
-#else
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&) = delete; \
- TypeName& operator=(const TypeName&) = delete;
-#endif
-
-/* ======== return value check ======== */
-#define RET_FAIL(expr) UNLIKELY(common::E_OK != (ret = (expr)))
-#define RFAIL(expr) UNLIKELY(common::E_OK != (ret = (expr)))
-#define RET_SUCC(expr) LIKELY(common::E_OK != (ret = (exprt)))
-#define RSUCC(expr) LIKELY(common::E_OK != (ret = (exprt)))
-#define IS_SUCC(ret) LIKELY(common::E_OK == (ret))
-#define IS_FAIL(ret) UNLIKELY(common::E_OK != (ret))
-
-#define IS_NULL(ptr) UNLIKELY((ptr) == nullptr)
-
-/* ======== min/max ======== */
-#define UTIL_MAX(a, b) ((a) > (b) ? (a) : (b))
-#define UTIL_MIN(a, b) ((a) > (b) ? (b) : (a))
-
-/*
- * int64_max < 10^20
- * consider +/- and the '\0' tail. 24 is enough
- */
-#define INT64_TO_BASE10_MAX_LEN 24
-
-#endif // COMMON_UTIL_DEFINE_H
diff --git a/cpp/src/common/config/CMakeLists.txt b/cpp/src/common/config/CMakeLists.txt
deleted file mode 100644
index e7ef66faa..000000000
--- a/cpp/src/common/config/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-
-
diff --git a/cpp/src/common/config/config.h b/cpp/src/common/config/config.h
deleted file mode 100644
index 258165b3f..000000000
--- a/cpp/src/common/config/config.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONFIG_CONFIG_H
-#define COMMON_CONFIG_CONFIG_H
-
-#include <cstdint>
-
-#include "common/mutex/mutex.h"
-#include "utils/db_utils.h"
-#include "utils/util_define.h"
-
-namespace common {
-enum ConfigLevel {
- INIT, // Unchangeable, initialized during database init
- RESTART, // Can be changed, but the database must be restarted to take
- // effect
- USERSET // Session level update
-};
-
-typedef struct ConfigValue {
- uint32_t
- tsblock_mem_inc_step_size_; // tsblock memory self-increment step size
- uint32_t tsblock_max_memory_; // the maximum memory of a single tsblock
- uint32_t page_writer_max_point_num_;
- uint32_t page_writer_max_memory_bytes_;
- uint32_t max_degree_of_index_node_;
- double tsfile_index_bloom_filter_error_percent_;
- TSEncoding time_encoding_type_;
- TSDataType time_data_type_;
- CompressionType time_compress_type_;
- int32_t chunk_group_size_threshold_;
- int32_t record_count_for_next_mem_check_;
- bool encrypt_flag_ = false;
-} ConfigValue;
-
-extern void init_config_value();
-extern TSEncoding get_value_encoder(TSDataType data_type);
-extern CompressionType get_default_compressor();
-// In the future, configuration items need to be dynamically adjusted according
-// to the level
-extern void set_config_value();
-extern void config_set_page_max_point_count(uint32_t page_max_ponint_count);
-extern void config_set_max_degree_of_index_node(
- uint32_t max_degree_of_index_node);
-
-// FORCE_INLINE bool wal_cfg_enabled() { return
-// g_config_value_.wal_flush_policy_ != WAL_DISABLED; } FORCE_INLINE bool
-// wal_cfg_should_wait_persisted() { return g_config_value_.wal_flush_policy_ >=
-// WAL_FLUSH; }
-
-} // namespace common
-
-#endif // COMMON_CONFIG_CONFIG_H
diff --git a/cpp/src/common/constant/CMakeLists.txt b/cpp/src/common/constant/CMakeLists.txt
deleted file mode 100644
index 5860be1f2..000000000
--- a/cpp/src/common/constant/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-#[[
-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
-
- https://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.
-]]
\ No newline at end of file
diff --git a/cpp/src/common/constant/tsfile_constant.h b/cpp/src/common/constant/tsfile_constant.h
deleted file mode 100644
index af5d70f79..000000000
--- a/cpp/src/common/constant/tsfile_constant.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-#include <string>
-#include <regex>
-
-namespace storage
-{
- static const std::string TSFILE_SUFFIX = ".tsfile";
- static const std::string TSFILE_HOME = "TSFILE_HOME";
- static const std::string TSFILE_CONF = "TSFILE_CONF";
- static const std::string PATH_ROOT = "root";
- static const std::string TMP_SUFFIX = "tmp";
- static const std::string PATH_SEPARATOR = ".";
- static const char PATH_SEPARATOR_CHAR = '.';
- static const std::string PATH_SEPARATER_NO_REGEX = "\\.";
- static const char DOUBLE_QUOTE = '"';
- static const char BACK_QUOTE = '`';
- static const std::string BACK_QUOTE_STRING = "`";
- static const std::string DOUBLE_BACK_QUOTE_STRING = "``";
-
- static const unsigned char TIME_COLUMN_MASK = 0x80;
- static const unsigned char VALUE_COLUMN_MASK = 0x40;
-
- static const std::string TIME_COLUMN_ID = "";
-
- static const std::regex IDENTIFIER_PATTERN("([a-zA-Z0-9_\\u2E80-\\u9FFF]+)");
- static const std::regex NODE_NAME_PATTERN("(\\*{0,2}[a-zA-Z0-9_\\u2E80-\\u9FFF]+\\*{0,2})");
- static const int DEFAULT_SEGMENT_NUM_FOR_TABLE_NAME = 3;
-} // namespace storage
diff --git a/cpp/src/common/container/CMakeLists.txt b/cpp/src/common/container/CMakeLists.txt
deleted file mode 100644
index f92dd5ba1..000000000
--- a/cpp/src/common/container/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-#[[
-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
-
- https://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.
-]]
-message("Running in src/common/container directory")
-
-aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} common_container_SRC_LIST)
-add_library(common_container OBJECT ${common_container_SRC_LIST})
diff --git a/cpp/src/common/container/array.h b/cpp/src/common/container/array.h
deleted file mode 100644
index 96bc34643..000000000
--- a/cpp/src/common/container/array.h
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_ARRAY_H
-#define COMMON_CONTAINER_ARRAY_H
-
-#include <stdint.h>
-
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <iostream>
-
-#include "common/allocator/alloc_base.h"
-#include "common/logger/elog.h"
-#include "utils/errno_define.h"
-#include "utils/util_define.h"
-
-#define ARRAY_INIT_CAPACITY 1000 // TODO: configurable mode
-#define ARRAY_GROWTH_THRESHOLD 50 // TODO: configurable mode
-#define ARRAY_SHRINK_THRESHOLD 50 // TODO: configurable mode
-
-namespace common {
-
-template <class ValueType>
-class Array {
- public:
-#ifndef NDEBUG
- friend std::ostream &operator<<(std::ostream &out, Array<ValueType> &sa) {
- for (size_t idx = 0; idx < sa.size(); idx++) {
- if (idx > 0) {
- out << ' ';
- }
- out << sa[idx];
- }
- out << std::endl;
- return out;
- }
-#endif // NDEBUG
-
- Array() {
- capacity_ = ARRAY_INIT_CAPACITY;
- size_ = 0;
- is_inited_ = false;
- array_ = nullptr;
- }
-
- Array(size_t capacity) {
- capacity_ = capacity;
- size_ = 0;
- is_inited_ = false;
- array_ = nullptr;
- }
-
- ~Array() {
- if (is_inited_) {
- destroy();
- }
- capacity_ = 0;
- size_ = 0;
- }
-
- // int deep_copy(const Array &other)
- // {
- // this->capacity_ = other.capacity_;
- // this->size_ = other.size_;
- // if (init() == E_OK) {
- // memcpy(this->array_, other.array_, this->capacity_ *
- // sizeof(*(this->array_))); return E_OK;
- // }
- // return E_OOM;
- // }
-
- int init() {
- if (is_inited_) {
- // log_err("init repeated.");
- ASSERT(!is_inited_);
- }
- array_ =
- (ValueType *)mem_alloc(capacity_ * sizeof(*(array_)), MOD_ARRAY);
- if (UNLIKELY(nullptr == array_)) {
- is_inited_ = false;
- // log_err("malloc failed.");
- return E_OOM;
- }
- is_inited_ = true;
- return E_OK;
- }
-
- void destroy() {
- capacity_ = 0;
- size_ = 0;
- if (is_inited_) {
- mem_free(array_);
- array_ = nullptr;
- }
- is_inited_ = false;
- }
-
- private:
- static size_t linear_calc(size_t input) {
- if (input < ARRAY_GROWTH_THRESHOLD) {
- return input;
- }
- size_t res = 1;
- input /= 10;
- while (input) {
- input /= 10;
- res *= 10;
- }
- return res;
- }
-
- public:
- int extend() {
- // Check for a potential overflow
- uint64_t tmp = (uint64_t)(linear_calc(capacity_) + capacity_);
- if (tmp > SIZE_MAX) {
- // log_err("size overflow.");
- return E_OVERFLOW;
- }
-
- size_t new_capacity = (size_t)tmp;
- array_ =
- (ValueType *)mem_realloc(array_, new_capacity * sizeof(*(array_)));
- if (UNLIKELY(nullptr == array_)) {
- // log_err("realloc failed.");
- return E_OOM;
- }
- capacity_ = new_capacity;
- return E_OK;
- }
-
- int shrink() {
- size_t new_capacity = (size_t)(capacity_ / 2);
- // if the size passed to realloc is smaller than before, OS will
- // automatically release the rest memory
- array_ =
- (ValueType *)mem_realloc(array_, new_capacity * sizeof(*(array_)));
- if (UNLIKELY(nullptr == array_)) {
- // log_err("malloc failed.");
- return E_OOM;
- }
- capacity_ = new_capacity;
- return E_OK;
- }
-
- int insert(size_t idx, const ValueType &value) {
- if (idx > size_) {
- // log_err("index %lu is out of range, because size is %lu.", idx,
- // size_);
- return E_OUT_OF_RANGE;
- }
- if (size_ >= capacity_) {
- int ret = extend();
- if (ret != E_OK) {
- return ret;
- }
- }
- ASSERT(idx <= size_);
- ASSERT(size_ < capacity_);
- if (idx == size_) {
- array_[idx] = value;
- size_++;
- return E_OK;
- }
-
- memmove(array_ + (idx + 1), array_ + idx,
- (size_ - idx) * sizeof(*(array_)));
- array_[idx] = value;
- size_++;
- return E_OK;
- }
-
- // int update(size_t idx, const ValueType &value)
- // {
- // if (idx >= size_) {
- // //log_err("index %lu is out of range, because size is %lu.", idx,
- // size_); return E_OUT_OF_RANGE;
- // }
- // array_[idx] = value;
- // return E_OK;
- // }
-
- int append(const ValueType &value) {
- if (size_ >= capacity_) {
- int ret = extend();
- if (ret != E_OK) {
- return ret;
- }
- }
- array_[size_] = value;
- size_++;
- return E_OK;
- }
-
- FORCE_INLINE ValueType &at(size_t idx) {
- if (idx >= size_) {
- // log_err("index %lu is out of range, because size is %lu.", idx,
- // size_);
- ASSERT(idx < size_);
- return dummy_;
- }
- return array_[idx];
- }
-
- FORCE_INLINE ValueType &operator[](size_t idx) {
- if (idx >= size_) {
- // log_err("index %lu is out of range, because size is %lu.", idx,
- // size_);
- ASSERT(idx < size_);
- return dummy_;
- }
- return array_[idx];
- }
-
- bool contain(const ValueType &value) {
- for (size_t i = 0; i < size_; i++) {
- if (array_[i] == value) {
- return true;
- }
- }
- return false;
- }
-
- /*
- * if the value is not found, then set 'found' is false.
- */
- size_t find(const ValueType &target_val, bool &found) {
- for (size_t i = 0; i < size_; i++) {
- if (array_[i] == target_val) {
- found = true;
- return i;
- }
- }
- found = false;
- return 0;
- }
-
- ValueType remove(size_t idx) {
- if (idx >= size_) {
- // log_err("index %lu is out of range, because size is %lu.", idx,
- // size_);
- ASSERT(idx < size_);
- return dummy_;
- }
- if (capacity_ > ARRAY_SHRINK_THRESHOLD && size_ <= capacity_ / 4) {
- shrink();
- }
- ValueType ret = array_[idx];
- memmove(array_ + idx, array_ + idx + 1,
- (size_ - idx - 1) * sizeof(*(array_)));
- size_--;
-
- return ret;
- }
-
- int remove_value(const ValueType &value) {
- bool found = false;
- size_t pos = find(value, found);
- if (!found) {
- // log_warn("the value is not exist in the array.");
- return E_NOT_EXIST;
- }
- while (found) {
- remove(pos);
- pos = find(value, found);
- }
-
- return E_OK;
- }
-
- FORCE_INLINE void clear() { size_ = 0; }
-
- FORCE_INLINE bool empty() const { return ATOMIC_LOAD(&size_) == 0; }
-
- FORCE_INLINE size_t size() const { return ATOMIC_LOAD(&size_); }
-
- FORCE_INLINE size_t capacity() const { return ATOMIC_LOAD(&capacity_); }
-
- private:
- size_t capacity_;
- size_t size_;
- ValueType *array_;
- ValueType dummy_;
- bool is_inited_;
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_ARRAY_H
diff --git a/cpp/src/common/container/bit_map.cc b/cpp/src/common/container/bit_map.cc
deleted file mode 100644
index 407605e56..000000000
--- a/cpp/src/common/container/bit_map.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-
-#include "bit_map.h"
-
-#include "common/allocator/alloc_base.h"
-
-namespace common {
-
-BitMap::~BitMap() {
- if (bitmap_ && (size_ > 0)) {
- mem_free(bitmap_);
- bitmap_ = nullptr;
- size_ = 0;
- }
-}
-
-int BitMap::init(uint32_t item_size, bool init_as_zero) {
- uint32_t size = (item_size + 7) / 8;
- bitmap_ = static_cast<char*>(mem_alloc(size, MOD_TSBLOCK));
- // need set to 0, otherwise there will be wrong data
- const char initial_char = init_as_zero ? 0x00 : 0xFF;
- memset(bitmap_, initial_char, size);
- size_ = size;
- init_as_zero_ = init_as_zero;
- return common::E_OK;
-}
-
-} // namespace common
diff --git a/cpp/src/common/container/bit_map.h b/cpp/src/common/container/bit_map.h
deleted file mode 100644
index 9d0367449..000000000
--- a/cpp/src/common/container/bit_map.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_BIT_MAP_H
-#define COMMON_CONTAINER_BIT_MAP_H
-
-#include <string.h>
-
-#include "utils/errno_define.h"
-#include "utils/util_define.h"
-
-namespace common {
-
-class BitMap {
- public:
- BitMap() : bitmap_(nullptr), size_(0), init_as_zero_(true) {}
- ~BitMap();
- int init(uint32_t item_size, bool init_as_zero = true);
-
- FORCE_INLINE void reset() {
- const char initial_char = init_as_zero_ ? 0x00 : 0xFF;
- memset(bitmap_, initial_char, size_);
- }
-
- FORCE_INLINE void set(uint32_t index) {
- uint32_t offset = index >> 3;
- ASSERT(offset < size_);
-
- char *start_addr = bitmap_ + offset;
- uint8_t bit_mask = get_bit_mask(index);
- *start_addr = (*start_addr) | (bit_mask);
- }
-
- FORCE_INLINE void clear(uint32_t index) {
- uint32_t offset = index >> 3;
- ASSERT(offset < size_);
-
- char *start_addr = bitmap_ + offset;
- uint8_t bit_mask = get_bit_mask(index);
- *start_addr = (*start_addr) & (~bit_mask);
- }
-
- FORCE_INLINE bool test(uint32_t index) {
- uint32_t offset = index >> 3;
- ASSERT(offset < size_);
-
- char *start_addr = bitmap_ + offset;
- uint8_t bit_mask = get_bit_mask(index);
- return (*start_addr & bit_mask);
- }
-
- FORCE_INLINE uint32_t get_size() { return size_; }
-
- FORCE_INLINE char *get_bitmap() { return bitmap_; } // for debug
-
- private:
- FORCE_INLINE uint8_t get_bit_mask(uint32_t index) {
- return 1 << (index & 7);
- }
-
- private:
- char *bitmap_;
- uint32_t size_;
- bool init_as_zero_;
-};
-} // namespace common
-
-#endif // COMMON_CONTAINER_BIT_MAP_H
diff --git a/cpp/src/common/container/blocking_queue.cc b/cpp/src/common/container/blocking_queue.cc
deleted file mode 100644
index f5123d323..000000000
--- a/cpp/src/common/container/blocking_queue.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-
-#include "blocking_queue.h"
-
-namespace common {
-
-BlockingQueue::BlockingQueue() : queue_(), mutex_(), cond_() {
- pthread_mutex_init(&mutex_, NULL);
- pthread_cond_init(&cond_, NULL);
-}
-
-BlockingQueue::~BlockingQueue() {
- pthread_mutex_destroy(&mutex_);
- pthread_cond_destroy(&cond_);
-}
-
-void BlockingQueue::push(void *data) {
- pthread_mutex_lock(&mutex_);
- queue_.push(data);
- pthread_mutex_unlock(&mutex_);
- /*
- * it is safe to signal after unlock.
- * since pthread_cond_wait is guarantee to unlock and sleep atomically.
- */
- pthread_cond_signal(&cond_);
-}
-
-void *BlockingQueue::pop() {
- void *ret_data = NULL;
- pthread_mutex_lock(&mutex_);
- while (queue_.empty()) {
- pthread_cond_wait(&cond_, &mutex_);
- }
- ret_data = queue_.front();
- queue_.pop();
- pthread_mutex_unlock(&mutex_);
- return ret_data;
-}
-
-} // end namespace common
\ No newline at end of file
diff --git a/cpp/src/common/container/blocking_queue.h b/cpp/src/common/container/blocking_queue.h
deleted file mode 100644
index e03ea3a46..000000000
--- a/cpp/src/common/container/blocking_queue.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_BLOCKING_QUEUE_H
-#define COMMON_CONTAINER_BLOCKING_QUEUE_H
-
-#include <pthread.h>
-
-#include <queue>
-
-namespace common {
-
-class BlockingQueue {
- public:
- BlockingQueue();
- ~BlockingQueue();
-
- void push(void* data);
- // if empty, blocking
- void* pop();
-
- private:
- std::queue<void*> queue_;
- pthread_mutex_t mutex_;
- pthread_cond_t cond_;
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_BLOCKING_QUEUE_H
diff --git a/cpp/src/common/container/byte_buffer.h b/cpp/src/common/container/byte_buffer.h
deleted file mode 100644
index 967d36408..000000000
--- a/cpp/src/common/container/byte_buffer.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_BYTE_BUFFER_H
-#define COMMON_CONTAINER_BYTE_BUFFER_H
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "common/allocator/alloc_base.h"
-#include "common/global.h"
-#include "utils/util_define.h"
-
-namespace common {
-class ByteBuffer {
- public:
- ByteBuffer()
- : data_(nullptr),
- variable_type_len_(sizeof(uint32_t)),
- real_data_size_(0),
- reserved_size_(0) {}
-
- ~ByteBuffer() {
- if (data_ && (reserved_size_ > 0)) {
- mem_free(data_);
- data_ = nullptr;
- real_data_size_ = 0;
- reserved_size_ = 0;
- }
- }
-
- FORCE_INLINE void init(uint32_t size) {
- data_ = static_cast<char *>(mem_alloc(size, MOD_TSBLOCK));
- reserved_size_ = size;
- }
-
- FORCE_INLINE void reset() { real_data_size_ = 0; }
-
- FORCE_INLINE void extend_memory(uint32_t new_size) {
- ASSERT(new_size > reserved_size_);
- data_ = static_cast<char *>(mem_realloc(data_, new_size));
- reserved_size_ = new_size;
- }
-
- FORCE_INLINE void append_variable_value(const char *value, uint32_t len) {
- // dynamic growth
- if (UNLIKELY((real_data_size_ + len + variable_type_len_) >
- reserved_size_)) {
- // extreme scenarios, when encountering very long string
- uint32_t growth_size =
- g_config_value_.tsblock_mem_inc_step_size_ > len
- ? g_config_value_.tsblock_mem_inc_step_size_
- : (len + 1);
- extend_memory(reserved_size_ + growth_size);
- }
-
- ASSERT(data_);
- // append len
- memcpy(&data_[real_data_size_], reinterpret_cast<char *>(&len),
- variable_type_len_);
- real_data_size_ += variable_type_len_;
- if (len > 0) {
- // append data
- memcpy(&data_[real_data_size_], value, len);
- real_data_size_ += len;
- }
- }
-
- FORCE_INLINE void append_fixed_value(const char *value, uint32_t len) {
- // dynamic growth
- if (UNLIKELY(real_data_size_ + len > reserved_size_)) {
- // extreme scenarios, when encountering very long string
- uint32_t growth_size =
- g_config_value_.tsblock_mem_inc_step_size_ > len
- ? g_config_value_.tsblock_mem_inc_step_size_
- : (len + 1);
- extend_memory(reserved_size_ + growth_size);
- }
-
- ASSERT(data_);
- memcpy(&data_[real_data_size_], value, len);
- real_data_size_ += len;
- }
-
- // for fixed len value
- FORCE_INLINE char *read(uint32_t offset, uint32_t len) {
- ASSERT((offset + len) <= real_data_size_);
- char *p = &data_[offset];
- return p;
- }
-
- // for variable len value
- FORCE_INLINE char *read(uint32_t offset, uint32_t *len) {
- // get len
- *len = *reinterpret_cast<uint32_t *>(&data_[offset]);
- // get value
- char *p = &data_[offset + variable_type_len_];
- return p;
- }
-
- FORCE_INLINE char *get_data() { return data_; }
-
- private:
- char *data_;
- uint8_t variable_type_len_;
- uint32_t real_data_size_;
- uint32_t reserved_size_; // malloc memory size from system
-};
-
-} // namespace common
-#endif // COMMON_CONTAINER_BYTE_BUFFER_H
\ No newline at end of file
diff --git a/cpp/src/common/container/hash_func.h b/cpp/src/common/container/hash_func.h
deleted file mode 100644
index 8bac3170c..000000000
--- a/cpp/src/common/container/hash_func.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_HASH_FUNC_H
-#define COMMON_CONTAINER_HASH_FUNC_H
-
-#include <stddef.h>
-#include <stdint.h>
-
-#include "common/container/hash_table.h"
-#include "common/container/murmur_hash3.h"
-#include "common/container/slice.h"
-#include "utils/db_utils.h"
-
-#define TSID_MAX_LEN 20
-
-namespace common {
-
-/*
- * using djb2 hash algorithm
- */
-struct StringHashFunc {
- uint32_t hash_fmix32(uint32_t h) {
- h ^= h >> 16;
- h *= 0x3243f6a9U;
- h ^= h >> 16;
- return h;
- }
-
- uint32_t operator()(const void *data) {
- uint32_t hash_ = (const uint32_t)5381;
- const char *str = (const char *)data;
- char c;
- while ((c = *str++)) {
- hash_ = ((hash_ << 5) + hash_) + c;
- }
- return hash_fmix32(hash_);
- }
-};
-
-/*
- * using djb2 hash algorithm
- */
-struct SliceHashFunc {
- uint32_t hash_fmix32(uint32_t h) {
- h ^= h >> 16;
- h *= 0x3243f6a9U;
- h ^= h >> 16;
- return h;
- }
-
- uint32_t operator()(const Slice &slice) {
- uint32_t hash_ = (const uint32_t)5381;
- const char *str = (const char *)slice.data();
- char c;
- while ((c = *str++)) {
- hash_ = ((hash_ << 5) + hash_) + c;
- }
- return hash_fmix32(hash_);
- }
-};
-
-/*
- * using murmur_hash hash algorithm
- */
-struct TsIDHashFunc {
- uint32_t hash_fmix32(uint32_t h) {
- h ^= h >> 16;
- h *= 0x3243f6a9U;
- h ^= h >> 16;
- return h;
- }
-
- uint32_t operator()(const TsID &data) {
- int32_t tmp = data.db_nid_ * 10000 + data.device_nid_ * 100 +
- data.measurement_nid_;
- return Murmur128Hash::hash(tmp, 0);
- }
-};
-
-/*
- * using murmur_hash hash algorithm
- */
-struct NodeIDHashFunc {
- uint32_t operator()(const NodeID &data) {
- return Murmur128Hash::hash(static_cast<int32_t>(data), 0);
- }
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_HASH_FUNC_H
diff --git a/cpp/src/common/container/hash_node.h b/cpp/src/common/container/hash_node.h
deleted file mode 100644
index b51d01137..000000000
--- a/cpp/src/common/container/hash_node.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_HASH_NODE_H
-#define COMMON_CONTAINER_HASH_NODE_H
-
-#include "utils/util_define.h"
-
-namespace common {
-
-template <class KeyType, class ValueType>
-class HashNode {
- public:
- HashNode() {
- is_valid_ = false;
- rehash_ = 0;
- next_ = nullptr;
- }
-
- HashNode(const KeyType &key, const ValueType &value)
- : key_(key),
- value_(value),
- is_valid_(true),
- rehash_(0),
- next_(nullptr) {}
-
- ~HashNode() { is_valid_ = false; }
-
- FORCE_INLINE KeyType get_key() const { return key_; }
-
- FORCE_INLINE ValueType get_value() const { return value_; }
-
- FORCE_INLINE void set_key(const KeyType &key) { key_ = key; }
-
- FORCE_INLINE void set_value(const ValueType &value) { value_ = value; }
-
- FORCE_INLINE HashNode *get_next() const { return next_; }
-
- FORCE_INLINE void set_next(HashNode *next) { next_ = next; }
-
- FORCE_INLINE bool get_valid() const { return is_valid_; }
-
- FORCE_INLINE void set_valid(bool vd) { is_valid_ = vd; }
-
- FORCE_INLINE uint64_t get_rehashid() const { return rehash_; }
-
- FORCE_INLINE void set_rehashid(uint64_t id) { rehash_ = id; }
-
- public:
- bool is_valid_;
- uint64_t rehash_;
- KeyType key_;
- ValueType value_;
- HashNode *next_; // pointer to the next node (same bucket)
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_HASH_NODE_H
\ No newline at end of file
diff --git a/cpp/src/common/container/hash_segm.h b/cpp/src/common/container/hash_segm.h
deleted file mode 100644
index df0e53966..000000000
--- a/cpp/src/common/container/hash_segm.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_HASH_SEGM_H
-#define COMMON_CONTAINER_HASH_SEGM_H
-
-#include <stddef.h>
-
-#include "common/container/hash_node.h"
-#include "common/mutex/mutex.h"
-#include "utils/errno_define.h"
-#include "utils/util_define.h"
-
-#define SEGMENT_CAPACITY 100
-
-namespace common {
-
-template <class KeyType, class ValueType>
-class HashSegm {
- public:
- HashSegm() {}
- ~HashSegm() {}
-
- FORCE_INLINE HashNode<KeyType, ValueType>& operator[](size_t idx) {
- if (idx >= SEGMENT_CAPACITY) {
- // log_err("index %lu is out of range.", idx);
- ASSERT(idx < SEGMENT_CAPACITY);
- }
- return segm_pointer_[idx];
- }
-
- public:
- Mutex mutexes_[SEGMENT_CAPACITY];
- HashNode<KeyType, ValueType> segm_pointer_[SEGMENT_CAPACITY];
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_HASH_SEGM_H
\ No newline at end of file
diff --git a/cpp/src/common/container/hash_table.h b/cpp/src/common/container/hash_table.h
deleted file mode 100644
index 896289eb6..000000000
--- a/cpp/src/common/container/hash_table.h
+++ /dev/null
@@ -1,792 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_HASH_TABLE_H
-#define COMMON_CONTAINER_HASH_TABLE_H
-
-#include "common/allocator/alloc_base.h"
-#include "common/container/array.h"
-#include "common/container/hash_func.h"
-#include "common/container/hash_node.h"
-#include "common/container/hash_segm.h"
-
-#define TABLE_CAPACITY 100
-#define TABLE_GROWTH 2
-
-namespace common {
-
-template <typename KeyType, typename ValueType, typename F>
-class HashTable {
- public:
- HashTable() : table_(TABLE_CAPACITY) {
- new_table_capacity_ = TABLE_CAPACITY;
- old_table_capacity_ = TABLE_CAPACITY;
- size_ = 0;
- is_inited_ = false;
- hash_version_ = 0;
- is_extending_ = 0;
- }
-
- HashTable(size_t total_capacity)
- : table_(total_capacity / SEGMENT_CAPACITY) {
- new_table_capacity_ = total_capacity / SEGMENT_CAPACITY;
- old_table_capacity_ = new_table_capacity_;
- size_ = 0;
- is_inited_ = false;
- hash_version_ = 0;
- is_extending_ = 0;
- }
- ~HashTable() {
- new_table_capacity_ = 0;
- size_ = 0;
- is_inited_ = false;
- hash_version_ = 0;
- is_extending_ = 0;
- }
-
- int init() {
- if (is_inited_) {
- // log_err("init repeated.");
- ASSERT(!is_inited_);
- }
-
- int ret = E_OK;
- ret = table_.init();
- if (ret != E_OK) {
- return E_OOM;
- }
- for (size_t i = 0; i < new_table_capacity_; i++) {
- void* buf =
- mem_alloc(sizeof(HashSegm<KeyType, ValueType>), MOD_HASH_TABLE);
- if (UNLIKELY(nullptr == buf)) {
- // log_err("malloc() failed.");
- return E_OOM;
- }
- HashSegm<KeyType, ValueType>* tmp_segm =
- new (buf) HashSegm<KeyType, ValueType>;
- table_.append(tmp_segm);
- }
- is_inited_ = true;
- return E_OK;
- }
-
- void destroy() {
- if (is_inited_) {
- for (size_t i = 0; i < new_table_capacity_; i++) {
- for (size_t j = 0; j < SEGMENT_CAPACITY; j++) {
- if ((*table_[i])[j].get_valid()) {
- HashNode<KeyType, ValueType>* prev = nullptr;
- HashNode<KeyType, ValueType>* entry =
- (*table_[i])[j].get_next();
- while (entry != nullptr) {
- prev = entry;
- entry = entry->get_next();
- prev->~HashNode();
- mem_free(prev);
- prev = nullptr;
- }
- (*table_[i])[j].set_valid(false);
- }
- }
- table_[i]->~HashSegm();
- mem_free(table_[i]);
- table_[i] = nullptr;
- }
- table_.destroy();
- }
- is_inited_ = false;
- }
-
- int table_extend() {
- int ret = table_.extend();
- if (ret != E_OK) {
- return ret;
- }
- for (size_t i = ATOMIC_LOAD(&new_table_capacity_);
- i < table_.capacity(); i++) {
- void* buf =
- mem_alloc(sizeof(HashSegm<KeyType, ValueType>), MOD_HASH_TABLE);
- if (UNLIKELY(nullptr == buf)) {
- // log_err("malloc() failed.");
- return E_OOM;
- }
- HashSegm<KeyType, ValueType>* tmp_segm =
- new (buf) HashSegm<KeyType, ValueType>;
- table_.append(tmp_segm);
- }
- return E_OK;
- }
-
- int move_bucket_head(size_t from_segment_idx, size_t from_bucket_idx) {
- HashNode<KeyType, ValueType>* prev =
- &((*table_[from_segment_idx])[from_bucket_idx]);
- HashNode<KeyType, ValueType>* entry =
- ((*table_[from_segment_idx])[from_bucket_idx]).get_next();
-
- while (
- (*table_[from_segment_idx])[from_bucket_idx].get_rehashid() !=
- ATOMIC_LOAD(&hash_version_)) { // if the hashnode hasn't rehashed
- uint32_t hash_value = hashfunc_(
- (*table_[from_segment_idx])[from_bucket_idx].get_key());
- size_t to_segment_idx =
- hash_value % ATOMIC_LOAD(&new_table_capacity_);
- size_t to_bucket_idx = hash_value % SEGMENT_CAPACITY;
- if (from_segment_idx == to_segment_idx &&
- from_bucket_idx == to_bucket_idx) {
- ((*table_[to_segment_idx])[to_bucket_idx])
- .set_rehashid(
- ATOMIC_LOAD(&hash_version_)); // only update rehashid
- } else {
- // put
- table_[to_segment_idx]->mutexes_[to_bucket_idx].lock();
- int ret = put_nolock(
- (*table_[from_segment_idx])[from_bucket_idx].get_key(),
- (*table_[from_segment_idx])[from_bucket_idx].get_value(),
- to_segment_idx, to_bucket_idx);
- table_[to_segment_idx]->mutexes_[to_bucket_idx].unlock();
- if (ret != E_OK) {
- return ret;
- }
- // remove
- if (entry != nullptr) {
- ((*table_[from_segment_idx])[from_bucket_idx])
- .set_key(entry->get_key());
- ((*table_[from_segment_idx])[from_bucket_idx])
- .set_value(entry->get_value());
- ((*table_[from_segment_idx])[from_bucket_idx])
- .set_next(entry->get_next());
- ((*table_[from_segment_idx])[from_bucket_idx])
- .set_valid(true);
- ((*table_[from_segment_idx])[from_bucket_idx])
- .set_rehashid(entry->get_rehashid());
- ATOMIC_AAF(&size_, -1);
- entry->~HashNode();
- mem_free(entry);
- entry = prev->get_next();
- } else {
- ((*table_[from_segment_idx])[from_bucket_idx])
- .set_valid(false);
- ATOMIC_AAF(&size_, -1);
- break;
- }
- }
- }
-
- return E_OK;
- }
-
- int move_bucket_chain(size_t from_segment_idx, size_t from_bucket_idx) {
- HashNode<KeyType, ValueType>* prev =
- &((*table_[from_segment_idx])[from_bucket_idx]);
- HashNode<KeyType, ValueType>* entry =
- ((*table_[from_segment_idx])[from_bucket_idx]).get_next();
-
- while (entry != nullptr) {
- if (entry->get_rehashid() != ATOMIC_LOAD(&hash_version_)) {
- uint32_t hash_value = hashfunc_(entry->get_key());
- size_t to_segment_idx =
- hash_value % ATOMIC_LOAD(&new_table_capacity_);
- size_t to_bucket_idx = hash_value % SEGMENT_CAPACITY;
- if (from_segment_idx == to_segment_idx &&
- from_bucket_idx == to_bucket_idx) {
- entry->set_rehashid(ATOMIC_LOAD(&hash_version_));
- prev = entry;
- entry = entry->get_next();
- } else {
- table_[to_segment_idx]->mutexes_[to_bucket_idx].lock();
- if ((*table_[to_segment_idx])[to_bucket_idx].get_valid() ==
- false) {
- ((*table_[to_segment_idx])[to_bucket_idx])
- .set_key(entry->get_key());
- ((*table_[to_segment_idx])[to_bucket_idx])
- .set_value(entry->get_value());
- ((*table_[to_segment_idx])[to_bucket_idx])
- .set_next(nullptr);
- ((*table_[to_segment_idx])[to_bucket_idx])
- .set_valid(true);
- ((*table_[to_segment_idx])[to_bucket_idx])
- .set_rehashid(ATOMIC_LOAD(&hash_version_));
- prev->set_next(entry->get_next());
- entry->~HashNode();
- mem_free(entry);
- entry = prev->get_next();
- // entry = entry->get_next();
- } else {
- entry->set_rehashid(ATOMIC_LOAD(&hash_version_));
- prev->set_next(entry->get_next());
- entry->set_next((*table_[to_segment_idx])[to_bucket_idx]
- .get_next());
- (*table_[to_segment_idx])[to_bucket_idx].set_next(
- entry);
- entry = prev->get_next();
- }
- table_[to_segment_idx]->mutexes_[to_bucket_idx].unlock();
- }
- } else {
- prev = prev->get_next();
- entry = entry->get_next();
- }
- }
- return E_OK;
- }
-
- int extend() {
- int ret = table_extend();
- if (ret != E_OK) {
- return ret;
- }
- ATOMIC_STORE(&old_table_capacity_, ATOMIC_LOAD(&new_table_capacity_));
- ATOMIC_STORE(&new_table_capacity_, table_.capacity());
- // ATOMIC_STORE(&hash_total_capacity_, table_.capacity() *
- // SEGMENT_CAPACITY);
-
- int64_t next_hash_version =
- ATOMIC_LOAD(&hash_version_) +
- 1; // the highest position of next_hash_version is 0
- ATOMIC_STORE(&hash_version_,
- next_hash_version |
- (1UL << 63)); // set the highest position to 1
- // which means 'extend' is beginning.
-
- // rehash
- for (size_t from_segment_idx = 0;
- from_segment_idx < ATOMIC_LOAD(&old_table_capacity_);
- from_segment_idx++) {
- for (size_t from_bucket_idx = 0; from_bucket_idx < SEGMENT_CAPACITY;
- from_bucket_idx++) {
- table_[from_segment_idx]->mutexes_[from_bucket_idx].lock();
- if ((*table_[from_segment_idx])[from_bucket_idx].get_valid()) {
- ret = move_bucket_head(from_segment_idx, from_bucket_idx);
- if (ret != E_OK) {
- table_[from_segment_idx]
- ->mutexes_[from_bucket_idx]
- .unlock();
- return ret;
- }
- ret = move_bucket_chain(from_segment_idx, from_bucket_idx);
- if (ret != E_OK) {
- table_[from_segment_idx]
- ->mutexes_[from_bucket_idx]
- .unlock();
- return ret;
- }
- }
- table_[from_segment_idx]->mutexes_[from_bucket_idx].unlock();
- }
- }
-
- ATOMIC_STORE(
- &hash_version_,
- next_hash_version & (~(1UL << 63))); // set extending flag is false
-
- return E_OK;
- }
-
- /*
- * when the key already exists, just update old value to new value;
- */
- int put(const KeyType& key, const ValueType& value) {
- int ret;
- uint32_t hash_value = hashfunc_(key);
-
- while (true) {
- uint8_t cur_table_capacity = ATOMIC_LOAD(&new_table_capacity_);
- size_t segment_idx = hash_value % cur_table_capacity;
- size_t bucket_idx = hash_value % SEGMENT_CAPACITY;
-
- table_[segment_idx]->mutexes_[bucket_idx].lock();
- ret = put_nolock(key, value, segment_idx, bucket_idx);
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- if (ret != E_OK) {
- return ret;
- }
-
- if (UNLIKELY(
- cur_table_capacity !=
- ATOMIC_LOAD(
- &new_table_capacity_))) { // resolve the problem of
- // insert into old position
- ret = remove_from_wrong_bucket(key, segment_idx, bucket_idx);
- // if (ret != E_OK) {
- // return ret;
- // }
- continue;
- } else {
- break;
- }
- }
-
- if (ATOMIC_LOAD(&size_) > ATOMIC_LOAD(&new_table_capacity_) *
- SEGMENT_CAPACITY * TABLE_GROWTH) {
- uint8_t tmp = 0;
- if (ATOMIC_CAS(&is_extending_, &tmp, 1)) {
- ret = extend();
- if (ret != E_OK) {
- ATOMIC_AAF(&is_extending_, -1);
- return ret;
- }
- ATOMIC_AAF(&is_extending_, -1);
- }
- }
-
- return ret;
- }
-
- /*
- * when the key already exists, just update old value to new value;
- */
- int put_nolock(const KeyType& key, const ValueType& value,
- size_t segment_idx, size_t bucket_idx) {
- if (((*table_[segment_idx])[bucket_idx]).get_valid() ==
- false) { // if current segment has no valid node
- ((*table_[segment_idx])[bucket_idx]).set_key(key);
- ((*table_[segment_idx])[bucket_idx]).set_value(value);
- ((*table_[segment_idx])[bucket_idx]).set_next(nullptr);
- ((*table_[segment_idx])[bucket_idx]).set_valid(true);
- ((*table_[segment_idx])[bucket_idx])
- .set_rehashid(ATOMIC_LOAD(&hash_version_));
- ATOMIC_AAF(&size_, 1);
- } else if (((*table_[segment_idx])[bucket_idx]).get_key() ==
- key) { // if current segment's first node's key is same as
- // the target key
- ((*table_[segment_idx])[bucket_idx])
- .set_value(value); // update value of existing node
- ((*table_[segment_idx])[bucket_idx])
- .set_rehashid(ATOMIC_LOAD(&hash_version_));
- } else { // follow the link list
- HashNode<KeyType, ValueType>* prev =
- &((*table_[segment_idx])[bucket_idx]);
- HashNode<KeyType, ValueType>* entry =
- ((*table_[segment_idx])[bucket_idx]).get_next();
- while (entry != nullptr && entry->get_key() != key) {
- prev = entry;
- entry = entry->get_next();
- }
- if (LIKELY(entry == nullptr)) {
- void* buf = mem_alloc(sizeof(HashNode<KeyType, ValueType>),
- MOD_HASH_TABLE);
- if (UNLIKELY(nullptr == buf)) {
- // log_err("malloc() failed.");
- return E_OOM;
- }
- entry = new (buf) HashNode<KeyType, ValueType>;
- entry->set_key(key);
- entry->set_value(value);
- entry->set_valid(true);
- entry->set_rehashid(ATOMIC_LOAD(&hash_version_));
- prev->set_next(entry);
- ATOMIC_AAF(&size_, 1);
- } else {
- entry->set_value(value); // update value of existing node
- entry->set_rehashid(ATOMIC_LOAD(&hash_version_));
- }
- }
- return E_OK;
- }
-
- /*
- * when the key already exists, then remain the old value and return the old
- * value and set 'exist' to true
- */
- int put_no_update(const KeyType& key, ValueType& value, bool& exist) {
- int ret;
- uint32_t hash_value = hashfunc_(key);
-
- while (true) {
- uint8_t cur_table_capacity = ATOMIC_LOAD(&new_table_capacity_);
- size_t segment_idx = hash_value % cur_table_capacity;
- size_t bucket_idx = hash_value % SEGMENT_CAPACITY;
-
- table_[segment_idx]->mutexes_[bucket_idx].lock();
- ret = put_nolock_no_update(key, value, segment_idx, bucket_idx,
- exist);
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- if (ret != E_OK) {
- return ret;
- }
-
- if (UNLIKELY(
- cur_table_capacity !=
- ATOMIC_LOAD(
- &new_table_capacity_))) { // resolve the problem of
- // insert into old position
- ret = remove_from_wrong_bucket(key, segment_idx, bucket_idx);
- // if (ret != E_OK) {
- // return ret;
- // }
- continue;
- } else {
- break;
- }
- }
-
- if (ATOMIC_LOAD(&size_) > ATOMIC_LOAD(&new_table_capacity_) *
- SEGMENT_CAPACITY * TABLE_GROWTH) {
- uint8_t tmp = 0;
- if (ATOMIC_CAS(&is_extending_, &tmp, 1)) {
- ret = extend();
- if (ret != E_OK) {
- return ret;
- }
- ATOMIC_AAF(&is_extending_, -1);
- }
- }
-
- return ret;
- }
-
- /*
- * when the key already exists, then remain the old value and return the old
- * value and set 'exist' to true
- */
- int put_nolock_no_update(const KeyType& key, ValueType& value,
- size_t segment_idx, size_t bucket_idx,
- bool& exist) {
- if (((*table_[segment_idx])[bucket_idx]).get_valid() ==
- false) { // if current segment has no valid node
- ((*table_[segment_idx])[bucket_idx]).set_key(key);
- ((*table_[segment_idx])[bucket_idx]).set_value(value);
- ((*table_[segment_idx])[bucket_idx]).set_next(nullptr);
- ((*table_[segment_idx])[bucket_idx]).set_valid(true);
- ((*table_[segment_idx])[bucket_idx])
- .set_rehashid(ATOMIC_LOAD(&hash_version_));
- ATOMIC_AAF(&size_, 1);
- } else if (((*table_[segment_idx])[bucket_idx]).get_key() ==
- key) { // if current segment's first node's key is same as
- // the target key
- exist = true;
- value = ((*table_[segment_idx])[bucket_idx]).get_value();
- ((*table_[segment_idx])[bucket_idx])
- .set_rehashid(ATOMIC_LOAD(&hash_version_));
- } else { // follow the link list
- HashNode<KeyType, ValueType>* prev =
- &((*table_[segment_idx])[bucket_idx]);
- HashNode<KeyType, ValueType>* entry =
- ((*table_[segment_idx])[bucket_idx]).get_next();
- while (entry != nullptr && entry->get_key() != key) {
- prev = entry;
- entry = entry->get_next();
- }
- if (LIKELY(entry == nullptr)) {
- void* buf = mem_alloc(sizeof(HashNode<KeyType, ValueType>),
- MOD_HASH_TABLE);
- if (UNLIKELY(nullptr == buf)) {
- // log_err("malloc() failed.");
- return E_OOM;
- }
- entry = new (buf) HashNode<KeyType, ValueType>;
- entry->set_key(key);
- entry->set_value(value);
- entry->set_valid(true);
- entry->set_rehashid(ATOMIC_LOAD(&hash_version_));
- prev->set_next(entry);
- ATOMIC_AAF(&size_, 1);
- } else {
- exist = true;
- value = entry->get_value();
- entry->set_rehashid(ATOMIC_LOAD(&hash_version_));
- }
- }
- return E_OK;
- }
-
- int get(const KeyType& key, ValueType& result_value) {
- if (!ATOMIC_LOAD(&size_)) {
- return E_NOT_EXIST;
- }
- int ret;
- ValueType result1;
- ValueType result2;
- ValueType result3;
- while (true) {
- uint64_t hv1 = ATOMIC_LOAD(&hash_version_);
-
- if ((hv1 & (1UL << 63))) {
- ret = get_by_bucket(key, result1,
- ATOMIC_LOAD(&old_table_capacity_));
- if (ret == E_OK) {
- result_value = result1;
- return ret;
- }
- ret = get_by_bucket(key, result2,
- ATOMIC_LOAD(&new_table_capacity_));
- if (ret == E_OK) {
- result_value = result2;
- return ret;
- }
- } else { //
- ret = get_by_bucket(key, result3,
- ATOMIC_LOAD(&new_table_capacity_));
- if (ret == E_OK) {
- result_value = result3;
- return ret;
- }
- }
-
- uint64_t hv2 = ATOMIC_LOAD(&hash_version_);
- if ((hv1 & (~(1UL << 63))) != (hv2 & (~(1UL << 63)))) {
- continue;
- } else if (ATOMIC_LOAD(&is_extending_)) {
- continue;
- } else {
- return E_NOT_EXIST;
- }
- }
- }
-
- int get_by_bucket(const KeyType& key, ValueType& result_value,
- size_t table_capacity) {
- uint32_t hash_value = hashfunc_(key);
- size_t segment_idx = hash_value % table_capacity;
- size_t bucket_idx = hash_value % SEGMENT_CAPACITY;
-
- table_[segment_idx]->mutexes_[bucket_idx].lock();
-
- if (!((*table_[segment_idx])[bucket_idx])
- .get_valid()) { // if current segment has no node
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_NOT_EXIST;
- } else if (((*table_[segment_idx])[bucket_idx]).get_key() == key) {
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- result_value = ((*table_[segment_idx])[bucket_idx]).get_value();
- return E_OK;
- } else {
- HashNode<KeyType, ValueType>* entry =
- ((*table_[segment_idx])[bucket_idx]).get_next();
- while (entry != nullptr) {
- if (entry->get_key() == key) {
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- result_value = entry->get_value();
- return E_OK;
- }
- entry = entry->get_next();
- }
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_NOT_EXIST;
- }
- }
-
- int remove(const KeyType& key) {
- if (!ATOMIC_LOAD(&size_)) {
- return E_NOT_EXIST;
- }
- int ret;
- while (true) {
- uint64_t hv1 = ATOMIC_LOAD(&hash_version_);
-
- if ((hv1 & (1UL << 63))) {
- ret = remove_by_bucket(key, ATOMIC_LOAD(&old_table_capacity_));
- if (ret == E_OK) {
- return ret;
- }
- ret = remove_by_bucket(key, ATOMIC_LOAD(&new_table_capacity_));
- if (ret == E_OK) {
- return ret;
- }
- } else {
- ret = remove_by_bucket(key, ATOMIC_LOAD(&new_table_capacity_));
- if (ret == E_OK) {
- return ret;
- }
- }
-
- uint64_t hv2 = ATOMIC_LOAD(&hash_version_);
- if ((hv1 & (~(1UL << 63))) != (hv2 & (~(1UL << 63)))) {
- continue;
- } else if (ATOMIC_LOAD(&is_extending_)) {
- continue;
- } else {
- return E_NOT_EXIST;
- }
- }
- }
-
- int remove_by_bucket(const KeyType& key, size_t table_capacity) {
- uint32_t hash_value = hashfunc_(key);
- size_t segment_idx = hash_value % table_capacity;
- size_t bucket_idx = hash_value % SEGMENT_CAPACITY;
-
- table_[segment_idx]->mutexes_[bucket_idx].lock();
-
- if (!((*table_[segment_idx])[bucket_idx])
- .get_valid()) { // if current segment has no node
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_NOT_EXIST;
- } else if (((*table_[segment_idx])[bucket_idx]).get_key() == key) {
- HashNode<KeyType, ValueType>* entry =
- ((*table_[segment_idx])[bucket_idx]).get_next();
- if (entry != nullptr) {
- ((*table_[segment_idx])[bucket_idx]).set_key(entry->get_key());
- ((*table_[segment_idx])[bucket_idx])
- .set_value(entry->get_value());
- ((*table_[segment_idx])[bucket_idx])
- .set_next(entry->get_next());
- ((*table_[segment_idx])[bucket_idx]).set_valid(true);
- ((*table_[segment_idx])[bucket_idx])
- .set_rehashid(entry->get_rehashid());
- entry->~HashNode();
- mem_free(entry);
- entry = nullptr;
- } else {
- ((*table_[segment_idx])[bucket_idx]).set_valid(false);
- }
- ATOMIC_AAF(&size_, -1);
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_OK;
- } else {
- HashNode<KeyType, ValueType>* prev =
- &((*table_[segment_idx])[bucket_idx]);
- HashNode<KeyType, ValueType>* entry =
- ((*table_[segment_idx])[bucket_idx]).get_next();
- while (entry != nullptr) {
- if (entry->get_key() == key) {
- prev->set_next(
- entry->get_next()); // remove node and reconnect
- entry->~HashNode();
- mem_free(entry);
- entry = nullptr;
- ATOMIC_AAF(&size_, -1);
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_OK;
- }
- prev = entry;
- entry = entry->get_next();
- }
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_NOT_EXIST;
- }
- }
-
- int remove_from_wrong_bucket(const KeyType& key, size_t segment_idx,
- size_t bucket_idx) {
- if (!ATOMIC_LOAD(&size_)) {
- return E_NO_MORE_DATA;
- }
-
- table_[segment_idx]->mutexes_[bucket_idx].lock();
-
- if (!((*table_[segment_idx])[bucket_idx])
- .get_valid()) { // if current segment has no node
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_NOT_EXIST;
- } else if (((*table_[segment_idx])[bucket_idx]).get_key() == key) {
- HashNode<KeyType, ValueType>* entry =
- ((*table_[segment_idx])[bucket_idx]).get_next();
- if (entry != nullptr) {
- ((*table_[segment_idx])[bucket_idx]).set_key(entry->get_key());
- ((*table_[segment_idx])[bucket_idx])
- .set_value(entry->get_value());
- ((*table_[segment_idx])[bucket_idx])
- .set_next(entry->get_next());
- ((*table_[segment_idx])[bucket_idx]).set_valid(true);
- ((*table_[segment_idx])[bucket_idx])
- .set_rehashid(entry->get_rehashid());
- entry->~HashNode();
- mem_free(entry);
- entry = nullptr;
- } else {
- ((*table_[segment_idx])[bucket_idx]).set_valid(false);
- }
- ATOMIC_AAF(&size_, -1);
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_OK;
- } else {
- HashNode<KeyType, ValueType>* prev =
- &((*table_[segment_idx])[bucket_idx]);
- HashNode<KeyType, ValueType>* entry =
- ((*table_[segment_idx])[bucket_idx]).get_next();
- while (entry != nullptr) {
- if (entry->get_key() == key) {
- prev->set_next(
- entry->get_next()); // remove node and reconnect
- entry->~HashNode();
- mem_free(entry);
- entry = nullptr;
- ATOMIC_AAF(&size_, -1);
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_OK;
- }
- prev = entry;
- entry = entry->get_next();
- }
- table_[segment_idx]->mutexes_[bucket_idx].unlock();
- return E_NOT_EXIST;
- }
- }
-
-#ifndef NDEBUG
- void print() {
- printf("<< The Hash Table >>\n");
- if (!ATOMIC_AAF(&size_, 0)) {
- printf(" Empty now!\n");
- return;
- }
- size_t bucket_num = 0;
- for (size_t i = 0; i < ATOMIC_AAF(&new_table_capacity_, 0); i++) {
- for (size_t j = 0; j < SEGMENT_CAPACITY; j++) {
- // printf("----(%ld)segment id is %ld, bucket id is %ld----\n",
- // bucket_num++, i, j);
- if ((*table_[i])[j].get_valid()) {
- printf("----(%ld)segment id is %ld, bucket id is %ld----\n",
- bucket_num++, i, j);
- std::cout << "| "
- << "key is " << (*table_[i])[j].get_key()
- << ", value is " << (*table_[i])[j].get_value()
- << ", rehashid is "
- << (int)(*table_[i])[j].get_rehashid()
- << std::endl;
- HashNode<KeyType, ValueType>* entry =
- ((*table_[i])[j]).get_next();
- while (entry != nullptr) {
- std::cout << "| "
- << "key is " << entry->get_key()
- << ", value is " << entry->get_value()
- << ", rehashid is "
- << (int)entry->get_rehashid() << std::endl;
- entry = entry->get_next();
- }
- } else {
- bucket_num++;
- }
- }
- }
- }
-#endif // #ifndef NDEBUG
-
- FORCE_INLINE bool empty() const { return ATOMIC_LOAD(&size_) == 0; }
-
- FORCE_INLINE size_t size() { return ATOMIC_LOAD(&size_); }
-
- FORCE_INLINE size_t total_capacity() {
- return ATOMIC_LOAD(&new_table_capacity_) * SEGMENT_CAPACITY;
- }
-
- private:
- size_t new_table_capacity_;
- size_t old_table_capacity_;
- size_t size_;
- uint64_t hash_version_;
- Array<HashSegm<KeyType, ValueType>*>
- table_; // the element in Array is pointer.
- bool is_inited_;
- uint8_t is_extending_;
- F hashfunc_;
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_HASH_TABLE_H
diff --git a/cpp/src/common/container/list.h b/cpp/src/common/container/list.h
deleted file mode 100644
index 88a733798..000000000
--- a/cpp/src/common/container/list.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef COMMON_CONTAINER_LIST_H
-#define COMMON_CONTAINER_LIST_H
-
-#include "common/allocator/page_arena.h"
-#include "utils/errno_define.h"
-
-namespace common {
-
-#define INVALID_NODE_PTR ((SimpleListNode *)0xABCDEF)
-
-/*
- * A very simple list.
- * There are such scenarios:
- * We prepare all data in the list, and pass the list as immutable
- * parameters to other module or caller. We never do delete or complex
- * push operations.
- * for example:
- * SchemaMgr::get_timeseries_by_tsid(TsID, list<ColumnDesc>&)
- * SchemaMgr::create_aligned_timeseries(..., const list<char*>
- * &measurement_list, ...)
- *
- * Note: not thread safe!
- */
-template <class T>
-class SimpleList {
- private:
- struct SimpleListNode {
- T data_;
- SimpleListNode *next_;
-
- SimpleListNode() : next_(nullptr) {}
- SimpleListNode(const T &data) : data_(data), next_(nullptr) {}
- };
-
- public:
- class Iterator {
- public:
- Iterator(SimpleListNode *node) : cur_(node) {}
- Iterator() : cur_(INVALID_NODE_PTR) {}
- T &get() { return cur_->data_; }
- FORCE_INLINE bool is_inited() const { return cur_ != INVALID_NODE_PTR; }
- FORCE_INLINE Iterator &operator++(int n) {
- if (LIKELY(cur_ != nullptr)) {
- cur_ = cur_->next_;
- }
- return *this;
- }
- FORCE_INLINE bool operator!=(const Iterator &other) const {
- return this->cur_ != other.cur_;
- }
- FORCE_INLINE bool operator==(const Iterator &other) const {
- return this->cur_ == other.cur_;
- }
-
- private:
- SimpleListNode *cur_;
- };
-
- public:
- SimpleList(const uint32_t page_size, AllocModID mid)
- : head_(nullptr), tail_(nullptr), size_(0) {
- own_page_arena_.init(page_size, mid);
- page_arena_ = &own_page_arena_;
- }
-
- SimpleList(PageArena *page_arena)
- : page_arena_(page_arena), head_(nullptr), tail_(nullptr), size_(0) {
- // page_arena_ should be destroy outside by caller
- }
-
- int push_back(const T &data) {
- void *buf = page_arena_->alloc(sizeof(SimpleListNode));
- if (UNLIKELY(buf == nullptr)) {
- return common::E_OOM;
- }
- SimpleListNode *node = new (buf) SimpleListNode(data);
- if (head_ == nullptr) {
- head_ = node;
- tail_ = node;
- } else {
- assert(tail_ != nullptr);
- tail_->next_ = node;
- tail_ = node;
- }
- size_++;
- return common::E_OK;
- }
-
- FORCE_INLINE T &front() {
- ASSERT(size_ > 0 && head_ != nullptr);
- return head_->data_;
- }
-
- int remove(T target) {
- if (head_ == nullptr) {
- return common::E_NOT_EXIST;
- }
- SimpleListNode *prev = head_;
- SimpleListNode *cur = head_->next_;
- while (cur && cur->data_ != target) {
- cur = cur->next_;
- }
- if (!cur) {
- return common::E_NOT_EXIST;
- }
- prev->next_ = cur->next_;
- size_--;
- // cur is allocated from PageArena, it should not reclaim now
- return common::E_OK;
- }
-
- FORCE_INLINE Iterator begin() const { return Iterator(head_); }
- FORCE_INLINE Iterator end() const { return Iterator(nullptr); }
- FORCE_INLINE uint32_t size() const { return size_; }
- FORCE_INLINE void clear() {
- head_ = nullptr;
- tail_ = nullptr;
- size_ = 0;
- own_page_arena_.destroy();
- }
-
- private:
- PageArena *page_arena_;
- PageArena own_page_arena_;
- SimpleListNode *head_;
- SimpleListNode *tail_;
- uint32_t size_;
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_LIST_H
diff --git a/cpp/src/common/container/murmur_hash3.cc b/cpp/src/common/container/murmur_hash3.cc
deleted file mode 100644
index 14a060228..000000000
--- a/cpp/src/common/container/murmur_hash3.cc
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * 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.
- */
-#include "murmur_hash3.h"
-
-namespace common {
-
-/* ================ Murmur128Hash ================ */
-// follow Java IoTDB exactly.
-int64_t Murmur128Hash::inner_hash(const char *buf, int32_t len, int64_t seed) {
- const int block_count = len >> 4; // as 128-bit blocks
- int64_t h1 = seed;
- int64_t h2 = seed;
- int64_t c1 = 0x87c37b91114253d5L;
- int64_t c2 = 0x4cf5ad432745937fL;
-
- for (int i = 0; i < block_count; i++) {
- int64_t k1 = get_block(buf, i * 2);
- int64_t k2 = get_block(buf, i * 2 + 1);
- k1 *= c1;
- k1 = rotl64(k1, 31);
- k1 *= c2;
- h1 ^= k1;
- h1 = rotl64(h1, 27);
- h1 += h2;
- h1 = h1 * 5 + 0x52dce729;
- k2 *= c2;
- k2 = rotl64(k2, 33);
- k2 *= c1;
- h2 ^= k2;
- h2 = rotl64(h2, 31);
- h2 += h1;
- h2 = h2 * 5 + 0x38495ab5;
- }
-
- int offset = block_count * 16;
- int64_t k1 = 0;
- int64_t k2 = 0;
- switch (len & 15) {
- case 15:
- k2 ^= ((int64_t)(buf[offset + 14])) << 48;
- // fallthrough
- case 14:
- k2 ^= ((int64_t)(buf[offset + 13])) << 40;
- // fallthrough
- case 13:
- k2 ^= ((int64_t)(buf[offset + 12])) << 32;
- // fallthrough
- case 12:
- k2 ^= ((int64_t)(buf[offset + 11])) << 24;
- // fallthrough
- case 11:
- k2 ^= ((int64_t)(buf[offset + 10])) << 16;
- // fallthrough
- case 10:
- k2 ^= ((int64_t)(buf[offset + 9])) << 8;
- // fallthrough
- case 9:
- k2 ^= buf[offset + 8];
- k2 *= c2;
- k2 = rotl64(k2, 33);
- k2 *= c1;
- h2 ^= k2;
- // fallthrough
- case 8:
- k1 ^= ((int64_t)buf[offset + 7]) << 56;
- // fallthrough
- case 7:
- k1 ^= ((int64_t)buf[offset + 6]) << 48;
- // fallthrough
- case 6:
- k1 ^= ((int64_t)buf[offset + 5]) << 40;
- // fallthrough
- case 5:
- k1 ^= ((int64_t)buf[offset + 4]) << 32;
- // fallthrough
- case 4:
- k1 ^= ((int64_t)buf[offset + 3]) << 24;
- // fallthrough
- case 3:
- k1 ^= ((int64_t)buf[offset + 2]) << 16;
- // fallthrough
- case 2:
- k1 ^= ((int64_t)buf[offset + 1]) << 8;
- // fallthrough
- case 1:
- k1 ^= buf[offset];
- k1 *= c1;
- k1 = rotl64(k1, 31);
- k1 *= c2;
- h1 ^= k1;
- break;
- default: // 0
- // do nothing
- break;
- }
-
- h1 ^= len;
- h2 ^= len;
- h1 += h2;
- h2 += h1;
- h1 = fmix(h1);
- h2 = fmix(h2);
- h1 += h2;
- h2 += h1;
- return h1 + h2;
-}
-
-int64_t Murmur128Hash::get_block(const char *buf, int32_t index) {
- int block_offset = index << 3;
- int64_t res = 0;
- res += ((int64_t)(buf[block_offset + 0] & 0xFF));
- res += (((int64_t)(buf[block_offset + 1] & 0xFF)) << 8);
- res += (((int64_t)(buf[block_offset + 2] & 0xFF)) << 16);
- res += (((int64_t)(buf[block_offset + 3] & 0xFF)) << 24);
- res += (((int64_t)(buf[block_offset + 4] & 0xFF)) << 32);
- res += (((int64_t)(buf[block_offset + 5] & 0xFF)) << 40);
- res += (((int64_t)(buf[block_offset + 6] & 0xFF)) << 48);
- res += (((int64_t)(buf[block_offset + 7] & 0xFF)) << 56);
- return res;
-}
-
-} // end namespace common
\ No newline at end of file
diff --git a/cpp/src/common/container/murmur_hash3.h b/cpp/src/common/container/murmur_hash3.h
deleted file mode 100644
index 1e2bf44ba..000000000
--- a/cpp/src/common/container/murmur_hash3.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_MURMUR3_MURMUR_HASH3_H
-#define COMMON_CONTAINER_MURMUR3_MURMUR_HASH3_H
-
-#include <string>
-
-#include "common/allocator/my_string.h"
-#include "utils/db_utils.h"
-
-namespace common {
-
-/*
- * Murmur128Hash has to follow the logic in Java IoTDB,
- * since the bitmap buffer will be serialized to tsfile.
- */
-class Murmur128Hash {
- public:
- FORCE_INLINE static int32_t hash(int32_t value, uint32_t seed) {
- return inner_hash(reinterpret_cast<const char *>(&value), 4, seed);
- }
-
- FORCE_INLINE static int32_t hash(int64_t value, uint32_t seed) {
- return inner_hash(reinterpret_cast<const char *>(&value), 8, seed);
- }
-
- FORCE_INLINE static int32_t hash(double value, uint32_t seed) {
- return inner_hash(reinterpret_cast<const char *>(&value), 8, seed);
- }
-
- FORCE_INLINE static int32_t hash(std::string &value, uint32_t seed) {
- return inner_hash(value.data(), static_cast<uint32_t>(value.size()),
- seed);
- }
-
- FORCE_INLINE static int32_t hash(const common::String &buf, int32_t seed) {
- return inner_hash(buf.buf_, buf.len_ - 1, seed);
- }
-
- private:
- FORCE_INLINE static int64_t rotl64(int64_t v, int n) {
- uint64_t uv = (uint64_t)v;
- return ((uv << n) | (uv >> (64 - n)));
- }
- FORCE_INLINE static int64_t fmix(int64_t k) {
- uint64_t uk = (uint64_t)k;
- uk ^= uk >> 33;
- uk *= 0xff51afd7ed558ccdL;
- uk ^= uk >> 33;
- uk *= 0xc4ceb9fe1a85ec53L;
- uk ^= uk >> 33;
- return (int64_t)uk;
- }
- static int64_t get_block(const char *buf, int32_t index);
- static int64_t inner_hash(const char *buf, int32_t len, int64_t seed);
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_MURMUR3_MURMUR_HASH3_H
diff --git a/cpp/src/common/container/simple_vector.h b/cpp/src/common/container/simple_vector.h
deleted file mode 100644
index 77b2d9516..000000000
--- a/cpp/src/common/container/simple_vector.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_VECTOR_H
-#define COMMON_CONTAINER_VECTOR_H
-
-#include <vector>
-
-#include "utils/util_define.h"
-
-namespace common {
-
-template <typename T>
-class SimpleVector {
- public:
- SimpleVector() : std_vec_(), size_(0) {}
- void push_back(T t) {
- if (LIKELY(size_ < STACKED_ITEM_COUNT)) {
- stacked_items_[size_] = t;
- } else {
- std_vec_.push_back(t);
- }
- size_++;
- }
- size_t size() { return size_; }
- T operator[](int index) {
- if (UNLIKELY((size_t)index > size_)) {
- abort();
- }
- if (index < STACKED_ITEM_COUNT) {
- return stacked_items_[index];
- } else {
- return std_vec_[index - STACKED_ITEM_COUNT];
- }
- }
-
- private:
- static const int STACKED_ITEM_COUNT = 16;
- T stacked_items_[STACKED_ITEM_COUNT];
- std::vector<T> std_vec_;
- size_t size_;
-};
-
-} // end namespace common
-#endif
diff --git a/cpp/src/common/container/slice.h b/cpp/src/common/container/slice.h
deleted file mode 100644
index 4f678d782..000000000
--- a/cpp/src/common/container/slice.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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.
- */
-#ifndef COMMON_CONTAINER_SLICE_H
-#define COMMON_CONTAINER_SLICE_H
-
-#include <cassert>
-#include <cstddef>
-#include <cstring>
-#include <string>
-
-#include "common/allocator/alloc_base.h"
-#include "common/logger/elog.h"
-#include "utils/errno_define.h"
-#include "utils/util_define.h"
-
-namespace common {
-
-class Slice {
- public:
- // Create an empty slice.
- // Slice() : data_(""), size_(0) {}
- Slice() {
- data_ = nullptr;
- size_ = 0;
- }
-
- // Create a slice that refers to the contents of "s"
- // Slice(const std::string& s) : data_(s.data()), size_(s.size()) {}
- Slice(const std::string &s) {
- int len = s.size();
- data_ = (char *)malloc(len + 1); // TODO: user ourself's mem_alloc()
- if (UNLIKELY(nullptr == data_)) {
- // log_err("malloc() failed.");
- }
- strcpy(data_, s.c_str());
- size_ = len;
- }
-
- // Create a slice that refers to s[0,strlen(s)-1]
- // Slice(const char* s) : data_(s), size_(strlen(s)) {}
- Slice(const char *s) {
- int len = strlen(s);
- data_ = (char *)malloc(len + 1); // TODO: user ourself's mem_alloc()
- if (UNLIKELY(nullptr == data_)) {
- // log_err("malloc() failed.");
- }
- strcpy(data_, s);
- size_ = len;
- }
-
- ~Slice() {
- free(data_); // TODO: user ourself's mem_free()
- data_ = nullptr;
- size_ = 0;
- }
-
- // Intentionally copyable.
- // Slice(const Slice&) = default;
- // Slice& operator=(const Slice&) = default;
- Slice(const Slice &other) {
- int len = other.size_;
- data_ = (char *)malloc(len + 1); // TODO: user ourself's mem_alloc()
- if (UNLIKELY(nullptr == data_)) {
- // log_err("malloc() failed.");
- }
- strcpy(data_, other.data_);
- size_ = len;
- }
- Slice &operator=(const Slice &other) {
- if (this->data_ != nullptr) {
- free(data_); // TODO: user ourself's mem_free()
- data_ = nullptr;
- }
- int len = other.size_;
- this->data_ =
- (char *)malloc(len + 1); // TODO: user ourself's mem_alloc()
- if (UNLIKELY(nullptr == data_)) {
- // log_err("malloc() failed.");
- }
- strcpy(this->data_, other.data_);
- this->size_ = len;
- return *this;
- }
-
- // Return a pointer to the beginning of the referenced data
- char *data() const { return data_; }
-
- // Return the length (in bytes) of the referenced data
- size_t size() const { return size_; }
-
- // Return true iff the length of the referenced data is zero
- bool empty() const { return size_ == 0; }
-
- // Return the ith byte in the referenced data.
- char operator[](size_t n) const {
- ASSERT(n < size());
- return data_[n];
- }
-
- // Return a string that contains the copy of the referenced data.
- std::string to_string() const { return std::string(data_, size_); }
-
- friend bool operator==(const Slice &x, const Slice &y) {
- return ((x.size() == y.size()) &&
- (memcmp(x.data(), y.data(), x.size()) == 0));
- }
-
- friend bool operator!=(const Slice &x, const Slice &y) { return !(x == y); }
-
- // Three-way comparison. Returns value:
- // < 0 iff "*this" < "b",
- // == 0 iff "*this" == "b",
- // > 0 iff "*this" > "b"
- int compare(const Slice &b) const {
- const size_t min_len = (size_ < b.size_) ? size_ : b.size_;
- int r = memcmp(data_, b.data_, min_len);
- if (r == 0) {
- if (size_ < b.size_)
- r = -1;
- else if (size_ > b.size_)
- r = +1;
- }
- return r;
- }
-
- private:
- char *data_;
- size_t size_;
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_SLICE_H
diff --git a/cpp/src/common/container/sorted_array.h b/cpp/src/common/container/sorted_array.h
deleted file mode 100644
index 175f96374..000000000
--- a/cpp/src/common/container/sorted_array.h
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * 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.
- */
-/*
- * no duplicated elements
- */
-#ifndef COMMON_CONTAINER_SORTEDARRAY_H
-#define COMMON_CONTAINER_SORTEDARRAY_H
-
-#include <stdint.h>
-
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <iostream>
-
-#include "common/allocator/alloc_base.h"
-#include "common/logger/elog.h"
-#include "utils/errno_define.h"
-#include "utils/util_define.h"
-
-#define SORTED_ARRAY_INIT_CAPACITY 1000 // TODO: configurable mode
-#define SORTED_ARRAY_GROWTH_THRESHOLD 50 // TODO: configurable mode
-#define SORTED_ARRAY_SHRINK_THRESHOLD 50 // TODO: configurable mode
-
-namespace common {
-
-template <class ValueType>
-class SortedArray {
- public:
-#ifndef NDEBUG
- friend std::ostream &operator<<(std::ostream &out,
- SortedArray<ValueType> &sa) {
- for (size_t idx = 0; idx < sa.size(); idx++) {
- if (idx > 0) {
- out << ' ';
- }
- out << sa.at(idx);
- }
- out << std::endl;
- return out;
- }
-#endif // NDEBUG
-
- SortedArray() {
- capacity_ = SORTED_ARRAY_INIT_CAPACITY;
- size_ = 0;
- is_inited_ = false;
- array_ = nullptr;
- }
-
- SortedArray(size_t capacity) {
- capacity_ = capacity;
- size_ = 0;
- is_inited_ = false;
- array_ = nullptr;
- }
-
- ~SortedArray() {
- if (is_inited_) {
- destroy();
- }
- capacity_ = 0;
- size_ = 0;
- }
-
- // int deep_copy(const SortedArray &other)
- // {
- // this->capacity_ = other.capacity_;
- // this->size_ = other.size_;
- // if (init() == E_OK) {
- // memcpy(this->array_, other.array_, this->capacity_ *
- // sizeof(*(this->array_))); return E_OK;
- // }
- // return E_OOM;
- // }
-
- int init() {
- if (is_inited_) {
- // log_err("init repeated.");
- ASSERT(!is_inited_);
- }
- array_ =
- (ValueType *)mem_alloc(capacity_ * sizeof(*(array_)), MOD_ARRAY);
- if (UNLIKELY(nullptr == array_)) {
- is_inited_ = false;
- // log_err("malloc failed.");
- return E_OOM;
- }
- is_inited_ = true;
- return E_OK;
- }
-
- void destroy() {
- capacity_ = 0;
- size_ = 0;
- if (is_inited_) {
- mem_free(array_);
- array_ = nullptr;
- }
- is_inited_ = false;
- }
-
- private:
- static size_t linear_calc(size_t input) {
- if (input < SORTED_ARRAY_GROWTH_THRESHOLD) {
- return input;
- }
- size_t res = 1;
- input /= 10;
- while (input) {
- input /= 10;
- res *= 10;
- }
- return res;
- }
-
- int extend() {
- // Check for a potential overflow
- uint64_t tmp = (uint64_t)(linear_calc(capacity_) + capacity_);
- if (tmp > SIZE_MAX) {
- // log_err("size overflow.");
- return E_OVERFLOW;
- }
-
- size_t new_capacity = (size_t)tmp;
- array_ =
- (ValueType *)mem_realloc(array_, new_capacity * sizeof(*(array_)));
- if (UNLIKELY(nullptr == array_)) {
- // log_err("realloc failed.");
- return E_OOM;
- }
- capacity_ = new_capacity;
- return E_OK;
- }
-
- int shrink() {
- size_t new_capacity = (size_t)(capacity_ / 2);
- // if the size passed to realloc is smaller than before, OS will
- // automatically release the rest memory
- array_ = (ValueType *)mem_realloc(
- array_,
- new_capacity *
- sizeof(*(array_))); // TODO: user ourself's mem_alloc()
- if (UNLIKELY(nullptr == array_)) {
- // log_err("malloc failed.");
- return E_OOM;
- }
- capacity_ = new_capacity;
- return E_OK;
- }
-
- public:
- int insert(const ValueType &value) {
- if (size_ >= capacity_) {
- int ret = extend();
- if (ret != E_OK) {
- return ret;
- }
- }
-
- bool found = false;
- size_t pos = find(value, found);
- if (found) {
- // log_warn("the new value has already in the sorted array.");
- return E_ALREADY_EXIST;
- }
-
- if (pos == size_) {
- array_[pos] = value;
- size_++;
- return E_OK;
- }
-
- memmove(array_ + (pos + 1), array_ + pos,
- (size_ - pos) * sizeof(*(array_)));
- array_[pos] = value;
- size_++;
- return E_OK;
- }
-
- FORCE_INLINE ValueType at(size_t idx) {
- if (idx >= size_) {
- // log_err("index %lu is out of range, because size is %lu.", idx,
- // size_);
- ASSERT(idx < size_);
- return dummy_;
- }
- return array_[idx];
- }
-
- FORCE_INLINE ValueType operator[](size_t idx) {
- if (idx >= size_) {
- // log_err("index %lu is out of range, because size is %lu.", idx,
- // size_);
- ASSERT(idx < size_);
- return dummy_;
- }
- return array_[idx];
- }
-
- bool contain(const ValueType &target_val) {
- if (size_ == 0) {
- return false;
- }
- int64_t left = 0;
- int64_t right = size_ - 1;
- while (left <= right) {
- size_t mid = (left + right) / 2;
- ValueType mid_val = array_[mid];
- if (mid_val == target_val) {
- return true;
- } else if (mid_val < target_val) {
- left = mid + 1;
- } else if (mid_val > target_val) {
- right = mid - 1;
- }
- }
- return false;
- }
-
- /*
- * if the value is not found, then set 'found' is false ant return the first
- * bigger one's location
- */
- size_t find(const ValueType &target_val, bool &found) {
- if (size_ == 0) {
- found = false;
- return 0;
- }
- int64_t left = 0;
- int64_t right = size_ - 1;
- while (left <= right) {
- size_t mid = (left + right) / 2;
- ValueType mid_val = array_[mid];
- if (mid_val == target_val) {
- found = true;
- return mid;
- } else if (mid_val < target_val) {
- left = mid + 1;
- } else if (mid_val > target_val) {
- right = mid - 1;
- }
- }
- found = false;
- return (size_t)left;
- }
-
- ValueType remove(size_t idx) {
- if (idx >= size_) {
- // log_err("index %lu is out of range, because size is %lu.", idx,
- // size_);
- ASSERT(idx < size_);
- }
- if (capacity_ > SORTED_ARRAY_SHRINK_THRESHOLD &&
- size_ <= capacity_ / 4) {
- shrink();
- }
- ValueType ret = array_[idx];
- memmove(array_ + idx, array_ + idx + 1,
- (size_ - idx - 1) * sizeof(*(array_)));
- size_--;
-
- return ret;
- }
-
- int remove_value(const ValueType &value) {
- bool found = false;
- size_t pos = find(value, found);
- if (found) {
- remove(pos);
- } else {
- // log_warn("the value is not exist in the array.");
- return E_NOT_EXIST;
- }
- return E_OK;
- }
-
- FORCE_INLINE void clear() { size_ = 0; }
-
- ValueType get_min() {
- if (size_ == 0) {
- // log_warn("The array is empty now.");
- ASSERT(size_ > 0);
- return dummy_;
- }
- return array_[0];
- }
-
- ValueType &get_max() {
- if (size_ == 0) {
- // log_warn("The array is empty now.");
- ASSERT(size_ > 0);
- return dummy_;
- }
- return array_[size_ - 1];
- }
-
- FORCE_INLINE bool empty() const { return ATOMIC_LOAD(&size_) == 0; }
-
- FORCE_INLINE size_t size() const { return ATOMIC_LOAD(&size_); }
-
- FORCE_INLINE size_t capacity() const { return ATOMIC_LOAD(&capacity_); }
-
- private:
- size_t capacity_;
- size_t size_;
- ValueType *array_;
- ValueType dummy_;
- bool is_inited_;
-};
-
-} // end namespace common
-#endif // COMMON_CONTAINER_SORTEDARRAY_H
diff --git a/cpp/src/common/datatype/CMakeLists.txt b/cpp/src/common/datatype/CMakeLists.txt
deleted file mode 100644
index f7db3afcc..000000000
--- a/cpp/src/common/datatype/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-#[[
-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
-
- https://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.
... 291708 lines suppressed ...