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/14 11:30:45 UTC

[GitHub] [shardingsphere] Pace2Car opened a new pull request, #25173: Improve EXPORT METADATA add snapshot data

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

   For #24338.
   
   Changes proposed in this pull request:
     - add csn and generate time into snapshot info data
     - update related test case
   
   ---
   
   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] Pace2Car commented on a diff in pull request #25173: Improve EXPORT METADATA add snapshot data

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


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportMetaDataExecutor.java:
##########
@@ -110,6 +116,20 @@ private String generateRulesData(final Collection<RuleConfiguration> rules) {
         return result.toString();
     }
     
+    private void generateSnapshotInfo(final ShardingSphereMetaData metaData, final ExportedClusterInfo exportedClusterInfo) {
+        Optional<GlobalClockRule> globalClockRule = metaData.getGlobalRuleMetaData().findSingleRule(GlobalClockRule.class);

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] Pace2Car commented on a diff in pull request #25173: Improve EXPORT METADATA add snapshot data

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


##########
kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/core/rule/GlobalClockRule.java:
##########
@@ -63,6 +62,10 @@ private Collection<DataSource> getDataSources(final Map<String, ShardingSphereDa
                 .flatMap(each -> each.getResourceMetaData().getDataSources().values().stream()).collect(Collectors.toList());
     }
     
+    public String getGlobalClockProviderType() {

Review Comment:
   Added, 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 #25173: Improve EXPORT METADATA add snapshot data

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


-- 
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 #25173: Improve EXPORT METADATA add snapshot data

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


##########
proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ExportMetaDataExecutor.java:
##########
@@ -110,6 +116,20 @@ private String generateRulesData(final Collection<RuleConfiguration> rules) {
         return result.toString();
     }
     
+    private void generateSnapshotInfo(final ShardingSphereMetaData metaData, final ExportedClusterInfo exportedClusterInfo) {
+        Optional<GlobalClockRule> globalClockRule = metaData.getGlobalRuleMetaData().findSingleRule(GlobalClockRule.class);

Review Comment:
   Please use `getSingleRule` to get global rule, because it always exists.



-- 
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 #25173: Improve EXPORT METADATA add snapshot data

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


##########
kernel/global-clock/core/src/main/java/org/apache/shardingsphere/globalclock/core/rule/GlobalClockRule.java:
##########
@@ -63,6 +62,10 @@ private Collection<DataSource> getDataSources(final Map<String, ShardingSphereDa
                 .flatMap(each -> each.getResourceMetaData().getDataSources().values().stream()).collect(Collectors.toList());
     }
     
+    public String getGlobalClockProviderType() {

Review Comment:
   Please add java doc for public 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: notifications-unsubscribe@shardingsphere.apache.org

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