public class CqlClusterImpl
extends java.lang.Object
implements com.netflix.astyanax.Cluster, com.netflix.astyanax.connectionpool.ConnectionPoolProxy.SeedHostListener
Cluster that implements ddl operations.
The class encapsulates a java driver cluster and session object to provide all the functionality.
Note that due to the way the object is setup via AstyanaxContext and CqlFamilyFactory, it needs to implements
a ConnectionPoolProxy.SeedHostListener so that it can construct the cluster and session object appropriately once the seed hosts
have been provided by the HostSupplier object| Modifier and Type | Field and Description |
|---|---|
com.datastax.driver.core.Cluster |
cluster |
| Constructor and Description |
|---|
CqlClusterImpl(com.netflix.astyanax.AstyanaxConfiguration asConfig,
com.netflix.astyanax.KeyspaceTracerFactory tracerFactory,
com.netflix.astyanax.connectionpool.ConnectionPoolConfiguration cpConfig,
com.netflix.astyanax.connectionpool.ConnectionPoolMonitor cpMonitor) |
| Modifier and Type | Method and Description |
|---|---|
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
addColumnFamily(com.netflix.astyanax.ddl.ColumnFamilyDefinition def) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
addKeyspace(com.netflix.astyanax.ddl.KeyspaceDefinition def) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
createColumnFamily(java.util.Map<java.lang.String,java.lang.Object> options) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
createColumnFamily(java.util.Properties props) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
createKeyspace(java.util.Map<java.lang.String,java.lang.Object> options) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
createKeyspace(java.util.Properties props) |
java.lang.String |
describeClusterName() |
com.netflix.astyanax.ddl.KeyspaceDefinition |
describeKeyspace(java.lang.String ksName) |
java.util.List<com.netflix.astyanax.ddl.KeyspaceDefinition> |
describeKeyspaces() |
java.lang.String |
describePartitioner() |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
describeSchemaVersions() |
java.lang.String |
describeSnitch() |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
dropColumnFamily(java.lang.String keyspaceName,
java.lang.String columnFamilyName) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
dropKeyspace(java.lang.String keyspaceName) |
java.util.Properties |
getAllKeyspaceProperties() |
java.util.Properties |
getColumnFamilyProperties(java.lang.String keyspace,
java.lang.String columnfamilyName) |
com.netflix.astyanax.AstyanaxConfiguration |
getConfig() |
com.netflix.astyanax.Keyspace |
getKeyspace(java.lang.String keyspace) |
java.util.Properties |
getKeyspaceProperties(java.lang.String keyspace) |
java.lang.String |
getVersion() |
com.netflix.astyanax.ddl.ColumnDefinition |
makeColumnDefinition() |
com.netflix.astyanax.ddl.ColumnFamilyDefinition |
makeColumnFamilyDefinition() |
com.netflix.astyanax.ddl.KeyspaceDefinition |
makeKeyspaceDefinition() |
void |
setHosts(java.util.Collection<com.netflix.astyanax.connectionpool.Host> hosts,
int port) |
void |
shutdown() |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
updateColumnFamily(com.netflix.astyanax.ddl.ColumnFamilyDefinition def) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
updateColumnFamily(java.util.Map<java.lang.String,java.lang.Object> options) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
updateColumnFamily(java.util.Properties props) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
updateKeyspace(com.netflix.astyanax.ddl.KeyspaceDefinition def) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
updateKeyspace(java.util.Map<java.lang.String,java.lang.Object> options) |
com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> |
updateKeyspace(java.util.Properties props) |
public CqlClusterImpl(com.netflix.astyanax.AstyanaxConfiguration asConfig,
com.netflix.astyanax.KeyspaceTracerFactory tracerFactory,
com.netflix.astyanax.connectionpool.ConnectionPoolConfiguration cpConfig,
com.netflix.astyanax.connectionpool.ConnectionPoolMonitor cpMonitor)
public java.lang.String describeClusterName()
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
describeClusterName in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic java.lang.String getVersion()
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
getVersion in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic void shutdown()
shutdown in interface com.netflix.astyanax.connectionpool.ConnectionPoolProxy.SeedHostListenerpublic java.lang.String describeSnitch()
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
describeSnitch in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic java.lang.String describePartitioner()
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
describePartitioner in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> describeSchemaVersions()
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
describeSchemaVersions in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.ddl.KeyspaceDefinition makeKeyspaceDefinition()
makeKeyspaceDefinition in interface com.netflix.astyanax.Clusterpublic java.util.Properties getAllKeyspaceProperties()
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
getAllKeyspaceProperties in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic java.util.Properties getKeyspaceProperties(java.lang.String keyspace)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
getKeyspaceProperties in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic java.util.List<com.netflix.astyanax.ddl.KeyspaceDefinition> describeKeyspaces()
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
describeKeyspaces in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.ddl.KeyspaceDefinition describeKeyspace(java.lang.String ksName)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
describeKeyspace in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.Keyspace getKeyspace(java.lang.String keyspace)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
getKeyspace in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> dropKeyspace(java.lang.String keyspaceName)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
dropKeyspace in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> addKeyspace(com.netflix.astyanax.ddl.KeyspaceDefinition def)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
addKeyspace in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> updateKeyspace(com.netflix.astyanax.ddl.KeyspaceDefinition def)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
updateKeyspace in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> createKeyspace(java.util.Map<java.lang.String,java.lang.Object> options)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
createKeyspace in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> createKeyspace(java.util.Properties props)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
createKeyspace in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> updateKeyspace(java.util.Map<java.lang.String,java.lang.Object> options)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
updateKeyspace in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> updateKeyspace(java.util.Properties props)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
updateKeyspace in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.AstyanaxConfiguration getConfig()
getConfig in interface com.netflix.astyanax.Clusterpublic com.netflix.astyanax.ddl.ColumnFamilyDefinition makeColumnFamilyDefinition()
makeColumnFamilyDefinition in interface com.netflix.astyanax.Clusterpublic com.netflix.astyanax.ddl.ColumnDefinition makeColumnDefinition()
makeColumnDefinition in interface com.netflix.astyanax.Clusterpublic java.util.Properties getColumnFamilyProperties(java.lang.String keyspace,
java.lang.String columnfamilyName)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
getColumnFamilyProperties in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> createColumnFamily(java.util.Map<java.lang.String,java.lang.Object> options)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
createColumnFamily in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> createColumnFamily(java.util.Properties props)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
createColumnFamily in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> updateColumnFamily(java.util.Map<java.lang.String,java.lang.Object> options)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
updateColumnFamily in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> updateColumnFamily(java.util.Properties props)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
updateColumnFamily in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> dropColumnFamily(java.lang.String keyspaceName,
java.lang.String columnFamilyName)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
dropColumnFamily in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> addColumnFamily(com.netflix.astyanax.ddl.ColumnFamilyDefinition def)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
addColumnFamily in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic com.netflix.astyanax.connectionpool.OperationResult<com.netflix.astyanax.ddl.SchemaChangeResult> updateColumnFamily(com.netflix.astyanax.ddl.ColumnFamilyDefinition def)
throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
updateColumnFamily in interface com.netflix.astyanax.Clustercom.netflix.astyanax.connectionpool.exceptions.ConnectionExceptionpublic void setHosts(java.util.Collection<com.netflix.astyanax.connectionpool.Host> hosts,
int port)
setHosts in interface com.netflix.astyanax.connectionpool.ConnectionPoolProxy.SeedHostListener