sandynz commented on code in PR #29477: URL: https://github.com/apache/shardingsphere/pull/29477#discussion_r1433379243
########## kernel/data-pipeline/scenario/cdc/core/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/core/pojo/CDCJobItemInfo.java: ########## @@ -0,0 +1,55 @@ +/* + * 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.data.pipeline.cdc.core.pojo; + +import lombok.Getter; +import lombok.RequiredArgsConstructor; +import org.apache.shardingsphere.data.pipeline.core.job.JobStatus; +import org.apache.shardingsphere.data.pipeline.core.job.progress.JobItemIncrementalTasksProgress; + +/** + * CDC job item info. + */ +@RequiredArgsConstructor +@Getter +public class CDCJobItemInfo { + + private final int shardingItem; + + private final String dataSourceName; + + private final String tableNames; + + private final JobStatus status; + + private final boolean active; + + private final long inventoryRecordsCount; + + private final long processedRecordsCount; + + private final int inventoryFinishedPercentage; + + private final JobItemIncrementalTasksProgress incremental; + + private final String confirmedPosition; + + private final String currentPosition; + + private final String errorMessage; +} Review Comment: Could we embed `TransmissionJobItemInfo` and just keep 2 new fields (`confirmedPosition` and `currentPosition`)? ########## kernel/data-pipeline/dialect/opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/wal/decode/OpenGaussLogSequenceNumber.java: ########## @@ -40,4 +38,9 @@ public long asLong() { public Object get() { return logSequenceNumber; } + + @Override + public String toString() { + return logSequenceNumber.asString(); + } Review Comment: Could we use `asString` method name? ########## kernel/data-pipeline/dialect/opengauss/src/main/java/org/apache/shardingsphere/data/pipeline/opengauss/ingest/OpenGaussPositionInitializer.java: ########## @@ -56,7 +56,7 @@ public WALPosition init(final DataSource dataSource, final String slotNameSuffix @Override public WALPosition init(final String data) { - return new WALPosition(new OpenGaussLogSequenceNumber(LogSequenceNumber.valueOf(Long.parseLong(data)))); + return new WALPosition(new OpenGaussLogSequenceNumber(LogSequenceNumber.valueOf(data))); Review Comment: Could `asLong()` in `BaseLogSequenceNumber` and sub-classes be removed? -- 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]
