Add SHOW RECEIVERS support - #17869
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #17869 +/- ##
============================================
+ Coverage 42.65% 42.73% +0.07%
- Complexity 414 442 +28
============================================
Files 5451 5459 +8
Lines 394061 395004 +943
Branches 51608 51700 +92
============================================
+ Hits 168089 168791 +702
- Misses 225972 226213 +241 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
# Conflicts: # iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiverTest.java
# Conflicts: # iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
…ow-receivers # Conflicts: # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/writeback/WriteBackSink.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/parser/ASTVisitor.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/security/TreeAccessCheckVisitor.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/statement/StatementVisitor.java # iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeSinkTest.java
# Conflicts: # iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/pipe/receiver/protocol/IoTDBConfigNodeReceiver.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/thrift/IoTDBDataNodeReceiver.java # iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/receiver/IoTDBFileReceiver.java
…ow-receivers # Conflicts: # iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/sink/PipeSinkTest.java
…ow-receivers # Conflicts: # integration-test/src/test/java/org/apache/iotdb/pipe/it/single/IoTDBPipeReceiverIT.java # integration-test/src/test/java/org/apache/iotdb/relational/it/schema/IoTDBDatabaseIT.java # iotdb-core/datanode/src/test/java/org/apache/iotdb/db/pipe/receiver/protocol/airgap/IoTDBAirGapReceiverTest.java
|
| public void testShowReceiversPipeIdsDisappearAfterDropPipe() throws Exception { | ||
| final String database = "root.show_receivers_lifecycle"; | ||
| final String pipeName = "show_receivers_lifecycle_pipe"; | ||
|
|
||
| createThriftPipe(database, pipeName); | ||
|
|
||
| assertShowReceivers("show receivers", BaseEnv.TREE_SQL_DIALECT, pipeName); | ||
| assertShowReceivers( | ||
| "select * from information_schema.receivers", BaseEnv.TABLE_SQL_DIALECT, pipeName); |
There was a problem hiding this comment.
Why can a tree pipe be shown in the table model?
| private TPipeTransferResp recordConfigNodeReceiverRuntimeIfSuccess( | ||
| final Pair<TPipeTransferResp, Integer> respWithReceiverNodeId, final TPipeTransferReq req) { | ||
| final TPipeTransferResp resp = respWithReceiverNodeId.left; | ||
| if (!PipeRequestType.isValidatedRequestType(req.getType())) { | ||
| return resp; | ||
| } | ||
|
|
||
| final PipeRequestType requestType = PipeRequestType.valueOf(req.getType()); | ||
| if (requestType == PipeRequestType.HANDSHAKE_CONFIGNODE_V1 | ||
| || requestType == PipeRequestType.HANDSHAKE_CONFIGNODE_V2) { | ||
| if (isSuccess(resp)) { | ||
| recordConfigNodeHandshake(req, requestType, respWithReceiverNodeId.right); | ||
| } | ||
| } else { | ||
| if (isSuccess(resp)) { | ||
| PipeReceiverRuntimeRegistry.getInstance() | ||
| .markTransfer(configPipeReceiverRuntimeSessionKey.get(), System.currentTimeMillis()); | ||
| } | ||
| } | ||
| return resp; | ||
| } |
There was a problem hiding this comment.
The return value is fixed. Is it necessary?
| getSenderHost(), | ||
| parseSenderPort(getSenderPort()), |
| final Map<String, String> params = new HashMap<>(); | ||
| if (req.getBody() == null) { | ||
| return params; | ||
| } |
There was a problem hiding this comment.
Move the judgment to the very beginning and return Collections.emptyMap if the map will not be written later.
…ow-receivers # Conflicts: # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/agent/task/subtask/sink/PipeSinkSubtaskManager.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeClient.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeInfo.java




Summary
Tests
Notes