From d692f30321a2bbdd6f7ae1f078318209cfa90029 Mon Sep 17 00:00:00 2001 From: Raymond Huffman Date: Tue, 26 Nov 2024 11:52:01 -0500 Subject: [PATCH] nits --- src/java/org/apache/cassandra/dht/BootStrapper.java | 1 - .../apache/cassandra/service/StorageService.java | 13 +++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/java/org/apache/cassandra/dht/BootStrapper.java b/src/java/org/apache/cassandra/dht/BootStrapper.java index ae6e4278d5..5d5ba14dd5 100644 --- a/src/java/org/apache/cassandra/dht/BootStrapper.java +++ b/src/java/org/apache/cassandra/dht/BootStrapper.java @@ -37,7 +37,6 @@ import org.apache.cassandra.io.util.DataOutputPlus; import org.apache.cassandra.locator.AbstractReplicationStrategy; import org.apache.cassandra.locator.TokenMetadata; -import org.apache.cassandra.service.MigrationManager; import org.apache.cassandra.service.StorageService; import org.apache.cassandra.streaming.*; import org.apache.cassandra.utils.progress.ProgressEvent; diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index faf4431140..8ce35ae744 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -1121,16 +1121,9 @@ private void joinTokenRing(int delay, boolean autoBootstrap, Collection private static boolean isSchemaConsistent() { String localSchemaVersion = Schema.instance.getVersion().toString(); - Set> endpointStates = Gossiper.instance.getEndpointStates(); - for (Entry entry : endpointStates) - { - String remoteSchemaVersion = entry.getValue().getApplicationState(ApplicationState.SCHEMA).value; - if (!localSchemaVersion.equals(remoteSchemaVersion)) - { - return false; - } - } - return true; + return Gossiper.instance.getEndpointStates().stream() + .map(entry -> entry.getValue().getApplicationState(ApplicationState.SCHEMA).value) + .allMatch(localSchemaVersion::equals); } private void joinTokenRing(int delay) throws ConfigurationException