Skip to content

Commit

Permalink
Merge branch 'master' into modifyTabletUsage
Browse files Browse the repository at this point in the history
  • Loading branch information
jt2594838 authored Jan 10, 2025
2 parents 43b48d8 + c8d7c5d commit 68ee4a5
Show file tree
Hide file tree
Showing 124 changed files with 3,807 additions and 854 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.iotdb.it.env.cluster.node.DataNodeWrapper;
import org.apache.iotdb.it.framework.IoTDBTestRunner;
import org.apache.iotdb.itbase.category.MultiClusterIT2AutoCreateSchema;
import org.apache.iotdb.itbase.env.BaseEnv;

import org.junit.Assert;
import org.junit.Test;
Expand Down Expand Up @@ -106,7 +105,7 @@ public void testBasicAlterPipe() throws Exception {
}

// Alter pipe (modify)
try (final Connection connection = senderEnv.getConnection(BaseEnv.TABLE_SQL_DIALECT);
try (final Connection connection = senderEnv.getConnection();
final Statement statement = connection.createStatement()) {
statement.execute("alter pipe a2b modify source ('source.pattern'='root.test2')");
} catch (SQLException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,14 @@ public void testWrongPipeName() throws Exception {
.setExtractorAttributes(extractorAttributes)
.setProcessorAttributes(processorAttributes));
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.startPipe("").getCode());
Assert.assertEquals(
TSStatusCode.PIPE_ERROR.getStatusCode(), client.startPipe("p0").getCode());
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.startPipe("p").getCode());
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.startPipe("*").getCode());
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("").getCode());
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("p0").getCode());
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("p").getCode());
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("*").getCode());
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Expand All @@ -281,10 +284,14 @@ public void testWrongPipeName() throws Exception {
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));

Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.stopPipe("").getCode());
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.stopPipe("p0").getCode());
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.stopPipe("p").getCode());
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.stopPipe("*").getCode());
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("").getCode());
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("p0").getCode());
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("p").getCode());
Assert.assertEquals(
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("*").getCode());
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
Assert.assertTrue(
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public void testBasicAlterPipe() throws Exception {
long lastCreationTime;
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
Expand Down Expand Up @@ -96,7 +97,8 @@ public void testBasicAlterPipe() throws Exception {
// Show pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
Expand All @@ -114,7 +116,8 @@ public void testBasicAlterPipe() throws Exception {
// Show pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
Expand Down Expand Up @@ -149,7 +152,8 @@ public void testBasicAlterPipe() throws Exception {
// Show pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
Expand Down Expand Up @@ -183,7 +187,8 @@ public void testBasicAlterPipe() throws Exception {
// Show pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
Expand Down Expand Up @@ -225,7 +230,8 @@ public void testBasicAlterPipe() throws Exception {
// Show pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
Expand Down Expand Up @@ -257,7 +263,8 @@ public void testBasicAlterPipe() throws Exception {
// show pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
Expand Down Expand Up @@ -289,7 +296,8 @@ public void testBasicAlterPipe() throws Exception {
// show pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
Expand Down Expand Up @@ -323,7 +331,8 @@ public void testBasicAlterPipe() throws Exception {
// show pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
Expand Down Expand Up @@ -354,7 +363,8 @@ public void testBasicAlterPipe() throws Exception {
// Show pipe
try (final SyncConfigNodeIServiceClient client =
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
final List<TShowPipeInfo> showPipeResult =
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
Assert.assertEquals(1, showPipeResult.size());
// Check status
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
Expand Down
Loading

0 comments on commit 68ee4a5

Please sign in to comment.