Skip to content

Commit

Permalink
Remove useless MetaDataVersion.getActiveVersionKeys() (#31344)
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu authored May 22, 2024
1 parent 1a5c2cf commit 9e58dbc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
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

0 comments on commit 9e58dbc

Please sign in to comment.