You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/12/28 14:20:36 UTC
[GitHub] [iotdb] BUAAserein opened a new pull request, #8647: fix some code smells
BUAAserein opened a new pull request, #8647:
URL: https://github.com/apache/iotdb/pull/8647
## Description
### Fix some code smells, please see in [JIRA5284](https://issues.apache.org/jira/browse/IOTDB-5284)
--
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] SpriCoder commented on a diff in pull request #8647: [IOTDB-5284] Fix some code smells
Posted by GitBox <gi...@apache.org>.
SpriCoder commented on code in PR #8647:
URL: https://github.com/apache/iotdb/pull/8647#discussion_r1058859124
##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/cq/CQScheduleTask.java:
##########
@@ -216,6 +204,18 @@ public AsyncExecuteCQCallback(long startTime, long endTime) {
this.endTime = endTime;
}
+ private void updateExecutionTime() {
+ if (timeoutPolicy == TimeoutPolicy.BLOCKED) {
+ executionTime = executionTime + everyInterval;
+ } else if (timeoutPolicy == TimeoutPolicy.DISCARD) {
+ long now = System.currentTimeMillis();
+ executionTime =
+ executionTime + ((now - executionTime - 1) / everyInterval + 1) * everyInterval;
+ } else {
+ throw new IllegalArgumentException("Unknown TimeoutPolicy: " + timeoutPolicy);
+ }
+ }
+
Review Comment:
Why move these method?
--
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 #8647: [IOTDB-5284] Fix some code smells
Posted by GitBox <gi...@apache.org>.
OneSizeFitsQuorum merged PR #8647:
URL: https://github.com/apache/iotdb/pull/8647
--
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] SpriCoder commented on a diff in pull request #8647: [IOTDB-5284] Fix some code smells
Posted by GitBox <gi...@apache.org>.
SpriCoder commented on code in PR #8647:
URL: https://github.com/apache/iotdb/pull/8647#discussion_r1058988088
##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/cq/CQScheduleTask.java:
##########
@@ -216,6 +204,18 @@ public AsyncExecuteCQCallback(long startTime, long endTime) {
this.endTime = endTime;
}
+ private void updateExecutionTime() {
+ if (timeoutPolicy == TimeoutPolicy.BLOCKED) {
+ executionTime = executionTime + everyInterval;
+ } else if (timeoutPolicy == TimeoutPolicy.DISCARD) {
+ long now = System.currentTimeMillis();
+ executionTime =
+ executionTime + ((now - executionTime - 1) / everyInterval + 1) * everyInterval;
+ } else {
+ throw new IllegalArgumentException("Unknown TimeoutPolicy: " + timeoutPolicy);
+ }
+ }
+
Review Comment:
Get it!
--
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] BUAAserein commented on a diff in pull request #8647: [IOTDB-5284] Fix some code smells
Posted by GitBox <gi...@apache.org>.
BUAAserein commented on code in PR #8647:
URL: https://github.com/apache/iotdb/pull/8647#discussion_r1058984245
##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/cq/CQScheduleTask.java:
##########
@@ -216,6 +204,18 @@ public AsyncExecuteCQCallback(long startTime, long endTime) {
this.endTime = endTime;
}
+ private void updateExecutionTime() {
+ if (timeoutPolicy == TimeoutPolicy.BLOCKED) {
+ executionTime = executionTime + everyInterval;
+ } else if (timeoutPolicy == TimeoutPolicy.DISCARD) {
+ long now = System.currentTimeMillis();
+ executionTime =
+ executionTime + ((now - executionTime - 1) / everyInterval + 1) * everyInterval;
+ } else {
+ throw new IllegalArgumentException("Unknown TimeoutPolicy: " + timeoutPolicy);
+ }
+ }
+
Review Comment:
"private" methods called only by inner classes should be moved to those classes
--
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] SpriCoder commented on a diff in pull request #8647: [IOTDB-5284] Fix some code smells
Posted by GitBox <gi...@apache.org>.
SpriCoder commented on code in PR #8647:
URL: https://github.com/apache/iotdb/pull/8647#discussion_r1058859124
##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/cq/CQScheduleTask.java:
##########
@@ -216,6 +204,18 @@ public AsyncExecuteCQCallback(long startTime, long endTime) {
this.endTime = endTime;
}
+ private void updateExecutionTime() {
+ if (timeoutPolicy == TimeoutPolicy.BLOCKED) {
+ executionTime = executionTime + everyInterval;
+ } else if (timeoutPolicy == TimeoutPolicy.DISCARD) {
+ long now = System.currentTimeMillis();
+ executionTime =
+ executionTime + ((now - executionTime - 1) / everyInterval + 1) * everyInterval;
+ } else {
+ throw new IllegalArgumentException("Unknown TimeoutPolicy: " + timeoutPolicy);
+ }
+ }
+
Review Comment:
Why move this method?
--
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