Skip to content

Commit

Permalink
DBZ-8278 Remove deprecated additional condition for incremental snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
mfvitale authored and jpechane committed Sep 30, 2024
1 parent 5fc9139 commit 32dfd72
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,6 @@ public boolean arrived(SignalPayload<P> signalPayload) throws InterruptedExcepti

private List<AdditionalCondition> getAdditionalConditions(Document data, SnapshotType type) {

// TODO remove in 2.5 release
Optional<String> oldAdditionalConditionField = getAdditionalCondition(data);
if (oldAdditionalConditionField.isPresent() && type.equals(SnapshotType.INCREMENTAL)) {
return List.of(AdditionalCondition.AdditionalConditionBuilder.builder()
.dataCollection(Pattern.compile(MATCH_ALL_PATTERN, Pattern.CASE_INSENSITIVE))
.filter(oldAdditionalConditionField.orElse(""))
.build());
}

return Optional.ofNullable(data.getArray(FIELD_ADDITIONAL_CONDITIONS)).orElse(Array.create()).streamValues()
.map(this::buildAdditionalCondition)
.collect(Collectors.toList());
Expand Down Expand Up @@ -123,16 +114,6 @@ public static List<String> getDataCollections(Document data) {
.collect(Collectors.toList());
}

/**
* TODO remove in 2.5 release
* @deprecated Use {getAdditionalConditions} instead.
*/
@Deprecated
public static Optional<String> getAdditionalCondition(Document data) {
String additionalCondition = data.getString(FIELD_ADDITIONAL_CONDITION);
return Strings.isNullOrBlank(additionalCondition) ? Optional.empty() : Optional.of(additionalCondition);
}

public static Optional<String> getSurrogateKey(Document data) {
String surrogateKey = data.getString(FIELD_SURROGATE_KEY);
return Strings.isNullOrBlank(surrogateKey) ? Optional.empty() : Optional.of(surrogateKey);
Expand Down

0 comments on commit 32dfd72

Please sign in to comment.