@Provides @Singleton CassandraKeyspace provideKeyspace(DatabusConfiguration configuration, CassandraFactory factory) { Map<String, CassandraKeyspace> keyspaces = factory.build(configuration.getCassandraConfiguration()); // Databus module should only have one keyspace configured checkArgument(keyspaces.size() == 1, "Only one keyspace expected for databus, found %s", keyspaces.keySet()); return keyspaces.values().iterator().next(); }
@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); }
CassandraHealthCheck healthCheck = newHealthCheck(healthCheckKeyspace, healthCheckConfig.getHealthCheckCql()); _healthChecks.addHealthCheck(healthCheckConfig.getName(), healthCheck);
CassandraHealthCheck healthCheck = newHealthCheck(healthCheckKeyspace, healthCheckConfig.getHealthCheckCql()); _healthChecks.addHealthCheck(healthCheckConfig.getName(), healthCheck);
@Provides @Singleton CassandraKeyspace provideKeyspace(QueueConfiguration configuration, CassandraFactory factory) { Map<String, CassandraKeyspace> keyspaces = factory.build(configuration.getCassandraConfiguration()); // Queue module should only have one keyspace configured checkArgument(keyspaces.size() == 1, "Only one keyspace expected for queue, found %s", keyspaces.keySet()); return keyspaces.values().iterator().next(); } }
@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); }
@Provides @Singleton CassandraKeyspace provideKeyspace(DatabusConfiguration configuration, CassandraFactory factory) { Map<String, CassandraKeyspace> keyspaces = factory.build(configuration.getCassandraConfiguration()); // Databus module should only have one keyspace configured checkArgument(keyspaces.size() == 1, "Only one keyspace expected for databus, found %s", keyspaces.keySet()); return keyspaces.values().iterator().next(); }
@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); }
@Provides @Singleton CassandraKeyspace provideKeyspace(QueueConfiguration configuration, CassandraFactory factory) { Map<String, CassandraKeyspace> keyspaces = factory.build(configuration.getCassandraConfiguration()); // Queue module should only have one keyspace configured checkArgument(keyspaces.size() == 1, "Only one keyspace expected for queue, found %s", keyspaces.keySet()); return keyspaces.values().iterator().next(); } }
@Provides @Singleton @KeyspaceMap Map<String, CassandraKeyspace> provideKeyspaces(DataStoreConfiguration configuration, CassandraFactory factory) { Map<String, CassandraKeyspace> keyspaceMap = Maps.newHashMap(); for (CassandraConfiguration cassandraConfig : configuration.getCassandraClusters().values()) { Map<String, CassandraKeyspace> keyspacesInCluster = factory.build(cassandraConfig); keyspaceMap.putAll(keyspacesInCluster); } return ImmutableMap.copyOf(keyspaceMap); }
@Provides @Singleton @KeyspaceMap Map<String, CassandraKeyspace> provideKeyspaces(DataStoreConfiguration configuration, CassandraFactory factory) { Map<String, CassandraKeyspace> keyspaceMap = Maps.newHashMap(); for (CassandraConfiguration cassandraConfig : configuration.getCassandraClusters().values()) { Map<String, CassandraKeyspace> keyspacesInCluster = factory.build(cassandraConfig); keyspaceMap.putAll(keyspacesInCluster); } return ImmutableMap.copyOf(keyspaceMap); }
@Provides @Singleton @KeyspaceMap Map<String, CassandraKeyspace> provideKeyspaces(BlobStoreConfiguration configuration, CassandraFactory factory) { Map<String, CassandraKeyspace> keyspaceMap = Maps.newHashMap(); for (CassandraConfiguration cassandraConfig : configuration.getCassandraClusters().values()) { Map<String, CassandraKeyspace> keyspacesInCluster = factory.build(cassandraConfig); keyspaceMap.putAll(keyspacesInCluster); } return ImmutableMap.copyOf(keyspaceMap); }