public ContextConfigurations(Collection<ContextConfiguration> contextConfigs) { for (ContextConfiguration contextConfig : contextConfigs) { addContextConfig(contextConfig); } }
public CassandraSession getCassandraSession() { return new CassandraSessionImpl(CASSANDRA_KEYSPACE, host, port, CASSANDRA_COMPRESSION, CASSANDRA_USERNAME, CASSANDRA_PASSWORD, false); }
public void create(Schema schema) throws IOException { create(schema, true); }
@Override protected void run(Bootstrap<NewtsConfig> bootstrap, Namespace namespace, NewtsConfig config) throws Exception { try (SchemaManager m = new SchemaManager(config.getCassandraKeyspace(), config.getCassandraHost(), config.getCassandraPort(), config.getCassandraUsername(), config.getCassandraPassword(), config.getCassandraSsl())) { for (Schema s : s_schemas) { m.create(s, true); } } }
public Duration getResourceShard(Context context) { ContextConfiguration configConfig = m_contexts.get(context); if (configConfig != null) { return configConfig.getResourceShard(); } else { return DEFAULT_RESOURCE_SHARD; } }
public ConsistencyLevel getReadConsistency(Context context) { ContextConfiguration configConfig = m_contexts.get(context); if (configConfig != null) { return configConfig.getReadConsistency(); } else { return DEFAULT_READ_CONSISTENCY; } }
public ConsistencyLevel getWriteConsistency(Context context) { ContextConfiguration configConfig = m_contexts.get(context); if (configConfig != null) { return configConfig.getWriteConsistency(); } else { return DEFAULT_WRITE_CONSISTENCY; } } }
public ContextConfigurations addContextConfig(Context context, Duration resourceShard, ConsistencyLevel readConsistencyLevel, ConsistencyLevel writeConsistencyLevel) { m_contexts.put(context, new ContextConfiguration(context, resourceShard, readConsistencyLevel, writeConsistencyLevel)); return this; }
public PreparedStatement prepare(String statement) { try { return m_session.prepare(statement); } catch (DriverException excep) { throw new CassandraException(excep); } }
public ContextConfigurations addContextConfig(ContextConfiguration contextConfig) { m_contexts.put(contextConfig.getContext(), contextConfig); return this; }
@Override protected void run(Bootstrap<NewtsConfig> bootstrap, Namespace namespace, NewtsConfig config) throws Exception { try (SchemaManager m = new SchemaManager(config.getCassandraKeyspace(), config.getCassandraHost(), config.getCassandraPort(), config.getCassandraUsername(), config.getCassandraPassword(), config.getCassandraSsl())) { for (Schema s : s_schemas) { m.create(s, true); } } }
public void create(Schema schema, boolean ifNotExists) throws IOException { create(schema, ifNotExists, false); }
public ContextConfigurations(Collection<ContextConfiguration> contextConfigs) { for (ContextConfiguration contextConfig : contextConfigs) { addContextConfig(contextConfig); } }
public Duration getResourceShard(Context context) { ContextConfiguration configConfig = m_contexts.get(context); if (configConfig != null) { return configConfig.getResourceShard(); } else { return DEFAULT_RESOURCE_SHARD; } }
public ConsistencyLevel getReadConsistency(Context context) { ContextConfiguration configConfig = m_contexts.get(context); if (configConfig != null) { return configConfig.getReadConsistency(); } else { return DEFAULT_READ_CONSISTENCY; } }
public ConsistencyLevel getWriteConsistency(Context context) { ContextConfiguration configConfig = m_contexts.get(context); if (configConfig != null) { return configConfig.getWriteConsistency(); } else { return DEFAULT_WRITE_CONSISTENCY; } } }
public ContextConfigurations addContextConfig(Context context, Duration resourceShard, ConsistencyLevel readConsistencyLevel, ConsistencyLevel writeConsistencyLevel) { m_contexts.put(context, new ContextConfiguration(context, resourceShard, readConsistencyLevel, writeConsistencyLevel)); return this; }
public PreparedStatement prepare(RegularStatement statement) { try { return m_session.prepare(statement); } catch (DriverException excep) { throw new CassandraException(excep); } }
public void create(Schema schema) throws IOException { create(schema, true); }
public void create(Schema schema, boolean ifNotExists) throws IOException { create(schema, ifNotExists, false); }