You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Pace2Car (via GitHub)" <gi...@apache.org> on 2023/04/24 11:57:09 UTC

[GitHub] [shardingsphere] Pace2Car opened a new pull request, #25306: Add DistSQL for global clock

Pace2Car opened a new pull request, #25306:
URL: https://github.com/apache/shardingsphere/pull/25306

   For #25222.
   
   Changes proposed in this pull request:
     - Add DistSQL for global clock
     - Add related unit tests
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [x] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [x] I have added corresponding unit tests for my changes.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #25306: Add DistSQL for global clock

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #25306:
URL: https://github.com/apache/shardingsphere/pull/25306#discussion_r1175961034


##########
kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/update/AlterGlobalClockRuleStatementUpdater.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.shardingsphere.globalclock.distsql.handler.update;
+
+import org.apache.shardingsphere.distsql.handler.ral.update.GlobalRuleRALUpdater;
+import org.apache.shardingsphere.globalclock.api.config.GlobalClockRuleConfiguration;
+import org.apache.shardingsphere.globalclock.distsql.parser.statement.updatable.AlterGlobalClockRuleStatement;
+
+/**
+ * Alter global clock rule statement handler.

Review Comment:
   Class name is `updater` but comment `handler`.



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] Pace2Car commented on a diff in pull request #25306: Add DistSQL for global clock

Posted by "Pace2Car (via GitHub)" <gi...@apache.org>.
Pace2Car commented on code in PR #25306:
URL: https://github.com/apache/shardingsphere/pull/25306#discussion_r1175967377


##########
kernel/global-clock/distsql/parser/src/main/antlr4/imports/globalclock/RALStatement.g4:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+grammar RALStatement;
+
+import Keyword, Literals;
+
+showGlobalClockRule
+    : SHOW GLOBAL CLOCK RULE
+    ;
+
+alterGlobalClockRule
+    : ALTER GLOBAL CLOCK RULE globalClockRuleDefinition
+    ;
+
+globalClockRuleDefinition
+    : LP_ typeDefinition COMMA_ providerDefinition COMMA_ enabledDefinition (COMMA_ propertiesDefinition)? RP_
+    ;
+
+typeDefinition
+    : TYPE EQ_ typeName
+    ;
+
+providerDefinition
+    : PROVIDER EQ_ providerName
+    ;
+
+enabledDefinition
+    : ENABLED EQ_ enabled
+    ;
+
+typeName
+    : STRING_
+    ;
+
+providerName
+    : STRING_
+    ;
+
+enabled
+    : TRUE | FALSE
+    ;
+
+propertiesDefinition
+    : PROPERTIES LP_ properties? RP_
+    ;
+
+properties
+    : property (COMMA_ property)*
+    ;
+
+property
+    : key=STRING_ EQ_ value=STRING_

Review Comment:
   Fixed, THX



##########
kernel/global-clock/distsql/handler/src/main/java/org/apache/shardingsphere/globalclock/distsql/handler/update/AlterGlobalClockRuleStatementUpdater.java:
##########
@@ -0,0 +1,47 @@
+/*
+ * 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.shardingsphere.globalclock.distsql.handler.update;
+
+import org.apache.shardingsphere.distsql.handler.ral.update.GlobalRuleRALUpdater;
+import org.apache.shardingsphere.globalclock.api.config.GlobalClockRuleConfiguration;
+import org.apache.shardingsphere.globalclock.distsql.parser.statement.updatable.AlterGlobalClockRuleStatement;
+
+/**
+ * Alter global clock rule statement handler.

Review Comment:
   Fixed THX



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang merged pull request #25306: Add DistSQL for global clock

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang merged PR #25306:
URL: https://github.com/apache/shardingsphere/pull/25306


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on a diff in pull request #25306: Add DistSQL for global clock

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on code in PR #25306:
URL: https://github.com/apache/shardingsphere/pull/25306#discussion_r1175963068


##########
kernel/global-clock/distsql/parser/src/main/antlr4/imports/globalclock/RALStatement.g4:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+grammar RALStatement;
+
+import Keyword, Literals;
+
+showGlobalClockRule
+    : SHOW GLOBAL CLOCK RULE
+    ;
+
+alterGlobalClockRule
+    : ALTER GLOBAL CLOCK RULE globalClockRuleDefinition
+    ;
+
+globalClockRuleDefinition
+    : LP_ typeDefinition COMMA_ providerDefinition COMMA_ enabledDefinition (COMMA_ propertiesDefinition)? RP_
+    ;
+
+typeDefinition
+    : TYPE EQ_ typeName
+    ;
+
+providerDefinition
+    : PROVIDER EQ_ providerName
+    ;
+
+enabledDefinition
+    : ENABLED EQ_ enabled
+    ;
+
+typeName
+    : STRING_
+    ;
+
+providerName
+    : STRING_
+    ;
+
+enabled
+    : TRUE | FALSE
+    ;
+
+propertiesDefinition
+    : PROPERTIES LP_ properties? RP_
+    ;
+
+properties
+    : property (COMMA_ property)*
+    ;
+
+property
+    : key=STRING_ EQ_ value=STRING_

Review Comment:
   The value of property should be typed `literal`
   
   Please search for reference:
   ```
   property
       : key=STRING_ EQ_ value=literal
   ```



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org