sandynz commented on code in PR #22048:
URL: https://github.com/apache/shardingsphere/pull/22048#discussion_r1018624536
##########
kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/job/progress/ConsistencyCheckJobItemProgress.java:
##########
@@ -18,28 +18,34 @@
package org.apache.shardingsphere.data.pipeline.api.job.progress;
import lombok.Getter;
+import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.apache.shardingsphere.data.pipeline.api.job.JobStatus;
+import java.util.Map;
+
/**
* Data consistency check job item progress.
*/
// TODO use final for fields
@Getter
-@Setter
Review Comment:
`TODO` could be removed
##########
kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/check/consistency/DataConsistencyCalculatedResult.java:
##########
@@ -28,4 +28,11 @@ public interface DataConsistencyCalculatedResult {
* @return records count
*/
int getRecordsCount();
+
+ /**
+ * Get max unique value.
+ *
+ * @return max unique value
+ */
+ Object getMaxUniqueKeyValue();
Review Comment:
Java doc should be consistent with method name
##########
kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/check/consistency/DataConsistencyCalculateParameter.java:
##########
@@ -73,4 +73,9 @@ public final class DataConsistencyCalculateParameter {
* Previous calculated result will be transferred to next call.
*/
private volatile Object previousCalculatedResult;
+
+ /**
+ * The position value of data check.
+ */
+ private final Object dataCheckPositionValue;
Review Comment:
`dataCheckPositionValue` could be `tableCheckPosition`, keep it consistency
with other places
##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/check/consistency/SingleTableInventoryDataConsistencyChecker.java:
##########
@@ -74,7 +75,7 @@ public final class SingleTableInventoryDataConsistencyChecker
{
private final JobRateLimitAlgorithm readRateLimitAlgorithm;
- private final PipelineJobProgressListener jobProgressListener;
+ private final ConsistencyCheckJobItemContext
consistencyCheckJobItemContext;
Review Comment:
`consistencyCheckJobItemContext` could be `jobItemContext`
##########
test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/primarykey/TextPrimaryKeyMigrationIT.java:
##########
@@ -92,11 +92,8 @@ public void assertTextPrimaryMigrationSuccess() throws
SQLException, Interrupted
sourceExecuteWithLog(String.format("INSERT INTO %s
(order_id,user_id,status) VALUES (%s, %s, '%s')", getSourceTableOrderName(),
"1000000000", 1, "afterStop"));
waitIncrementTaskFinished(String.format("SHOW MIGRATION STATUS '%s'",
jobId));
// TODO The ordering of primary or unique keys for text types is
different, but can't reproduce now
- if (DatabaseTypeUtil.isMySQL(getDatabaseType())) {
- assertCheckMigrationSuccess(jobId, "DATA_MATCH");
- } else {
- assertCheckMigrationSuccess(jobId, "DATA_MATCH");
- }
+ proxyExecuteWithLog(String.format("CHECK MIGRATION '%s' BY TYPE
(NAME='%s')", jobId, "DATA_MATCH"), 2);
Review Comment:
There're several repeated CHECK MIGRATION DistSQL construction, it's better
to extract it in super class
##########
kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/check/consistency/DataConsistencyCalculatedResult.java:
##########
@@ -28,4 +28,11 @@ public interface DataConsistencyCalculatedResult {
* @return records count
*/
int getRecordsCount();
+
+ /**
+ * Get max unique value.
+ *
+ * @return max unique value
+ */
+ Object getMaxUniqueKeyValue();
Review Comment:
Looks it's not implemented in CRC32_MATCH, could we return
`Optional<Object>`?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]