You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/23 09:40:39 UTC

[GitHub] [shardingsphere] sandynz opened a new pull request #12653: Add dataConsistencyCheckAlgorithm default implementation and DataConsistencyChecker refactor

sandynz opened a new pull request #12653:
URL: https://github.com/apache/shardingsphere/pull/12653


   Fixes #12615.
   
   Changes proposed in this pull request:
   - Add `SingleTableDataCalculator` and default impl
   - Refactor DataConsistencyChecker and EnvironmentChecker
   - `ScalingDataConsistencyCheckAlgorithm` integrate with `SingleTableDataCalculator`
   - Add `ScalingDataConsistencyCheckAlgorithm` default impl
   - Refactor DataConsistencyChecker and integrate with `ScalingAPIImpl`
   - Refactor `SingleTableDataCalculator`, source and target database type could be different
   - Add `dataConsistencyCheckAlgorithm` config in `server.yaml`
   - Unit test
   
   


-- 
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] tristaZero commented on a change in pull request #12653: Add dataConsistencyCheckAlgorithm default implementation and DataConsistencyChecker refactor

Posted by GitBox <gi...@apache.org>.
tristaZero commented on a change in pull request #12653:
URL: https://github.com/apache/shardingsphere/pull/12653#discussion_r714723160



##########
File path: shardingsphere-scaling/shardingsphere-scaling-core/src/main/java/org/apache/shardingsphere/scaling/core/job/check/consistency/DataConsistencyCheckerImpl.java
##########
@@ -0,0 +1,139 @@
+/*
+ * 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.scaling.core.job.check.consistency;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.infra.database.type.DatabaseType;
+import org.apache.shardingsphere.scaling.core.api.ScalingDataConsistencyCheckAlgorithm;
+import org.apache.shardingsphere.scaling.core.api.SingleTableDataCalculator;
+import org.apache.shardingsphere.scaling.core.common.datasource.DataSourceFactory;
+import org.apache.shardingsphere.scaling.core.common.datasource.DataSourceWrapper;
+import org.apache.shardingsphere.scaling.core.common.exception.DataCheckFailException;
+import org.apache.shardingsphere.scaling.core.common.sqlbuilder.ScalingSQLBuilderFactory;
+import org.apache.shardingsphere.scaling.core.config.datasource.ScalingDataSourceConfiguration;
+import org.apache.shardingsphere.scaling.core.job.JobContext;
+
+import javax.sql.DataSource;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+/**
+ * Data consistency checker implementation.
+ */
+@RequiredArgsConstructor
+@Getter
+@Slf4j
+public class DataConsistencyCheckerImpl implements DataConsistencyChecker {

Review comment:
       final?




-- 
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] tristaZero merged pull request #12653: Add dataConsistencyCheckAlgorithm default implementation and DataConsistencyChecker refactor

Posted by GitBox <gi...@apache.org>.
tristaZero merged pull request #12653:
URL: https://github.com/apache/shardingsphere/pull/12653


   


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