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