This is an automated email from the ASF dual-hosted git repository. samt pushed a commit to branch cep-21-tcm in repository https://gitbox.apache.org/repos/asf/cassandra.git
commit 9c496e842d2dad9874cd9fd8ddc1e8aedc08d8b7 Author: Sam Tunnicliffe <[email protected]> AuthorDate: Thu Mar 2 19:33:16 2023 +0000 [CEP-21] Fix misc compilation errors (5/7) Part 5 of 7 only compilation errors in non-test code are directly related to TokenMetadata Co-authored-by: Marcus Eriksson <[email protected]> Co-authored-by: Alex Petrov <[email protected]> Co-authored-by: Sam Tunnicliffe <[email protected]> --- .../org/apache/cassandra/locator/PropertyFileSnitch.java | 12 +++++------- .../org/apache/cassandra/tcm/ClusterMetadataService.java | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/java/org/apache/cassandra/locator/PropertyFileSnitch.java b/src/java/org/apache/cassandra/locator/PropertyFileSnitch.java index 3a9b161356..4ceef2e84e 100644 --- a/src/java/org/apache/cassandra/locator/PropertyFileSnitch.java +++ b/src/java/org/apache/cassandra/locator/PropertyFileSnitch.java @@ -31,6 +31,7 @@ import org.slf4j.LoggerFactory; import org.apache.cassandra.exceptions.ConfigurationException; import org.apache.cassandra.service.StorageService; +import org.apache.cassandra.tcm.ClusterMetadataService; import org.apache.cassandra.utils.FBUtilities; import org.apache.cassandra.utils.ResourceWatcher; import org.apache.cassandra.utils.WrappedRunnable; @@ -213,14 +214,9 @@ public class PropertyFileSnitch extends AbstractNetworkTopologySnitch endpointMap = reloadedMap; if (StorageService.instance != null) // null check tolerates circular dependency; see CASSANDRA-4145 { - if (isUpdate) - StorageService.instance.updateTopology(); - else - StorageService.instance.getTokenMetadata().invalidateCachedRings(); +// if (isUpdate) +// StorageService.instance.updateTopology(); } - - if (gossipStarted) - StorageService.instance.gossipSnitchInfo(); } /** @@ -232,6 +228,8 @@ public class PropertyFileSnitch extends AbstractNetworkTopologySnitch */ private static boolean livenessCheck(HashMap<InetAddressAndPort, String[]> reloadedMap, String[] reloadedDefaultDCRack) { + if (ClusterMetadataService.instance() == null) + return false; // If the default has changed we must check all live hosts but hopefully we will find a live // host quickly and interrupt the loop. Otherwise we only check the live hosts that were either // in the old set or in the new set diff --git a/src/java/org/apache/cassandra/tcm/ClusterMetadataService.java b/src/java/org/apache/cassandra/tcm/ClusterMetadataService.java index 37381354aa..4cf0db438a 100644 --- a/src/java/org/apache/cassandra/tcm/ClusterMetadataService.java +++ b/src/java/org/apache/cassandra/tcm/ClusterMetadataService.java @@ -35,7 +35,6 @@ import org.apache.cassandra.net.IVerbHandler; import org.apache.cassandra.net.Message; import org.apache.cassandra.net.NoPayload; import org.apache.cassandra.schema.DistributedSchema; -import org.apache.cassandra.service.StorageService; import org.apache.cassandra.tcm.log.Entry; import org.apache.cassandra.tcm.log.LocalLog; import org.apache.cassandra.tcm.log.Replication; @@ -390,6 +389,17 @@ public class ClusterMetadataService }); } + public void initRecentlySealedPeriodsIndex() + { + Sealed.initIndexFromSystemTables(); + } + + public boolean isMigrating() + { + return false; +// return Election.instance.isMigrating(); + } + /** * Switchable implementations that allow us to go between local and remote implementation whenever we need it. * When the node becomes a member of CMS, it switches back to being a regular member of a cluster, and all @@ -469,6 +479,6 @@ public class ClusterMetadataService public enum State { - LOCAL, REMOTE + LOCAL, REMOTE, GOSSIP } } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
