Skip to content

Commit 9909d1c

Browse files
committed
Merge branch 'master' into update_last_cache_in_load
2 parents 3871640 + 8fb0b46 commit 9909d1c

212 files changed

Lines changed: 17798 additions & 1362 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: AINode Code Style Check
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- "rc/*"
8+
paths:
9+
- 'iotdb-core/ainode/**'
10+
pull_request:
11+
branches:
12+
- master
13+
- "rc/*"
14+
paths:
15+
- 'iotdb-core/ainode/**'
16+
# allow manually run the action:
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
env:
24+
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
25+
MAVEN_ARGS: --batch-mode --no-transfer-progress
26+
27+
jobs:
28+
check-style:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v4
33+
34+
- name: Set up Python 3.10
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: "3.10"
38+
39+
- name: Install dependencies
40+
run: |
41+
pip3 install black==25.1.0 isort==6.0.1
42+
- name: Check code formatting (Black)
43+
run: |
44+
cd iotdb-core/ainode
45+
black --check .
46+
continue-on-error: false
47+
48+
- name: Check import order (Isort)
49+
run: |
50+
cd iotdb-core/ainode
51+
isort --check-only --profile black .
52+
continue-on-error: false

.github/workflows/pipe-it.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ jobs:
438438
matrix:
439439
java: [ 17 ]
440440
# StrongConsistencyClusterMode is ignored now because RatisConsensus has not been supported yet.
441-
cluster1: [ ScalableSingleNodeMode ]
441+
cluster1: [ ScalableSingleNodeMode, PipeConsensusBatchMode, PipeConsensusStreamMode ]
442442
cluster2: [ ScalableSingleNodeMode ]
443443
os: [ ubuntu-latest ]
444444
runs-on: ${{ matrix.os }}
@@ -606,7 +606,7 @@ jobs:
606606
matrix:
607607
java: [ 17 ]
608608
# do not use HighPerformanceMode here, otherwise some tests will cause the GH runner to receive a shutdown signal
609-
cluster1: [ ScalableSingleNodeMode ]
609+
cluster1: [ ScalableSingleNodeMode, PipeConsensusBatchMode, PipeConsensusStreamMode ]
610610
cluster2: [ ScalableSingleNodeMode ]
611611
os: [ ubuntu-latest ]
612612
runs-on: ${{ matrix.os }}
@@ -690,7 +690,7 @@ jobs:
690690
matrix:
691691
java: [ 17 ]
692692
# do not use HighPerformanceMode here, otherwise some tests will cause the GH runner to receive a shutdown signal
693-
cluster1: [ ScalableSingleNodeMode ]
693+
cluster1: [ ScalableSingleNodeMode, PipeConsensusBatchMode, PipeConsensusStreamMode ]
694694
cluster2: [ ScalableSingleNodeMode ]
695695
os: [ ubuntu-latest ]
696696
runs-on: ${{ matrix.os }}

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

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
import org.apache.iotdb.isession.pool.ITableSessionPool;
4141
import org.apache.iotdb.it.env.EnvFactory;
4242
import org.apache.iotdb.it.env.cluster.EnvUtils;
43-
import org.apache.iotdb.it.env.cluster.config.*;
43+
import org.apache.iotdb.it.env.cluster.config.MppClusterConfig;
44+
import org.apache.iotdb.it.env.cluster.config.MppCommonConfig;
45+
import org.apache.iotdb.it.env.cluster.config.MppConfigNodeConfig;
46+
import org.apache.iotdb.it.env.cluster.config.MppDataNodeConfig;
47+
import org.apache.iotdb.it.env.cluster.config.MppJVMConfig;
4448
import org.apache.iotdb.it.env.cluster.node.AINodeWrapper;
4549
import org.apache.iotdb.it.env.cluster.node.AbstractNodeWrapper;
4650
import org.apache.iotdb.it.env.cluster.node.ConfigNodeWrapper;
@@ -49,7 +53,11 @@
4953
import org.apache.iotdb.itbase.env.BaseEnv;
5054
import org.apache.iotdb.itbase.env.BaseNodeWrapper;
5155
import org.apache.iotdb.itbase.env.ClusterConfig;
52-
import org.apache.iotdb.itbase.runtime.*;
56+
import org.apache.iotdb.itbase.runtime.ClusterTestConnection;
57+
import org.apache.iotdb.itbase.runtime.NodeConnection;
58+
import org.apache.iotdb.itbase.runtime.ParallelRequestDelegate;
59+
import org.apache.iotdb.itbase.runtime.RequestDelegate;
60+
import org.apache.iotdb.itbase.runtime.SerialRequestDelegate;
5361
import org.apache.iotdb.jdbc.Config;
5462
import org.apache.iotdb.jdbc.Constant;
5563
import org.apache.iotdb.jdbc.IoTDBConnection;
@@ -70,13 +78,23 @@
7078
import java.sql.DriverManager;
7179
import java.sql.SQLException;
7280
import java.time.ZoneId;
73-
import java.util.*;
81+
import java.util.ArrayList;
82+
import java.util.Collections;
83+
import java.util.HashMap;
84+
import java.util.List;
85+
import java.util.Map;
86+
import java.util.Optional;
87+
import java.util.Random;
7488
import java.util.concurrent.TimeUnit;
7589
import java.util.function.Predicate;
7690
import java.util.stream.Collectors;
7791
import java.util.stream.Stream;
7892

