Skip to content

Commit

Permalink
Fix sonar issues (#33305)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Oct 18, 2024
1 parent e28d60a commit 7034564
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.apache.shardingsphere.data.pipeline.cdc.generator.CDCResponseUtils;
import org.apache.shardingsphere.data.pipeline.core.context.PipelineContextKey;
import org.apache.shardingsphere.data.pipeline.core.context.PipelineJobItemContext;
import org.apache.shardingsphere.data.pipeline.core.context.TransmissionJobItemContext;
import org.apache.shardingsphere.data.pipeline.core.context.TransmissionProcessContext;
import org.apache.shardingsphere.data.pipeline.core.datanode.JobDataNodeLine;
import org.apache.shardingsphere.data.pipeline.core.datanode.JobDataNodeLineConvertUtils;
Expand Down Expand Up @@ -183,7 +182,7 @@ private void executeInventoryTasks(final Collection<CDCJobItemContext> jobItemCo
Collection<CompletableFuture<?>> futures = new LinkedList<>();
for (CDCJobItemContext each : jobItemContexts) {
updateJobItemStatus(each, JobStatus.EXECUTE_INVENTORY_TASK, jobItemManager);
for (PipelineTask task : ((TransmissionJobItemContext) each).getInventoryTasks()) {
for (PipelineTask task : each.getInventoryTasks()) {
if (task.getTaskProgress().getPosition() instanceof IngestFinishedPosition) {
continue;
}
Expand All @@ -204,7 +203,7 @@ private void executeIncrementalTasks(final Collection<CDCJobItemContext> jobItem
return;
}
updateJobItemStatus(each, JobStatus.EXECUTE_INCREMENTAL_TASK, jobItemManager);
for (PipelineTask task : ((TransmissionJobItemContext) each).getIncrementalTasks()) {
for (PipelineTask task : each.getIncrementalTasks()) {
if (task.getTaskProgress().getPosition() instanceof IngestFinishedPosition) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import java.util.Collection;
import java.util.LinkedList;
import java.util.Objects;
import java.util.Optional;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicReference;

Expand Down Expand Up @@ -82,10 +81,7 @@ private void closeStaleTransactionRule(final RuleConfiguration ruleConfig) {
if (!"transaction".equals(Objects.requireNonNull(yamlRuleConfig.getClass().getAnnotation(RepositoryTupleEntity.class)).value())) {
return;
}
Optional<TransactionRule> transactionRule = metaDataContexts.get().getMetaData().getGlobalRuleMetaData().findSingleRule(TransactionRule.class);
if (transactionRule.isPresent()) {
((AutoCloseable) transactionRule.get()).close();
}
metaDataContexts.get().getMetaData().getGlobalRuleMetaData().findSingleRule(TransactionRule.class).ifPresent(TransactionRule::close);
}

/**
Expand Down

0 comments on commit 7034564

Please sign in to comment.