Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove useless MetaDataVersion.getActiveVersionKeys() #31344

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;
import java.util.Collection;

/**
* Meta data version.
*/
Expand Down Expand Up @@ -63,13 +60,4 @@ public String getActiveVersionNodePath() {
public String getVersionsNodePath() {
return String.join("/", key, VERSIONS, currentActiveVersion);
}

/**
* Get active version keys.
*
* @return active version keys
*/
public Collection<String> getActiveVersionKeys() {
return Arrays.asList(String.join("/", key, ACTIVE_VERSION), String.join("/", key, ACTIVE_VERSION, currentActiveVersion));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

import org.junit.jupiter.api.Test;

import java.util.Arrays;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

Expand All @@ -35,9 +33,4 @@ void assertGetActiveVersionNodePath() {
void assertGetVersionsNodePath() {
assertThat(new MetaDataVersion("foo", "0", "1").getVersionsNodePath(), is("foo/versions/0"));
}

@Test
void assertGetActiveVersionKeys() {
assertThat(new MetaDataVersion("foo", "0", "1").getActiveVersionKeys(), is(Arrays.asList("foo/active_version", "foo/active_version/0")));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,8 @@ private void sendDatabaseRuleChangedEvent(final String databaseName, final Colle
}

private void sendDatabaseRuleChangedEvent(final String databaseName, final MetaDataVersion metaDataVersion) {
for (String each : metaDataVersion.getActiveVersionKeys()) {
ruleConfigurationEventBuilder.build(databaseName, new DataChangedEvent(each, metaDataVersion.getNextActiveVersion(), Type.UPDATED))
.ifPresent(optional -> contextManager.getComputeNodeInstanceContext().getEventBusContext().post(optional));
}
ruleConfigurationEventBuilder.build(databaseName, new DataChangedEvent(metaDataVersion.getActiveVersionNodePath(), metaDataVersion.getNextActiveVersion(), Type.UPDATED))
.ifPresent(optional -> contextManager.getComputeNodeInstanceContext().getEventBusContext().post(optional));
}

@Override
Expand Down