use of com.metabroadcast.common.persistence.cassandra.DatastaxCassandraService in project atlas-deer by atlasapi.
the class CassandraContentStoreIT method setup.
@BeforeClass
public static void setup() throws Exception {
root.addAppender(new ConsoleAppender(new PatternLayout(PatternLayout.TTCC_CONVERSION_PATTERN)));
root.setLevel(Level.WARN);
context.start();
DatastaxCassandraService cassandraService = CassandraInit.datastaxCassandraService();
cassandraService.startAsync().awaitRunning();
Cluster cluster = cassandraService.getCluster();
session = cluster.connect();
CassandraInit.createTables(session, context);
CassandraInit.truncate(session, context);
session.close();
session = cluster.connect(KEYSPACE);
}
use of com.metabroadcast.common.persistence.cassandra.DatastaxCassandraService in project atlas-deer by atlasapi.
the class DatastaxCassandraEventStoreIT method init.
@BeforeClass
public static void init() throws Exception {
// Thrift init
context.start();
// CQL init
DatastaxCassandraService cassandraService = new DatastaxCassandraService(seeds, 8, 2);
cassandraService.startAsync().awaitRunning();
session = cassandraService.getCluster().connect();
CassandraInit.createTables(session, context);
CassandraInit.truncate(session, context);
session = cassandraService.getCluster().connect(keyspace);
}
use of com.metabroadcast.common.persistence.cassandra.DatastaxCassandraService in project atlas-deer by atlasapi.
the class OrganisationUriStoreIT method init.
@BeforeClass
public static void init() throws Exception {
// Thrift init
context.start();
CassandraHelper.createKeyspace(context);
// CQL init
DatastaxCassandraService cassandraService = new DatastaxCassandraService(seeds, 8, 2);
cassandraService.startAsync().awaitRunning();
session = cassandraService.getCluster().connect(keyspace);
session.execute(IOUtils.toString(DatastaxCassandraOrganizationStoreTest.class.getResourceAsStream("/atlas_organisation.schema")));
session.execute(IOUtils.toString(DatastaxCassandraOrganizationStoreTest.class.getResourceAsStream("/atlas_organisation_uri.schema")));
}
use of com.metabroadcast.common.persistence.cassandra.DatastaxCassandraService in project atlas-deer by atlasapi.
the class CassandraTopicStoreIT method setup.
@BeforeClass
public static void setup() throws ConnectionException, IOException {
context.start();
DatastaxCassandraService service = CassandraInit.datastaxCassandraService();
service.startAsync().awaitRunning();
Cluster cluster = service.getCluster();
Session session = cluster.connect();
CassandraInit.createTables(session, context);
CassandraInit.truncate(session, context);
session.close();
}
use of com.metabroadcast.common.persistence.cassandra.DatastaxCassandraService in project atlas-deer by atlasapi.
the class AtlasPersistenceModule method persistenceModule.
@Bean
public CassandraPersistenceModule persistenceModule() {
Iterable<String> seeds = Splitter.on(",").split(cassandraSeeds);
ConfiguredAstyanaxContext contextSupplier = new ConfiguredAstyanaxContext(cassandraCluster, cassandraKeyspace, seeds, Integer.parseInt(cassandraPort), Integer.parseInt(cassandraClientThreads), Integer.parseInt(cassandraConnectionTimeout), metricsModule.metrics());
AstyanaxContext<Keyspace> context = contextSupplier.get();
context.start();
DatastaxCassandraService cassandraService = DatastaxCassandraService.builder().withNodes(seeds).withConnectionsPerHostLocal(cassandraConnectionsPerHostLocal).withConnectionsPerHostRemote(cassandraConnectionsPerHostRemote).withCodecRegistry(new CodecRegistry().register(InstantCodec.instance).register(LocalDateCodec.instance).register(new JacksonJsonCodec<>(org.atlasapi.content.v2.model.Clip.Wrapper.class, MAPPER)).register(new JacksonJsonCodec<>(org.atlasapi.content.v2.model.Encoding.Wrapper.class, MAPPER))).withConnectTimeoutMillis(cassandraDatastaxConnectionTimeout).withReadTimeoutMillis(cassandraDatastaxReadTimeout).build();
cassandraService.startAsync().awaitRunning();
return CassandraPersistenceModule.builder().withBrokerFactory(deerBrokerFactory).withAstyanaxContext(context).withDatastaxCassandraService(cassandraService).withKeyspace(cassandraKeyspace).withIdGeneratorBuilder(idGeneratorBuilder()).withContentHasher(ContentHashGenerator.create(HashGenerator.create(), UTIL_METRIC_PREFIX, metricsModule.metrics())).withEventHasher(eventV2 -> UUID.randomUUID().toString()).withMetrics(metricsModule.metrics()).build();
}
Aggregations