You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2025/07/17 08:34:34 UTC
(iotdb) branch ssl_between_nodes updated (314467e90ac -> 808e46b586e)
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a change to branch ssl_between_nodes
in repository https://gitbox.apache.org/repos/asf/iotdb.git
from 314467e90ac Fix cndn heart beat
new 4d4284c19eb deving
add 24209d50ace IoTV2: Remove events that do not retry in leader's transfer buffer & fix concurrency bug of retryQueue & fix retry interval & refine log (#15684)
add 3e6aaa3a4cc fix cpp client processing null value (#15700)
add e315e44bf94 User password encryption upgraded from MD5 to SHA256. (#15680)
add 6cee5f4fbee Fix arrary index out-of-bounds in agg query with align by device when cross region
add 921d9e24804 Subscription IT: intro retry rule for flaky tests (#15698)
add be0b921ea88 Pipe: Add retry for tablet batch req to avoid retransmission when memory is insufficient (#15715)
add 99ada4fbe40 Load: Convert to tablets when node is read-only (#15693)
add 18b10bc2d3b Pipe: Fix the inconsistency between schema and values columns in the process of building tsfile (#15625)
add c5b8d9c8c25 use environment variable and PBKDF to generate main encrypt key (#15711)
add 855ea12c523 Put last query IT only in 1c1d
add 83ebf5b1a9c Support order by time for Agg align by device query with cross region data
add b3d0ad72e31 Skip update-cache logic when loading TsFile in IoTV2Consensus (#15729)
add 369971c8164 fix datanode check (#15730)
add 9d474682cf5 Enhance "remove region" sql to handle the case of DataNode not exist (#15728)
add 346ee720e7a [remove datanode] Fix ArrayIndexOutOfBoundsException in computeInitialDbLoad (#15718)
add a2432d2fc2f Fixed the bug that the characters surrounded by "" cannot be parsed in tree view path
add 7b5a2b39416 Using join to query views of non-aligned series may throw NullPointerException
add 882c4b7898c Fixed the bug that the old view's cache is not cleared when altering its name
add 232e0c9054f Fix timeout didn't pass to client bug
add 726d0935320 Subscription: fix drop subscription from session under table model (#15725)
add cc3c442a1e2 Return empty result set for non aligned series when no filed columns can be obtained from view
add b34e05e5da4 fix exception msg in RPR
add 58927a19d3a Fixed the potential failure for table view query with pattern beyond databases
add ca2ad11712f Conf Template: Fix wrong symbol (#15742)
add 5d5e0478bc1 Pipe: Set WAL to uncompressed when using real-time sync (#15733)
add f7992dd37fb Pipe: Fixed the insert node EMA logic for degrading (#15741)
add 8763d57e8bb Fix RPROperator blocking behavior
add 55232d021e9 fix tsfile checker leak (#15710)
add 8a8a7bedb5b Avoiding error log by removing ThreadLocal for Mqtt Client
add 1fc3eae29b4 Fix TypeProvider and AggregationDescriptor serde in Templated Query
add 0c35003d41e Reset global time filter for each device in table view scan
add f55dfe07e5e Add more tests for removing datanode (#15749)
add 3ff855e98d0 Fix stuck when stopping a DataNode with large unremovable WAL files (#15727)
add ecdf0d77bc1 Fixed the device NPE for table view in view device & Added semantic check to prohibit the last data query for prefix paths with "*" & Refactored metric log of tag number
add 1b9a446ecea Pipe: Delete the extra tags created by the PipeWALInsertNodeCacheMetrics (#15761)
add 02febc0506e Optimize group by query in ClientRPCServiceImpl to reduce cpu usage
add bbe031aaebe Fix thread leak in session while connected DN is down
add e1b6e890dbc Pipe: Fixed the NPE when closing sync connector (#15772)
add c603b990c75 Subscription: return immediately when unsubscribe empty complete topics (#15770)
add a3920b0fd55 Pipe: Fixed the NPE caused by the compression timer (#15782)
add e227a53a726 Pipe/IoTV2: Persist progress index locally before shutdown to accurate recovery after restart (#15779)
add f7373707336 Opt error msg while time column is empty string
add 84b56d27b6b Improve argument validation for approx_most_frequent function
add b7bd5526b3f [Remove DataNode] Increase the waiting time for removing DN test (#15769)
add f706aacccaf Fix multiple bugs in window function
add 2b60aa5eecc [AINode] Unify .safetensors model loading through huggingface interfaces (#15756)
add cb24cb7f936 update go:package_prefix to v2 (#15795)
add 0505dfb9cb2 Fix the returning state of NotifyRegionMigrationProcedure (#15797)
add fb2684a8249 Export TsFile: manual commit instead of auto commit (#15798)
add f207084f03c Pipe: Add upper bound check for Pipe request decompression buffer (#15699)
add e1bd11b9d6e Fixed the issue with deeply nested Or Filter in NonAlignedTreeViewScan
add 89649f1d67d Prevent the contents of log_datanode_sample_query.log and log_explain_ananlyze.log from being output to log_datanode_all.log (#15800)
add 817150d29d9 Avoid NPE in fetch FI Info
add 71ef45d9e1c Add new parameter [ignoreNull] and supported data type for VARIATION Function (#15628)
add 5cb388190ae Parallel disptach read fragment instance
new 2ac954004d5 Merge branch 'master' of github.com:apache/iotdb into ssl_between_nodes
new 23dc90a4543 deving
add 5054ff6fbbc Throw CANNOT_FETCH_FI_STATE(722) instead of 301/305 while DN restarting
add 037ef649ad6 Fix sort elimination when table join self in TableModel
add b3435b79f42 Pause remove DN tests
add 35f2ff6fc5a Clarify the exception message when using a closed session (#15811)
add 7a7dbecb0b7 Avoid 301/305 code about fetch schema failed
add 71563ed372f Make timecol be case-insensitive
add 7afc2b65b41 [AINode] Update the class fields of IoTDB dataset (#15799)
add 1dc47d48e07 Rest Service add FastLastQuery method
add 88abd3e3097 Enhance it for cluster-restart tests (#15794)
add b8fd08984cb IoTV2: Refactor replicate index so that it is shared at the pipe task level & Add some log for delete local peer (#15815)
add 46c9827d846 Fix elimination rule of TopK when generate DistributionPlan
add 0ffa4b67deb Correct status code from 301 to 719 while memory not enough & Record release resource blocked too long by driver (#15828)
add 3016bb54e48 [AINode] Add TimerXL to the built-in list (#15832)
add 5c4c297e63d [AINode] Modify dataset module for table-model training (#15816)
add 30f69c61182 Add WAL entry number for one TsFile metric (#15818)
add 2b6400f275f [AINode] Support customize session config in AINode (#15834)
add 719c504d410 [AINode] Refactor the result columns of "show models" SQL (#15831)
add ccba945c67e [AINode] Simplify the CREATE MODEL SQL for model training (#15840)
add 354d6b5c732 [AINode] Quick bug fix patch (#15841)
add 2482a71b100 Fixed the issue that columns may not be pruned when querying non-field columns in tree view scan
add 1642f674103 Subscription: add config to enable or disable subscription (#15820)
add 16ad6c1a686 Resolve IndexOutOfPartitionBound and symbol not found in window functions.
add a0a4700b932 [AINode] Distinguish uppder and lower case of model id (#15847)
add 0927009a779 [AINode] Fix the seed when inference (#15850)
add 71df4956ef0 Subscription: intro poll and prefetch v2 for tsfile topic (#15790)
add be7a1de2b45 [AINode] Fix bug that AINode cannot register and invoke user_defined model (#15849)
add b1429293894 Fix the issue that symbol name is not found in tree view scan & Querying a time range with no data may throw an exception
add c30af2c6b53 Add size control of result for SimpleNestedLoopCrossJoinOperator
add e69fc997803 Pipe: Fixed the class cast exception of the table view meta sync (#15855)
add 5cda97b25d5 Support aggregation functions in RPR
add d86b86e87c4 Merge LastQueryScanNode of same device
add 03e701860ad [AINode] Add window_step options for dataset (#15857)
add 65b18ff9e3e Pipe: prevent historical extractor from forwarding TsFiles generated by pipe when isForwardingPipeRequests is false (#15845)
add f8e24dc71eb Feature/retry on disk failure (#15676)
add 5ef583cfe67 Disable the parameter 'ALLOW_ZERO-BYTE_CITE_SIDED_PROPERTY1 NAME' and fix null pointer exception (#15866)
add b04cd468c5a [AINode] Fix built-in model inference & support user parameters (#15868)
add baa9e1ac005 [AINode] IoTDBTreeModelDataset bug fix (#15869)
add d2a040003f3 Don't print exception stack for 719
add b4045de6eb2 Bump ratis to 3.2.0 (#15825)
add f2f00501a5e Pipe: Added rate limiter for tsFile sending (#15765)
add 1a035c4b8de Print measurement for putting buffer exceptions (#15873)
add ad8bedc1d50 Bump ratis to 3.2.1 (#15871)
add a184469ada3 When querying the lastest point of alias view and normal series at the same time, points may be lost due to overwriting
add 7800de6ad0d Correct the memroy calculation of BinaryColumnBuilder
add c5009f3ad61 Fix dead lock when take snapshot for Trigger and UDF
add 4cc6085e35c Pipe: Fix the error of Client object returning to object pool after file transfer is completed (#15883)
add acaa72d703b Try delete sort tmp after driver is closed
add 57f22e770b1 [AINode] Fix the bug that the built-in model be deleted (#15888)
add a10e2132d80 Fixed the NPE caused by view permission check
add 0a0ec3fb176 [AINode] Fix model management bugs (#15890)
add 966cfc73348 Change ErrorCode from 305 to 701 if there is no from clause
add 0fce0ccfdb0 Update tsfile version & add table view query it
add 309f205859d Update Release info after 2.0.4 released (#15898)
add 1ad56c78138 Pipe: Enabled waiting for pipes to finish & progress index persist to config node in shutdown hook (#15896)
add 14b4382ff44 [AINode]Fix the parameter "predict_length" (#15900)
add 4be53debee7 Fix potential memory leak of Memory Pool
add 9042a0d2c43 Pipe: Reduced the progress index report interval & Added some logs (#15905)
add e6bc39f4da5 Add more checkpoints in series scan
add bf8329b1517 Pipe: Fix connection leak caused by clients not closed after task dropped (2 situations) (#15910)
add f8e03f987f3 Fix the issue that the DeviceIteratorScanOperator.next() method throws NoSuchElementException
add eb1e786fa15 Revert Pipe/IoTV2: Try to persist progressIndex in local for resend event more efficently (#15924)
add ba6eed15d29 [AINode] Support model management for Table (#15923)
add 03385938f74 Bump org.apache.commons:commons-lang3 from 3.13.0 to 3.18.0 (#15922)
add ccfd563960b Correct Memory Allocation for SinkHandle in Table model
add ac44d8b8594 Make div and mod return long type if types of two inputs are all int64 or int32
add 1f24444a868 Fix timestamp type data conversion issue in exported data of table model (#15918)
add b2cdbe03f77 Fix display of Blob type in last query
add 59eb9bbb0a9 Fix explicit time query process in TreeModel
add d7844931a87 Fixed the issue that non aligned tree view query used too much memory
add 77a91e0f60a Remove CI on windows-2022 (#15938)
add 8472c71bcdc Fixed the issue where devices in the cache may be repeatedly fetched
add e139623037e [AINode] Remove AINode through SQL (#15937)
add f69347580e8 Avoid NPE while stop DN (#15939)
new 64761e2a963 Merge branch 'master' of github.com:apache/iotdb into ssl_between_nodes
new 9f77e329a87 dev
new 1ce4494eccf Grok4 is powerful
new 808e46b586e recover some code
The 7 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.
Summary of changes:
.github/workflows/multi-language-client.yml | 10 +-
RELEASE_NOTES.md | 22 +
dependencies.json | 14 +-
.../org/apache/iotdb/it/env/cluster/EnvUtils.java | 77 ++-
.../it/env/cluster/config/MppCommonConfig.java | 23 +
.../it/env/cluster/config/MppDataNodeConfig.java | 12 +
.../env/cluster/config/MppSharedCommonConfig.java | 26 +
.../iotdb/it/env/cluster/env/AbstractEnv.java | 266 +++++++++--
.../it/env/cluster/node/AbstractNodeWrapper.java | 13 +-
.../it/env/remote/config/RemoteCommonConfig.java | 16 +
.../it/env/remote/config/RemoteDataNodeConfig.java | 10 +
.../org/apache/iotdb/itbase/env/CommonConfig.java | 8 +
.../apache/iotdb/itbase/env/DataNodeConfig.java | 4 +
.../org/apache/iotdb/ainode/it/AINodeBasicIT.java | 270 -----------
.../iotdb/ainode/it/AINodeClusterConfigIT.java | 113 +++++
.../iotdb/ainode/it/AINodeInferenceSQLIT.java | 292 +++++++++++
.../iotdb/ainode/it/AINodeModelManageIT.java | 215 +++++++++
.../apache/iotdb/ainode/utils/AINodeTestUtils.java | 126 +++++
...reamIT.java => IoTDBConfigNodeSnapshot2IT.java} | 29 +-
.../confignode/it/IoTDBConfigNodeSnapshotIT.java | 5 +-
.../IoTDBRemoveConfigNodeITFramework.java | 2 +-
.../IoTDBRemoveDataNodeNormalIT.java | 366 +++++++++++++-
.../removedatanode/IoTDBRemoveDataNodeUtils.java | 178 +++++++
...work.java => IoTDBRemoveUnknownDataNodeIT.java} | 324 ++++++-------
.../confignode/it/utils/ConfigNodeTestUtils.java | 12 +
.../iotdb/db/it/IoTDBCustomizedClusterIT.java | 271 +++++++++++
.../org/apache/iotdb/db/it/IoTDBNestedQueryIT.java | 4 +-
.../maxby/IoTDBMaxByAlignedSeriesIT.java | 20 +
.../db/it/aggregation/maxby/IoTDBMaxByIT.java | 21 +-
.../db/it/aggregation/minby/IoTDBMinByIT.java | 5 +-
.../db/it/last/IoTDBLastQueryLastCacheIT.java | 15 +-
.../IoTDBArithmeticDivAndModWithoutDoubleIT.java} | 34 +-
.../withoutNull/IoTDBWithoutNullAllFilterIT.java | 48 +-
.../withoutNull/IoTDBWithoutNullAnyFilterIT.java | 48 +-
.../db/it/IoTDBMultiTAGsWithAttributesTableIT.java | 8 +-
.../it/db/it/IoTDBPatternAggregationIT.java | 492 +++++++++++++++++++
.../relational/it/db/it/IoTDBWindowFunctionIT.java | 233 ++++++++-
.../relational/it/db/it/IoTDBWindowTVFIT.java | 175 +++++++
.../it/query/recent/IoTDBTableAggregationIT.java | 181 +++++--
.../view/recent/IoTDBNullValueTableViewIT.java | 14 +-
.../query/view/recent/IoTDBTableViewQueryIT.java | 29 ++
.../IoTDBTableViewQueryWithCachedDeviceIT.java | 127 +++++
.../recent/IoTDBTableViewWithTreeTTLQueryIT.java | 38 +-
.../relational/it/schema/IoTDBDatabaseIT.java | 36 +-
.../iotdb/relational/it/schema/IoTDBTableIT.java | 72 ++-
.../iotdb/session/it/IoTDBSessionSimpleIT.java | 16 +
.../org/apache/iotdb/session/it/SessionIT.java | 133 +++++-
.../org/apache/iotdb/subscription/it/Retry.java | 10 +-
.../apache/iotdb/subscription/it/RetryRule.java | 69 +++
.../it/cluster/IoTDBSubscriptionRestartIT.java | 4 +
.../it/dual/AbstractSubscriptionDualIT.java | 4 +
.../it/local/AbstractSubscriptionLocalIT.java | 2 +
.../it/triple/AbstractSubscriptionTripleIT.java | 12 +
.../AbstractSubscriptionTreeRegressionIT.java | 71 ++-
.../IoTDBRootPullConsumeTsfileIT.java | 15 +-
.../format/IoTDBDBTsfilePullConsumerIT.java | 18 +-
.../IoTDBAllTsTsfilePullConsumerIT.java | 16 +-
.../IoTDBAllTsfilePullConsumerSnapshotIT.java | 14 +-
.../IoTDBPathDeviceTsfilePullConsumerIT.java | 17 +-
.../IoTDBTimeTsTsfilePullConsumerIT.java | 17 +-
.../IoTDBSnapshotDevicePullConsumerTsfileIT.java | 16 +-
.../multi/IoTDBOneConsumerMultiTopicsMixIT.java | 33 +-
.../multi/IoTDBOneConsumerMultiTopicsTsfileIT.java | 39 +-
.../pattern/IoTDBDBPatternPullConsumeTsfileIT.java | 15 +-
.../IoTDBDevicePatternPullConsumeTsfileIT.java | 14 +-
.../IoTDBRootPatternPullConsumeTsfileIT.java | 12 +-
.../pattern/IoTDBTSPatternPullConsumeTsfileIT.java | 15 +-
...oTDBSnapshotTSPatternDatasetPushConsumerIT.java | 8 +
...IoTDBSnapshotTSPatternTsfilePushConsumerIT.java | 8 +
.../multi/IoTDBOneConsumerMultiTopicsMixIT.java | 8 +
.../multi/IoTDBOneConsumerMultiTopicsTsfileIT.java | 18 +
.../topic/IoTDBDataSet1TopicConsumerSpecialIT.java | 4 +-
.../apache/iotdb/tools/it/ExportTsFileTestIT.java | 3 +
.../src/test/resources/ainode-example/config.yaml | 8 +-
...eption.java => UDFColumnNotFoundException.java} | 7 +-
...xception.java => UDFTypeMismatchException.java} | 7 +-
.../table/argument/ScalarArgumentChecker.java | 8 +
.../java/org/apache/iotdb/udf/api/type/Type.java | 10 +
.../org/apache/iotdb/tool/common/Constants.java | 3 +-
.../apache/iotdb/tool/data/ExportDataTable.java | 5 +-
.../subscription/SubscriptionTableTsFile.java | 2 +-
.../subscription/SubscriptionTreeTsFile.java | 2 +-
iotdb-client/client-cpp/src/main/Common.h | 15 +-
.../client-cpp/src/main/IoTDBRpcDataSet.cpp | 68 +--
iotdb-client/client-cpp/src/main/IoTDBRpcDataSet.h | 42 +-
iotdb-client/client-cpp/src/main/NodesSupplier.cpp | 16 +-
.../client-cpp/src/main/SessionDataSet.cpp | 78 ++-
iotdb-client/client-cpp/src/main/SessionDataSet.h | 32 +-
iotdb-client/client-cpp/src/test/cpp/sessionIT.cpp | 66 ++-
.../src/test/cpp/sessionRelationalIT.cpp | 81 +++-
.../java/org/apache/iotdb/isession/ISession.java | 6 +-
iotdb-client/service-rpc/pom.xml | 8 +
.../iotdb/rpc/NettyTNonBlockingTransport.java | 531 +++++++++++++++++++++
.../iotdb/rpc/TNonblockingSocketWrapper.java | 18 +
.../java/org/apache/iotdb/rpc/TSStatusCode.java | 4 +
.../java/org/apache/iotdb/session/Session.java | 267 ++++++-----
.../apache/iotdb/session/SessionConnection.java | 6 +-
.../apache/iotdb/session/TableSessionBuilder.java | 7 +-
.../subscription/AbstractSubscriptionSession.java | 2 +-
.../subscription/SubscriptionSessionWrapper.java | 4 +-
.../base/AbstractSubscriptionProvider.java | 31 +-
.../apache/iotdb/session/util/SessionUtils.java | 103 ++--
.../iotdb/session/util/SessionUtilsTest.java | 26 +-
iotdb-core/ainode/ainode/core/ainode.py | 167 +++++++
iotdb-core/ainode/ainode/core/config.py | 87 +++-
iotdb-core/ainode/ainode/core/constant.py | 45 +-
iotdb-core/ainode/ainode/core/exception.py | 5 +
iotdb-core/ainode/ainode/core/ingress/dataset.py | 20 +-
iotdb-core/ainode/ainode/core/ingress/iotdb.py | 278 ++++++-----
.../ainode/core/manager/inference_manager.py | 45 +-
.../ainode/ainode/core/manager/model_manager.py | 70 ++-
.../ainode/core/model/built_in_model_factory.py | 132 +++--
iotdb-core/ainode/ainode/core/model/model_info.py | 160 +++++++
.../ainode/ainode/core/model/model_storage.py | 407 ++++++++++++++--
.../ainode/core/model/sundial/modeling_sundial.py | 22 +-
.../core/model/sundial/ts_generation_mixin.py | 5 +
.../ainode/core/model/timerxl/modeling_timer.py | 22 +-
.../ainode/ainode/core/rpc}/__init__.py | 0
iotdb-core/ainode/ainode/core/{ => rpc}/client.py | 2 +-
iotdb-core/ainode/ainode/core/{ => rpc}/handler.py | 14 +-
iotdb-core/ainode/ainode/core/rpc/service.py | 101 ++++
.../ainode/ainode/core/{util => rpc}/status.py | 0
iotdb-core/ainode/ainode/core/script.py | 112 +----
iotdb-core/ainode/ainode/core/service.py | 57 ---
.../ainode/resources/conf/iotdb-ainode.properties | 32 +-
.../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 | 11 +-
.../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4 | 4 +
iotdb-core/confignode/pom.xml | 2 +-
.../rpc/DataNodeAsyncRequestRPCHandler.java | 2 +-
.../handlers/rpc/PipeHeartbeatRPCHandler.java | 2 +-
.../sync/SyncDataNodeHeartbeatClientPool.java | 70 ---
.../request/write/ainode/RemoveAINodePlan.java | 5 +
.../consensus/response/model/ModelTableResp.java | 13 +-
.../iotdb/confignode/manager/ConfigManager.java | 73 +--
.../apache/iotdb/confignode/manager/IManager.java | 7 +-
.../iotdb/confignode/manager/ModelManager.java | 60 ++-
.../iotdb/confignode/manager/ProcedureManager.java | 44 +-
.../region/GreedyCopySetRegionGroupAllocator.java | 8 +-
.../manager/load/service/HeartbeatService.java | 20 +-
.../manager/load/service/TopologyService.java | 9 +-
.../iotdb/confignode/manager/node/NodeManager.java | 20 +-
.../pipe/agent/task/PipeConfigNodeSubtask.java | 9 +-
.../pipe/agent/task/PipeConfigNodeTaskAgent.java | 22 +-
.../protocol/IoTDBConfigRegionAirGapConnector.java | 5 +
.../protocol/IoTDBConfigRegionConnector.java | 13 +-
.../runtime/heartbeat/PipeHeartbeatParser.java | 2 -
.../runtime/heartbeat/PipeHeartbeatScheduler.java | 2 +-
.../receiver/protocol/IoTDBConfigNodeReceiver.java | 7 +-
.../subscription/SubscriptionCoordinator.java | 3 +-
.../iotdb/confignode/persistence/ModelInfo.java | 28 +-
.../iotdb/confignode/persistence/TriggerInfo.java | 3 -
.../iotdb/confignode/persistence/UDFInfo.java | 3 -
.../partition/DatabasePartitionTable.java | 10 +-
.../persistence/partition/PartitionInfo.java | 2 +-
.../persistence/partition/RegionGroup.java | 6 +-
.../confignode/persistence/pipe/PipeTaskInfo.java | 7 +-
.../procedure/impl/model/DropModelProcedure.java | 57 +--
.../procedure/impl/node/RemoveAINodeProcedure.java | 24 +
.../impl/node/RemoveDataNodesProcedure.java | 5 +-
.../impl/pipe/runtime/PipeMetaSyncProcedure.java | 4 +-
.../impl/pipe/task/AlterPipeProcedureV2.java | 16 +-
.../impl/pipe/task/CreatePipeProcedureV2.java | 18 +-
.../region/NotifyRegionMigrationProcedure.java | 2 +-
.../procedure/impl/schema/SchemaUtils.java | 20 +-
.../table/AbstractAlterOrDropTableProcedure.java | 23 +-
.../impl/schema/table/CreateTableProcedure.java | 8 +-
.../impl/schema/table/RenameTableProcedure.java | 6 +-
.../procedure/state/RemoveAINodeState.java | 1 +
.../iotdb/confignode/service/ConfigNode.java | 12 +-
.../confignode/service/ConfigNodeShutdownHook.java | 3 -
.../thrift/ConfigNodeRPCServiceProcessor.java | 15 +-
.../request/ConfigPhysicalPlanSerDeTest.java | 12 +-
.../consensus/response/pipe/PipeTableRespTest.java | 6 +-
.../GreedyCopySetRemoveNodeReplicaSelectTest.java | 11 +-
.../agent/PipeConfigNodeSubtaskExecutorTest.java | 3 +-
.../iotdb/confignode/persistence/PipeInfoTest.java | 4 +-
iotdb-core/consensus/pom.xml | 14 +-
.../iot/client/AsyncIoTConsensusServiceClient.java | 16 +-
.../consensus/iot/logdispatcher/LogDispatcher.java | 2 +-
.../consensus/iot/logdispatcher/SyncStatus.java | 5 +-
.../apache/iotdb/consensus/pipe/PipeConsensus.java | 3 +-
.../consensus/pipe/PipeConsensusServerImpl.java | 19 +-
.../pipe/consensuspipe/ConsensusPipeConnector.java | 4 +-
.../consensuspipe/ReplicateProgressManager.java | 2 +-
.../pipe/metric/PipeConsensusSyncLagManager.java | 12 +-
iotdb-core/datanode/pom.xml | 2 +-
.../assembly/resources/conf/logback-datanode.xml | 6 +-
.../apache/iotdb/db/auth/BasicAuthorityCache.java | 2 +-
.../iotdb/db/auth/ClusterAuthorityFetcher.java | 5 +
.../org/apache/iotdb/db/conf/IoTDBDescriptor.java | 3 -
.../org/apache/iotdb/db/conf/IoTDBStartCheck.java | 29 +-
.../iotdb/db/exception/load/LoadFileException.java | 4 +
.../db/pipe/agent/task/PipeDataNodeTaskAgent.java | 80 ++--
.../task/builder/PipeDataNodeTaskBuilder.java | 68 ++-
.../task/execution/PipeSubtaskExecutorManager.java | 6 +-
.../subtask/connector/PipeConnectorSubtask.java | 5 +
.../connector/PipeConnectorSubtaskManager.java | 4 +
.../subtask/processor/PipeProcessorSubtask.java | 4 +-
.../client/IoTDBDataNodeAsyncClientManager.java | 20 +-
.../airgap/IoTDBDataRegionAirGapConnector.java | 33 +-
.../airgap/IoTDBSchemaRegionAirGapConnector.java | 5 +
.../pipeconsensus/PipeConsensusAsyncConnector.java | 41 +-
.../handler/PipeConsensusDeleteEventHandler.java | 4 +-
.../PipeConsensusTabletInsertionEventHandler.java | 5 +-
.../PipeConsensusTsFileInsertionEventHandler.java | 10 +-
.../async/IoTDBDataRegionAsyncConnector.java | 22 +-
.../handler/PipeTransferTrackableHandler.java | 2 +
.../async/handler/PipeTransferTsFileHandler.java | 28 +-
.../thrift/sync/IoTDBDataRegionSyncConnector.java | 27 +-
.../thrift/sync/IoTDBSchemaRegionConnector.java | 5 +
.../util/builder/PipeTableModelTsFileBuilder.java | 1 +
.../builder/PipeTableModelTsFileBuilderV2.java | 53 +-
.../util/builder/PipeTreeModelTsFileBuilder.java | 1 +
.../util/builder/PipeTreeModelTsFileBuilderV2.java | 42 +-
.../connector/util/builder/PipeTsFileBuilder.java | 40 +-
.../ReplicateProgressDataNodeManager.java | 21 +-
.../event/common/heartbeat/PipeHeartbeatEvent.java | 6 +-
.../statement/PipeStatementInsertionEvent.java | 6 +-
.../tablet/PipeInsertNodeTabletInsertionEvent.java | 6 +-
.../common/tablet/PipeRawTabletInsertionEvent.java | 6 +-
.../common/tsfile/PipeTsFileInsertionEvent.java | 6 +-
.../event/realtime/PipeRealtimeEventFactory.java | 50 +-
.../dataregion/IoTDBDataRegionExtractor.java | 39 +-
...oricalDataRegionTsFileAndDeletionExtractor.java | 39 +-
.../PipeRealtimeDataRegionHybridExtractor.java | 5 +-
.../realtime/assigner/PipeDataRegionAssigner.java | 18 +-
.../listener/PipeInsertionDataNodeListener.java | 11 +-
.../schemaregion/IoTDBSchemaRegionExtractor.java | 4 +-
.../iotdb/db/pipe/metric/PipeDataNodeMetrics.java | 6 +-
.../PipeDataNodeRemainingEventAndTimeOperator.java | 48 +-
...ics.java => PipeDataNodeSinglePipeMetrics.java} | 15 +-
.../pipe/metric/overview/PipeResourceMetrics.java | 14 +
.../overview/PipeWALInsertNodeCacheMetrics.java | 4 +-
.../pipeconsensus/PipeConsensusReceiver.java | 87 ++--
.../pipeconsensus/PipeConsensusReceiverAgent.java | 138 +++---
.../protocol/thrift/IoTDBDataNodeReceiver.java | 68 ++-
.../iotdb/db/protocol/client/ConfigNodeClient.java | 11 +-
.../iotdb/db/protocol/mqtt/MPPPublishHandler.java | 8 +-
.../protocol/rest/v2/handler/FastLastHandler.java | 71 +++
.../rest/v2/handler/RequestValidationHandler.java | 8 +
.../protocol/rest/v2/impl/RestApiServiceImpl.java | 230 ++++++---
.../iotdb/db/protocol/session/SessionManager.java | 14 +
.../protocol/thrift/impl/ClientRPCServiceImpl.java | 81 ++--
.../impl/DataNodeInternalRPCServiceImpl.java | 38 +-
.../db/queryengine/common/MPPQueryContext.java | 29 ++
.../execution/MemoryEstimationHelper.java | 28 ++
.../queryengine/execution/QueryStateMachine.java | 62 +--
.../execution/driver/DriverContext.java | 6 +
.../execution/exchange/SharedTsBlockQueue.java | 2 +-
.../queryengine/execution/exchange/sink/ISink.java | 4 +-
.../execution/exchange/sink/LocalSinkChannel.java | 14 +-
.../execution/exchange/sink/ShuffleSinkHandle.java | 40 +-
.../execution/exchange/sink/SinkChannel.java | 10 +-
.../exchange/source/LocalSourceHandle.java | 13 +-
.../execution/fragment/DataNodeQueryContext.java | 21 +-
.../fragment/FakedFragmentInstanceContext.java | 106 ++++
.../fragment/FragmentInstanceContext.java | 26 +-
.../fragment/FragmentInstanceExecution.java | 44 +-
.../fragment/FragmentInstanceManager.java | 8 +-
.../execution/fragment/QueryContext.java | 2 +-
.../process/PatternRecognitionOperator.java | 14 +
.../operator/process/ProjectOperator.java | 3 +-
.../operator/process/ai/InferenceOperator.java | 3 +-
.../join/SimpleNestedLoopCrossJoinOperator.java | 3 +-
.../last/AbstractUpdateLastCacheOperator.java | 24 +-
.../last/AlignedUpdateLastCacheOperator.java | 14 +-
.../AlignedUpdateViewPathLastCacheOperator.java | 10 +-
.../operator/process/last/LastQueryOperator.java | 1 +
.../process/last/LastQuerySortOperator.java | 10 +-
.../process/last/LastQueryTransformOperator.java | 4 +-
.../operator/process/last/LastQueryUtil.java | 34 ++
.../process/last/UpdateLastCacheOperator.java | 27 +-
.../last/UpdateViewPathLastCacheOperator.java | 4 +-
.../rowpattern/PatternAggregationTracker.java | 156 ++++++
.../process/rowpattern/PatternAggregator.java | 178 +++++++
.../process/rowpattern/PatternAggregators.java | 74 +++
.../rowpattern/PatternPartitionExecutor.java | 13 +
.../rowpattern/PatternVariableRecognizer.java | 8 +-
...cessor.java => PhysicalAggregationPointer.java} | 12 +-
.../rowpattern/expression/ArithmeticOperator.java | 7 +-
.../rowpattern/expression/ComparisonOperator.java | 8 +-
.../process/rowpattern/expression/Computation.java | 24 +-
.../rowpattern/expression/LogicalOperator.java | 4 +-
.../expression/PatternExpressionComputation.java | 21 +-
.../process/rowpattern/matcher/Matcher.java | 29 +-
.../process/window/TableWindowOperator.java | 7 +-
.../window/partition/PartitionExecutor.java | 17 +-
.../process/window/partition/frame/RangeFrame.java | 6 +-
.../process/window/utils/RowComparator.java | 20 +
.../schema/source/TableDeviceQuerySource.java | 23 +-
.../AbstractSeriesAggregationScanOperator.java | 70 ++-
.../source/AbstractSeriesScanOperator.java | 46 +-
.../execution/operator/source/SeriesScanUtil.java | 79 ++-
.../relational/AbstractAggTableScanOperator.java | 75 ++-
.../AbstractDefaultAggTableScanOperator.java | 4 +-
.../relational/AbstractMergeSortJoinOperator.java | 14 +
.../relational/AbstractTableScanOperator.java | 16 +-
.../relational/DeviceIteratorScanOperator.java | 3 +-
.../InformationSchemaContentSupplierFactory.java | 125 +++--
.../relational/LastQueryAggTableScanOperator.java | 4 +-
.../execution/schedule/task/DriverTaskId.java | 3 +-
.../iotdb/db/queryengine/plan/Coordinator.java | 19 +
.../db/queryengine/plan/analyze/Analysis.java | 33 +-
.../queryengine/plan/analyze/AnalyzeVisitor.java | 99 ++--
.../plan/analyze/ExpressionTypeAnalyzer.java | 29 ++
.../queryengine/plan/analyze/ExpressionUtils.java | 14 +-
.../db/queryengine/plan/analyze/TypeProvider.java | 8 +-
.../schema/dualkeycache/impl/DualKeyCacheImpl.java | 1 +
.../plan/analyze/load/LoadTsFileAnalyzer.java | 9 +-
.../queryengine/plan/execution/QueryExecution.java | 8 +-
.../execution/config/TableConfigTaskVisitor.java | 57 ++-
.../execution/config/TreeConfigTaskVisitor.java | 24 +-
.../config/executor/ClusterConfigTaskExecutor.java | 99 +++-
.../config/executor/IConfigTaskExecutor.java | 16 +-
...moveDataNodeTask.java => RemoveAINodeTask.java} | 12 +-
.../config/metadata/ai/CreateModelTask.java | 14 +-
.../config/metadata/ai/CreateTrainingTask.java | 41 +-
.../config/metadata/ai/ShowModelsTask.java | 72 ++-
.../metadata/relational/ShowCreateViewTask.java | 9 +-
.../execution/config/sys/pipe/ShowPipeTask.java | 4 +-
.../memory/StatementMemorySourceVisitor.java | 3 +-
.../visitor/ColumnTransformerVisitor.java | 11 +
.../db/queryengine/plan/parser/ASTVisitor.java | 36 +-
.../plan/planner/LogicalPlanBuilder.java | 152 +++---
.../plan/planner/OperatorTreeGenerator.java | 172 +++----
.../plan/planner/SubPlanTypeExtractor.java | 6 -
.../plan/planner/TableOperatorGenerator.java | 238 +++++++--
.../queryengine/plan/planner/TreeModelPlanner.java | 2 +-
.../planner/distribution/ExchangeNodeAdder.java | 15 +-
.../planner/distribution/NodeGroupContext.java | 12 +
.../SimpleFragmentParallelPlanner.java | 13 +-
.../plan/planner/distribution/SourceRewriter.java | 222 +++++++--
.../memory/FakedMemoryReservationManager.java} | 16 +-
.../plan/planner/plan/PlanFragment.java | 9 +
.../plan/planner/plan/node/PlanGraphPrinter.java | 18 +-
.../plan/planner/plan/node/PlanNodeType.java | 14 +-
.../plan/planner/plan/node/PlanVisitor.java | 5 -
.../planner/plan/node/process/AggregationNode.java | 3 +-
.../plan/node/process/MultiChildProcessNode.java | 4 +
.../plan/node/process/RawDataAggregationNode.java | 3 +-
.../plan/node/process/last/LastQueryNode.java | 141 +++++-
.../plan/node/source/AlignedLastQueryScanNode.java | 245 ----------
.../source/AlignedSeriesAggregationScanNode.java | 21 +-
.../plan/node/source/LastQueryScanNode.java | 193 ++++++--
.../node/source/SeriesAggregationScanNode.java | 15 +-
.../planner/plan/parameter/SeriesScanOptions.java | 24 +-
.../relational/analyzer/ExpressionAnalyzer.java | 179 ++++++-
.../relational/analyzer/StatementAnalyzer.java | 18 +-
.../function/tvf/ForecastTableFunction.java | 36 +-
.../metadata/fetcher/TableDeviceSchemaFetcher.java | 65 ++-
.../fetcher/TableDeviceSchemaValidator.java | 6 +-
.../plan/relational/planner/QueryPlanner.java | 44 +-
.../plan/relational/planner/RelationPlanner.java | 57 ++-
.../relational/planner/TableLogicalPlanner.java | 5 +
.../plan/relational/planner/TableModelPlanner.java | 2 +-
.../distribute/TableDistributedPlanGenerator.java | 35 +-
.../distribute/TableModelQueryFragmentPlanner.java | 1 +
.../optimizations/PushPredicateIntoTableScan.java | 3 +-
.../planner/optimizations/SortElimination.java | 60 ++-
.../planner/optimizations/SymbolMapper.java | 49 +-
.../optimizations/TransformSortToStreamSort.java | 33 +-
.../planner/rowpattern/AggregationLabelSet.java | 100 ++++
.../rowpattern/AggregationValuePointer.java | 161 +++++++
.../rowpattern/ExpressionAndValuePointers.java | 16 +
.../planner/rowpattern/IrRowPattern.java | 40 +-
.../plan/relational/sql/ast/AstVisitor.java | 12 +
.../sql/ast/{ShowModels.java => CreateModel.java} | 48 +-
.../plan/relational/sql/ast/CreateTraining.java | 85 +---
.../sql/ast/{ShowModels.java => DropModel.java} | 44 +-
.../plan/relational/sql/ast/Identifier.java | 6 +-
.../ast/{ShowFunctions.java => RemoveAINode.java} | 33 +-
.../plan/relational/sql/parser/AstBuilder.java | 118 ++---
.../plan/scheduler/ClusterScheduler.java | 11 +-
.../scheduler/FixedRateFragInsStateTracker.java | 34 +-
.../scheduler/FragmentInstanceDispatcherImpl.java | 108 ++++-
.../plan/scheduler/IFragInstanceDispatcher.java | 6 +-
.../scheduler/load/LoadTsFileDispatcherImpl.java | 4 +-
.../plan/scheduler/load/LoadTsFileScheduler.java | 29 +-
.../plan/statement/StatementVisitor.java | 5 +
.../plan/statement/crud/QueryStatement.java | 10 +-
...deStatement.java => RemoveAINodeStatement.java} | 14 +-
.../metadata/model/CreateModelStatement.java | 10 +-
.../metadata/model/CreateTrainingStatement.java | 14 +-
.../metadata/model/DropModelStatement.java | 10 +-
.../metadata/model/ShowModelsStatement.java | 12 +-
.../metadata/view/CreateLogicalViewStatement.java | 13 +-
.../dag/input/QueryDataSetInputLayer.java | 3 +
.../apache/iotdb/db/schemaengine/SchemaEngine.java | 10 +-
.../db/schemaengine/table/DataNodeTableCache.java | 42 +-
.../iotdb/db/schemaengine/table/ITableCache.java | 10 +-
.../java/org/apache/iotdb/db/service/DataNode.java | 13 +-
.../iotdb/db/service/DataNodeShutdownHook.java | 70 ++-
.../org/apache/iotdb/db/service/MQTTService.java | 2 +-
.../metrics/IoTDBInternalLocalReporter.java | 2 +-
.../iotdb/db/service/metrics/WritingMetrics.java | 13 +
.../db/storageengine/dataregion/DataRegion.java | 3 +-
.../utils/reader/SeriesDataBlockReader.java | 20 +-
.../dataregion/memtable/TsFileProcessor.java | 8 +
.../dataregion/snapshot/SnapshotLoader.java | 67 ++-
.../dataregion/tsfile/TsFileResourceList.java | 2 +-
.../tsfile/generator/TsFileNameGenerator.java | 63 +--
.../dataregion/utils/TsFileResourceUtils.java | 5 +-
.../storageengine/dataregion/wal/WALManager.java | 11 +-
.../allocation/AbstractNodeAllocationStrategy.java | 13 +-
.../file/AbstractTsFileRecoverPerformer.java | 2 +-
.../db/storageengine/load/LoadTsFileManager.java | 12 +-
.../storageengine/load/disk/ILoadDiskSelector.java | 3 +-
.../InheritSystemMultiDisksStrategySelector.java | 42 +-
.../db/storageengine/load/disk/MinIOSelector.java | 3 +-
.../load/limiter/LoadTsFileRateLimiter.java | 64 +--
.../storageengine/rescon/disk/FolderManager.java | 63 +++
.../db/storageengine/rescon/disk/TierManager.java | 4 +
.../rescon/disk/strategy/DirectoryStrategy.java | 34 ++
.../strategy/MaxDiskUsableSpaceFirstStrategy.java | 3 +
.../MinFolderOccupiedSpaceFirstStrategy.java | 4 +
.../strategy/RandomOnDiskUsableSpaceStrategy.java | 4 +
.../rescon/disk/strategy/SequenceStrategy.java | 4 +-
.../agent/SubscriptionReceiverAgent.java | 16 +-
.../agent/SubscriptionRuntimeAgent.java | 4 +
.../db/subscription/broker/SubscriptionBroker.java | 35 +-
.../broker/SubscriptionPrefetchingQueue.java | 387 ++++++++++++++-
.../broker/SubscriptionPrefetchingTabletQueue.java | 7 +-
.../broker/SubscriptionPrefetchingTsFileQueue.java | 6 -
.../SubscriptionPipeEventBatchSegmentLock.java} | 55 +--
.../event/batch/SubscriptionPipeEventBatches.java | 118 ++---
.../batch/SubscriptionPipeTsFileEventBatch.java | 40 +-
.../receiver/SubscriptionReceiverV1.java | 8 +
.../apache/iotdb/db/utils/ErrorHandlingUtils.java | 4 +-
.../iotdb/db/utils/sort/FileSpillerReader.java | 4 +-
.../SchemaRegionSimpleRecoverTest.java | 4 +-
.../queryengine/execution/exchange/StubSink.java | 6 +-
.../execution/operator/LastQueryOperatorTest.java | 6 +-
.../operator/LastQueryTreeSortOperatorTest.java | 6 +-
...nAlignedTreeDeviceViewScanOperatorTreeTest.java | 112 ++++-
.../process/TableStreamSortOperatorTest.java | 11 +-
.../operator/process/rowpattern/MatcherTest.java | 4 +-
.../db/queryengine/plan/analyze/AnalyzeTest.java | 4 +-
.../distribution/AggregationAlignByDeviceTest.java | 57 +++
.../plan/planner/distribution/LastQueryTest.java | 22 +-
.../logical/DataQueryLogicalPlannerTest.java | 86 ++--
...deTest.java => LastQueryScanNodeSerdeTest.java} | 51 +-
.../plan/relational/analyzer/AnalyzerTest.java | 5 +-
.../plan/relational/analyzer/JoinTest.java | 188 ++++++++
.../analyzer/RowPatternRecognitionTest.java | 32 ++
.../plan/relational/analyzer/SubQueryTest.java | 24 +
.../relational/analyzer/TableFunctionTest.java | 82 ++++
.../plan/relational/analyzer/TreeViewTest.java | 4 +-
.../fetcher/cache/TableDeviceSchemaCacheTest.java | 12 +-
.../planner/assertions/PlanMatchPattern.java | 4 +
.../security/encrypt/MessageDigestEncryptTest.java | 12 +-
.../storageengine/dataregion/DataRegionTest.java | 4 +-
.../TableModelCompactionWithTTLTest.java | 4 +-
.../AlignedSeriesScanLimitOffsetPushDownTest.java | 97 ++--
.../AlignedSeriesScanPredicatePushDownTest.java | 47 +-
...gleColumnSeriesScanLimitOffsetPushDownTest.java | 48 +-
.../read/reader/series/SeriesReaderTestUtil.java | 17 +
.../series/SeriesScanLimitOffsetPushDownTest.java | 60 +--
.../series/SeriesScanPredicatePushDownTest.java | 40 +-
.../file/UnsealedTsFileRecoverPerformerTest.java | 4 +-
.../org/apache/iotdb/metrics/utils/MetricInfo.java | 3 +-
iotdb-core/node-commons/pom.xml | 2 +-
.../conf/iotdb-system.properties.template | 2 +-
.../commons/auth/authorizer/BasicAuthorizer.java | 42 +-
.../apache/iotdb/commons/client/ClientManager.java | 27 +-
.../iotdb/commons/client/IClientManager.java | 3 +
.../iotdb/commons/client/ainode/AINodeClient.java | 30 ++
.../AsyncConfigNodeInternalServiceClient.java | 16 +-
.../async/AsyncDataNodeExternalServiceClient.java | 16 +-
.../async/AsyncDataNodeInternalServiceClient.java | 16 +-
.../AsyncDataNodeMPPDataExchangeServiceClient.java | 16 +-
.../async/AsyncPipeDataTransferServiceClient.java | 2 +-
.../commons/concurrent/IoTDBThreadPoolFactory.java | 28 ++
.../iotdb/commons/concurrent/ThreadName.java | 6 +-
.../apache/iotdb/commons/conf/CommonConfig.java | 173 +++----
.../iotdb/commons/conf/CommonDescriptor.java | 5 +
...meException.java => PortOccupiedException.java} | 14 +-
.../commons/exception/QueryTimeoutException.java | 4 +
.../iotdb/commons/model/ModelInformation.java | 2 +-
.../iotdb/commons/partition/DataPartition.java | 11 +-
.../org/apache/iotdb/commons/path/PartialPath.java | 16 +
.../agent/runtime/PipePeriodicalJobExecutor.java | 33 --
.../commons/pipe/agent/task/PipeTaskAgent.java | 13 +-
.../commons/pipe/agent/task/meta/PipeMeta.java | 6 +-
.../pipe/agent/task/meta/PipeRuntimeMeta.java | 42 +-
.../commons/pipe/agent/task/meta/PipeTaskMeta.java | 145 +-----
.../task/progress/PipeEventCommitManager.java | 11 -
.../iotdb/commons/pipe/config/PipeConfig.java | 54 +--
.../iotdb/commons/pipe/config/PipeDescriptor.java | 50 +-
.../config/constant/PipeConnectorConstant.java | 5 +
.../connector/limiter/GlobalRPCRateLimiter.java} | 15 +-
.../pipe/connector/limiter/GlobalRateLimiter.java | 14 +-
.../connector/limiter/TsFileSendRateLimiter.java} | 31 +-
.../thrift/request/PipeTransferCompressedReq.java | 15 +
.../connector/protocol/IoTDBAirGapConnector.java | 3 +
.../pipe/connector/protocol/IoTDBConnector.java | 4 +-
.../connector/protocol/IoTDBSslSyncConnector.java | 17 +-
.../iotdb/commons/pipe/event/EnrichedEvent.java | 4 +-
.../commons/pipe/receiver/IoTDBFileReceiver.java | 66 +--
.../commons/pipe/resource/log/PipeLogManager.java | 2 +-
.../commons/pipe/resource/log/PipeLogStatus.java | 4 +-
.../schema/column/ColumnHeaderConstant.java | 5 +-
.../security/encrypt/AsymmetricEncrypt.java | 23 +-
.../security/encrypt/MessageDigestEncrypt.java | 10 +-
.../iotdb/commons/service/metric/enums/Metric.java | 1 +
.../subscription/config/SubscriptionConfig.java | 6 +
.../relational/tvf/VariationTableFunction.java | 196 ++++++--
.../udf/builtin/relational/tvf/WindowTVFUtils.java | 6 +-
.../org/apache/iotdb/commons/utils/AuthUtils.java | 22 +-
.../apache/iotdb/commons/utils/JVMCommonUtils.java | 56 ++-
.../apache/iotdb/commons/utils/StatusUtils.java | 15 +-
.../iotdb/commons/pipe/task/PipeMetaDeSerTest.java | 22 +-
.../db/relational/grammar/sql/RelationalSql.g4 | 36 +-
iotdb-doap.rdf | 8 +
.../openapi/src/main/openapi3/iotdb_rest_v2.yaml | 25 +
.../thrift-ainode/src/main/thrift/ainode.thrift | 18 +-
.../thrift-commons/src/main/thrift/common.thrift | 7 +
.../src/main/thrift/confignode.thrift | 23 +-
.../thrift-datanode/src/main/thrift/client.thrift | 1 +
.../src/main/thrift/datanode.thrift | 10 +-
pom.xml | 24 +-
520 files changed, 14197 insertions(+), 5505 deletions(-)
delete mode 100644 integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeBasicIT.java
create mode 100644 integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeClusterConfigIT.java
create mode 100644 integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeInferenceSQLIT.java
create mode 100644 integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeModelManageIT.java
create mode 100644 integration-test/src/test/java/org/apache/iotdb/ainode/utils/AINodeTestUtils.java
copy integration-test/src/test/java/org/apache/iotdb/confignode/it/{regionmigration/pass/commit/stream/IoTDBRegionMigrateNormalForIoTV2StreamIT.java => IoTDBConfigNodeSnapshot2IT.java} (63%)
create mode 100644 integration-test/src/test/java/org/apache/iotdb/confignode/it/removedatanode/IoTDBRemoveDataNodeUtils.java
rename integration-test/src/test/java/org/apache/iotdb/confignode/it/removedatanode/{IoTDBRemoveDataNodeITFramework.java => IoTDBRemoveUnknownDataNodeIT.java} (55%)
create mode 100644 integration-test/src/test/java/org/apache/iotdb/db/it/IoTDBCustomizedClusterIT.java
copy integration-test/src/test/java/org/apache/iotdb/db/it/{groupby/IoTDBLeftORightCIT.java => query/IoTDBArithmeticDivAndModWithoutDoubleIT.java} (67%)
create mode 100644 integration-test/src/test/java/org/apache/iotdb/relational/it/db/it/IoTDBPatternAggregationIT.java
create mode 100644 integration-test/src/test/java/org/apache/iotdb/relational/it/query/view/recent/IoTDBTableViewQueryWithCachedDeviceIT.java
copy iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/SchemaRegion.java => integration-test/src/test/java/org/apache/iotdb/subscription/it/Retry.java (77%)
create mode 100644 integration-test/src/test/java/org/apache/iotdb/subscription/it/RetryRule.java
copy iotdb-api/udf-api/src/main/java/org/apache/iotdb/udf/api/exception/{UDFException.java => UDFColumnNotFoundException.java} (82%)
copy iotdb-api/udf-api/src/main/java/org/apache/iotdb/udf/api/exception/{UDFException.java => UDFTypeMismatchException.java} (83%)
create mode 100644 iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
create mode 100644 iotdb-core/ainode/ainode/core/ainode.py
create mode 100644 iotdb-core/ainode/ainode/core/model/model_info.py
copy {iotdb-client/client-py/iotdb => iotdb-core/ainode/ainode/core/rpc}/__init__.py (100%)
rename iotdb-core/ainode/ainode/core/{ => rpc}/client.py (99%)
rename iotdb-core/ainode/ainode/core/{ => rpc}/handler.py (84%)
create mode 100644 iotdb-core/ainode/ainode/core/rpc/service.py
rename iotdb-core/ainode/ainode/core/{util => rpc}/status.py (100%)
delete mode 100644 iotdb-core/ainode/ainode/core/service.py
delete mode 100644 iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/client/sync/SyncDataNodeHeartbeatClientPool.java
rename iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/metric/overview/{PipeDataNodeRemainingEventAndTimeMetrics.java => PipeDataNodeSinglePipeMetrics.java} (96%)
create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/rest/v2/handler/FastLastHandler.java
create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FakedFragmentInstanceContext.java
create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/rowpattern/PatternAggregationTracker.java
create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/rowpattern/PatternAggregator.java
create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/rowpattern/PatternAggregators.java
copy iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/rowpattern/{PhysicalValueAccessor.java => PhysicalAggregationPointer.java} (79%)
copy iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/config/metadata/{RemoveDataNodeTask.java => RemoveAINodeTask.java} (82%)
copy iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/{relational/sql/ast/JoinCriteria.java => planner/memory/FakedMemoryReservationManager.java} (70%)
delete mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/source/AlignedLastQueryScanNode.java
create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/rowpattern/AggregationLabelSet.java
create mode 100644 iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/rowpattern/AggregationValuePointer.java
copy iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/{ShowModels.java => CreateModel.java} (66%)
copy iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/{ShowModels.java => DropModel.java} (65%)
copy iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/{ShowFunctions.java => RemoveAINode.java} (69%)
copy iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/metadata/{RemoveConfigNodeStatement.java => RemoveAINodeStatement.java} (86%)
copy iotdb-core/datanode/src/main/java/org/apache/iotdb/db/{pipe/resource/tsfile/PipeTsFileResourceSegmentLock.java => subscription/event/batch/SubscriptionPipeEventBatchSegmentLock.java} (60%)
copy iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/node/source/{SeriesScanNodeSerdeTest.java => LastQueryScanNodeSerdeTest.java} (55%)
copy iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/exception/{IoTDBIORuntimeException.java => PortOccupiedException.java} (75%)
copy iotdb-core/{datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/DataTypeParameter.java => node-commons/src/main/java/org/apache/iotdb/commons/pipe/connector/limiter/GlobalRPCRateLimiter.java} (66%)
copy iotdb-core/{datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/execution/PipeConnectorSubtaskExecutor.java => node-commons/src/main/java/org/apache/iotdb/commons/pipe/connector/limiter/TsFileSendRateLimiter.java} (54%)
(iotdb) 06/07: Grok4 is powerful
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch ssl_between_nodes
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 1ce4494eccf814586bf0720e461b740b17ffb80c
Author: HTHou <ha...@apache.org>
AuthorDate: Thu Jul 17 16:02:06 2025 +0800
Grok4 is powerful
---
.../iotdb/rpc/NettyTNonBlockingTransport.java | 522 +++++++++------------
.../iotdb/confignode/conf/ConfigNodeConfig.java | 4 +-
.../manager/load/service/HeartbeatService.java | 20 +-
.../apache/iotdb/commons/conf/CommonConfig.java | 2 +-
4 files changed, 239 insertions(+), 309 deletions(-)
diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
index 7584ac68792..1f2456c4386 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
@@ -48,40 +48,51 @@ import javax.net.ssl.TrustManagerFactory;
import java.io.FileInputStream;
import java.io.IOException;
-import java.lang.reflect.Field;
+import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
-import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
+import java.nio.channels.ServerSocketChannel;
import java.security.KeyStore;
-import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.atomic.AtomicBoolean;
+/**
+ * A non-blocking Thrift transport implementation using Netty for asynchronous I/O. Integrates with
+ * Thrift's TAsyncClientManager using a dummy local SocketChannel for selector events. Supports
+ * SSL/TLS for secure communication.
+ */
public class NettyTNonBlockingTransport extends TNonblockingTransport {
private static final Logger logger = LoggerFactory.getLogger(NettyTNonBlockingTransport.class);
private final String host;
private final int port;
- private final int connectTimeoutMs = 60000;
+ private final int connectTimeoutMs;
+ private final long sslHandshakeTimeoutMs;
private final EventLoopGroup eventLoopGroup;
private final Bootstrap bootstrap;
- private Channel channel;
+ private volatile Channel channel;
private final AtomicBoolean connected = new AtomicBoolean(false);
private final AtomicBoolean connecting = new AtomicBoolean(false);
private final BlockingQueue<ByteBuf> readQueue = new LinkedBlockingQueue<>();
- private final Object writeLock = new Object();
- private NettySelectionKeyAdapter selectionKeyAdapter;
+ private final Object lock = new Object();
- // SSL 配置
+ // SSL configuration
private final String keystorePath;
private final String keystorePassword;
private final String truststorePath;
private final String truststorePassword;
+ // Dummy local socket for selector integration
+ private ServerSocketChannel dummyServer;
+ private java.nio.channels.SocketChannel dummyClient;
+ private java.nio.channels.SocketChannel dummyServerAccepted;
+ private int dummyPort;
+ private Selector selector; // Stored for wakeup if needed
+
public NettyTNonBlockingTransport(
String host,
int port,
@@ -93,15 +104,34 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
super(new TConfiguration());
this.host = host;
this.port = port;
+ this.connectTimeoutMs = 60000;
+ this.sslHandshakeTimeoutMs = 30000;
this.eventLoopGroup = new NioEventLoopGroup();
this.bootstrap = new Bootstrap();
this.keystorePath = keystorePath;
this.keystorePassword = keystorePassword;
this.truststorePath = truststorePath;
this.truststorePassword = truststorePassword;
+ initDummyChannels();
initBootstrap();
}
+ /** Initializes dummy local channels for selector event simulation. */
+ private void initDummyChannels() throws TTransportException {
+ try {
+ dummyServer = ServerSocketChannel.open();
+ dummyServer.configureBlocking(false);
+ dummyServer.bind(new InetSocketAddress("localhost", 0));
+ dummyPort = dummyServer.socket().getLocalPort();
+ logger.debug("Dummy server bound to localhost:{}", dummyPort);
+
+ dummyClient = java.nio.channels.SocketChannel.open();
+ dummyClient.configureBlocking(false);
+ } catch (IOException e) {
+ throw new TTransportException("Failed to initialize dummy channels", e);
+ }
+ }
+
private void initBootstrap() {
bootstrap
.group(eventLoopGroup)
@@ -113,28 +143,30 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
new ChannelInitializer<SocketChannel>() {
@Override
protected void initChannel(SocketChannel ch) throws Exception {
- logger.info("Initializing channel for {}:{}", host, port);
+ logger.debug("Initializing channel for {}:{}", host, port);
ChannelPipeline pipeline = ch.pipeline();
SslContext sslContext = createSslContext();
SslHandler sslHandler = sslContext.newHandler(ch.alloc(), host, port);
- // 增加握手超时时间
- sslHandler.setHandshakeTimeoutMillis(30000);
+ sslHandler.setHandshakeTimeoutMillis(sslHandshakeTimeoutMs);
pipeline.addLast("ssl", sslHandler);
- // 添加SSL握手完成监听器
sslHandler
.handshakeFuture()
.addListener(
future -> {
if (future.isSuccess()) {
- logger.info("SSL handshake completed successfully");
+ logger.info(
+ "SSL handshake completed successfully for {}:{}", host, port);
} else {
- logger.info("SSL handshake failed: {}", future.cause().getMessage());
+ logger.error(
+ "SSL handshake failed for {}:{}: {}",
+ host,
+ port,
+ future.cause().getMessage());
}
});
- // 添加业务处理器
pipeline.addLast("handler", new NettyTransportHandler());
}
});
@@ -143,7 +175,6 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
private SslContext createSslContext() throws Exception {
SslContextBuilder sslContextBuilder = SslContextBuilder.forClient();
- // 配置 KeyStore(客户端证书)
if (keystorePath != null && keystorePassword != null) {
KeyStore keyStore = KeyStore.getInstance("JKS");
try (FileInputStream fis = new FileInputStream(keystorePath)) {
@@ -155,7 +186,6 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
sslContextBuilder.keyManager(kmf);
}
- // 配置 TrustStore(信任的服务器证书)
if (truststorePath != null && truststorePassword != null) {
KeyStore trustStore = KeyStore.getInstance("JKS");
try (FileInputStream fis = new FileInputStream(truststorePath)) {
@@ -172,40 +202,43 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
@Override
public boolean isOpen() {
- return channel != null && channel.isActive() && connected.get();
+ synchronized (lock) {
+ return connected.get() || (channel != null && channel.isActive());
+ }
}
@Override
public void open() throws TTransportException {
- throw new RuntimeException("open() is not implemented for NettyTNonblockingTransport");
+ throw new TTransportException(
+ TTransportException.NOT_OPEN, "open() is not implemented; use startConnect() instead");
}
- /** Perform a nonblocking read into buffer. */
+ @Override
public int read(ByteBuffer buffer) throws TTransportException {
+ boolean readingResponseSize = buffer.remaining() == 4;
+
if (!isOpen()) {
- logger.info("Transport not open for ByteBuffer read");
+ logger.debug("Transport not open for ByteBuffer read");
throw new TTransportException(TTransportException.NOT_OPEN, "Transport not open");
}
+ ByteBuf byteBuf = null;
try {
- ByteBuf byteBuf = readQueue.poll();
+ byteBuf = readQueue.poll();
if (byteBuf == null) {
- logger.info("No data available for ByteBuffer read (non-blocking)");
- return 0; // 非阻塞读取,没有数据时返回 0
+ logger.info("No data available for ByteBuffer read");
+ return 0;
}
int available = Math.min(buffer.remaining(), byteBuf.readableBytes());
if (available > 0) {
- // 从 ByteBuf 读取数据到 ByteBuffer
byte[] tempArray = new byte[available];
byteBuf.readBytes(tempArray);
buffer.put(tempArray);
-
logger.info(
"Read {} bytes into ByteBuffer, remaining space: {}", available, buffer.remaining());
}
- // 如果还有剩余数据,创建一个新的 ByteBuf 包含剩余数据
if (byteBuf.readableBytes() > 0) {
ByteBuf remaining = byteBuf.slice();
remaining.retain();
@@ -213,41 +246,58 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
logger.info("Put back {} remaining bytes", remaining.readableBytes());
}
- byteBuf.release();
- return available;
+ // Drain dummy channel to clear OP_READ
+ ByteBuffer discard = ByteBuffer.allocate(16);
+ try {
+ while (dummyClient.read(discard) > 0) {
+ discard.clear();
+ }
+ } catch (IOException e) {
+ logger.warn("Failed to drain dummy channel", e);
+ }
+ if (readingResponseSize) {
+ // Trigger OP_READ on dummy by writing dummy byte
+ if (dummyServerAccepted != null) {
+ ByteBuffer dummyByte = ByteBuffer.wrap(new byte[1]);
+ dummyServerAccepted.write(dummyByte);
+ }
+ // Wakeup selector if needed
+ if (selector != null) {
+ selector.wakeup();
+ }
+ }
+ return available;
} catch (Exception e) {
- logger.warn("ByteBuffer read failed: ", e);
- throw new TTransportException(TTransportException.UNKNOWN, e);
+ logger.error("ByteBuffer read failed: {}", e.getMessage());
+ throw new TTransportException(TTransportException.UNKNOWN, "Read failed", e);
+ } finally {
+ if (byteBuf != null) {
+ byteBuf.release();
+ }
}
}
- /** Reads from the underlying input stream if not null. */
@Override
public int read(byte[] buf, int off, int len) throws TTransportException {
if (!isOpen()) {
- logger.info(
- "Transport not open for read - channel: "
- + (channel != null ? channel.isActive() : "null")
- + ", connected: "
- + connected.get());
+ logger.debug("Transport not open for read");
throw new TTransportException(TTransportException.NOT_OPEN, "Transport not open");
}
try {
- // 使用 ByteBuffer 包装数组进行读取
ByteBuffer buffer = ByteBuffer.wrap(buf, off, len);
return read(buffer);
} catch (Exception e) {
- logger.warn("Read failed: ", e);
- throw new TTransportException(TTransportException.UNKNOWN, e);
+ logger.error("Read failed: {}", e.getMessage());
+ throw new TTransportException(TTransportException.UNKNOWN, "Read failed", e);
}
}
- /** Perform a nonblocking write of the data in buffer; */
+ @Override
public int write(ByteBuffer buffer) throws TTransportException {
if (!isOpen()) {
- logger.info("Transport not open for ByteBuffer write");
+ logger.debug("Transport not open for ByteBuffer write");
throw new TTransportException(TTransportException.NOT_OPEN, "Transport not open");
}
@@ -256,170 +306,184 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
return 0;
}
- logger.info("Writing " + remaining + " bytes from ByteBuffer");
-
- synchronized (writeLock) {
- // 创建 ByteBuf 从 ByteBuffer
- ByteBuf byteBuf = Unpooled.buffer();
- byteBuf.writeBytes(buffer);
- ChannelFuture future = channel.writeAndFlush(byteBuf);
+ logger.info("Writing {} bytes from ByteBuffer", remaining);
- final int bytesToWrite = remaining;
- future.addListener(
- (GenericFutureListener<ChannelFuture>)
- future1 -> {
- if (future1.isSuccess()) {
- logger.info(
- "ByteBuffer write completed successfully: " + bytesToWrite + " bytes");
- } else {
- logger.warn("ByteBuffer write failed: " + future1.cause().getMessage());
- future1.cause().printStackTrace();
- }
- });
+ synchronized (lock) {
+ ByteBuf byteBuf = Unpooled.buffer(remaining);
+ try {
+ byteBuf.writeBytes(buffer);
+ ChannelFuture future = channel.writeAndFlush(byteBuf);
+ future.addListener(
+ (GenericFutureListener<ChannelFuture>)
+ future1 -> {
+ if (future1.isSuccess()) {
+ logger.debug("ByteBuffer write completed successfully: {} bytes", remaining);
+ } else {
+ logger.error("ByteBuffer write failed: {}", future1.cause().getMessage());
+ }
+ });
+ return remaining;
+ } catch (Exception e) {
+ byteBuf.release();
+ logger.error("ByteBuffer write failed: {}", e.getMessage());
+ throw new TTransportException(TTransportException.UNKNOWN, "Write failed", e);
+ }
}
-
- // 对于非阻塞写入,我们假设所有数据都能写入
- // 实际的写入状态通过 Future 监听器处理
- return remaining;
}
- /** Writes to the underlying output stream if not null. */
@Override
public void write(byte[] buf, int off, int len) throws TTransportException {
if (!isOpen()) {
- logger.info("Transport not open for write");
+ logger.debug("Transport not open for write");
throw new TTransportException(TTransportException.NOT_OPEN, "Transport not open");
}
- // 使用 ByteBuffer 包装数组进行写入
ByteBuffer buffer = ByteBuffer.wrap(buf, off, len);
write(buffer);
}
@Override
public void flush() throws TTransportException {
- // Not supported by SocketChannel.
+ if (!isOpen()) {
+ logger.debug("Transport not open for flush");
+ throw new TTransportException(TTransportException.NOT_OPEN, "Transport not open");
+ }
+ synchronized (lock) {
+ channel.flush();
+ logger.debug("Flushed channel");
+ }
}
@Override
public void close() {
- connected.set(false);
- if (channel != null) {
- channel.close();
+ synchronized (lock) {
+ connected.set(false);
+ if (channel != null) {
+ channel.close();
+ channel = null;
+ logger.info("Channel closed for {}:{}", host, port);
+ }
+ try {
+ if (dummyClient != null) {
+ dummyClient.close();
+ }
+ if (dummyServerAccepted != null) {
+ dummyServerAccepted.close();
+ }
+ if (dummyServer != null) {
+ dummyServer.close();
+ }
+ } catch (IOException e) {
+ logger.warn("Failed to close dummy channels", e);
+ }
+ eventLoopGroup.shutdownGracefully();
+ logger.info("EventLoopGroup shutdown initiated");
}
- eventLoopGroup.shutdownGracefully();
}
@Override
public boolean startConnect() throws IOException {
if (connected.get() || connecting.get()) {
- logger.info("Starting connection return " + (connected.get() || connecting.get()));
+ logger.debug("Connection already started or established for {}:{}", host, port);
return connected.get();
}
if (!connecting.compareAndSet(false, true)) {
+ logger.debug("Concurrent connection attempt detected for {}:{}", host, port);
return false;
}
- logger.info("Starting connection to " + host + ":" + port);
+
+ logger.info("Starting connection to {}:{}", host, port);
try {
+ // Initiate dummy connect, it will pend until accept
+ dummyClient.connect(new InetSocketAddress("localhost", dummyPort));
+
+ // Initiate Netty connect
ChannelFuture future = bootstrap.connect(host, port);
future.addListener(
(GenericFutureListener<ChannelFuture>)
future1 -> {
- if (future1.isSuccess()) {
- logger.info("Connection established successfully");
- channel = future1.channel();
- connected.set(true);
- if (selectionKeyAdapter != null) {
- selectionKeyAdapter.setConnected(true);
+ synchronized (lock) {
+ if (future1.isSuccess()) {
+ logger.info("Connection established successfully to {}:{}", host, port);
+ channel = future1.channel();
+ connected.set(true);
+ // Now accept the dummy connection to complete it
+ try {
+ dummyServerAccepted = dummyServer.accept();
+ if (dummyServerAccepted != null) {
+ dummyServerAccepted.configureBlocking(false);
+ logger.debug("Dummy server accepted connection");
+ // Wakeup selector to detect OP_CONNECT
+ if (selector != null) {
+ selector.wakeup();
+ }
+ }
+ } catch (IOException e) {
+ logger.warn("Failed to accept dummy connection", e);
+ }
+ } else {
+ logger.error(
+ "Connection failed to {}:{}: {}", host, port, future1.cause().getMessage());
}
+ connecting.set(false);
}
- connecting.set(false);
});
future.get();
- return true; // 异步连接,立即返回 false
+ return false; // Return false to indicate pending connect for dummy
} catch (Exception e) {
connecting.set(false);
- // throw new IOException("Failed to start connection", e);
- return false;
+ logger.error("Failed to start connection to {}:{}", host, port, e.getMessage());
+ throw new IOException("Failed to start connection", e);
}
}
@Override
public boolean finishConnect() throws IOException {
- return connected.get();
+ synchronized (lock) {
+ boolean dummyFinished = dummyClient.finishConnect();
+ boolean isConnected = connected.get() && dummyFinished;
+ logger.debug(
+ "finishConnect called, netty connected: {}, dummy finished: {}",
+ connected.get(),
+ dummyFinished);
+ return isConnected;
+ }
}
@Override
public SelectionKey registerSelector(Selector selector, int interests) throws IOException {
- if (selectionKeyAdapter == null) {
- selectionKeyAdapter = new NettySelectionKeyAdapter(this, selector, interests);
-
- // 尝试通过反射获取 selectedKeys 的可修改引用
- try {
- // 尝试不同的字段名,因为不同的 Selector 实现可能使用不同的字段名
- String[] possibleFieldNames = {"selectedKeys", "publicSelectedKeys", "keys"};
- Field selectedKeysField = null;
-
- for (String fieldName : possibleFieldNames) {
- try {
- selectedKeysField = selector.getClass().getSuperclass().getDeclaredField(fieldName);
- break;
- } catch (NoSuchFieldException e) {
- // 继续尝试下一个字段名
- }
- }
-
- if (selectedKeysField != null) {
- selectedKeysField.setAccessible(true);
- Object selectedKeysObj = selectedKeysField.get(selector);
-
- if (selectedKeysObj instanceof Set) {
- @SuppressWarnings("unchecked")
- Set<SelectionKey> selectedKeys = (Set<SelectionKey>) selectedKeysObj;
- selectionKeyAdapter.setSelectedKeysReference(selectedKeys);
- logger.info("Successfully obtained selectedKeys reference via reflection");
- try {
- selectionKeyAdapter.selectedKeysReference.add(selectionKeyAdapter);
- selector.wakeup();
- } catch (Exception e) {
- logger.warn("Failed to add to selectedKeys: " + e.getMessage());
- }
- }
- }
- } catch (Exception e) {
- logger.warn("Failed to access selectedKeys via reflection: " + e.getMessage());
- // 继续执行,使用备用方案
- }
-
- } else {
- selectionKeyAdapter.interestOps(interests);
+ synchronized (lock) {
+ this.selector = selector;
+ return dummyClient.register(selector, interests);
}
-
- return selectionKeyAdapter;
}
@Override
public String toString() {
- return "[remote: " + getRemoteAddress() + ", local: " + getLocalAddress() + "]";
+ synchronized (lock) {
+ return "[remote: " + getRemoteAddress() + ", local: " + getLocalAddress() + "]";
+ }
+ }
+
+ public SocketAddress getRemoteAddress() {
+ synchronized (lock) {
+ return channel != null ? channel.remoteAddress() : null;
+ }
+ }
+
+ public SocketAddress getLocalAddress() {
+ synchronized (lock) {
+ return channel != null ? channel.localAddress() : null;
+ }
}
- // Netty 处理器
private class NettyTransportHandler extends ChannelInboundHandlerAdapter {
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
- logger.info("Channel active: " + ctx.channel().remoteAddress());
-
- connected.set(true);
-
- // 更新 SelectionKey 状态
- if (selectionKeyAdapter != null) {
- selectionKeyAdapter.setConnected(true);
- selectionKeyAdapter.setReadReady(true);
- }
-
+ logger.info("Channel active: {}", ctx.channel().remoteAddress());
super.channelActive(ctx);
}
@@ -427,172 +491,40 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof ByteBuf) {
ByteBuf byteBuf = (ByteBuf) msg;
- logger.info("Received " + byteBuf.readableBytes() + " bytes");
-
- // 保留引用计数,将数据放入读取队列
- readQueue.offer(byteBuf.retain());
- byteBuf.release(); // 释放原始引用
-
- // 通知选择器适配器有数据可读
- if (selectionKeyAdapter != null) {
- selectionKeyAdapter.setReadReady(true);
+ logger.info("Received {} bytes", byteBuf.readableBytes());
+
+ synchronized (lock) {
+ readQueue.offer(byteBuf.retain());
+ // Trigger OP_READ on dummy by writing dummy byte
+ if (dummyServerAccepted != null) {
+ ByteBuffer dummyByte = ByteBuffer.wrap(new byte[1]);
+ dummyServerAccepted.write(dummyByte);
+ }
+ // Wakeup selector if needed
+ if (selector != null) {
+ selector.wakeup();
+ }
}
+ byteBuf.release();
}
}
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
- logger.info("Channel inactive");
-
- connected.set(false);
- connecting.set(false);
-
- // 更新 SelectionKey 状态
- if (selectionKeyAdapter != null) {
- selectionKeyAdapter.setConnected(false);
- selectionKeyAdapter.setReadReady(false);
+ logger.info("Channel inactive: {}", ctx.channel().remoteAddress());
+ synchronized (lock) {
+ connected.set(false);
+ connecting.set(false);
}
-
super.channelInactive(ctx);
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
- logger.warn("Channel exception: {}", cause.getMessage());
-
- // 更新 SelectionKey 状态
- if (selectionKeyAdapter != null) {
- selectionKeyAdapter.setConnected(false);
- selectionKeyAdapter.setReadReady(false);
- selectionKeyAdapter.cancel(); // 取消 SelectionKey
- }
-
- ctx.close();
- }
- }
-
- // SelectionKey 适配器类
- private static class NettySelectionKeyAdapter extends SelectionKey {
- private final NettyTNonBlockingTransport transport;
- private Selector selector;
- private int interestOps;
- private int readyOps = 0;
- private volatile boolean connected = false;
- private volatile boolean readReady = false;
- private volatile boolean valid = true;
- private Set<SelectionKey> selectedKeysReference;
-
- public NettySelectionKeyAdapter(
- NettyTNonBlockingTransport transport, Selector selector, int ops) {
- this.transport = transport;
- this.selector = selector;
- this.interestOps = ops;
- }
-
- public void setSelectedKeysReference(Set<SelectionKey> selectedKeys) {
- this.selectedKeysReference = selectedKeys;
- }
-
- @Override
- public SelectableChannel channel() {
- return null; // Netty 管理通道
- }
-
- @Override
- public Selector selector() {
- return selector;
- }
-
- @Override
- public void cancel() {
- this.valid = false;
- if (selectedKeysReference != null) {
- selectedKeysReference.remove(this);
- }
- logger.info("SelectionKey cancelled");
- }
-
- @Override
- public boolean isValid() {
- return valid;
- }
-
- @Override
- public SelectionKey interestOps(int ops) {
- this.interestOps = ops;
- logger.info("SelectionKey interestOps set to: " + ops);
- updateSelectorIfReady();
- return this;
- }
-
- @Override
- public int interestOps() {
- return interestOps;
- }
-
- @Override
- public int readyOps() {
- int ops = 0;
-
- // 检查连接状态
- if (connected && (interestOps & OP_CONNECT) != 0) {
- ops |= OP_CONNECT;
- }
-
- // 检查读取状态
- if (readReady && (interestOps & OP_READ) != 0) {
- ops |= OP_READ;
- }
-
- // 写入通常总是就绪的(如果连接是活跃的)
- if ((interestOps & OP_WRITE) != 0 && transport.isOpen()) {
- ops |= OP_WRITE;
- }
-
- if (ops != readyOps) {
- logger.info("SelectionKey readyOps changed: " + readyOps + " -> " + ops);
- }
-
- readyOps = ops;
- return readyOps;
- }
-
- public void setConnected(boolean connected) {
- this.connected = connected;
- updateSelectorIfReady();
- }
-
- public void setReadReady(boolean readReady) {
- if (this.readReady != readReady) {
- logger.info("ReadReady changed: {} -> {}", this.readReady, readReady);
+ logger.error("Channel exception: {}", cause.getMessage());
+ synchronized (lock) {
+ ctx.close();
}
- this.readReady = readReady;
- updateSelectorIfReady();
}
-
- private void updateSelectorIfReady() {
- if (selector != null && isValid() && selectedKeysReference != null) {
- int ready = readyOps();
- if (ready != 0) {
- try {
- selectedKeysReference.add(this);
- selector.wakeup();
- logger.info("Added self to selectedKeys via reference, readyOps: " + ready);
- } catch (Exception e) {
- logger.warn("Failed to add to selectedKeys: " + e.getMessage());
- }
- }
- }
- }
- }
-
- // 辅助方法:获取远程地址
- public SocketAddress getRemoteAddress() {
- return channel != null ? channel.remoteAddress() : null;
- }
-
- // 辅助方法:获取本地地址
- public SocketAddress getLocalAddress() {
- return channel != null ? channel.localAddress() : null;
}
}
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
index a8d5c330c5b..50c8f5bc9a0 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
@@ -61,10 +61,10 @@ public class ConfigNodeConfig {
private int configRegionId = 0;
/** ConfigNodeGroup consensus protocol. */
- private String configNodeConsensusProtocolClass = ConsensusFactory.SIMPLE_CONSENSUS;
+ private String configNodeConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
/** Schema region consensus protocol. */
- private String schemaRegionConsensusProtocolClass = ConsensusFactory.SIMPLE_CONSENSUS;
+ private String schemaRegionConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
/** Default number of SchemaRegion replicas. */
private int schemaReplicationFactor = 1;
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
index e079fac021f..59545dbec0a 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
@@ -27,7 +27,6 @@ import org.apache.iotdb.common.rpc.thrift.TEndPoint;
import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
import org.apache.iotdb.commons.concurrent.ThreadName;
import org.apache.iotdb.commons.concurrent.threadpool.ScheduledExecutorUtil;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.pipe.config.PipeConfig;
import org.apache.iotdb.confignode.client.async.AsyncAINodeHeartbeatClientPool;
import org.apache.iotdb.confignode.client.async.AsyncConfigNodeHeartbeatClientPool;
@@ -35,7 +34,6 @@ import org.apache.iotdb.confignode.client.async.AsyncDataNodeHeartbeatClientPool
import org.apache.iotdb.confignode.client.async.handlers.heartbeat.AINodeHeartbeatHandler;
import org.apache.iotdb.confignode.client.async.handlers.heartbeat.ConfigNodeHeartbeatHandler;
import org.apache.iotdb.confignode.client.async.handlers.heartbeat.DataNodeHeartbeatHandler;
-import org.apache.iotdb.confignode.client.sync.SyncDataNodeHeartbeatClientPool;
import org.apache.iotdb.confignode.conf.ConfigNodeDescriptor;
import org.apache.iotdb.confignode.manager.IManager;
import org.apache.iotdb.confignode.manager.consensus.ConsensusManager;
@@ -278,15 +276,15 @@ public class HeartbeatService {
configManager.getPipeManager().getPipeRuntimeCoordinator());
configManager.getClusterQuotaManager().updateSpaceQuotaUsage();
addConfigNodeLocationsToReq(dataNodeId, heartbeatReq);
-// if (CommonDescriptor.getInstance().getConfig().isEnableSSL()) {
-// SyncDataNodeHeartbeatClientPool.getInstance()
-// .getDataNodeHeartBeat(
-// dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
-// } else {
- AsyncDataNodeHeartbeatClientPool.getInstance()
- .getDataNodeHeartBeat(
- dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
-// }
+ // if (CommonDescriptor.getInstance().getConfig().isEnableSSL()) {
+ // SyncDataNodeHeartbeatClientPool.getInstance()
+ // .getDataNodeHeartBeat(
+ // dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
+ // } else {
+ AsyncDataNodeHeartbeatClientPool.getInstance()
+ .getDataNodeHeartBeat(
+ dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
+ // }
}
}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index 783769edaa4..852e55a65d3 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -406,7 +406,7 @@ public class CommonConfig {
private volatile Pattern trustedUriPattern = Pattern.compile("file:.*");
/** Enable the thrift Service ssl. */
- private boolean enableSSL = false;
+ private boolean enableSSL = true;
/** ssl key Store Path. */
private String keyStorePath = "/Users/ht/.keystore";
(iotdb) 07/07: recover some code
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch ssl_between_nodes
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 808e46b586e7179bc4e2601327fdfaf8e96570bf
Author: HTHou <ha...@apache.org>
AuthorDate: Thu Jul 17 16:33:39 2025 +0800
recover some code
---
.../iotdb/rpc/NettyTNonBlockingTransport.java | 29 ++++-----
.../iotdb/rpc/TNonblockingSocketWrapper.java | 3 +-
.../sync/SyncDataNodeHeartbeatClientPool.java | 70 ----------------------
.../iotdb/confignode/manager/load/LoadManager.java | 2 +-
.../iot/client/AsyncIoTConsensusServiceClient.java | 1 +
.../AsyncConfigNodeInternalServiceClient.java | 1 +
.../async/AsyncDataNodeExternalServiceClient.java | 1 +
.../async/AsyncDataNodeInternalServiceClient.java | 1 +
.../AsyncDataNodeMPPDataExchangeServiceClient.java | 1 +
9 files changed, 23 insertions(+), 86 deletions(-)
diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
index 1f2456c4386..d6911cea74d 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
@@ -96,6 +96,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
public NettyTNonBlockingTransport(
String host,
int port,
+ int connectTimeoutMs,
String keystorePath,
String keystorePassword,
String truststorePath,
@@ -104,8 +105,8 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
super(new TConfiguration());
this.host = host;
this.port = port;
- this.connectTimeoutMs = 60000;
- this.sslHandshakeTimeoutMs = 30000;
+ this.connectTimeoutMs = connectTimeoutMs;
+ this.sslHandshakeTimeoutMs = connectTimeoutMs;
this.eventLoopGroup = new NioEventLoopGroup();
this.bootstrap = new Bootstrap();
this.keystorePath = keystorePath;
@@ -156,7 +157,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
.addListener(
future -> {
if (future.isSuccess()) {
- logger.info(
+ logger.debug(
"SSL handshake completed successfully for {}:{}", host, port);
} else {
logger.error(
@@ -226,7 +227,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
try {
byteBuf = readQueue.poll();
if (byteBuf == null) {
- logger.info("No data available for ByteBuffer read");
+ logger.debug("No data available for ByteBuffer read");
return 0;
}
@@ -235,7 +236,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
byte[] tempArray = new byte[available];
byteBuf.readBytes(tempArray);
buffer.put(tempArray);
- logger.info(
+ logger.debug(
"Read {} bytes into ByteBuffer, remaining space: {}", available, buffer.remaining());
}
@@ -243,7 +244,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
ByteBuf remaining = byteBuf.slice();
remaining.retain();
readQueue.offer(remaining);
- logger.info("Put back {} remaining bytes", remaining.readableBytes());
+ logger.debug("Put back {} remaining bytes", remaining.readableBytes());
}
// Drain dummy channel to clear OP_READ
@@ -306,7 +307,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
return 0;
}
- logger.info("Writing {} bytes from ByteBuffer", remaining);
+ logger.debug("Writing {} bytes from ByteBuffer", remaining);
synchronized (lock) {
ByteBuf byteBuf = Unpooled.buffer(remaining);
@@ -361,7 +362,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
if (channel != null) {
channel.close();
channel = null;
- logger.info("Channel closed for {}:{}", host, port);
+ logger.debug("Channel closed for {}:{}", host, port);
}
try {
if (dummyClient != null) {
@@ -377,7 +378,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
logger.warn("Failed to close dummy channels", e);
}
eventLoopGroup.shutdownGracefully();
- logger.info("EventLoopGroup shutdown initiated");
+ logger.debug("EventLoopGroup shutdown initiated");
}
}
@@ -393,7 +394,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
return false;
}
- logger.info("Starting connection to {}:{}", host, port);
+ logger.debug("Starting connection to {}:{}", host, port);
try {
// Initiate dummy connect, it will pend until accept
@@ -406,7 +407,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
future1 -> {
synchronized (lock) {
if (future1.isSuccess()) {
- logger.info("Connection established successfully to {}:{}", host, port);
+ logger.debug("Connection established successfully to {}:{}", host, port);
channel = future1.channel();
connected.set(true);
// Now accept the dummy connection to complete it
@@ -483,7 +484,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
@Override
public void channelActive(ChannelHandlerContext ctx) throws Exception {
- logger.info("Channel active: {}", ctx.channel().remoteAddress());
+ logger.debug("Channel active: {}", ctx.channel().remoteAddress());
super.channelActive(ctx);
}
@@ -491,7 +492,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof ByteBuf) {
ByteBuf byteBuf = (ByteBuf) msg;
- logger.info("Received {} bytes", byteBuf.readableBytes());
+ logger.debug("Received {} bytes", byteBuf.readableBytes());
synchronized (lock) {
readQueue.offer(byteBuf.retain());
@@ -511,7 +512,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
- logger.info("Channel inactive: {}", ctx.channel().remoteAddress());
+ logger.debug("Channel inactive: {}", ctx.channel().remoteAddress());
synchronized (lock) {
connected.set(false);
connecting.set(false);
diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingSocketWrapper.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingSocketWrapper.java
index 9370d4a4373..1cfcd83e6db 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingSocketWrapper.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingSocketWrapper.java
@@ -62,13 +62,14 @@ public class TNonblockingSocketWrapper {
public static TNonblockingTransport wrap(
String host,
int port,
+ int timeout,
String keyStorePath,
String keyStorePwd,
String trustStorePath,
String trustStorePwd) {
try {
return new NettyTNonBlockingTransport(
- host, port, keyStorePath, keyStorePwd, trustStorePath, trustStorePwd);
+ host, port, timeout, keyStorePath, keyStorePwd, trustStorePath, trustStorePwd);
} catch (TTransportException e) {
// never happen
return null;
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/client/sync/SyncDataNodeHeartbeatClientPool.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/client/sync/SyncDataNodeHeartbeatClientPool.java
deleted file mode 100644
index b32f023dac2..00000000000
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/client/sync/SyncDataNodeHeartbeatClientPool.java
+++ /dev/null
@@ -1,70 +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.
- */
-
-package org.apache.iotdb.confignode.client.sync;
-
-import org.apache.iotdb.common.rpc.thrift.TEndPoint;
-import org.apache.iotdb.commons.client.ClientPoolFactory;
-import org.apache.iotdb.commons.client.IClientManager;
-import org.apache.iotdb.commons.client.sync.SyncDataNodeInternalServiceClient;
-import org.apache.iotdb.confignode.client.async.handlers.heartbeat.DataNodeHeartbeatHandler;
-import org.apache.iotdb.mpp.rpc.thrift.TDataNodeHeartbeatReq;
-import org.apache.iotdb.mpp.rpc.thrift.TDataNodeHeartbeatResp;
-
-/** Synchronously send RPC requests to DataNodes. See queryengine.thrift for more details. */
-public class SyncDataNodeHeartbeatClientPool {
-
- private final IClientManager<TEndPoint, SyncDataNodeInternalServiceClient> clientManager;
-
- private SyncDataNodeHeartbeatClientPool() {
- clientManager =
- new IClientManager.Factory<TEndPoint, SyncDataNodeInternalServiceClient>()
- .createClientManager(
- new ClientPoolFactory.SyncDataNodeHeartbeatServiceClientPoolFactory());
- }
-
- /**
- * Only used in LoadManager.
- *
- * @param endPoint The specific DataNode
- */
- public void getDataNodeHeartBeat(
- TEndPoint endPoint, TDataNodeHeartbeatReq req, DataNodeHeartbeatHandler handler) {
- try (SyncDataNodeInternalServiceClient client = clientManager.borrowClient(endPoint)) {
- TDataNodeHeartbeatResp resp = client.getDataNodeHeartBeat(req);
- handler.onComplete(resp);
- } catch (Exception e) {
- handler.onError(e);
- }
- }
-
- private static class SyncDataNodeHeartbeatClientPoolHolder {
-
- private static final SyncDataNodeHeartbeatClientPool INSTANCE =
- new SyncDataNodeHeartbeatClientPool();
-
- private SyncDataNodeHeartbeatClientPoolHolder() {
- // Empty constructor
- }
- }
-
- public static SyncDataNodeHeartbeatClientPool getInstance() {
- return SyncDataNodeHeartbeatClientPoolHolder.INSTANCE;
- }
-}
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
index b2f8a9189b3..54dd582551d 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
@@ -152,7 +152,7 @@ public class LoadManager {
statisticsService.startLoadStatisticsService();
eventService.startEventService();
partitionBalancer.setupPartitionBalancer();
- // topologyService.startTopologyService();
+ topologyService.startTopologyService();
}
public void stopLoadServices() {
diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java
index 4419ab2a72d..4a20b7c2f12 100644
--- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java
+++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java
@@ -62,6 +62,7 @@ public class AsyncIoTConsensusServiceClient extends IoTConsensusIService.AsyncCl
? TNonblockingSocketWrapper.wrap(
endpoint.getIp(),
endpoint.getPort(),
+ property.getConnectionTimeoutMs(),
commonConfig.getKeyStorePath(),
commonConfig.getKeyStorePwd(),
commonConfig.getTrustStorePath(),
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncConfigNodeInternalServiceClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncConfigNodeInternalServiceClient.java
index 0fae68ec249..0f86f1b2a37 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncConfigNodeInternalServiceClient.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncConfigNodeInternalServiceClient.java
@@ -64,6 +64,7 @@ public class AsyncConfigNodeInternalServiceClient extends IConfigNodeRPCService.
? TNonblockingSocketWrapper.wrap(
endpoint.getIp(),
endpoint.getPort(),
+ property.getConnectionTimeoutMs(),
commonConfig.getKeyStorePath(),
commonConfig.getKeyStorePwd(),
commonConfig.getTrustStorePath(),
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeExternalServiceClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeExternalServiceClient.java
index dad3eb02dc4..974df8f4222 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeExternalServiceClient.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeExternalServiceClient.java
@@ -64,6 +64,7 @@ public class AsyncDataNodeExternalServiceClient extends IDataNodeRPCService.Asyn
? TNonblockingSocketWrapper.wrap(
endpoint.getIp(),
endpoint.getPort(),
+ property.getConnectionTimeoutMs(),
commonConfig.getKeyStorePath(),
commonConfig.getKeyStorePwd(),
commonConfig.getTrustStorePath(),
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeInternalServiceClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeInternalServiceClient.java
index b39fce3bb87..f087d18b0e4 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeInternalServiceClient.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeInternalServiceClient.java
@@ -66,6 +66,7 @@ public class AsyncDataNodeInternalServiceClient extends IDataNodeRPCService.Asyn
? TNonblockingSocketWrapper.wrap(
endpoint.getIp(),
endpoint.getPort(),
+ property.getConnectionTimeoutMs(),
commonConfig.getKeyStorePath(),
commonConfig.getKeyStorePwd(),
commonConfig.getTrustStorePath(),
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeMPPDataExchangeServiceClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeMPPDataExchangeServiceClient.java
index 685105ef075..964ff7f1d94 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeMPPDataExchangeServiceClient.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeMPPDataExchangeServiceClient.java
@@ -62,6 +62,7 @@ public class AsyncDataNodeMPPDataExchangeServiceClient extends MPPDataExchangeSe
? TNonblockingSocketWrapper.wrap(
endpoint.getIp(),
endpoint.getPort(),
+ property.getConnectionTimeoutMs(),
commonConfig.getKeyStorePath(),
commonConfig.getKeyStorePwd(),
commonConfig.getTrustStorePath(),
(iotdb) 04/07: Merge branch 'master' of github.com:apache/iotdb into ssl_between_nodes
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch ssl_between_nodes
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 64761e2a963665f6a10fa87224609b6a11f6f870
Merge: 23dc90a4543 f69347580e8
Author: HTHou <ha...@apache.org>
AuthorDate: Tue Jul 15 18:26:23 2025 +0800
Merge branch 'master' of github.com:apache/iotdb into ssl_between_nodes
.github/workflows/multi-language-client.yml | 10 +-
RELEASE_NOTES.md | 22 +
dependencies.json | 14 +-
.../org/apache/iotdb/it/env/cluster/EnvUtils.java | 77 +++-
.../it/env/cluster/config/MppCommonConfig.java | 23 +
.../env/cluster/config/MppSharedCommonConfig.java | 26 ++
.../iotdb/it/env/cluster/env/AbstractEnv.java | 266 ++++++++---
.../it/env/cluster/node/AbstractNodeWrapper.java | 9 +-
.../it/env/remote/config/RemoteCommonConfig.java | 16 +
.../org/apache/iotdb/itbase/env/CommonConfig.java | 8 +
.../org/apache/iotdb/ainode/it/AINodeBasicIT.java | 270 -----------
.../iotdb/ainode/it/AINodeClusterConfigIT.java | 113 +++++
.../iotdb/ainode/it/AINodeInferenceSQLIT.java | 292 ++++++++++++
.../iotdb/ainode/it/AINodeModelManageIT.java | 215 +++++++++
.../apache/iotdb/ainode/utils/AINodeTestUtils.java | 126 ++++++
.../it/IoTDBConfigNodeSnapshot2IT.java} | 36 +-
.../confignode/it/IoTDBConfigNodeSnapshotIT.java | 5 +-
.../IoTDBRemoveDataNodeNormalIT.java | 4 +-
.../IoTDBRemoveUnknownDataNodeIT.java | 4 +-
.../iotdb/db/it/IoTDBCustomizedClusterIT.java | 127 +++++-
.../org/apache/iotdb/db/it/IoTDBNestedQueryIT.java | 4 +-
.../maxby/IoTDBMaxByAlignedSeriesIT.java | 20 +
.../db/it/aggregation/maxby/IoTDBMaxByIT.java | 21 +-
.../db/it/aggregation/minby/IoTDBMinByIT.java | 5 +-
.../db/it/last/IoTDBLastQueryLastCacheIT.java | 15 +-
.../IoTDBArithmeticDivAndModWithoutDoubleIT.java | 70 +++
.../withoutNull/IoTDBWithoutNullAllFilterIT.java | 48 +-
.../withoutNull/IoTDBWithoutNullAnyFilterIT.java | 48 +-
.../db/it/IoTDBMultiTAGsWithAttributesTableIT.java | 8 +-
.../it/db/it/IoTDBPatternAggregationIT.java | 492 +++++++++++++++++++++
.../relational/it/db/it/IoTDBWindowFunctionIT.java | 63 +++
.../view/recent/IoTDBNullValueTableViewIT.java | 14 +-
.../query/view/recent/IoTDBTableViewQueryIT.java | 24 +
.../IoTDBTableViewQueryWithCachedDeviceIT.java | 127 ++++++
.../relational/it/schema/IoTDBDatabaseIT.java | 32 +-
.../iotdb/session/it/IoTDBSessionSimpleIT.java | 16 +
.../org/apache/iotdb/session/it/SessionIT.java | 133 +++++-
.../it/cluster/IoTDBSubscriptionRestartIT.java | 4 +
.../it/dual/AbstractSubscriptionDualIT.java | 4 +
.../it/local/AbstractSubscriptionLocalIT.java | 2 +
.../it/triple/AbstractSubscriptionTripleIT.java | 12 +
.../AbstractSubscriptionTreeRegressionIT.java | 71 ++-
.../IoTDBRootPullConsumeTsfileIT.java | 15 +-
.../format/IoTDBDBTsfilePullConsumerIT.java | 18 +-
.../IoTDBAllTsTsfilePullConsumerIT.java | 16 +-
.../IoTDBAllTsfilePullConsumerSnapshotIT.java | 14 +-
.../IoTDBPathDeviceTsfilePullConsumerIT.java | 17 +-
.../IoTDBTimeTsTsfilePullConsumerIT.java | 17 +-
.../IoTDBSnapshotDevicePullConsumerTsfileIT.java | 16 +-
.../multi/IoTDBOneConsumerMultiTopicsMixIT.java | 33 +-
.../multi/IoTDBOneConsumerMultiTopicsTsfileIT.java | 39 +-
.../pattern/IoTDBDBPatternPullConsumeTsfileIT.java | 15 +-
.../IoTDBDevicePatternPullConsumeTsfileIT.java | 14 +-
.../IoTDBRootPatternPullConsumeTsfileIT.java | 12 +-
.../pattern/IoTDBTSPatternPullConsumeTsfileIT.java | 15 +-
.../multi/IoTDBOneConsumerMultiTopicsMixIT.java | 8 +
.../multi/IoTDBOneConsumerMultiTopicsTsfileIT.java | 11 +
.../topic/IoTDBDataSet1TopicConsumerSpecialIT.java | 4 +-
.../apache/iotdb/tools/it/ExportTsFileTestIT.java | 3 +
.../src/test/resources/ainode-example/config.yaml | 8 +-
.../apache/iotdb/tool/data/ExportDataTable.java | 5 +-
.../java/org/apache/iotdb/isession/ISession.java | 6 +-
.../java/org/apache/iotdb/rpc/TSStatusCode.java | 4 +
.../java/org/apache/iotdb/session/Session.java | 261 ++++++-----
.../apache/iotdb/session/SessionConnection.java | 6 +-
.../subscription/AbstractSubscriptionSession.java | 2 +-
.../subscription/SubscriptionSessionWrapper.java | 4 +-
.../base/AbstractSubscriptionProvider.java | 31 +-
.../apache/iotdb/session/util/SessionUtils.java | 103 +++--
.../iotdb/session/util/SessionUtilsTest.java | 26 +-
iotdb-core/ainode/ainode/core/ainode.py | 167 +++++++
iotdb-core/ainode/ainode/core/config.py | 77 +++-
iotdb-core/ainode/ainode/core/constant.py | 55 +--
iotdb-core/ainode/ainode/core/exception.py | 5 +
iotdb-core/ainode/ainode/core/ingress/dataset.py | 20 +-
iotdb-core/ainode/ainode/core/ingress/iotdb.py | 278 +++++++-----
.../ainode/core/manager/inference_manager.py | 37 +-
.../ainode/ainode/core/manager/model_manager.py | 36 +-
.../ainode/core/model/built_in_model_factory.py | 131 +++---
iotdb-core/ainode/ainode/core/model/model_info.py | 160 +++++++
.../ainode/ainode/core/model/model_storage.py | 358 +++++++++++++--
.../core/model/sundial/ts_generation_mixin.py | 5 +
.../core/{ingress/dataset.py => rpc/__init__.py} | 15 -
iotdb-core/ainode/ainode/core/{ => rpc}/client.py | 2 +-
iotdb-core/ainode/ainode/core/{ => rpc}/handler.py | 14 +-
iotdb-core/ainode/ainode/core/rpc/service.py | 101 +++++
.../ainode/ainode/core/{util => rpc}/status.py | 0
iotdb-core/ainode/ainode/core/script.py | 112 +----
iotdb-core/ainode/ainode/core/service.py | 57 ---
.../ainode/resources/conf/iotdb-ainode.properties | 32 +-
.../org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4 | 11 +-
.../antlr4/org/apache/iotdb/db/qp/sql/SqlLexer.g4 | 4 +
iotdb-core/confignode/pom.xml | 2 +-
.../rpc/DataNodeAsyncRequestRPCHandler.java | 2 +-
.../handlers/rpc/PipeHeartbeatRPCHandler.java | 2 +-
.../request/write/ainode/RemoveAINodePlan.java | 5 +
.../consensus/response/model/ModelTableResp.java | 13 +-
.../iotdb/confignode/manager/ConfigManager.java | 59 +--
.../apache/iotdb/confignode/manager/IManager.java | 7 +-
.../iotdb/confignode/manager/ModelManager.java | 60 ++-
.../iotdb/confignode/manager/node/NodeManager.java | 20 +-
.../pipe/agent/task/PipeConfigNodeTaskAgent.java | 22 +-
.../protocol/IoTDBConfigRegionAirGapConnector.java | 5 +
.../protocol/IoTDBConfigRegionConnector.java | 13 +-
.../runtime/heartbeat/PipeHeartbeatParser.java | 2 -
.../runtime/heartbeat/PipeHeartbeatScheduler.java | 2 +-
.../receiver/protocol/IoTDBConfigNodeReceiver.java | 7 +-
.../iotdb/confignode/persistence/ModelInfo.java | 28 +-
.../iotdb/confignode/persistence/TriggerInfo.java | 3 -
.../iotdb/confignode/persistence/UDFInfo.java | 3 -
.../confignode/persistence/pipe/PipeTaskInfo.java | 7 +-
.../procedure/impl/model/DropModelProcedure.java | 57 +--
.../procedure/impl/node/RemoveAINodeProcedure.java | 24 +
.../impl/pipe/runtime/PipeMetaSyncProcedure.java | 4 +-
.../impl/pipe/task/AlterPipeProcedureV2.java | 16 +-
.../impl/pipe/task/CreatePipeProcedureV2.java | 18 +-
.../procedure/state/RemoveAINodeState.java | 1 +
.../iotdb/confignode/service/ConfigNode.java | 12 +-
.../confignode/service/ConfigNodeShutdownHook.java | 3 -
.../thrift/ConfigNodeRPCServiceProcessor.java | 15 +-
.../request/ConfigPhysicalPlanSerDeTest.java | 12 +-
.../consensus/response/pipe/PipeTableRespTest.java | 6 +-
.../agent/PipeConfigNodeSubtaskExecutorTest.java | 3 +-
.../iotdb/confignode/persistence/PipeInfoTest.java | 4 +-
iotdb-core/consensus/pom.xml | 14 +-
.../apache/iotdb/consensus/pipe/PipeConsensus.java | 3 +-
.../pipe/consensuspipe/ConsensusPipeConnector.java | 4 +-
.../consensuspipe/ReplicateProgressManager.java | 2 +-
.../pipe/metric/PipeConsensusSyncLagManager.java | 12 +-
iotdb-core/datanode/pom.xml | 2 +-
.../iotdb/db/exception/load/LoadFileException.java | 4 +
.../db/pipe/agent/task/PipeDataNodeTaskAgent.java | 90 ++--
.../task/builder/PipeDataNodeTaskBuilder.java | 68 ++-
.../task/execution/PipeSubtaskExecutorManager.java | 6 +-
.../subtask/connector/PipeConnectorSubtask.java | 5 +
.../connector/PipeConnectorSubtaskManager.java | 4 +
.../subtask/processor/PipeProcessorSubtask.java | 4 +-
.../client/IoTDBDataNodeAsyncClientManager.java | 20 +-
.../airgap/IoTDBDataRegionAirGapConnector.java | 31 ++
.../airgap/IoTDBSchemaRegionAirGapConnector.java | 5 +
.../pipeconsensus/PipeConsensusAsyncConnector.java | 13 +-
.../async/IoTDBDataRegionAsyncConnector.java | 20 +-
.../handler/PipeTransferTrackableHandler.java | 2 +
.../async/handler/PipeTransferTsFileHandler.java | 28 +-
.../thrift/sync/IoTDBDataRegionSyncConnector.java | 21 +
.../thrift/sync/IoTDBSchemaRegionConnector.java | 5 +
.../connector/util/builder/PipeTsFileBuilder.java | 40 +-
.../ReplicateProgressDataNodeManager.java | 21 +-
.../event/common/heartbeat/PipeHeartbeatEvent.java | 6 +-
.../statement/PipeStatementInsertionEvent.java | 6 +-
.../tablet/PipeInsertNodeTabletInsertionEvent.java | 6 +-
.../common/tablet/PipeRawTabletInsertionEvent.java | 6 +-
.../common/tsfile/PipeTsFileInsertionEvent.java | 6 +-
.../event/realtime/PipeRealtimeEventFactory.java | 50 +--
.../dataregion/IoTDBDataRegionExtractor.java | 14 +-
...oricalDataRegionTsFileAndDeletionExtractor.java | 37 +-
.../PipeRealtimeDataRegionHybridExtractor.java | 5 +-
.../realtime/assigner/PipeDataRegionAssigner.java | 18 +-
.../listener/PipeInsertionDataNodeListener.java | 11 +-
.../schemaregion/IoTDBSchemaRegionExtractor.java | 4 +-
.../iotdb/db/pipe/metric/PipeDataNodeMetrics.java | 6 +-
.../PipeDataNodeRemainingEventAndTimeOperator.java | 18 +-
...ics.java => PipeDataNodeSinglePipeMetrics.java} | 15 +-
.../pipe/metric/overview/PipeResourceMetrics.java | 14 +
.../pipeconsensus/PipeConsensusReceiver.java | 75 ++--
.../protocol/thrift/IoTDBDataNodeReceiver.java | 5 +
.../iotdb/db/protocol/client/ConfigNodeClient.java | 11 +-
.../iotdb/db/protocol/mqtt/MPPPublishHandler.java | 4 +
.../protocol/rest/v2/handler/FastLastHandler.java | 71 +++
.../rest/v2/handler/RequestValidationHandler.java | 8 +
.../protocol/rest/v2/impl/RestApiServiceImpl.java | 230 +++++++---
.../protocol/thrift/impl/ClientRPCServiceImpl.java | 8 +-
.../impl/DataNodeInternalRPCServiceImpl.java | 28 +-
.../db/queryengine/common/MPPQueryContext.java | 29 ++
.../execution/MemoryEstimationHelper.java | 28 ++
.../queryengine/execution/QueryStateMachine.java | 62 +--
.../execution/exchange/SharedTsBlockQueue.java | 2 +-
.../queryengine/execution/exchange/sink/ISink.java | 4 +-
.../execution/exchange/sink/LocalSinkChannel.java | 14 +-
.../execution/exchange/sink/ShuffleSinkHandle.java | 40 +-
.../execution/exchange/sink/SinkChannel.java | 10 +-
.../execution/fragment/DataNodeQueryContext.java | 21 +-
.../fragment/FragmentInstanceContext.java | 7 +
.../fragment/FragmentInstanceExecution.java | 44 +-
.../process/PatternRecognitionOperator.java | 8 +
.../operator/process/ProjectOperator.java | 3 +-
.../operator/process/ai/InferenceOperator.java | 3 +-
.../join/SimpleNestedLoopCrossJoinOperator.java | 3 +-
.../last/AbstractUpdateLastCacheOperator.java | 24 +-
.../last/AlignedUpdateLastCacheOperator.java | 14 +-
.../AlignedUpdateViewPathLastCacheOperator.java | 10 +-
.../operator/process/last/LastQueryOperator.java | 1 +
.../process/last/LastQuerySortOperator.java | 10 +-
.../process/last/LastQueryTransformOperator.java | 4 +-
.../operator/process/last/LastQueryUtil.java | 34 ++
.../process/last/UpdateLastCacheOperator.java | 27 +-
.../last/UpdateViewPathLastCacheOperator.java | 4 +-
.../rowpattern/PatternAggregationTracker.java | 156 +++++++
.../process/rowpattern/PatternAggregator.java | 178 ++++++++
.../process/rowpattern/PatternAggregators.java | 74 ++++
.../rowpattern/PatternPartitionExecutor.java | 13 +
.../rowpattern/PatternVariableRecognizer.java | 8 +-
.../rowpattern/PhysicalAggregationPointer.java} | 15 +-
.../process/rowpattern/expression/Computation.java | 15 +-
.../expression/PatternExpressionComputation.java | 18 +-
.../process/rowpattern/matcher/Matcher.java | 29 +-
.../process/window/TableWindowOperator.java | 6 +-
.../window/partition/PartitionExecutor.java | 11 +-
.../AbstractSeriesAggregationScanOperator.java | 70 ++-
.../source/AbstractSeriesScanOperator.java | 46 +-
.../execution/operator/source/SeriesScanUtil.java | 73 ++-
.../relational/AbstractAggTableScanOperator.java | 75 +++-
.../AbstractDefaultAggTableScanOperator.java | 4 +-
.../relational/AbstractMergeSortJoinOperator.java | 14 +
.../relational/AbstractTableScanOperator.java | 16 +-
.../relational/DeviceIteratorScanOperator.java | 3 +-
.../InformationSchemaContentSupplierFactory.java | 125 ++++--
.../relational/LastQueryAggTableScanOperator.java | 4 +-
.../iotdb/db/queryengine/plan/Coordinator.java | 6 +
.../db/queryengine/plan/analyze/Analysis.java | 33 +-
.../queryengine/plan/analyze/AnalyzeVisitor.java | 99 +++--
.../plan/analyze/ExpressionTypeAnalyzer.java | 29 ++
.../queryengine/plan/analyze/ExpressionUtils.java | 14 +-
.../queryengine/plan/execution/QueryExecution.java | 8 +-
.../execution/config/TableConfigTaskVisitor.java | 57 ++-
.../execution/config/TreeConfigTaskVisitor.java | 24 +-
.../config/executor/ClusterConfigTaskExecutor.java | 99 ++++-
.../config/executor/IConfigTaskExecutor.java | 16 +-
.../CreateModelTask.java => RemoveAINodeTask.java} | 22 +-
.../config/metadata/ai/CreateModelTask.java | 14 +-
.../config/metadata/ai/CreateTrainingTask.java | 41 +-
.../config/metadata/ai/ShowModelsTask.java | 72 ++-
.../execution/config/sys/pipe/ShowPipeTask.java | 4 +-
.../memory/StatementMemorySourceVisitor.java | 3 +-
.../visitor/ColumnTransformerVisitor.java | 11 +
.../db/queryengine/plan/parser/ASTVisitor.java | 36 +-
.../plan/planner/LogicalPlanBuilder.java | 152 +++----
.../plan/planner/OperatorTreeGenerator.java | 160 ++++---
.../plan/planner/SubPlanTypeExtractor.java | 6 -
.../plan/planner/TableOperatorGenerator.java | 173 +++++++-
.../planner/distribution/ExchangeNodeAdder.java | 15 +-
.../planner/distribution/NodeGroupContext.java | 12 +
.../SimpleFragmentParallelPlanner.java | 12 +-
.../plan/planner/distribution/SourceRewriter.java | 152 +++++--
.../plan/planner/plan/node/PlanGraphPrinter.java | 18 +-
.../plan/planner/plan/node/PlanNodeType.java | 14 +-
.../plan/planner/plan/node/PlanVisitor.java | 5 -
.../plan/node/process/MultiChildProcessNode.java | 4 +
.../plan/node/process/last/LastQueryNode.java | 141 +++++-
.../plan/node/source/AlignedLastQueryScanNode.java | 245 ----------
.../plan/node/source/LastQueryScanNode.java | 193 ++++++--
.../relational/analyzer/ExpressionAnalyzer.java | 155 ++++++-
.../relational/analyzer/StatementAnalyzer.java | 18 +-
.../function/tvf/ForecastTableFunction.java | 22 +-
.../metadata/fetcher/TableDeviceSchemaFetcher.java | 53 ++-
.../plan/relational/planner/QueryPlanner.java | 2 +-
.../plan/relational/planner/RelationPlanner.java | 57 ++-
.../distribute/TableDistributedPlanGenerator.java | 24 +-
.../planner/optimizations/SymbolMapper.java | 49 +-
.../optimizations/TransformSortToStreamSort.java | 33 +-
.../planner/rowpattern/AggregationLabelSet.java | 100 +++++
.../rowpattern/AggregationValuePointer.java | 161 +++++++
.../rowpattern/ExpressionAndValuePointers.java | 16 +
.../plan/relational/sql/ast/AstVisitor.java | 12 +
.../plan/relational/sql/ast/CreateModel.java | 72 +++
.../plan/relational/sql/ast/CreateTraining.java | 85 +---
.../plan/relational/sql/ast/DropModel.java | 64 +++
.../plan/relational/sql/ast/Identifier.java | 6 +-
.../plan/relational/sql/ast/RemoveAINode.java | 64 +++
.../plan/relational/sql/parser/AstBuilder.java | 101 ++---
.../scheduler/FixedRateFragInsStateTracker.java | 34 +-
.../scheduler/FragmentInstanceDispatcherImpl.java | 7 +-
.../plan/statement/StatementVisitor.java | 5 +
.../plan/statement/crud/QueryStatement.java | 10 +-
...elStatement.java => RemoveAINodeStatement.java} | 43 +-
.../metadata/model/CreateModelStatement.java | 10 +-
.../metadata/model/CreateTrainingStatement.java | 14 +-
.../metadata/model/DropModelStatement.java | 10 +-
.../metadata/model/ShowModelsStatement.java | 12 +-
.../metadata/view/CreateLogicalViewStatement.java | 13 +-
.../dag/input/QueryDataSetInputLayer.java | 3 +
.../apache/iotdb/db/schemaengine/SchemaEngine.java | 10 +-
.../java/org/apache/iotdb/db/service/DataNode.java | 13 +-
.../iotdb/db/service/DataNodeShutdownHook.java | 39 +-
.../org/apache/iotdb/db/service/MQTTService.java | 2 +-
.../metrics/IoTDBInternalLocalReporter.java | 2 +-
.../iotdb/db/service/metrics/WritingMetrics.java | 13 +
.../utils/reader/SeriesDataBlockReader.java | 20 +-
.../dataregion/memtable/TsFileProcessor.java | 8 +
.../dataregion/snapshot/SnapshotLoader.java | 67 ++-
.../tsfile/generator/TsFileNameGenerator.java | 63 +--
.../allocation/AbstractNodeAllocationStrategy.java | 13 +-
.../db/storageengine/load/LoadTsFileManager.java | 12 +-
.../storageengine/load/disk/ILoadDiskSelector.java | 3 +-
.../InheritSystemMultiDisksStrategySelector.java | 42 +-
.../db/storageengine/load/disk/MinIOSelector.java | 3 +-
.../load/limiter/LoadTsFileRateLimiter.java | 64 +--
.../storageengine/rescon/disk/FolderManager.java | 63 +++
.../db/storageengine/rescon/disk/TierManager.java | 4 +
.../rescon/disk/strategy/DirectoryStrategy.java | 34 ++
.../strategy/MaxDiskUsableSpaceFirstStrategy.java | 3 +
.../MinFolderOccupiedSpaceFirstStrategy.java | 4 +
.../strategy/RandomOnDiskUsableSpaceStrategy.java | 4 +
.../rescon/disk/strategy/SequenceStrategy.java | 4 +-
.../agent/SubscriptionReceiverAgent.java | 16 +-
.../agent/SubscriptionRuntimeAgent.java | 4 +
.../db/subscription/broker/SubscriptionBroker.java | 35 +-
.../broker/SubscriptionPrefetchingQueue.java | 387 +++++++++++++++-
.../broker/SubscriptionPrefetchingTabletQueue.java | 7 +-
.../broker/SubscriptionPrefetchingTsFileQueue.java | 6 -
.../SubscriptionPipeEventBatchSegmentLock.java | 75 ++++
.../event/batch/SubscriptionPipeEventBatches.java | 118 ++---
.../batch/SubscriptionPipeTsFileEventBatch.java | 40 +-
.../receiver/SubscriptionReceiverV1.java | 2 +
.../apache/iotdb/db/utils/ErrorHandlingUtils.java | 4 +-
.../iotdb/db/utils/sort/FileSpillerReader.java | 4 +-
.../queryengine/execution/exchange/StubSink.java | 6 +-
.../execution/operator/LastQueryOperatorTest.java | 6 +-
.../operator/LastQueryTreeSortOperatorTest.java | 6 +-
...nAlignedTreeDeviceViewScanOperatorTreeTest.java | 69 ++-
.../process/TableStreamSortOperatorTest.java | 11 +-
.../operator/process/rowpattern/MatcherTest.java | 4 +-
.../db/queryengine/plan/analyze/AnalyzeTest.java | 4 +-
.../plan/planner/distribution/LastQueryTest.java | 22 +-
.../logical/DataQueryLogicalPlannerTest.java | 86 ++--
.../node/source/LastQueryScanNodeSerdeTest.java | 70 +++
.../plan/relational/analyzer/AnalyzerTest.java | 5 +-
.../plan/relational/analyzer/JoinTest.java | 188 ++++++++
.../plan/relational/analyzer/SubQueryTest.java | 24 +
.../relational/analyzer/TableFunctionTest.java | 82 ++++
.../planner/assertions/PlanMatchPattern.java | 4 +
.../AlignedSeriesScanLimitOffsetPushDownTest.java | 97 ++--
.../AlignedSeriesScanPredicatePushDownTest.java | 47 +-
...gleColumnSeriesScanLimitOffsetPushDownTest.java | 48 +-
.../read/reader/series/SeriesReaderTestUtil.java | 17 +
.../series/SeriesScanLimitOffsetPushDownTest.java | 60 +--
.../series/SeriesScanPredicatePushDownTest.java | 40 +-
iotdb-core/node-commons/pom.xml | 2 +-
.../apache/iotdb/commons/client/ClientManager.java | 27 +-
.../iotdb/commons/client/IClientManager.java | 3 +
.../iotdb/commons/client/ainode/AINodeClient.java | 30 ++
.../async/AsyncPipeDataTransferServiceClient.java | 2 +-
.../iotdb/commons/concurrent/ThreadName.java | 5 +-
.../apache/iotdb/commons/conf/CommonConfig.java | 109 ++---
.../iotdb/commons/conf/CommonDescriptor.java | 5 +
.../commons/exception/PortOccupiedException.java} | 14 +-
.../iotdb/commons/model/ModelInformation.java | 2 +-
.../iotdb/commons/partition/DataPartition.java | 11 +-
.../org/apache/iotdb/commons/path/PartialPath.java | 4 +
.../agent/runtime/PipePeriodicalJobExecutor.java | 33 --
.../commons/pipe/agent/task/PipeTaskAgent.java | 13 +-
.../commons/pipe/agent/task/meta/PipeMeta.java | 6 +-
.../pipe/agent/task/meta/PipeRuntimeMeta.java | 51 +--
.../commons/pipe/agent/task/meta/PipeTaskMeta.java | 142 +-----
.../task/progress/PipeEventCommitManager.java | 11 -
.../iotdb/commons/pipe/config/PipeConfig.java | 34 +-
.../iotdb/commons/pipe/config/PipeDescriptor.java | 31 +-
.../config/constant/PipeConnectorConstant.java | 5 +
.../connector/limiter/GlobalRPCRateLimiter.java} | 17 +-
.../pipe/connector/limiter/GlobalRateLimiter.java | 14 +-
.../connector/limiter/TsFileSendRateLimiter.java | 34 +-
.../connector/protocol/IoTDBAirGapConnector.java | 3 +
.../pipe/connector/protocol/IoTDBConnector.java | 4 +-
.../connector/protocol/IoTDBSslSyncConnector.java | 17 +-
.../commons/pipe/receiver/IoTDBFileReceiver.java | 66 +--
.../commons/pipe/resource/log/PipeLogManager.java | 2 +-
.../commons/pipe/resource/log/PipeLogStatus.java | 4 +-
.../schema/column/ColumnHeaderConstant.java | 5 +-
.../iotdb/commons/service/metric/enums/Metric.java | 1 +
.../subscription/config/SubscriptionConfig.java | 6 +
.../apache/iotdb/commons/utils/JVMCommonUtils.java | 56 ++-
.../apache/iotdb/commons/utils/StatusUtils.java | 15 +-
.../iotdb/commons/pipe/task/PipeMetaDeSerTest.java | 22 +-
.../db/relational/grammar/sql/RelationalSql.g4 | 36 +-
iotdb-doap.rdf | 8 +
.../openapi/src/main/openapi3/iotdb_rest_v2.yaml | 25 ++
.../thrift-ainode/src/main/thrift/ainode.thrift | 18 +-
.../thrift-commons/src/main/thrift/common.thrift | 7 +
.../src/main/thrift/confignode.thrift | 23 +-
.../src/main/thrift/datanode.thrift | 9 +-
pom.xml | 22 +-
381 files changed, 10162 insertions(+), 4199 deletions(-)
(iotdb) 01/07: deving
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch ssl_between_nodes
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 4d4284c19eb3a4f80eaf3251f30442edd2f19542
Author: HTHou <ha...@apache.org>
AuthorDate: Tue Jun 24 15:14:31 2025 +0800
deving
---
iotdb-client/service-rpc/pom.xml | 8 +
.../iotdb/rpc/NettyTNonBlockingTransport.java | 607 +++++++++++++++++++++
.../iotdb/rpc/TNonblockingSocketWrapper.java | 17 +
.../iotdb/confignode/conf/ConfigNodeConfig.java | 4 +-
.../iotdb/confignode/manager/load/LoadManager.java | 2 +-
.../manager/load/service/HeartbeatService.java | 18 +-
.../manager/load/service/TopologyService.java | 9 +-
.../iot/client/AsyncIoTConsensusServiceClient.java | 15 +-
.../AsyncConfigNodeInternalServiceClient.java | 15 +-
.../async/AsyncDataNodeExternalServiceClient.java | 15 +-
.../async/AsyncDataNodeInternalServiceClient.java | 15 +-
.../AsyncDataNodeMPPDataExchangeServiceClient.java | 15 +-
.../apache/iotdb/commons/conf/CommonConfig.java | 12 +-
13 files changed, 717 insertions(+), 35 deletions(-)
diff --git a/iotdb-client/service-rpc/pom.xml b/iotdb-client/service-rpc/pom.xml
index d7efd73817c..f4b3a7e2e90 100644
--- a/iotdb-client/service-rpc/pom.xml
+++ b/iotdb-client/service-rpc/pom.xml
@@ -84,6 +84,14 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-transport</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-handler</artifactId>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
new file mode 100644
index 00000000000..63f4611d325
--- /dev/null
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
@@ -0,0 +1,607 @@
+/*
+ * 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.
+ */
+
+package org.apache.iotdb.rpc;
+
+import io.netty.bootstrap.Bootstrap;
+import io.netty.buffer.ByteBuf;
+import io.netty.buffer.Unpooled;
+import io.netty.channel.Channel;
+import io.netty.channel.ChannelFuture;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelInboundHandlerAdapter;
+import io.netty.channel.ChannelInitializer;
+import io.netty.channel.ChannelOption;
+import io.netty.channel.ChannelPipeline;
+import io.netty.channel.EventLoopGroup;
+import io.netty.channel.nio.NioEventLoopGroup;
+import io.netty.channel.socket.SocketChannel;
+import io.netty.channel.socket.nio.NioSocketChannel;
+import io.netty.handler.codec.ByteToMessageDecoder;
+import io.netty.handler.codec.MessageToByteEncoder;
+import io.netty.handler.ssl.SslContext;
+import io.netty.handler.ssl.SslContextBuilder;
+import io.netty.handler.ssl.SslHandler;
+import io.netty.util.concurrent.GenericFutureListener;
+import org.apache.thrift.TConfiguration;
+import org.apache.thrift.transport.TNonblockingTransport;
+import org.apache.thrift.transport.TTransportException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.TrustManagerFactory;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.channels.SelectableChannel;
+import java.nio.channels.SelectionKey;
+import java.nio.channels.Selector;
+import java.security.KeyStore;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+public class NettyTNonBlockingTransport extends TNonblockingTransport {
+
+ private static final Logger logger = LoggerFactory.getLogger(NettyTNonBlockingTransport.class);
+
+ private final String host;
+ private final int port;
+ private final int connectTimeoutMs = 60000;
+ private final EventLoopGroup eventLoopGroup;
+ private final Bootstrap bootstrap;
+ private Channel channel;
+ private final AtomicBoolean connected = new AtomicBoolean(false);
+ private final AtomicBoolean connecting = new AtomicBoolean(false);
+ private final BlockingQueue<ByteBuf> readQueue = new LinkedBlockingQueue<>();
+ private final Object writeLock = new Object();
+ private NettySelectionKeyAdapter selectionKeyAdapter;
+
+ // SSL 配置
+ private final String keystorePath;
+ private final String keystorePassword;
+ private final String truststorePath;
+ private final String truststorePassword;
+ private boolean sslEnabled = false;
+
+ public NettyTNonBlockingTransport(
+ String host,
+ int port,
+ String keystorePath,
+ String keystorePassword,
+ String truststorePath,
+ String truststorePassword)
+ throws TTransportException {
+ super(new TConfiguration());
+ this.host = host;
+ this.port = port;
+ this.eventLoopGroup = new NioEventLoopGroup();
+ this.bootstrap = new Bootstrap();
+ this.keystorePath = keystorePath;
+ this.keystorePassword = keystorePassword;
+ this.truststorePath = truststorePath;
+ this.truststorePassword = truststorePassword;
+ this.sslEnabled = true;
+ initBootstrap();
+ }
+
+ private void initBootstrap() {
+ bootstrap
+ .group(eventLoopGroup)
+ .channel(NioSocketChannel.class)
+ .option(ChannelOption.TCP_NODELAY, true)
+ .option(ChannelOption.SO_KEEPALIVE, true)
+ .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, connectTimeoutMs)
+ .handler(
+ new ChannelInitializer<SocketChannel>() {
+ @Override
+ protected void initChannel(SocketChannel ch) throws Exception {
+ logger.info("Initializing channel for {}:{}", host, port);
+
+ ChannelPipeline pipeline = ch.pipeline();
+
+ // 添加 SSL 处理器(如果启用)
+ if (sslEnabled) {
+ SslContext sslContext = createSslContext();
+ SslHandler sslHandler = sslContext.newHandler(ch.alloc(), host, port);
+ // 增加握手超时时间
+ sslHandler.setHandshakeTimeoutMillis(30000);
+
+ pipeline.addLast("ssl", sslHandler);
+ // 添加SSL握手完成监听器
+ sslHandler
+ .handshakeFuture()
+ .addListener(
+ future -> {
+ if (future.isSuccess()) {
+ logger.info("SSL handshake completed successfully");
+ } else {
+ logger.info("SSL handshake failed: ", future.cause());
+ }
+ });
+ }
+
+ // 添加业务处理器
+ pipeline.addLast("handler", new NettyTransportHandler());
+ }
+ });
+ }
+
+ private SslContext createSslContext() throws Exception {
+ SslContextBuilder sslContextBuilder = SslContextBuilder.forClient();
+
+ // 配置 KeyStore(客户端证书)
+ if (keystorePath != null && keystorePassword != null) {
+ KeyStore keyStore = KeyStore.getInstance("JKS");
+ try (FileInputStream fis = new FileInputStream(keystorePath)) {
+ keyStore.load(fis, keystorePassword.toCharArray());
+ }
+ KeyManagerFactory kmf =
+ KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
+ kmf.init(keyStore, keystorePassword.toCharArray());
+ sslContextBuilder.keyManager(kmf);
+ }
+
+ // 配置 TrustStore(信任的服务器证书)
+ if (truststorePath != null && truststorePassword != null) {
+ KeyStore trustStore = KeyStore.getInstance("JKS");
+ try (FileInputStream fis = new FileInputStream(truststorePath)) {
+ trustStore.load(fis, truststorePassword.toCharArray());
+ }
+ TrustManagerFactory tmf =
+ TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
+ tmf.init(trustStore);
+ sslContextBuilder.trustManager(tmf);
+ }
+
+ return sslContextBuilder.build();
+ }
+
+ @Override
+ public boolean isOpen() {
+ return channel != null && channel.isActive() && connected.get();
+ }
+
+ @Override
+ public void open() throws TTransportException {
+ throw new RuntimeException("open() is not implemented for NettyTNonblockingTransport");
+ }
+
+ /** Perform a nonblocking read into buffer. */
+ public int read(ByteBuffer buffer) throws TTransportException {
+ if (!isOpen()) {
+ logger.info("Transport not open for ByteBuffer read");
+ throw new TTransportException(TTransportException.NOT_OPEN, "Transport not open");
+ }
+
+ try {
+ ByteBuf byteBuf = readQueue.take();
+// if (byteBuf == null) {
+// logger.info("No data available for ByteBuffer read (non-blocking)");
+// return 0; // 非阻塞读取,没有数据时返回 0
+// }
+
+ int available = Math.min(buffer.remaining(), byteBuf.readableBytes());
+ if (available > 0) {
+ // 从 ByteBuf 读取数据到 ByteBuffer
+ byte[] tempArray = new byte[available];
+ byteBuf.readBytes(tempArray);
+ buffer.put(tempArray);
+
+ logger.info(
+ "Read {} bytes into ByteBuffer, remaining space: {}", available, buffer.remaining());
+ }
+
+ // 如果还有剩余数据,创建一个新的 ByteBuf 包含剩余数据
+ if (byteBuf.readableBytes() > 0) {
+ ByteBuf remaining = byteBuf.slice();
+ remaining.retain();
+ readQueue.offer(remaining);
+ logger.info("Put back {} remaining bytes", remaining.readableBytes());
+ }
+
+ byteBuf.release();
+ return available;
+
+ } catch (Exception e) {
+ logger.warn("ByteBuffer read failed: ", e);
+ throw new TTransportException(TTransportException.UNKNOWN, e);
+ }
+ }
+
+ /** Reads from the underlying input stream if not null. */
+ @Override
+ public int read(byte[] buf, int off, int len) throws TTransportException {
+ if (!isOpen()) {
+ logger.info(
+ "Transport not open for read - channel: "
+ + (channel != null ? channel.isActive() : "null")
+ + ", connected: "
+ + connected.get());
+ throw new TTransportException(TTransportException.NOT_OPEN, "Transport not open");
+ }
+
+ try {
+ // 使用 ByteBuffer 包装数组进行读取
+ ByteBuffer buffer = ByteBuffer.wrap(buf, off, len);
+ return read(buffer);
+ } catch (Exception e) {
+ logger.warn("Read failed: ", e);
+ throw new TTransportException(TTransportException.UNKNOWN, e);
+ }
+ }
+
+ /** Perform a nonblocking write of the data in buffer; */
+ public int write(ByteBuffer buffer) throws TTransportException {
+ if (!isOpen()) {
+ logger.info("Transport not open for ByteBuffer write");
+ throw new TTransportException(TTransportException.NOT_OPEN, "Transport not open");
+ }
+
+ int remaining = buffer.remaining();
+ if (remaining == 0) {
+ return 0;
+ }
+
+ logger.info("Writing " + remaining + " bytes from ByteBuffer");
+
+ synchronized (writeLock) {
+ // 创建 ByteBuf 从 ByteBuffer
+ ByteBuf byteBuf = Unpooled.buffer();
+ byteBuf.writeBytes(buffer);
+ ChannelFuture future = channel.writeAndFlush(byteBuf);
+
+ final int bytesToWrite = remaining;
+ future.addListener(
+ (GenericFutureListener<ChannelFuture>)
+ future1 -> {
+ if (future1.isSuccess()) {
+ logger.info(
+ "ByteBuffer write completed successfully: " + bytesToWrite + " bytes");
+ } else {
+ logger.warn("ByteBuffer write failed: " + future1.cause().getMessage());
+ future1.cause().printStackTrace();
+ }
+ });
+ }
+
+ // 对于非阻塞写入,我们假设所有数据都能写入
+ // 实际的写入状态通过 Future 监听器处理
+ return remaining;
+ }
+
+ /** Writes to the underlying output stream if not null. */
+ @Override
+ public void write(byte[] buf, int off, int len) throws TTransportException {
+ if (!isOpen()) {
+ logger.info("Transport not open for write");
+ throw new TTransportException(TTransportException.NOT_OPEN, "Transport not open");
+ }
+
+ // 使用 ByteBuffer 包装数组进行写入
+ ByteBuffer buffer = ByteBuffer.wrap(buf, off, len);
+ write(buffer);
+ }
+
+ @Override
+ public void flush() throws TTransportException {
+ // Not supported by SocketChannel.
+ }
+
+ @Override
+ public void close() {
+ connected.set(false);
+ if (channel != null) {
+ channel.close();
+ }
+ eventLoopGroup.shutdownGracefully();
+ }
+
+ @Override
+ public boolean startConnect() throws IOException {
+ if (connected.get() || connecting.get()) {
+ logger.info("Starting connection return " + (connected.get() || connecting.get()));
+ return connected.get();
+ }
+
+ if (!connecting.compareAndSet(false, true)) {
+ return false;
+ }
+ logger.info("Starting connection to " + host + ":" + port);
+
+ try {
+ ChannelFuture future = bootstrap.connect(host, port);
+ future.addListener(
+ (GenericFutureListener<ChannelFuture>)
+ future1 -> {
+ if (future1.isSuccess()) {
+ logger.info("Connection established successfully");
+ channel = future1.channel();
+ connected.set(true);
+ if (selectionKeyAdapter != null) {
+ selectionKeyAdapter.setConnected(true);
+ }
+ }
+ connecting.set(false);
+ });
+ future.get();
+ return false; // 异步连接,立即返回 false
+ } catch (Exception e) {
+ connecting.set(false);
+// throw new IOException("Failed to start connection", e);
+ return false;
+ }
+ }
+
+ @Override
+ public boolean finishConnect() throws IOException {
+ return connected.get();
+ }
+
+ @Override
+ public SelectionKey registerSelector(Selector selector, int interests) throws IOException {
+ if (selectionKeyAdapter == null) {
+ selectionKeyAdapter = new NettySelectionKeyAdapter(this, selector, interests);
+
+ // 尝试通过反射获取 selectedKeys 的可修改引用
+ try {
+ // 尝试不同的字段名,因为不同的 Selector 实现可能使用不同的字段名
+ String[] possibleFieldNames = {"selectedKeys", "publicSelectedKeys", "keys"};
+ Field selectedKeysField = null;
+
+ for (String fieldName : possibleFieldNames) {
+ try {
+ selectedKeysField = selector.getClass().getSuperclass().getDeclaredField(fieldName);
+ break;
+ } catch (NoSuchFieldException e) {
+ // 继续尝试下一个字段名
+ }
+ }
+
+ if (selectedKeysField != null) {
+ selectedKeysField.setAccessible(true);
+ Object selectedKeysObj = selectedKeysField.get(selector);
+
+ if (selectedKeysObj instanceof Set) {
+ @SuppressWarnings("unchecked")
+ Set<SelectionKey> selectedKeys = (Set<SelectionKey>) selectedKeysObj;
+ selectionKeyAdapter.setSelectedKeysReference(selectedKeys);
+ logger.info("Successfully obtained selectedKeys reference via reflection");
+ try {
+ selectionKeyAdapter.selectedKeysReference.add(selectionKeyAdapter);
+ selector.wakeup();
+ } catch (Exception e) {
+ logger.warn("Failed to add to selectedKeys: " + e.getMessage());
+ }
+ }
+ }
+ } catch (Exception e) {
+ logger.warn("Failed to access selectedKeys via reflection: " + e.getMessage());
+ // 继续执行,使用备用方案
+ }
+
+ } else {
+ selectionKeyAdapter.interestOps(interests);
+ }
+
+ return selectionKeyAdapter;
+ }
+
+ @Override
+ public String toString() {
+ return "[remote: " + getRemoteAddress() + ", local: " + getLocalAddress() + "]";
+ }
+
+ // Netty 处理器
+ private class NettyTransportHandler extends ChannelInboundHandlerAdapter {
+
+ @Override
+ public void channelActive(ChannelHandlerContext ctx) throws Exception {
+ logger.info("Channel active: " + ctx.channel().remoteAddress());
+
+ connected.set(true);
+
+ // 更新 SelectionKey 状态
+ if (selectionKeyAdapter != null) {
+ selectionKeyAdapter.setConnected(true);
+ selectionKeyAdapter.setReadReady(true);
+ }
+
+ super.channelActive(ctx);
+ }
+
+ @Override
+ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
+ if (msg instanceof ByteBuf) {
+ ByteBuf byteBuf = (ByteBuf) msg;
+ logger.info("Received " + byteBuf.readableBytes() + " bytes");
+
+ // 保留引用计数,将数据放入读取队列
+ readQueue.offer(byteBuf.retain());
+ byteBuf.release(); // 释放原始引用
+
+ // 通知选择器适配器有数据可读
+ if (selectionKeyAdapter != null) {
+ selectionKeyAdapter.setReadReady(true);
+ }
+ }
+ }
+
+ @Override
+ public void channelInactive(ChannelHandlerContext ctx) throws Exception {
+ logger.info("Channel inactive");
+
+ connected.set(false);
+ connecting.set(false);
+
+ // 更新 SelectionKey 状态
+ if (selectionKeyAdapter != null) {
+ selectionKeyAdapter.setConnected(false);
+ selectionKeyAdapter.setReadReady(false);
+ }
+
+ super.channelInactive(ctx);
+ }
+
+ @Override
+ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
+ logger.warn("Channel exception: {}", cause.getMessage());
+
+ // 更新 SelectionKey 状态
+ if (selectionKeyAdapter != null) {
+ selectionKeyAdapter.setConnected(false);
+ selectionKeyAdapter.setReadReady(false);
+ selectionKeyAdapter.cancel(); // 取消 SelectionKey
+ }
+
+ ctx.close();
+ }
+ }
+
+ // SelectionKey 适配器类
+ private static class NettySelectionKeyAdapter extends SelectionKey {
+ private final NettyTNonBlockingTransport transport;
+ private Selector selector;
+ private int interestOps;
+ private int readyOps = 0;
+ private volatile boolean connected = false;
+ private volatile boolean readReady = false;
+ private volatile boolean valid = true;
+ private Set<SelectionKey> selectedKeysReference;
+
+ public NettySelectionKeyAdapter(
+ NettyTNonBlockingTransport transport, Selector selector, int ops) {
+ this.transport = transport;
+ this.selector = selector;
+ this.interestOps = ops;
+ }
+
+ public void setSelectedKeysReference(Set<SelectionKey> selectedKeys) {
+ this.selectedKeysReference = selectedKeys;
+ }
+
+ @Override
+ public SelectableChannel channel() {
+ return null; // Netty 管理通道
+ }
+
+ @Override
+ public Selector selector() {
+ return selector;
+ }
+
+ @Override
+ public void cancel() {
+ this.valid = false;
+ if (selectedKeysReference != null) {
+ selectedKeysReference.remove(this);
+ }
+ logger.info("SelectionKey cancelled");
+ }
+
+ @Override
+ public boolean isValid() {
+ return valid;
+ }
+
+ @Override
+ public SelectionKey interestOps(int ops) {
+ this.interestOps = ops;
+ logger.info("SelectionKey interestOps set to: " + ops);
+ updateSelectorIfReady();
+ return this;
+ }
+
+ @Override
+ public int interestOps() {
+ return interestOps;
+ }
+
+ @Override
+ public int readyOps() {
+ int ops = 0;
+
+ // 检查连接状态
+ if (connected && (interestOps & OP_CONNECT) != 0) {
+ ops |= OP_CONNECT;
+ }
+
+ // 检查读取状态
+ if (readReady && (interestOps & OP_READ) != 0) {
+ ops |= OP_READ;
+ }
+
+ // 写入通常总是就绪的(如果连接是活跃的)
+ if ((interestOps & OP_WRITE) != 0 && transport.isOpen()) {
+ ops |= OP_WRITE;
+ }
+
+ if (ops != readyOps) {
+ logger.info("SelectionKey readyOps changed: " + readyOps + " -> " + ops);
+ }
+
+ readyOps = ops;
+ return readyOps;
+ }
+
+ public void setConnected(boolean connected) {
+ this.connected = connected;
+ updateSelectorIfReady();
+ }
+
+ public void setReadReady(boolean readReady) {
+ if (this.readReady != readReady) {
+ logger.info("ReadReady changed: {} -> {}", this.readReady, readReady);
+ }
+ this.readReady = readReady;
+ updateSelectorIfReady();
+ }
+
+ private void updateSelectorIfReady() {
+ if (selector != null && isValid() && selectedKeysReference != null) {
+ int ready = readyOps();
+ if (ready != 0) {
+ try {
+ selectedKeysReference.add(this);
+ selector.wakeup();
+ logger.info("Added self to selectedKeys via reference, readyOps: " + ready);
+ } catch (Exception e) {
+ logger.warn("Failed to add to selectedKeys: " + e.getMessage());
+ }
+ }
+ }
+ }
+ }
+
+ // 辅助方法:获取远程地址
+ public SocketAddress getRemoteAddress() {
+ return channel != null ? channel.remoteAddress() : null;
+ }
+
+ // 辅助方法:获取本地地址
+ public SocketAddress getLocalAddress() {
+ return channel != null ? channel.localAddress() : null;
+ }
+}
diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingSocketWrapper.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingSocketWrapper.java
index 5f2b6cde2f4..9370d4a4373 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingSocketWrapper.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/TNonblockingSocketWrapper.java
@@ -20,6 +20,7 @@
package org.apache.iotdb.rpc;
import org.apache.thrift.transport.TNonblockingSocket;
+import org.apache.thrift.transport.TNonblockingTransport;
import org.apache.thrift.transport.TTransportException;
import java.io.IOException;
@@ -58,5 +59,21 @@ public class TNonblockingSocketWrapper {
}
}
+ public static TNonblockingTransport wrap(
+ String host,
+ int port,
+ String keyStorePath,
+ String keyStorePwd,
+ String trustStorePath,
+ String trustStorePwd) {
+ try {
+ return new NettyTNonBlockingTransport(
+ host, port, keyStorePath, keyStorePwd, trustStorePath, trustStorePwd);
+ } catch (TTransportException e) {
+ // never happen
+ return null;
+ }
+ }
+
private TNonblockingSocketWrapper() {}
}
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
index 50c8f5bc9a0..a8d5c330c5b 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeConfig.java
@@ -61,10 +61,10 @@ public class ConfigNodeConfig {
private int configRegionId = 0;
/** ConfigNodeGroup consensus protocol. */
- private String configNodeConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
+ private String configNodeConsensusProtocolClass = ConsensusFactory.SIMPLE_CONSENSUS;
/** Schema region consensus protocol. */
- private String schemaRegionConsensusProtocolClass = ConsensusFactory.RATIS_CONSENSUS;
+ private String schemaRegionConsensusProtocolClass = ConsensusFactory.SIMPLE_CONSENSUS;
/** Default number of SchemaRegion replicas. */
private int schemaReplicationFactor = 1;
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
index 54dd582551d..c1651039ec5 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
@@ -152,7 +152,7 @@ public class LoadManager {
statisticsService.startLoadStatisticsService();
eventService.startEventService();
partitionBalancer.setupPartitionBalancer();
- topologyService.startTopologyService();
+// topologyService.startTopologyService();
}
public void stopLoadServices() {
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
index 40418a00efc..63a6da33fc3 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
@@ -278,15 +278,15 @@ public class HeartbeatService {
configManager.getPipeManager().getPipeRuntimeCoordinator());
configManager.getClusterQuotaManager().updateSpaceQuotaUsage();
addConfigNodeLocationsToReq(dataNodeId, heartbeatReq);
- if (CommonDescriptor.getInstance().getConfig().isEnableSSL()) {
- SyncDataNodeHeartbeatClientPool.getInstance()
- .getDataNodeHeartBeat(
- dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
- } else {
- AsyncDataNodeHeartbeatClientPool.getInstance()
- .getDataNodeHeartBeat(
- dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
- }
+ if (CommonDescriptor.getInstance().getConfig().isEnableSSL()) {
+ SyncDataNodeHeartbeatClientPool.getInstance()
+ .getDataNodeHeartBeat(
+ dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
+ } else {
+ AsyncDataNodeHeartbeatClientPool.getInstance()
+ .getDataNodeHeartBeat(
+ dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
+ }
}
}
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/TopologyService.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/TopologyService.java
index e05f00415bd..3a4ff73ecae 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/TopologyService.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/TopologyService.java
@@ -27,7 +27,6 @@ import org.apache.iotdb.common.rpc.thrift.TTestConnectionResult;
import org.apache.iotdb.commons.cluster.NodeStatus;
import org.apache.iotdb.commons.concurrent.IoTDBThreadPoolFactory;
import org.apache.iotdb.commons.concurrent.ThreadName;
-import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.confignode.client.async.CnToDnAsyncRequestType;
import org.apache.iotdb.confignode.client.async.CnToDnInternalServiceAsyncRequestManager;
import org.apache.iotdb.confignode.client.async.handlers.DataNodeAsyncRequestContext;
@@ -182,12 +181,8 @@ public class TopologyService implements Runnable, IClusterStatusSubscriber {
CnToDnAsyncRequestType.SUBMIT_TEST_DN_INTERNAL_CONNECTION_TASK,
nodeLocations,
dataNodeLocationMap);
- if (CommonDescriptor.getInstance().getConfig().isEnableSSL()) {
- // TODO: Haonan do it syncly
- } else {
- CnToDnInternalServiceAsyncRequestManager.getInstance()
- .sendAsyncRequestWithTimeoutInMs(dataNodeAsyncRequestContext, PROBING_TIMEOUT_MS);
- }
+ CnToDnInternalServiceAsyncRequestManager.getInstance()
+ .sendAsyncRequestWithTimeoutInMs(dataNodeAsyncRequestContext, PROBING_TIMEOUT_MS);
final List<TTestConnectionResult> results = new ArrayList<>();
dataNodeAsyncRequestContext
.getResponseMap()
diff --git a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java
index cb635c8e6dd..4419ab2a72d 100644
--- a/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java
+++ b/iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/client/AsyncIoTConsensusServiceClient.java
@@ -24,6 +24,8 @@ import org.apache.iotdb.commons.client.ClientManager;
import org.apache.iotdb.commons.client.ThriftClient;
import org.apache.iotdb.commons.client.factory.AsyncThriftClientFactory;
import org.apache.iotdb.commons.client.property.ThriftClientProperty;
+import org.apache.iotdb.commons.conf.CommonConfig;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.consensus.iot.thrift.IoTConsensusIService;
import org.apache.iotdb.rpc.TNonblockingSocketWrapper;
@@ -41,6 +43,7 @@ public class AsyncIoTConsensusServiceClient extends IoTConsensusIService.AsyncCl
private static final Logger logger =
LoggerFactory.getLogger(AsyncIoTConsensusServiceClient.class);
+ private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConfig();
private final boolean printLogWhenEncounterException;
private final TEndPoint endpoint;
@@ -55,8 +58,16 @@ public class AsyncIoTConsensusServiceClient extends IoTConsensusIService.AsyncCl
super(
property.getProtocolFactory(),
tAsyncClientManager,
- TNonblockingSocketWrapper.wrap(
- endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
+ commonConfig.isEnableSSL()
+ ? TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(),
+ endpoint.getPort(),
+ commonConfig.getKeyStorePath(),
+ commonConfig.getKeyStorePwd(),
+ commonConfig.getTrustStorePath(),
+ commonConfig.getTrustStorePwd())
+ : TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
setTimeout(property.getConnectionTimeoutMs());
this.printLogWhenEncounterException = property.isPrintLogWhenEncounterException();
this.endpoint = endpoint;
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncConfigNodeInternalServiceClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncConfigNodeInternalServiceClient.java
index 1b3d6a21a1f..0fae68ec249 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncConfigNodeInternalServiceClient.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncConfigNodeInternalServiceClient.java
@@ -24,6 +24,8 @@ import org.apache.iotdb.commons.client.ClientManager;
import org.apache.iotdb.commons.client.ThriftClient;
import org.apache.iotdb.commons.client.factory.AsyncThriftClientFactory;
import org.apache.iotdb.commons.client.property.ThriftClientProperty;
+import org.apache.iotdb.commons.conf.CommonConfig;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.confignode.rpc.thrift.IConfigNodeRPCService;
import org.apache.iotdb.rpc.TNonblockingSocketWrapper;
@@ -41,6 +43,7 @@ public class AsyncConfigNodeInternalServiceClient extends IConfigNodeRPCService.
private static final Logger logger =
LoggerFactory.getLogger(AsyncConfigNodeInternalServiceClient.class);
+ private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConfig();
private long originalTimeout = -1;
@@ -57,8 +60,16 @@ public class AsyncConfigNodeInternalServiceClient extends IConfigNodeRPCService.
super(
property.getProtocolFactory(),
tClientManager,
- TNonblockingSocketWrapper.wrap(
- endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
+ commonConfig.isEnableSSL()
+ ? TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(),
+ endpoint.getPort(),
+ commonConfig.getKeyStorePath(),
+ commonConfig.getKeyStorePwd(),
+ commonConfig.getTrustStorePath(),
+ commonConfig.getTrustStorePwd())
+ : TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
setTimeout(property.getConnectionTimeoutMs());
this.printLogWhenEncounterException = property.isPrintLogWhenEncounterException();
this.endpoint = endpoint;
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeExternalServiceClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeExternalServiceClient.java
index 5de58b8eef1..dad3eb02dc4 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeExternalServiceClient.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeExternalServiceClient.java
@@ -24,6 +24,8 @@ import org.apache.iotdb.commons.client.ClientManager;
import org.apache.iotdb.commons.client.ThriftClient;
import org.apache.iotdb.commons.client.factory.AsyncThriftClientFactory;
import org.apache.iotdb.commons.client.property.ThriftClientProperty;
+import org.apache.iotdb.commons.conf.CommonConfig;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.utils.TestOnly;
import org.apache.iotdb.mpp.rpc.thrift.IDataNodeRPCService;
import org.apache.iotdb.rpc.TNonblockingSocketWrapper;
@@ -42,6 +44,7 @@ public class AsyncDataNodeExternalServiceClient extends IDataNodeRPCService.Asyn
private static final Logger logger =
LoggerFactory.getLogger(AsyncDataNodeExternalServiceClient.class);
+ private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConfig();
private final boolean printLogWhenEncounterException;
@@ -57,8 +60,16 @@ public class AsyncDataNodeExternalServiceClient extends IDataNodeRPCService.Asyn
super(
property.getProtocolFactory(),
tClientManager,
- TNonblockingSocketWrapper.wrap(
- endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
+ commonConfig.isEnableSSL()
+ ? TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(),
+ endpoint.getPort(),
+ commonConfig.getKeyStorePath(),
+ commonConfig.getKeyStorePwd(),
+ commonConfig.getTrustStorePath(),
+ commonConfig.getTrustStorePwd())
+ : TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
setTimeout(property.getConnectionTimeoutMs());
this.printLogWhenEncounterException = property.isPrintLogWhenEncounterException();
this.endpoint = endpoint;
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeInternalServiceClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeInternalServiceClient.java
index e56aab91c0d..b39fce3bb87 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeInternalServiceClient.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeInternalServiceClient.java
@@ -24,6 +24,8 @@ import org.apache.iotdb.commons.client.ClientManager;
import org.apache.iotdb.commons.client.ThriftClient;
import org.apache.iotdb.commons.client.factory.AsyncThriftClientFactory;
import org.apache.iotdb.commons.client.property.ThriftClientProperty;
+import org.apache.iotdb.commons.conf.CommonConfig;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.commons.utils.TestOnly;
import org.apache.iotdb.mpp.rpc.thrift.IDataNodeRPCService;
import org.apache.iotdb.rpc.TNonblockingSocketWrapper;
@@ -42,6 +44,7 @@ public class AsyncDataNodeInternalServiceClient extends IDataNodeRPCService.Asyn
private static final Logger logger =
LoggerFactory.getLogger(AsyncDataNodeInternalServiceClient.class);
+ private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConfig();
public long originalTimeout = -1;
@@ -59,8 +62,16 @@ public class AsyncDataNodeInternalServiceClient extends IDataNodeRPCService.Asyn
super(
property.getProtocolFactory(),
tClientManager,
- TNonblockingSocketWrapper.wrap(
- endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
+ commonConfig.isEnableSSL()
+ ? TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(),
+ endpoint.getPort(),
+ commonConfig.getKeyStorePath(),
+ commonConfig.getKeyStorePwd(),
+ commonConfig.getTrustStorePath(),
+ commonConfig.getTrustStorePwd())
+ : TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
setTimeout(property.getConnectionTimeoutMs());
this.printLogWhenEncounterException = property.isPrintLogWhenEncounterException();
this.endpoint = endpoint;
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeMPPDataExchangeServiceClient.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeMPPDataExchangeServiceClient.java
index 6434ec7f017..685105ef075 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeMPPDataExchangeServiceClient.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/client/async/AsyncDataNodeMPPDataExchangeServiceClient.java
@@ -24,6 +24,8 @@ import org.apache.iotdb.commons.client.ClientManager;
import org.apache.iotdb.commons.client.ThriftClient;
import org.apache.iotdb.commons.client.factory.AsyncThriftClientFactory;
import org.apache.iotdb.commons.client.property.ThriftClientProperty;
+import org.apache.iotdb.commons.conf.CommonConfig;
+import org.apache.iotdb.commons.conf.CommonDescriptor;
import org.apache.iotdb.mpp.rpc.thrift.MPPDataExchangeService;
import org.apache.iotdb.rpc.TNonblockingSocketWrapper;
@@ -41,6 +43,7 @@ public class AsyncDataNodeMPPDataExchangeServiceClient extends MPPDataExchangeSe
private static final Logger logger =
LoggerFactory.getLogger(AsyncDataNodeMPPDataExchangeServiceClient.class);
+ private static final CommonConfig commonConfig = CommonDescriptor.getInstance().getConfig();
private final boolean printLogWhenEncounterException;
private final TEndPoint endpoint;
@@ -55,8 +58,16 @@ public class AsyncDataNodeMPPDataExchangeServiceClient extends MPPDataExchangeSe
super(
property.getProtocolFactory(),
tClientManager,
- TNonblockingSocketWrapper.wrap(
- endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
+ commonConfig.isEnableSSL()
+ ? TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(),
+ endpoint.getPort(),
+ commonConfig.getKeyStorePath(),
+ commonConfig.getKeyStorePwd(),
+ commonConfig.getTrustStorePath(),
+ commonConfig.getTrustStorePwd())
+ : TNonblockingSocketWrapper.wrap(
+ endpoint.getIp(), endpoint.getPort(), property.getConnectionTimeoutMs()));
setTimeout(property.getConnectionTimeoutMs());
this.printLogWhenEncounterException = property.isPrintLogWhenEncounterException();
this.endpoint = endpoint;
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index 038d401cb2c..849eeca860b 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -405,19 +405,19 @@ public class CommonConfig {
private volatile Pattern trustedUriPattern = Pattern.compile("file:.*");
/** Enable the thrift Service ssl. */
- private boolean enableSSL = false;
+ private boolean enableSSL = true;
/** ssl key Store Path. */
- private String keyStorePath = "";
+ private String keyStorePath = "/Users/ht/.keystore";
/** ssl key Store password. */
- private String keyStorePwd = "";
+ private String keyStorePwd = "123456";
/** ssl trust Store Path. */
- private String trustStorePath = "";
+ private String trustStorePath = "/Users/ht/.truststore";
/** ssl trust Store password. */
- private String trustStorePwd = "";
+ private String trustStorePwd = "123456";
CommonConfig() {
// Empty constructor
@@ -2602,7 +2602,7 @@ public class CommonConfig {
}
public String getTrustStorePath() {
- return trustStorePwd;
+ return trustStorePath;
}
public void setTrustStorePath(String trustStorePath) {
(iotdb) 03/07: deving
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch ssl_between_nodes
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 23dc90a45433197bee27da979e2b52c5fb55a3e5
Author: HTHou <ha...@apache.org>
AuthorDate: Wed Jun 25 09:36:19 2025 +0800
deving
---
.../apache/iotdb/rpc/NettyTNonBlockingTransport.java | 13 +++++--------
.../iotdb/confignode/manager/load/LoadManager.java | 2 +-
.../manager/load/service/HeartbeatService.java | 18 +++++++++---------
.../org/apache/iotdb/commons/conf/CommonConfig.java | 2 +-
4 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
index 63f4611d325..1996a21f6a3 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
@@ -33,8 +33,6 @@ import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
-import io.netty.handler.codec.ByteToMessageDecoder;
-import io.netty.handler.codec.MessageToByteEncoder;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.SslHandler;
@@ -57,7 +55,6 @@ import java.nio.channels.SelectableChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.security.KeyStore;
-import java.util.List;
import java.util.Set;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
@@ -198,10 +195,10 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
try {
ByteBuf byteBuf = readQueue.take();
-// if (byteBuf == null) {
-// logger.info("No data available for ByteBuffer read (non-blocking)");
-// return 0; // 非阻塞读取,没有数据时返回 0
-// }
+ // if (byteBuf == null) {
+ // logger.info("No data available for ByteBuffer read (non-blocking)");
+ // return 0; // 非阻塞读取,没有数据时返回 0
+ // }
int available = Math.min(buffer.remaining(), byteBuf.readableBytes());
if (available > 0) {
@@ -350,7 +347,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
return false; // 异步连接,立即返回 false
} catch (Exception e) {
connecting.set(false);
-// throw new IOException("Failed to start connection", e);
+ // throw new IOException("Failed to start connection", e);
return false;
}
}
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
index c1651039ec5..b2f8a9189b3 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java
@@ -152,7 +152,7 @@ public class LoadManager {
statisticsService.startLoadStatisticsService();
eventService.startEventService();
partitionBalancer.setupPartitionBalancer();
-// topologyService.startTopologyService();
+ // topologyService.startTopologyService();
}
public void stopLoadServices() {
diff --git a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
index 63a6da33fc3..e079fac021f 100644
--- a/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
+++ b/iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/load/service/HeartbeatService.java
@@ -278,15 +278,15 @@ public class HeartbeatService {
configManager.getPipeManager().getPipeRuntimeCoordinator());
configManager.getClusterQuotaManager().updateSpaceQuotaUsage();
addConfigNodeLocationsToReq(dataNodeId, heartbeatReq);
- if (CommonDescriptor.getInstance().getConfig().isEnableSSL()) {
- SyncDataNodeHeartbeatClientPool.getInstance()
- .getDataNodeHeartBeat(
- dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
- } else {
- AsyncDataNodeHeartbeatClientPool.getInstance()
- .getDataNodeHeartBeat(
- dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
- }
+// if (CommonDescriptor.getInstance().getConfig().isEnableSSL()) {
+// SyncDataNodeHeartbeatClientPool.getInstance()
+// .getDataNodeHeartBeat(
+// dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
+// } else {
+ AsyncDataNodeHeartbeatClientPool.getInstance()
+ .getDataNodeHeartBeat(
+ dataNodeInfo.getLocation().getInternalEndPoint(), heartbeatReq, handler);
+// }
}
}
diff --git a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
index aa58082664d..b75aa59f319 100644
--- a/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
+++ b/iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java
@@ -406,7 +406,7 @@ public class CommonConfig {
private volatile Pattern trustedUriPattern = Pattern.compile("file:.*");
/** Enable the thrift Service ssl. */
- private boolean enableSSL = true;
+ private boolean enableSSL = false;
/** ssl key Store Path. */
private String keyStorePath = "/Users/ht/.keystore";
(iotdb) 02/07: Merge branch 'master' of github.com:apache/iotdb into ssl_between_nodes
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch ssl_between_nodes
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 2ac954004d50f233d8b33cf1915a32212d7a51ee
Merge: 4d4284c19eb 5cb388190ae
Author: HTHou <ha...@apache.org>
AuthorDate: Tue Jun 24 15:14:43 2025 +0800
Merge branch 'master' of github.com:apache/iotdb into ssl_between_nodes
.../it/env/cluster/config/MppDataNodeConfig.java | 12 +
.../it/env/cluster/node/AbstractNodeWrapper.java | 4 +
.../it/env/remote/config/RemoteDataNodeConfig.java | 10 +
.../apache/iotdb/itbase/env/DataNodeConfig.java | 4 +
.../IoTDBRemoveConfigNodeITFramework.java | 2 +-
.../IoTDBRemoveDataNodeNormalIT.java | 362 ++++++++++++++++++++-
.../removedatanode/IoTDBRemoveDataNodeUtils.java | 178 ++++++++++
...work.java => IoTDBRemoveUnknownDataNodeIT.java} | 324 ++++++++----------
.../confignode/it/utils/ConfigNodeTestUtils.java | 12 +
.../iotdb/db/it/IoTDBCustomizedClusterIT.java | 148 +++++++++
.../relational/it/db/it/IoTDBWindowFunctionIT.java | 170 +++++++++-
.../relational/it/db/it/IoTDBWindowTVFIT.java | 175 ++++++++++
.../it/query/recent/IoTDBTableAggregationIT.java | 181 ++++++++---
.../query/view/recent/IoTDBTableViewQueryIT.java | 5 +
.../recent/IoTDBTableViewWithTreeTTLQueryIT.java | 38 ++-
.../relational/it/schema/IoTDBDatabaseIT.java | 4 +-
.../iotdb/relational/it/schema/IoTDBTableIT.java | 72 ++--
.../org/apache/iotdb/subscription/it/Retry.java | 26 +-
.../apache/iotdb/subscription/it/RetryRule.java | 69 ++++
...oTDBSnapshotTSPatternDatasetPushConsumerIT.java | 8 +
...IoTDBSnapshotTSPatternTsfilePushConsumerIT.java | 8 +
.../multi/IoTDBOneConsumerMultiTopicsTsfileIT.java | 7 +
.../api/exception/UDFColumnNotFoundException.java | 14 +-
.../api/exception/UDFTypeMismatchException.java | 14 +-
.../table/argument/ScalarArgumentChecker.java | 8 +
.../java/org/apache/iotdb/udf/api/type/Type.java | 10 +
.../org/apache/iotdb/tool/common/Constants.java | 3 +-
.../subscription/SubscriptionTableTsFile.java | 2 +-
.../subscription/SubscriptionTreeTsFile.java | 2 +-
iotdb-client/client-cpp/src/main/Common.h | 15 +-
.../client-cpp/src/main/IoTDBRpcDataSet.cpp | 68 ++--
iotdb-client/client-cpp/src/main/IoTDBRpcDataSet.h | 42 +--
iotdb-client/client-cpp/src/main/NodesSupplier.cpp | 16 +-
.../client-cpp/src/main/SessionDataSet.cpp | 78 +++--
iotdb-client/client-cpp/src/main/SessionDataSet.h | 32 +-
iotdb-client/client-cpp/src/test/cpp/sessionIT.cpp | 66 ++--
.../src/test/cpp/sessionRelationalIT.cpp | 81 ++++-
.../java/org/apache/iotdb/session/Session.java | 6 +-
.../apache/iotdb/session/TableSessionBuilder.java | 7 +-
iotdb-core/ainode/ainode/core/config.py | 10 +-
iotdb-core/ainode/ainode/core/constant.py | 22 +-
.../ainode/core/manager/inference_manager.py | 22 +-
.../ainode/ainode/core/manager/model_manager.py | 48 ++-
.../ainode/core/model/built_in_model_factory.py | 67 ++--
.../ainode/ainode/core/model/model_storage.py | 103 +++---
.../ainode/core/model/sundial/modeling_sundial.py | 22 +-
.../ainode/core/model/timerxl/modeling_timer.py | 22 +-
.../iotdb/confignode/manager/ConfigManager.java | 14 +-
.../iotdb/confignode/manager/ProcedureManager.java | 44 ++-
.../region/GreedyCopySetRegionGroupAllocator.java | 8 +-
.../pipe/agent/task/PipeConfigNodeSubtask.java | 9 +-
.../subscription/SubscriptionCoordinator.java | 3 +-
.../partition/DatabasePartitionTable.java | 10 +-
.../persistence/partition/PartitionInfo.java | 2 +-
.../persistence/partition/RegionGroup.java | 6 +-
.../impl/node/RemoveDataNodesProcedure.java | 5 +-
.../region/NotifyRegionMigrationProcedure.java | 2 +-
.../procedure/impl/schema/SchemaUtils.java | 20 +-
.../table/AbstractAlterOrDropTableProcedure.java | 23 +-
.../impl/schema/table/CreateTableProcedure.java | 8 +-
.../impl/schema/table/RenameTableProcedure.java | 6 +-
.../GreedyCopySetRemoveNodeReplicaSelectTest.java | 11 +-
.../consensus/iot/logdispatcher/LogDispatcher.java | 2 +-
.../consensus/iot/logdispatcher/SyncStatus.java | 5 +-
.../consensus/pipe/PipeConsensusServerImpl.java | 19 +-
.../assembly/resources/conf/logback-datanode.xml | 6 +-
.../apache/iotdb/db/auth/BasicAuthorityCache.java | 2 +-
.../iotdb/db/auth/ClusterAuthorityFetcher.java | 5 +
.../org/apache/iotdb/db/conf/IoTDBDescriptor.java | 3 -
.../org/apache/iotdb/db/conf/IoTDBStartCheck.java | 29 +-
.../db/pipe/agent/task/PipeDataNodeTaskAgent.java | 24 ++
.../airgap/IoTDBDataRegionAirGapConnector.java | 2 +-
.../pipeconsensus/PipeConsensusAsyncConnector.java | 28 +-
.../handler/PipeConsensusDeleteEventHandler.java | 4 +-
.../PipeConsensusTabletInsertionEventHandler.java | 5 +-
.../PipeConsensusTsFileInsertionEventHandler.java | 10 +-
.../async/IoTDBDataRegionAsyncConnector.java | 2 +-
.../thrift/sync/IoTDBDataRegionSyncConnector.java | 6 +-
.../util/builder/PipeTableModelTsFileBuilder.java | 1 +
.../builder/PipeTableModelTsFileBuilderV2.java | 53 +--
.../util/builder/PipeTreeModelTsFileBuilder.java | 1 +
.../util/builder/PipeTreeModelTsFileBuilderV2.java | 42 ++-
.../event/realtime/PipeRealtimeEventFactory.java | 6 +-
.../dataregion/IoTDBDataRegionExtractor.java | 25 +-
...oricalDataRegionTsFileAndDeletionExtractor.java | 2 +-
.../PipeDataNodeRemainingEventAndTimeOperator.java | 30 +-
.../overview/PipeWALInsertNodeCacheMetrics.java | 4 +-
.../pipeconsensus/PipeConsensusReceiver.java | 12 +-
.../pipeconsensus/PipeConsensusReceiverAgent.java | 138 ++++----
.../protocol/thrift/IoTDBDataNodeReceiver.java | 63 ++--
.../iotdb/db/protocol/mqtt/MPPPublishHandler.java | 4 +-
.../iotdb/db/protocol/session/SessionManager.java | 14 +
.../protocol/thrift/impl/ClientRPCServiceImpl.java | 73 +++--
.../impl/DataNodeInternalRPCServiceImpl.java | 10 +-
.../execution/driver/DriverContext.java | 6 +
.../exchange/source/LocalSourceHandle.java | 13 +-
.../fragment/FakedFragmentInstanceContext.java | 106 ++++++
.../fragment/FragmentInstanceContext.java | 19 +-
.../fragment/FragmentInstanceManager.java | 8 +-
.../execution/fragment/QueryContext.java | 2 +-
.../process/PatternRecognitionOperator.java | 6 +
.../rowpattern/expression/ArithmeticOperator.java | 7 +-
.../rowpattern/expression/ComparisonOperator.java | 8 +-
.../process/rowpattern/expression/Computation.java | 9 +-
.../rowpattern/expression/LogicalOperator.java | 4 +-
.../expression/PatternExpressionComputation.java | 3 +-
.../process/window/TableWindowOperator.java | 1 -
.../window/partition/PartitionExecutor.java | 6 +-
.../process/window/partition/frame/RangeFrame.java | 6 +-
.../process/window/utils/RowComparator.java | 20 ++
.../schema/source/TableDeviceQuerySource.java | 23 +-
.../execution/operator/source/SeriesScanUtil.java | 6 +-
.../execution/schedule/task/DriverTaskId.java | 3 +-
.../iotdb/db/queryengine/plan/Coordinator.java | 13 +
.../db/queryengine/plan/analyze/TypeProvider.java | 8 +-
.../schema/dualkeycache/impl/DualKeyCacheImpl.java | 1 +
.../plan/analyze/load/LoadTsFileAnalyzer.java | 9 +-
.../metadata/relational/ShowCreateViewTask.java | 9 +-
.../plan/planner/OperatorTreeGenerator.java | 12 +-
.../plan/planner/TableOperatorGenerator.java | 65 +++-
.../queryengine/plan/planner/TreeModelPlanner.java | 2 +-
.../SimpleFragmentParallelPlanner.java | 1 +
.../plan/planner/distribution/SourceRewriter.java | 70 +++-
.../memory/FakedMemoryReservationManager.java | 23 +-
.../plan/planner/plan/PlanFragment.java | 9 +
.../planner/plan/node/process/AggregationNode.java | 3 +-
.../plan/node/process/RawDataAggregationNode.java | 3 +-
.../source/AlignedSeriesAggregationScanNode.java | 21 +-
.../node/source/SeriesAggregationScanNode.java | 15 +-
.../planner/plan/parameter/SeriesScanOptions.java | 24 +-
.../relational/analyzer/ExpressionAnalyzer.java | 24 +-
.../function/tvf/ForecastTableFunction.java | 16 +-
.../metadata/fetcher/TableDeviceSchemaFetcher.java | 12 +-
.../fetcher/TableDeviceSchemaValidator.java | 6 +-
.../plan/relational/planner/QueryPlanner.java | 42 ++-
.../relational/planner/TableLogicalPlanner.java | 5 +
.../plan/relational/planner/TableModelPlanner.java | 2 +-
.../distribute/TableDistributedPlanGenerator.java | 11 +
.../distribute/TableModelQueryFragmentPlanner.java | 1 +
.../optimizations/PushPredicateIntoTableScan.java | 3 +-
.../planner/optimizations/SortElimination.java | 60 +++-
.../planner/rowpattern/IrRowPattern.java | 40 +--
.../plan/relational/sql/parser/AstBuilder.java | 17 +-
.../plan/scheduler/ClusterScheduler.java | 11 +-
.../scheduler/FragmentInstanceDispatcherImpl.java | 101 +++++-
.../plan/scheduler/IFragInstanceDispatcher.java | 6 +-
.../scheduler/load/LoadTsFileDispatcherImpl.java | 4 +-
.../plan/scheduler/load/LoadTsFileScheduler.java | 29 +-
.../db/schemaengine/table/DataNodeTableCache.java | 42 ++-
.../iotdb/db/schemaengine/table/ITableCache.java | 10 +-
.../iotdb/db/service/DataNodeShutdownHook.java | 33 +-
.../db/storageengine/dataregion/DataRegion.java | 3 +-
.../dataregion/tsfile/TsFileResourceList.java | 2 +-
.../dataregion/utils/TsFileResourceUtils.java | 5 +-
.../storageengine/dataregion/wal/WALManager.java | 11 +-
.../file/AbstractTsFileRecoverPerformer.java | 2 +-
.../receiver/SubscriptionReceiverV1.java | 6 +
.../SchemaRegionSimpleRecoverTest.java | 4 +-
...nAlignedTreeDeviceViewScanOperatorTreeTest.java | 43 ++-
.../distribution/AggregationAlignByDeviceTest.java | 57 ++++
.../analyzer/RowPatternRecognitionTest.java | 32 ++
.../plan/relational/analyzer/TreeViewTest.java | 4 +-
.../fetcher/cache/TableDeviceSchemaCacheTest.java | 12 +-
.../security/encrypt/MessageDigestEncryptTest.java | 12 +-
.../storageengine/dataregion/DataRegionTest.java | 4 +-
.../TableModelCompactionWithTTLTest.java | 4 +-
.../file/UnsealedTsFileRecoverPerformerTest.java | 4 +-
.../org/apache/iotdb/metrics/utils/MetricInfo.java | 3 +-
.../conf/iotdb-system.properties.template | 2 +-
.../commons/auth/authorizer/BasicAuthorizer.java | 42 ++-
.../commons/concurrent/IoTDBThreadPoolFactory.java | 28 ++
.../iotdb/commons/concurrent/ThreadName.java | 1 +
.../apache/iotdb/commons/conf/CommonConfig.java | 52 +--
.../commons/exception/QueryTimeoutException.java | 4 +
.../org/apache/iotdb/commons/path/PartialPath.java | 12 +
.../pipe/agent/task/meta/PipeRuntimeMeta.java | 9 +
.../commons/pipe/agent/task/meta/PipeTaskMeta.java | 25 +-
.../iotdb/commons/pipe/config/PipeConfig.java | 20 +-
.../iotdb/commons/pipe/config/PipeDescriptor.java | 19 +-
.../thrift/request/PipeTransferCompressedReq.java | 15 +
.../iotdb/commons/pipe/event/EnrichedEvent.java | 4 +-
.../security/encrypt/AsymmetricEncrypt.java | 23 +-
.../security/encrypt/MessageDigestEncrypt.java | 10 +-
.../relational/tvf/VariationTableFunction.java | 196 +++++++++--
.../udf/builtin/relational/tvf/WindowTVFUtils.java | 6 +-
.../org/apache/iotdb/commons/utils/AuthUtils.java | 22 +-
.../thrift-datanode/src/main/thrift/client.thrift | 1 +
.../src/main/thrift/datanode.thrift | 1 +
pom.xml | 4 +-
189 files changed, 3875 insertions(+), 1248 deletions(-)
(iotdb) 05/07: dev
Posted by ha...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch ssl_between_nodes
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 9f77e329a87b4d98ed28642096a5840814291bb5
Author: HTHou <ha...@apache.org>
AuthorDate: Thu Jul 17 10:02:29 2025 +0800
dev
---
.../iotdb/rpc/NettyTNonBlockingTransport.java | 52 ++++++++++------------
1 file changed, 23 insertions(+), 29 deletions(-)
diff --git a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
index 1996a21f6a3..7584ac68792 100644
--- a/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
+++ b/iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/NettyTNonBlockingTransport.java
@@ -81,7 +81,6 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
private final String keystorePassword;
private final String truststorePath;
private final String truststorePassword;
- private boolean sslEnabled = false;
public NettyTNonBlockingTransport(
String host,
@@ -100,7 +99,6 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
this.keystorePassword = keystorePassword;
this.truststorePath = truststorePath;
this.truststorePassword = truststorePassword;
- this.sslEnabled = true;
initBootstrap();
}
@@ -118,27 +116,23 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
logger.info("Initializing channel for {}:{}", host, port);
ChannelPipeline pipeline = ch.pipeline();
-
- // 添加 SSL 处理器(如果启用)
- if (sslEnabled) {
- SslContext sslContext = createSslContext();
- SslHandler sslHandler = sslContext.newHandler(ch.alloc(), host, port);
- // 增加握手超时时间
- sslHandler.setHandshakeTimeoutMillis(30000);
-
- pipeline.addLast("ssl", sslHandler);
- // 添加SSL握手完成监听器
- sslHandler
- .handshakeFuture()
- .addListener(
- future -> {
- if (future.isSuccess()) {
- logger.info("SSL handshake completed successfully");
- } else {
- logger.info("SSL handshake failed: ", future.cause());
- }
- });
- }
+ SslContext sslContext = createSslContext();
+ SslHandler sslHandler = sslContext.newHandler(ch.alloc(), host, port);
+ // 增加握手超时时间
+ sslHandler.setHandshakeTimeoutMillis(30000);
+
+ pipeline.addLast("ssl", sslHandler);
+ // 添加SSL握手完成监听器
+ sslHandler
+ .handshakeFuture()
+ .addListener(
+ future -> {
+ if (future.isSuccess()) {
+ logger.info("SSL handshake completed successfully");
+ } else {
+ logger.info("SSL handshake failed: {}", future.cause().getMessage());
+ }
+ });
// 添加业务处理器
pipeline.addLast("handler", new NettyTransportHandler());
@@ -194,11 +188,11 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
}
try {
- ByteBuf byteBuf = readQueue.take();
- // if (byteBuf == null) {
- // logger.info("No data available for ByteBuffer read (non-blocking)");
- // return 0; // 非阻塞读取,没有数据时返回 0
- // }
+ ByteBuf byteBuf = readQueue.poll();
+ if (byteBuf == null) {
+ logger.info("No data available for ByteBuffer read (non-blocking)");
+ return 0; // 非阻塞读取,没有数据时返回 0
+ }
int available = Math.min(buffer.remaining(), byteBuf.readableBytes());
if (available > 0) {
@@ -344,7 +338,7 @@ public class NettyTNonBlockingTransport extends TNonblockingTransport {
connecting.set(false);
});
future.get();
- return false; // 异步连接,立即返回 false
+ return true; // 异步连接,立即返回 false
} catch (Exception e) {
connecting.set(false);
// throw new IOException("Failed to start connection", e);