Skip to content

Commit

Permalink
For code format (#34602)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored Feb 8, 2025
1 parent 17e9bf4 commit eb5bcea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public void switchActiveVersion(final Collection<MetaDataVersion> metaDataVersio
if (each.getNextActiveVersion().equals(each.getCurrentActiveVersion())) {
continue;
}
repository.persist(new VersionNodePathGenerator(each.getPath()).getActiveVersionPath(), String.valueOf(each.getNextActiveVersion()));
VersionNodePathGenerator versionNodePathGenerator = new VersionNodePathGenerator(each.getPath());
getVersions(versionNodePathGenerator.getVersionsPath()).stream()
.filter(version -> version < each.getNextActiveVersion()).forEach(version -> repository.delete(versionNodePathGenerator.getVersionPath(version)));
VersionNodePathGenerator nodePathGenerator = new VersionNodePathGenerator(each.getPath());
repository.persist(nodePathGenerator.getActiveVersionPath(), String.valueOf(each.getNextActiveVersion()));
getVersions(nodePathGenerator.getVersionsPath()).stream()
.filter(version -> version < each.getNextActiveVersion()).forEach(version -> repository.delete(nodePathGenerator.getVersionPath(version)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,12 @@ public void handle(final String databaseName, final DataChangedEvent event) thro
return;
}
int version = Integer.parseInt(event.getValue());
Optional<AlterRuleItem> alterRuleItem = ruleItemChangedBuilder.build(databaseName, new MetaDataVersion(event.getKey(), version, version),
new RuleItemAlteredBuildExecutor());
Optional<AlterRuleItem> alterRuleItem = ruleItemChangedBuilder.build(databaseName, new MetaDataVersion(event.getKey(), version, version), new RuleItemAlteredBuildExecutor());
if (alterRuleItem.isPresent()) {
contextManager.getMetaDataContextManager().getDatabaseRuleItemManager().alter(alterRuleItem.get());
}
} else if (Type.DELETED == event.getType()) {
Optional<DropRuleItem> dropRuleItem = ruleItemChangedBuilder.build(databaseName, new MetaDataVersion(event.getKey()),
new RuleItemDroppedBuildExecutor());
Optional<DropRuleItem> dropRuleItem = ruleItemChangedBuilder.build(databaseName, new MetaDataVersion(event.getKey()), new RuleItemDroppedBuildExecutor());
if (dropRuleItem.isPresent()) {
contextManager.getMetaDataContextManager().getDatabaseRuleItemManager().drop(dropRuleItem.get());
}
Expand Down

0 comments on commit eb5bcea

Please sign in to comment.