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

[GitHub] [shardingsphere] LeeGuoPing opened a new pull request, #26245: Add NewYamlTransactionRuleConfigurationSwapperto adpate new metadata structure.

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

   For #25485 , #26165 .


-- 
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] zhaojinchao95 commented on a diff in pull request #26245: Add NewYamlTransactionRuleConfigurationSwapperto adpate new metadata structure.

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


##########
kernel/transaction/core/src/main/java/org/apache/shardingsphere/transaction/yaml/swapper/NewYamlTransactionRuleConfigurationSwapper.java:
##########
@@ -0,0 +1,79 @@
+/*
+ * 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.transaction.yaml.swapper;
+
+import org.apache.shardingsphere.infra.util.yaml.YamlEngine;
+import org.apache.shardingsphere.infra.util.yaml.datanode.YamlDataNode;
+import org.apache.shardingsphere.infra.yaml.config.swapper.rule.NewYamlRuleConfigurationSwapper;
+import org.apache.shardingsphere.transaction.config.TransactionRuleConfiguration;
+import org.apache.shardingsphere.transaction.constant.TransactionOrder;
+import org.apache.shardingsphere.transaction.metadata.converter.TransactionNodeConverter;
+import org.apache.shardingsphere.transaction.yaml.config.YamlTransactionRuleConfiguration;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Optional;
+import java.util.Properties;
+
+/**
+ * TODO Rename YamlTransactionRuleConfigurationSwapper when metadata structure adjustment completed. #25485
+ * New YAML Transaction rule configuration swapper.
+ */
+public final class NewYamlTransactionRuleConfigurationSwapper implements NewYamlRuleConfigurationSwapper<TransactionRuleConfiguration> {
+
+    @Override
+    public Collection<YamlDataNode> swapToDataNodes(final TransactionRuleConfiguration data) {
+        return Collections.singletonList(new YamlDataNode(TransactionNodeConverter.getRootNode(), YamlEngine.marshal(swapToYamlConfiguration(data))));

Review Comment:
   Use `GlobalRuleNodeConverter` please



-- 
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] zhaojinchao95 merged pull request #26245: Add NewYamlTransactionRuleConfigurationSwapperto adpate new metadata structure.

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


-- 
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