Tabnine Logo
CassandraFactory
Code IndexAdd Tabnine to your IDE (free)

How to use
CassandraFactory
in
com.bazaarvoice.emodb.common.cassandra

Best Java code snippets using com.bazaarvoice.emodb.common.cassandra.CassandraFactory (Showing top 12 results out of 315)

origin: com.bazaarvoice.emodb/emodb-databus

@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();
}
origin: bazaarvoice/emodb

@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);
}
origin: bazaarvoice/emodb

CassandraHealthCheck healthCheck = newHealthCheck(healthCheckKeyspace, healthCheckConfig.getHealthCheckCql());
_healthChecks.addHealthCheck(healthCheckConfig.getName(), healthCheck);
origin: com.bazaarvoice.emodb/emodb-common-astyanax

CassandraHealthCheck healthCheck = newHealthCheck(healthCheckKeyspace, healthCheckConfig.getHealthCheckCql());
_healthChecks.addHealthCheck(healthCheckConfig.getName(), healthCheck);
origin: bazaarvoice/emodb

  @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();
  }
}
origin: bazaarvoice/emodb

@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);
}
origin: bazaarvoice/emodb

@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();
}
origin: com.bazaarvoice.emodb/emodb-sor

@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);
}
origin: com.bazaarvoice.emodb/emodb-queue

  @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();
  }
}
origin: com.bazaarvoice.emodb/emodb-sor

@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);
}
origin: bazaarvoice/emodb

@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);
}
origin: bazaarvoice/emodb

@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);
}
com.bazaarvoice.emodb.common.cassandraCassandraFactory

Javadoc

Dropwizard factory for Cassandra per-keyspace connection pools. Integrates with the Dropwizard lifecycle events (start, stop) and adds a health check for the connection pool.

Most used methods

  • build
  • cqlSessionForHintsPoller
  • newHealthCheck

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • requestLocationUpdates (LocationManager)
  • getExternalFilesDir (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JButton (javax.swing)
  • JPanel (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now