Skip to content

Commit 24e3f51

Browse files
committed
Merge branch 'master' of github.com:LJW21-02/iotdb
sync remote and local code
2 parents 8fb72a1 + ee4b3f1 commit 24e3f51

File tree

171 files changed

+5843
-1229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+5843
-1229
lines changed

integration-test/src/main/java/org/apache/iotdb/it/env/cluster/env/AbstractEnv.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,11 @@ public void shutdownAllDataNodes() {
11271127
dataNodeWrapperList.forEach(AbstractNodeWrapper::stop);
11281128
}
11291129

1130+
@Override
1131+
public void shutdownForciblyAllDataNodes() {
1132+
dataNodeWrapperList.forEach(AbstractNodeWrapper::stopForcibly);
1133+
}
1134+
11301135
@Override
11311136
public void ensureNodeStatus(
11321137
final List<BaseNodeWrapper> nodes, final List<NodeStatus> targetStatus)

integration-test/src/main/java/org/apache/iotdb/it/env/remote/env/RemoteServerEnv.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,11 @@ public void shutdownAllDataNodes() {
440440
throw new UnsupportedOperationException();
441441
}
442442

443+
@Override
444+
public void shutdownForciblyAllDataNodes() {
445+
throw new UnsupportedOperationException();
446+
}
447+
443448
@Override
444449
public int getMqttPort() {
445450
throw new UnsupportedOperationException();

integration-test/src/main/java/org/apache/iotdb/itbase/env/BaseEnv.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ void ensureNodeStatus(List<BaseNodeWrapper> nodes, List<NodeStatus> targetStatus
300300
/** Shutdown all existed DataNodes. */
301301
void shutdownAllDataNodes();
302302

303+
/** Shutdown forcibly all existed DataNodes. */
304+
void shutdownForciblyAllDataNodes();
305+
303306
int getMqttPort();
304307

305308
String getIP();

integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,4 +1318,27 @@ public static void restartDataNodes() {
13181318
}
13191319
}
13201320
}
1321+
1322+
public static void stopForciblyAndRestartDataNodes() {
1323+
EnvFactory.getEnv().shutdownForciblyAllDataNodes();
1324+
EnvFactory.getEnv().startAllDataNodes();
1325+
long waitStartMS = System.currentTimeMillis();
1326+
long maxWaitMS = 60_000L;
1327+
long retryIntervalMS = 1000;
1328+
while (true) {
1329+
try (Connection connection = EnvFactory.getEnv().getConnection()) {
1330+
break;
1331+
} catch (Exception e) {
1332+
try {
1333+
Thread.sleep(retryIntervalMS);
1334+
} catch (InterruptedException ex) {
1335+
break;
1336+
}
1337+
}
1338+
long waited = System.currentTimeMillis() - waitStartMS;
1339+
if (waited > maxWaitMS) {
1340+
fail("Timeout while waiting for datanodes restart");
1341+
}
1342+
}
1343+
}
13211344
}

integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeAlterIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.apache.iotdb.it.env.cluster.node.DataNodeWrapper;
2727
import org.apache.iotdb.it.framework.IoTDBTestRunner;
2828
import org.apache.iotdb.itbase.category.MultiClusterIT2AutoCreateSchema;
29-
import org.apache.iotdb.itbase.env.BaseEnv;
3029

3130
import org.junit.Assert;
3231
import org.junit.Test;
@@ -106,7 +105,7 @@ public void testBasicAlterPipe() throws Exception {
106105
}
107106

108107
// Alter pipe (modify)
109-
try (final Connection connection = senderEnv.getConnection(BaseEnv.TABLE_SQL_DIALECT);
108+
try (final Connection connection = senderEnv.getConnection();
110109
final Statement statement = connection.createStatement()) {
111110
statement.execute("alter pipe a2b modify source ('source.pattern'='root.test2')");
112111
} catch (SQLException e) {

integration-test/src/test/java/org/apache/iotdb/pipe/it/autocreate/IoTDBPipeSwitchStatusIT.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,14 @@ public void testWrongPipeName() throws Exception {
266266
.setExtractorAttributes(extractorAttributes)
267267
.setProcessorAttributes(processorAttributes));
268268
Assert.assertEquals(TSStatusCode.SUCCESS_STATUS.getStatusCode(), status.getCode());
269-
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.startPipe("").getCode());
270269
Assert.assertEquals(
271-
TSStatusCode.PIPE_ERROR.getStatusCode(), client.startPipe("p0").getCode());
272-
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.startPipe("p").getCode());
273-
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.startPipe("*").getCode());
270+
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("").getCode());
271+
Assert.assertEquals(
272+
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("p0").getCode());
273+
Assert.assertEquals(
274+
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("p").getCode());
275+
Assert.assertEquals(
276+
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.startPipe("*").getCode());
274277
List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
275278
Assert.assertTrue(
276279
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
@@ -281,10 +284,14 @@ public void testWrongPipeName() throws Exception {
281284
Assert.assertTrue(
282285
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));
283286

284-
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.stopPipe("").getCode());
285-
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.stopPipe("p0").getCode());
286-
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.stopPipe("p").getCode());
287-
Assert.assertEquals(TSStatusCode.PIPE_ERROR.getStatusCode(), client.stopPipe("*").getCode());
287+
Assert.assertEquals(
288+
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("").getCode());
289+
Assert.assertEquals(
290+
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("p0").getCode());
291+
Assert.assertEquals(
292+
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("p").getCode());
293+
Assert.assertEquals(
294+
TSStatusCode.PIPE_NOT_EXIST_ERROR.getStatusCode(), client.stopPipe("*").getCode());
288295
showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
289296
Assert.assertTrue(
290297
showPipeResult.stream().anyMatch((o) -> o.id.equals("p1") && o.state.equals("RUNNING")));