79-
import static org.apache.iotdb.it.env.cluster.ClusterConstant.*;
93+
import static org.apache.iotdb.it.env.cluster.ClusterConstant.NODE_NETWORK_TIMEOUT_MS;
94+
import static org.apache.iotdb.it.env.cluster.ClusterConstant.NODE_START_TIMEOUT;
95+
import static org.apache.iotdb.it.env.cluster.ClusterConstant.TEMPLATE_NODE_LIB_PATH;
96+
import static org.apache.iotdb.it.env.cluster.ClusterConstant.TEMPLATE_NODE_PATH;
97+
import static org.apache.iotdb.it.env.cluster.ClusterConstant.ZERO_TIME_ZONE;
8098
import static org.apache.iotdb.jdbc.Config.VERSION;
8199

82100
public abstract class AbstractEnv implements BaseEnv {

integration-test/src/test/java/org/apache/iotdb/db/it/auth/IoTDBSeriesPermissionIT.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
import static org.apache.iotdb.commons.schema.column.ColumnHeaderConstant.countTimeSeriesColumnHeaders;
3939
import static org.apache.iotdb.commons.schema.column.ColumnHeaderConstant.showChildNodesColumnHeaders;
4040
import static org.apache.iotdb.commons.schema.column.ColumnHeaderConstant.showChildPathsColumnHeaders;
41+
import static org.apache.iotdb.commons.schema.column.ColumnHeaderConstant.showDatabasesColumnHeaders;
4142
import static org.apache.iotdb.commons.schema.column.ColumnHeaderConstant.showDevicesColumnHeaders;
42-
import static org.apache.iotdb.commons.schema.column.ColumnHeaderConstant.showStorageGroupsColumnHeaders;
4343
import static org.apache.iotdb.commons.schema.column.ColumnHeaderConstant.showTTLColumnHeaders;
4444
import static org.apache.iotdb.commons.schema.column.ColumnHeaderConstant.showTimeSeriesColumnHeaders;
4545
import static org.apache.iotdb.db.it.utils.TestUtils.assertNonQueryTestFail;
@@ -160,9 +160,7 @@ private void testReadSchema() {
160160
// show/count databases
161161
resultSetEqualTest(
162162
"show databases",
163-
showStorageGroupsColumnHeaders.stream()
164-
.map(ColumnHeader::getColumnName)
165-
.toArray(String[]::new),
163+
showDatabasesColumnHeaders.stream().map(ColumnHeader::getColumnName).toArray(String[]::new),
166164
new String[] {"root.test,1,1,0,604800000,"},
167165
"test1",
168166
"test123");

integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteStorageGroupIT.java renamed to integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBDeleteDatabaseIT.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
import static org.junit.Assert.assertTrue;
4242

4343
@Category({LocalStandaloneIT.class, ClusterIT.class})
44-
public class IoTDBDeleteStorageGroupIT extends AbstractSchemaIT {
44+
public class IoTDBDeleteDatabaseIT extends AbstractSchemaIT {
4545

46-
public IoTDBDeleteStorageGroupIT(SchemaTestMode schemaTestMode) {
46+
public IoTDBDeleteDatabaseIT(SchemaTestMode schemaTestMode) {
4747
super(schemaTestMode);
4848
}
4949

@@ -65,7 +65,7 @@ public void tearDown() throws Exception {
6565
}
6666

6767
@Test
68-
public void testDeleteStorageGroup() throws Exception {
68+
public void testDeleteDatabase() throws Exception {
6969
try (Connection connection = EnvFactory.getEnv().getConnection();
7070
Statement statement = connection.createStatement()) {
7171
statement.execute("CREATE DATABASE root.ln.wf01.wt01");
@@ -90,7 +90,7 @@ public void testDeleteStorageGroup() throws Exception {
9090
}
9191

9292
@Test
93-
public void testDeleteMultipleStorageGroupWithQuote() throws Exception {
93+
public void testDeleteMultipleDatabasesWithQuote() throws Exception {
9494
try (Connection connection = EnvFactory.getEnv().getConnection();
9595
Statement statement = connection.createStatement()) {
9696
statement.execute("CREATE DATABASE root.ln1.wf01.wt01");
@@ -113,7 +113,7 @@ public void testDeleteMultipleStorageGroupWithQuote() throws Exception {
113113
}
114114

115115
@Test(expected = SQLException.class)
116-
public void deleteNonExistStorageGroup() throws Exception {
116+
public void deleteNonExistDatabase() throws Exception {
117117
try (final Connection connection = EnvFactory.getEnv().getConnection();
118118
final Statement statement = connection.createStatement()) {
119119
statement.execute("CREATE DATABASE root.ln2.wf01.wt01");
@@ -122,7 +122,7 @@ public void deleteNonExistStorageGroup() throws Exception {
122122
}
123123

124124
@Test
125-
public void testDeleteStorageGroupWithStar() throws Exception {
125+
public void testDeleteDatabaseWithStar() throws Exception {
126126
try (Connection connection = EnvFactory.getEnv().getConnection();
127127
Statement statement = connection.createStatement()) {
128128
statement.execute("CREATE DATABASE root.ln3.wf01.wt01");
@@ -145,7 +145,7 @@ public void testDeleteStorageGroupWithStar() throws Exception {
145145
}
146146

147147
@Test
148-
public void testDeleteAllStorageGroups() throws Exception {
148+
public void testDeleteAllDatabases() throws Exception {
149149
try (Connection connection = EnvFactory.getEnv().getConnection();
150150
Statement statement = connection.createStatement()) {
151151
statement.execute("CREATE DATABASE root.ln4.wf01.wt01");
@@ -164,7 +164,7 @@ public void testDeleteAllStorageGroups() throws Exception {
164164
}
165165

166166
@Test
167-
public void testDeleteStorageGroupAndThenQuery() throws Exception {
167+
public void testDeleteDatabaseAndThenQuery() throws Exception {
168168
try (Connection connection = EnvFactory.getEnv().getConnection();
169169
Statement statement = connection.createStatement()) {
170170
statement.execute("insert into root.sg1.d1(time,s1) values(1,1);");
@@ -185,7 +185,7 @@ public void testDeleteStorageGroupAndThenQuery() throws Exception {
185185
}
186186

187187
@Test
188-
public void testDeleteStorageGroupInvalidateCache() throws Exception {
188+
public void testDeleteDatabaseInvalidateCache() throws Exception {
189189
try (final Connection connection = EnvFactory.getEnv().getConnection();
190190
final Statement statement = connection.createStatement()) {
191191
try {

integration-test/src/test/java/org/apache/iotdb/db/it/schema/IoTDBMetadataFetchIT.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.util.Arrays;
3939
import java.util.Collections;
4040
import java.util.HashSet;
41+
import java.util.List;
4142
import java.util.Set;
4243

4344
import static org.junit.Assert.assertEquals;
@@ -185,37 +186,36 @@ public void showTimeseriesTest() throws SQLException {
185186
}
186187

187188
@Test
188-
public void showStorageGroupTest() throws SQLException {
189-
try (Connection connection = EnvFactory.getEnv().getConnection();
190-
Statement statement = connection.createStatement()) {
191-
String[] sqls =
189+
public void showDatabasesTest() throws SQLException {
190+
try (final Connection connection = EnvFactory.getEnv().getConnection();
191+
final Statement statement = connection.createStatement()) {
192+
final String[] sqls =
192193
new String[] {
193194
"show databases",
194195
"show databases root.ln.wf01.**",
195196
"show databases root.ln.wf01.wt01.status"
196197
};
197-
Set<String>[] standards =
198-
new Set[] {
199-
new HashSet<>(
200-
Arrays.asList(
201-
"root.ln.wf01.wt01",
202-
"root.ln.wf01.wt02",
203-
"root.ln1.wf01.wt01",
204-
"root.ln2.wf01.wt01")),
205-
new HashSet<>(Arrays.asList("root.ln.wf01.wt01", "root.ln.wf01.wt02")),
206-
new HashSet<>()
198+
final List<String>[] standards =
199+
new List[] {
200+
Arrays.asList(
201+
"root.ln.wf01.wt01",
202+
"root.ln.wf01.wt02",
203+
"root.ln1.wf01.wt01",
204+
"root.ln2.wf01.wt01"),
205+
Arrays.asList("root.ln.wf01.wt01", "root.ln.wf01.wt02"),
206+
Collections.emptyList()
207207
};
208208

209209
for (int n = 0; n < sqls.length; n++) {
210-
String sql = sqls[n];
211-
Set<String> standard = standards[n];
212-
try (ResultSet resultSet = statement.executeQuery(sql)) {
210+
final String sql = sqls[n];
211+
final List<String> standard = standards[n];
212+
int i = 0;
213+
try (final ResultSet resultSet = statement.executeQuery(sql)) {
213214
while (resultSet.next()) {
214-
Assert.assertTrue(standard.contains(resultSet.getString(1)));
215-
standard.remove(resultSet.getString(1));
215+
assertEquals(standard.get(i++), resultSet.getString(1));
216216
}
217-
assertEquals(0, standard.size());
218-
} catch (SQLException e) {
217+
assertEquals(i, standard.size());
218+
} catch (final SQLException e) {
219219
e.printStackTrace();
220220
fail(e.getMessage());
221221
}

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
import java.text.DateFormat;
4444
import java.time.ZoneId;
4545
import java.time.ZoneOffset;
46+
import java.util.ArrayList;
47+
import java.util.Collection;
4648
import java.util.Collections;
4749
import java.util.HashMap;
4850
import java.util.HashSet;
@@ -619,16 +621,19 @@ public static void assertResultSetEqual(
619621
}
620622

621623
public static void assertResultSetEqual(
622-
ResultSet actualResultSet, String expectedHeader, Set<String> expectedRetSet) {
624+
final ResultSet actualResultSet,
625+
final String expectedHeader,
626+
final Collection<String> expectedResult) {
623627
try {
624-
ResultSetMetaData resultSetMetaData = actualResultSet.getMetaData();
625-
StringBuilder header = new StringBuilder();
628+
final ResultSetMetaData resultSetMetaData = actualResultSet.getMetaData();
629+
final StringBuilder header = new StringBuilder();
626630
for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) {
627631
header.append(resultSetMetaData.getColumnName(i)).append(",");
628632
}
629633
assertEquals(expectedHeader, header.toString());
630634

631-
Set<String> actualRetSet = new HashSet<>();
635+
final Collection<String> actualRetSet =
636+
expectedResult instanceof Set ? new HashSet<>() : new ArrayList<>();
632637

633638
while (actualResultSet.next()) {
634639
StringBuilder builder = new StringBuilder();
@@ -637,8 +642,8 @@ public static void assertResultSetEqual(
637642
}
638643
actualRetSet.add(builder.toString());
639644
}
640-
assertEquals(expectedRetSet, actualRetSet);
641-
} catch (Exception e) {
645+
assertEquals(expectedResult, actualRetSet);
646+
} catch (final Exception e) {
642647
e.printStackTrace();
643648
Assert.fail(String.valueOf(e));
644649
}

0 commit comments

Comments
 (0)