You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "l2280212 (via GitHub)" <gi...@apache.org> on 2023/04/20 11:10:51 UTC
[GitHub] [iotdb] l2280212 opened a new pull request, #9665: [IOTDB-5567] improve show cluster slots information
l2280212 opened a new pull request, #9665:
URL: https://github.com/apache/iotdb/pull/9665
improve [show-cluster-slots-information](https://iotdb.apache.org/UserGuide/Master/Cluster/Cluster-Maintenance.html#show-cluster-slots-information) to make it more convenient for users
see more information in [IOTDB-5567](https://issues.apache.org/jira/browse/IOTDB-5567)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] l2280212 commented on a diff in pull request #9665: [IOTDB-5567] improve show cluster slots information
Posted by "l2280212 (via GitHub)" <gi...@apache.org>.
l2280212 commented on code in PR #9665:
URL: https://github.com/apache/iotdb/pull/9665#discussion_r1173279122
##########
antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4:
##########
@@ -447,23 +447,36 @@ showConfigNodes
// ---- Get Region Id
getRegionId
- : SHOW (DATA|SCHEMA) REGIONID OF path=prefixPath WHERE (SERIESSLOTID operator_eq
- seriesSlot=INTEGER_LITERAL|DEVICEID operator_eq deviceId=prefixPath) (OPERATOR_AND (TIMESLOTID operator_eq timeSlot=INTEGER_LITERAL|
- TIMESTAMP operator_eq timeStamp=INTEGER_LITERAL))?
+ : SHOW (DATA|SCHEMA) REGIONID WHERE (DATABASE operator_eq database=prefixPath
+ |(DEVICE|DEVICEID) operator_eq device=prefixPath)
Review Comment:
need to consider compatibility with previous versions? I can remove that
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] l2280212 commented on a diff in pull request #9665: [IOTDB-5567] improve show cluster slots information
Posted by "l2280212 (via GitHub)" <gi...@apache.org>.
l2280212 commented on code in PR #9665:
URL: https://github.com/apache/iotdb/pull/9665#discussion_r1173303957
##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/metadata/GetTimeSlotListStatement.java:
##########
@@ -93,8 +108,8 @@ public QueryType getQueryType() {
@Override
public List<PartialPath> getPaths() {
try {
- return Collections.singletonList(new PartialPath(storageGroup));
- } catch (IllegalPathException e) {
+ return Collections.singletonList(new PartialPath(database));
+ } catch (IllegalPathException | NullPointerException e) {
return new ArrayList<>();
Review Comment:
fix
##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/metadata/GetRegionIdStatement.java:
##########
@@ -115,8 +94,8 @@ public QueryType getQueryType() {
@Override
public List<PartialPath> getPaths() {
try {
- return Collections.singletonList(new PartialPath(storageGroup));
- } catch (IllegalPathException e) {
+ return Collections.singletonList(new PartialPath(database));
+ } catch (IllegalPathException | NullPointerException e) {
return new ArrayList<>();
}
Review Comment:
fix
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] OneSizeFitsQuorum merged pull request #9665: [IOTDB-5567] improve show cluster slots information
Posted by "OneSizeFitsQuorum (via GitHub)" <gi...@apache.org>.
OneSizeFitsQuorum merged PR #9665:
URL: https://github.com/apache/iotdb/pull/9665
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] l2280212 commented on a diff in pull request #9665: [IOTDB-5567] improve show cluster slots information
Posted by "l2280212 (via GitHub)" <gi...@apache.org>.
l2280212 commented on code in PR #9665:
URL: https://github.com/apache/iotdb/pull/9665#discussion_r1173304192
##########
confignode/pom.xml:
##########
@@ -69,6 +69,10 @@
<artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
Review Comment:
deleted
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] l2280212 commented on a diff in pull request #9665: [IOTDB-5567] improve show cluster slots information
Posted by "l2280212 (via GitHub)" <gi...@apache.org>.
l2280212 commented on code in PR #9665:
URL: https://github.com/apache/iotdb/pull/9665#discussion_r1173304057
##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/metadata/CountTimeSlotListStatement.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.db.mpp.plan.statement.metadata;
+
+import org.apache.iotdb.commons.exception.IllegalPathException;
+import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.db.mpp.plan.analyze.QueryType;
+import org.apache.iotdb.db.mpp.plan.statement.IConfigStatement;
+import org.apache.iotdb.db.mpp.plan.statement.Statement;
+import org.apache.iotdb.db.mpp.plan.statement.StatementVisitor;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class CountTimeSlotListStatement extends Statement implements IConfigStatement {
+
+ private String database;
+
+ private String device;
+
+ private long regionId = -1;
+
+ private long startTime = -1;
+
+ private long endTime = -1;
+
+ public CountTimeSlotListStatement() {
+ super();
+ }
+
+ public void setDatabase(String database) {
+ this.database = database;
+ }
+
+ public String getDatabase() {
+ return database;
+ }
+
+ public long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ }
+
+ public long getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(long endTime) {
+ this.endTime = endTime;
+ }
+
+ public void setDevice(String device) {
+ this.device = device;
+ }
+
+ public String getDevice() {
+ return this.device;
+ }
+
+ public void setRegionId(long regionId) {
+ this.regionId = regionId;
+ }
+
+ public long getRegionId() {
+ return this.regionId;
+ }
+
+ @Override
+ public <R, C> R accept(StatementVisitor<R, C> visitor, C context) {
+ return visitor.visitCountTimeSlotList(this, context);
+ }
+
+ @Override
+ public QueryType getQueryType() {
+ return QueryType.READ;
+ }
+
+ @Override
+ public List<PartialPath> getPaths() {
+ try {
+ return Collections.singletonList(new PartialPath(database));
+ } catch (IllegalPathException | NullPointerException e) {
+ return new ArrayList<>();
+ }
Review Comment:
fix
##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java:
##########
@@ -629,9 +631,11 @@ TDataPartitionTableResp getOrCreateDataPartition(
TGetRegionIdResp getRegionId(TGetRegionIdReq req);
- TGetTimeSlotListResp getTimeSlotList(GetTimeSlotListPlan plan);
+ TGetTimeSlotListResp getTimeSlotList(TGetTimeSlotListReq req);
- TGetSeriesSlotListResp getSeriesSlotList(GetSeriesSlotListPlan plan);
+ TCountTimeSlotListResp countTimeSlotList(TCountTimeSlotListReq req);
+
+ TGetSeriesSlotListResp getSeriesSlotList(TGetSeriesSlotListReq req);
Review Comment:
added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] CRZbulabula commented on a diff in pull request #9665: [IOTDB-5567] improve show cluster slots information
Posted by "CRZbulabula (via GitHub)" <gi...@apache.org>.
CRZbulabula commented on code in PR #9665:
URL: https://github.com/apache/iotdb/pull/9665#discussion_r1172554759
##########
antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4:
##########
@@ -447,23 +447,36 @@ showConfigNodes
// ---- Get Region Id
getRegionId
- : SHOW (DATA|SCHEMA) REGIONID OF path=prefixPath WHERE (SERIESSLOTID operator_eq
- seriesSlot=INTEGER_LITERAL|DEVICEID operator_eq deviceId=prefixPath) (OPERATOR_AND (TIMESLOTID operator_eq timeSlot=INTEGER_LITERAL|
- TIMESTAMP operator_eq timeStamp=INTEGER_LITERAL))?
+ : SHOW (DATA|SCHEMA) REGIONID WHERE (DATABASE operator_eq database=prefixPath
+ |(DEVICE|DEVICEID) operator_eq device=prefixPath)
Review Comment:
```suggestion
| DEVICE operator_eq device=prefixPath)
```
"DEVICEID" will be strange because we only accept input device=prefixPath
##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/IManager.java:
##########
@@ -629,9 +631,11 @@ TDataPartitionTableResp getOrCreateDataPartition(
TGetRegionIdResp getRegionId(TGetRegionIdReq req);
- TGetTimeSlotListResp getTimeSlotList(GetTimeSlotListPlan plan);
+ TGetTimeSlotListResp getTimeSlotList(TGetTimeSlotListReq req);
- TGetSeriesSlotListResp getSeriesSlotList(GetSeriesSlotListPlan plan);
+ TCountTimeSlotListResp countTimeSlotList(TCountTimeSlotListReq req);
+
+ TGetSeriesSlotListResp getSeriesSlotList(TGetSeriesSlotListReq req);
Review Comment:
Add function annotations for these interfaces
##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/metadata/CountTimeSlotListStatement.java:
##########
@@ -0,0 +1,107 @@
+/*
+ * 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.db.mpp.plan.statement.metadata;
+
+import org.apache.iotdb.commons.exception.IllegalPathException;
+import org.apache.iotdb.commons.path.PartialPath;
+import org.apache.iotdb.db.mpp.plan.analyze.QueryType;
+import org.apache.iotdb.db.mpp.plan.statement.IConfigStatement;
+import org.apache.iotdb.db.mpp.plan.statement.Statement;
+import org.apache.iotdb.db.mpp.plan.statement.StatementVisitor;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public class CountTimeSlotListStatement extends Statement implements IConfigStatement {
+
+ private String database;
+
+ private String device;
+
+ private long regionId = -1;
+
+ private long startTime = -1;
+
+ private long endTime = -1;
+
+ public CountTimeSlotListStatement() {
+ super();
+ }
+
+ public void setDatabase(String database) {
+ this.database = database;
+ }
+
+ public String getDatabase() {
+ return database;
+ }
+
+ public long getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ }
+
+ public long getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(long endTime) {
+ this.endTime = endTime;
+ }
+
+ public void setDevice(String device) {
+ this.device = device;
+ }
+
+ public String getDevice() {
+ return this.device;
+ }
+
+ public void setRegionId(long regionId) {
+ this.regionId = regionId;
+ }
+
+ public long getRegionId() {
+ return this.regionId;
+ }
+
+ @Override
+ public <R, C> R accept(StatementVisitor<R, C> visitor, C context) {
+ return visitor.visitCountTimeSlotList(this, context);
+ }
+
+ @Override
+ public QueryType getQueryType() {
+ return QueryType.READ;
+ }
+
+ @Override
+ public List<PartialPath> getPaths() {
+ try {
+ return Collections.singletonList(new PartialPath(database));
+ } catch (IllegalPathException | NullPointerException e) {
+ return new ArrayList<>();
+ }
Review Comment:
```suggestion
if (database == null) {
return new ArrayList<>();
}
try {
return Collections.singletonList(new PartialPath(database));
} catch (IllegalPathException e) {
/** Throw or log IllegalPathException here */
return new ArrayList<>();
}
```
##########
antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4:
##########
@@ -447,23 +447,36 @@ showConfigNodes
// ---- Get Region Id
getRegionId
- : SHOW (DATA|SCHEMA) REGIONID OF path=prefixPath WHERE (SERIESSLOTID operator_eq
- seriesSlot=INTEGER_LITERAL|DEVICEID operator_eq deviceId=prefixPath) (OPERATOR_AND (TIMESLOTID operator_eq timeSlot=INTEGER_LITERAL|
- TIMESTAMP operator_eq timeStamp=INTEGER_LITERAL))?
+ : SHOW (DATA|SCHEMA) REGIONID WHERE (DATABASE operator_eq database=prefixPath
+ |(DEVICE|DEVICEID) operator_eq device=prefixPath)
+ (OPERATOR_AND (TIMESTAMP|TIME) operator_eq time = timeValue)?
;
// ---- Get Time Slot List
getTimeSlotList
- : SHOW TIMESLOTID OF path=prefixPath WHERE SERIESSLOTID operator_eq seriesSlot=INTEGER_LITERAL
+ : SHOW (TIMESLOTID|TIMEPARTITION) WHERE ((DEVICE|DEVICEID) operator_eq device=prefixPath
Review Comment:
```suggestion
: SHOW (TIMESLOTID|TIMEPARTITION) WHERE (DEVICE operator_eq device=prefixPath
```
The same as above
##########
confignode/pom.xml:
##########
@@ -69,6 +69,10 @@
<artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </dependency>
Review Comment:
What is this dependency for?
##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/metadata/GetTimeSlotListStatement.java:
##########
@@ -93,8 +108,8 @@ public QueryType getQueryType() {
@Override
public List<PartialPath> getPaths() {
try {
- return Collections.singletonList(new PartialPath(storageGroup));
- } catch (IllegalPathException e) {
+ return Collections.singletonList(new PartialPath(database));
+ } catch (IllegalPathException | NullPointerException e) {
return new ArrayList<>();
Review Comment:
The same as above
##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/statement/metadata/GetRegionIdStatement.java:
##########
@@ -115,8 +94,8 @@ public QueryType getQueryType() {
@Override
public List<PartialPath> getPaths() {
try {
- return Collections.singletonList(new PartialPath(storageGroup));
- } catch (IllegalPathException e) {
+ return Collections.singletonList(new PartialPath(database));
+ } catch (IllegalPathException | NullPointerException e) {
return new ArrayList<>();
}
Review Comment:
The same as above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [iotdb] CRZbulabula commented on a diff in pull request #9665: [IOTDB-5567] improve show cluster slots information
Posted by "CRZbulabula (via GitHub)" <gi...@apache.org>.
CRZbulabula commented on code in PR #9665:
URL: https://github.com/apache/iotdb/pull/9665#discussion_r1174297918
##########
antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4:
##########
@@ -447,23 +447,36 @@ showConfigNodes
// ---- Get Region Id
getRegionId
- : SHOW (DATA|SCHEMA) REGIONID OF path=prefixPath WHERE (SERIESSLOTID operator_eq
- seriesSlot=INTEGER_LITERAL|DEVICEID operator_eq deviceId=prefixPath) (OPERATOR_AND (TIMESLOTID operator_eq timeSlot=INTEGER_LITERAL|
- TIMESTAMP operator_eq timeStamp=INTEGER_LITERAL))?
+ : SHOW (DATA|SCHEMA) REGIONID WHERE (DATABASE operator_eq database=prefixPath
+ |(DEVICE|DEVICEID) operator_eq device=prefixPath)
Review Comment:
I think we don't need to consider the compatibility with our previous incomplete version
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org