com.netflix.astyanax
Interface Cluster

All Known Implementing Classes:
ThriftClusterImpl

public interface Cluster

Interface for cluster operations. Use the Keyspace interface to perform keyspace query and mutation operations.

Author:
elandau

Method Summary
 String addColumnFamily(ColumnFamilyDefinition def)
          Add a column family to an existing keyspace
 String addKeyspace(KeyspaceDefinition def)
          Add a new keyspace to the cluster.
 String describeClusterName()
          The cluster name is completely arbitrary
 KeyspaceDefinition describeKeyspace(String ksName)
          Describe a single keyspace
 List<KeyspaceDefinition> describeKeyspaces()
          Return details about all keyspaces in the cluster
 String describePartitioner()
          Describe the partitioner used by the cluster
 Map<String,List<String>> describeSchemaVersions()
           
 String describeSnitch()
          Describe the snitch name used on the cluster
 String dropColumnFamily(String keyspaceName, String columnFamilyName)
          Delete the column family from the keyspace
 String dropKeyspace(String keyspaceName)
          Delete a keyspace from the cluster
 AstyanaxConfiguration getConfig()
          Configuration object for this Cluster
 Keyspace getKeyspace(String keyspace)
          Return a keyspace client.
 String getVersion()
          Return version of cassandra running on the cluster
 ColumnDefinition makeColumnDefinition()
          Make a column definitio to be added to a ColumnFamilyDefinition
 ColumnFamilyDefinition makeColumnFamilyDefinition()
          Prepare a column family definition.
 KeyspaceDefinition makeKeyspaceDefinition()
          Prepare a keyspace definition.
 String updateColumnFamily(ColumnFamilyDefinition def)
          Update an existing column family
 String updateKeyspace(KeyspaceDefinition def)
          Update a new keyspace in the cluster.
 

Method Detail

describeClusterName

String describeClusterName()
                           throws ConnectionException
The cluster name is completely arbitrary

Returns:
Throws:
ConnectionException

getVersion

String getVersion()
                  throws ConnectionException
Return version of cassandra running on the cluster

Returns:
Throws:
ConnectionException

describeSnitch

String describeSnitch()
                      throws ConnectionException
Describe the snitch name used on the cluster

Returns:
Throws:
ConnectionException

describePartitioner

String describePartitioner()
                           throws ConnectionException
Describe the partitioner used by the cluster

Returns:
Throws:
ConnectionException

describeSchemaVersions

Map<String,List<String>> describeSchemaVersions()
                                                throws ConnectionException
Throws:
ConnectionException

makeColumnFamilyDefinition

ColumnFamilyDefinition makeColumnFamilyDefinition()
Prepare a column family definition. Call execute() on the returned object to create the column family.

Returns:

makeColumnDefinition

ColumnDefinition makeColumnDefinition()
Make a column definitio to be added to a ColumnFamilyDefinition

Returns:

dropColumnFamily

String dropColumnFamily(String keyspaceName,
                        String columnFamilyName)
                        throws ConnectionException
Delete the column family from the keyspace

Parameters:
columnFamilyName -
Returns:
Throws:
OperationException
ConnectionException

addColumnFamily

String addColumnFamily(ColumnFamilyDefinition def)
                       throws ConnectionException
Add a column family to an existing keyspace

Parameters:
def - - Created by calling prepareColumnFamilyDefinition();
Returns:
Throws:
ConnectionException

updateColumnFamily

String updateColumnFamily(ColumnFamilyDefinition def)
                          throws ConnectionException
Update an existing column family

Parameters:
def - - Created by calling prepareColumnFamilyDefinition();
Returns:
Throws:
ConnectionException

makeKeyspaceDefinition

KeyspaceDefinition makeKeyspaceDefinition()
Prepare a keyspace definition. Call execute() on the returned object to create the keyspace. Not that column families can be added the keyspace definition here instead of calling prepareColumnFamilyDefinition separately.

Returns:

describeKeyspaces

List<KeyspaceDefinition> describeKeyspaces()
                                           throws ConnectionException
Return details about all keyspaces in the cluster

Returns:
Throws:
ConnectionException

describeKeyspace

KeyspaceDefinition describeKeyspace(String ksName)
                                    throws ConnectionException
Describe a single keyspace

Parameters:
ksName -
Returns:
Throws:
ConnectionException

getKeyspace

Keyspace getKeyspace(String keyspace)
Return a keyspace client. Note that this keyspace will use the same connection pool as the cluster and any other keyspaces created from this cluster instance. As a result each keyspace operation is likely to have some overhead for switching keyspaces.

Returns:

dropKeyspace

String dropKeyspace(String keyspaceName)
                    throws ConnectionException
Delete a keyspace from the cluster

Parameters:
keyspaceName -
Returns:
Throws:
OperationException
ConnectionException

addKeyspace

String addKeyspace(KeyspaceDefinition def)
                   throws ConnectionException
Add a new keyspace to the cluster. The keyspace object may include column families as well. Create a KeyspaceDefinition object by calling prepareKeyspaceDefinition().

Parameters:
def -
Returns:
Throws:
ConnectionException

updateKeyspace

String updateKeyspace(KeyspaceDefinition def)
                      throws ConnectionException
Update a new keyspace in the cluster. The keyspace object may include column families as well. Create a KeyspaceDefinition object by calling prepareKeyspaceDefinition().

Parameters:
def -
Throws:
ConnectionException

getConfig

AstyanaxConfiguration getConfig()
Configuration object for this Cluster

Returns:


Copyright © 2012. All Rights Reserved.