@Provides @Singleton Collection<ClusterInfo> provideCassandraClusterInfo(BlobStoreConfiguration configuration) { Map<String, ClusterInfo> clusterInfoMap = Maps.newLinkedHashMap(); for (CassandraConfiguration config : configuration.getCassandraClusters().values()) { ClusterInfo clusterInfo = new ClusterInfo(config.getCluster(), config.getClusterMetric()); ClusterInfo old = clusterInfoMap.put(config.getCluster(), clusterInfo); checkState(old == null || old.getClusterMetric().equals(clusterInfo.getClusterMetric()), "Cluster %s is configured with multiple distinct names for the cluster metric.", config.getCluster()); } return ImmutableList.copyOf(clusterInfoMap.values()); }
@Provides @Singleton @CassandraClusters Collection<String> provideCassandraClusterNames(DataStoreConfiguration configuration) { Set<String> clusters = Sets.newLinkedHashSet(); for (CassandraConfiguration config : configuration.getCassandraClusters().values()) { clusters.add(config.getCluster()); } return clusters; }
private Collection<ClusterInfo> getClusterInfos(DataStoreConfiguration configuration) { Map<String, ClusterInfo> clusterInfoMap = Maps.newLinkedHashMap(); for (CassandraConfiguration config : configuration.getCassandraClusters().values()) { ClusterInfo clusterInfo = new ClusterInfo(config.getCluster(), config.getClusterMetric()); ClusterInfo old = clusterInfoMap.put(config.getCluster(), clusterInfo); checkState(old == null || old.getClusterMetric().equals(clusterInfo.getClusterMetric()), "Cluster %s is configured with multiple distinct names for the cluster metric.", config.getCluster()); } return ImmutableList.copyOf(clusterInfoMap.values()); }
@Provides @Singleton @CQLSessionForHintsPollerMap Map<String, HintsPollerCQLSession> provideCQLSessionsForHintsPoller(DataStoreConfiguration configuration, CassandraFactory factory) { Map<String, HintsPollerCQLSession> cqlSessionMap = Maps.newHashMap(); for (CassandraConfiguration config : configuration.getCassandraClusters().values()) { String clusterName = config.getCluster(); if(!cqlSessionMap.containsKey(clusterName)) { cqlSessionMap.put(clusterName, factory.cqlSessionForHintsPoller(config)); } } return ImmutableMap.copyOf(cqlSessionMap); }
private Collection<ClusterInfo> getClusterInfos(DataStoreConfiguration configuration) { Map<String, ClusterInfo> clusterInfoMap = Maps.newLinkedHashMap(); for (CassandraConfiguration config : configuration.getCassandraClusters().values()) { ClusterInfo clusterInfo = new ClusterInfo(config.getCluster(), config.getClusterMetric()); ClusterInfo old = clusterInfoMap.put(config.getCluster(), clusterInfo); checkState(old == null || old.getClusterMetric().equals(clusterInfo.getClusterMetric()), "Cluster %s is configured with multiple distinct names for the cluster metric.", config.getCluster()); } return ImmutableList.copyOf(clusterInfoMap.values()); }
@Provides @Singleton @CassandraClusters Collection<String> provideCassandraClusterNames(DataStoreConfiguration configuration) { Set<String> clusters = Sets.newLinkedHashSet(); for (CassandraConfiguration config : configuration.getCassandraClusters().values()) { clusters.add(config.getCluster()); } return clusters; }
/** Required for HintsPollerManager **/ @Provides @Singleton @CassandraClusters Collection<String> provideCassandraClusterNames(BlobStoreConfiguration configuration) { Set<String> clusters = Sets.newLinkedHashSet(); for (CassandraConfiguration config : configuration.getCassandraClusters().values()) { clusters.add(config.getCluster()); } return clusters; }
@Provides @Singleton @CQLSessionForHintsPollerMap Map<String, HintsPollerCQLSession> provideCQLSessionsForHintsPoller(BlobStoreConfiguration configuration, CassandraFactory factory) { Map<String, HintsPollerCQLSession> cqlSessionMap = Maps.newHashMap(); for (CassandraConfiguration config : configuration.getCassandraClusters().values()) { String clusterName = config.getCluster(); if(!cqlSessionMap.containsKey(clusterName)) { cqlSessionMap.put(clusterName, factory.cqlSessionForHintsPoller(config)); } } return ImmutableMap.copyOf(cqlSessionMap); }
@Provides @Singleton @CQLSessionForHintsPollerMap Map<String, HintsPollerCQLSession> provideCQLSessionsForHintsPoller(DataStoreConfiguration configuration, CassandraFactory factory) { Map<String, HintsPollerCQLSession> cqlSessionMap = Maps.newHashMap(); for (CassandraConfiguration config : configuration.getCassandraClusters().values()) { String clusterName = config.getCluster(); if(!cqlSessionMap.containsKey(clusterName)) { cqlSessionMap.put(clusterName, factory.cqlSessionForHintsPoller(config)); } } return ImmutableMap.copyOf(cqlSessionMap); }
keyspaceName, configuration.getCluster()); } else { _log.info("Connection to keyspace {} will be created using a private connection to cluster \"{}\"", keyspaceName, configuration.getCluster());
keyspaceName, configuration.getCluster()); } else { _log.info("Connection to keyspace {} will be created using a private connection to cluster \"{}\"", keyspaceName, configuration.getCluster());