Skip to content

Commit

Permalink
Fix sonar issue of DataConsistencyCalculateParameter (apache#25636)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored May 13, 2023
1 parent c074b84 commit 7e5161e
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,17 @@

import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import org.apache.shardingsphere.data.pipeline.api.datasource.PipelineDataSourceWrapper;
import org.apache.shardingsphere.data.pipeline.api.metadata.model.PipelineColumnMetaData;

import java.util.List;
import java.util.concurrent.atomic.AtomicReference;

/**
* Data consistency calculate parameter.
*/
@RequiredArgsConstructor
@Getter
@Setter
public final class DataConsistencyCalculateParameter {

/**
Expand All @@ -55,10 +54,25 @@ public final class DataConsistencyCalculateParameter {
*/
private final PipelineColumnMetaData uniqueKey;

private final Object tableCheckPosition;

private final AtomicReference<AutoCloseable> calculationContext = new AtomicReference<>();

/**
* Calculation context.
* Get calculation context.
*
* @return calculation context
*/
private volatile AutoCloseable calculationContext;
public AutoCloseable getCalculationContext() {
return calculationContext.get();
}

private final Object tableCheckPosition;
/**
* Set calculation context.
*
* @param calculationContext calculation context
*/
public void setCalculationContext(final AutoCloseable calculationContext) {
this.calculationContext.set(calculationContext);
}
}

0 comments on commit 7e5161e

Please sign in to comment.