integration-test/src/test/java/org/apache/iotdb/pipe/it/tablemodel/IoTDBPipeAlterIT.java

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ public void testBasicAlterPipe() throws Exception {
6565
long lastCreationTime;
6666
try (final SyncConfigNodeIServiceClient client =
6767
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
68-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
68+
final List<TShowPipeInfo> showPipeResult =
69+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
6970
Assert.assertEquals(1, showPipeResult.size());
7071
// Check status
7172
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -96,7 +97,8 @@ public void testBasicAlterPipe() throws Exception {
9697
// Show pipe
9798
try (final SyncConfigNodeIServiceClient client =
9899
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
99-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
100+
final List<TShowPipeInfo> showPipeResult =
101+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
100102
Assert.assertEquals(1, showPipeResult.size());
101103
// Check status
102104
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -114,7 +116,8 @@ public void testBasicAlterPipe() throws Exception {
114116
// Show pipe
115117
try (final SyncConfigNodeIServiceClient client =
116118
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
117-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
119+
final List<TShowPipeInfo> showPipeResult =
120+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
118121
Assert.assertEquals(1, showPipeResult.size());
119122
// Check status
120123
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -149,7 +152,8 @@ public void testBasicAlterPipe() throws Exception {
149152
// Show pipe
150153
try (final SyncConfigNodeIServiceClient client =
151154
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
152-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
155+
final List<TShowPipeInfo> showPipeResult =
156+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
153157
Assert.assertEquals(1, showPipeResult.size());
154158
// check status
155159
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -183,7 +187,8 @@ public void testBasicAlterPipe() throws Exception {
183187
// Show pipe
184188
try (final SyncConfigNodeIServiceClient client =
185189
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
186-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
190+
final List<TShowPipeInfo> showPipeResult =
191+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
187192
Assert.assertEquals(1, showPipeResult.size());
188193
// Check status
189194
Assert.assertEquals("STOPPED", showPipeResult.get(0).state);
@@ -225,7 +230,8 @@ public void testBasicAlterPipe() throws Exception {
225230
// Show pipe
226231
try (final SyncConfigNodeIServiceClient client =
227232
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
228-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
233+
final List<TShowPipeInfo> showPipeResult =
234+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
229235
Assert.assertEquals(1, showPipeResult.size());
230236
// Check status
231237
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -257,7 +263,8 @@ public void testBasicAlterPipe() throws Exception {
257263
// show pipe
258264
try (final SyncConfigNodeIServiceClient client =
259265
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
260-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
266+
final List<TShowPipeInfo> showPipeResult =
267+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
261268
Assert.assertEquals(1, showPipeResult.size());
262269
// check status
263270
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -289,7 +296,8 @@ public void testBasicAlterPipe() throws Exception {
289296
// show pipe
290297
try (final SyncConfigNodeIServiceClient client =
291298
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
292-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
299+
final List<TShowPipeInfo> showPipeResult =
300+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
293301
Assert.assertEquals(1, showPipeResult.size());
294302
// check status
295303
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -323,7 +331,8 @@ public void testBasicAlterPipe() throws Exception {
323331
// show pipe
324332
try (final SyncConfigNodeIServiceClient client =
325333
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
326-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
334+
final List<TShowPipeInfo> showPipeResult =
335+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
327336
Assert.assertEquals(1, showPipeResult.size());
328337
// check status
329338
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);
@@ -354,7 +363,8 @@ public void testBasicAlterPipe() throws Exception {
354363
// Show pipe
355364
try (final SyncConfigNodeIServiceClient client =
356365
(SyncConfigNodeIServiceClient) senderEnv.getLeaderConfigNodeConnection()) {
357-
final List<TShowPipeInfo> showPipeResult = client.showPipe(new TShowPipeReq()).pipeInfoList;
366+
final List<TShowPipeInfo> showPipeResult =
367+
client.showPipe(new TShowPipeReq().setIsTableModel(true)).pipeInfoList;
358368
Assert.assertEquals(1, showPipeResult.size());
359369
// Check status
360370
Assert.assertEquals("RUNNING", showPipeResult.get(0).state);

0 commit comments

Comments
 (0)