public interface

Keyspace

com.netflix.astyanax.Keyspace
Known Indirect Subclasses

Class Overview

Interface providing access to mutate and query columns from a cassandra keyspace.

Summary

Public Methods
abstract KeyspaceDefinition describeKeyspace()
Return a complete description of the keyspace and its column families@return
abstract List<TokenRange> describeRing()
Get a list of all tokens and their endpoints@return
abstract List<TokenRange> describeRing(boolean cached)
Describe the ring but use the last locally cached version if available.@return
abstract AstyanaxConfiguration getConfig()
Return the configuration object used to set up this keyspace
abstract String getKeyspaceName()
Returns keyspace name
abstract SerializerPackage getSerializerPackage(String cfName, boolean ignoreErrors)
Return the serializer package for a specific column family.
abstract <K, C> ColumnMutation prepareColumnMutation(ColumnFamily<K, C> columnFamily, K rowKey, C column)
Mutation for a single column
abstract MutationBatch prepareMutationBatch()
Prepare a batch mutation object.
abstract <K, C> ColumnFamilyQuery<K, C> prepareQuery(ColumnFamily<K, C> cf)
Starting point for constructing a query.
abstract OperationResult<Void> testOperation(Operation<?, ?> operation)
This method is used for testing purposes only.
abstract OperationResult<Void> testOperation(Operation<?, ?> operation, RetryPolicy retry)
This method is used for testing purposes only.
abstract <K, C> OperationResult<Void> truncateColumnFamily(ColumnFamily<K, C> columnFamily)
Delete all rows in a column family@return

Public Methods

public abstract KeyspaceDefinition describeKeyspace ()

Return a complete description of the keyspace and its column families@return

public abstract List<TokenRange> describeRing ()

Get a list of all tokens and their endpoints@return

public abstract List<TokenRange> describeRing (boolean cached)

Describe the ring but use the last locally cached version if available.@return

public abstract AstyanaxConfiguration getConfig ()

Return the configuration object used to set up this keyspace

public abstract String getKeyspaceName ()

Returns keyspace name

public abstract SerializerPackage getSerializerPackage (String cfName, boolean ignoreErrors)

Return the serializer package for a specific column family. This requires a call to the Cassandra cluster and is therefore cached to reduce load on Cassandra and since this data rarely changes.@return

public abstract ColumnMutation prepareColumnMutation (ColumnFamily<K, C> columnFamily, K rowKey, C column)

Mutation for a single column

public abstract MutationBatch prepareMutationBatch ()

Prepare a batch mutation object. It is possible to create multiple batch mutations and later merge them into a single mutation by calling mergeShallow on a batch mutation object.@return

public abstract ColumnFamilyQuery<K, C> prepareQuery (ColumnFamily<K, C> cf)

Starting point for constructing a query. From the column family the client can perform all 4 types of queries: get column, get key slice, get key range and and index query.

Parameters
cf Column family to be used for the query. The key and column serializers in the ColumnFamily are automatically used while constructing the query and the response.

public abstract OperationResult<Void> testOperation (Operation<?, ?> operation)

This method is used for testing purposes only. It is used to inject errors in the connection pool.@return

public abstract OperationResult<Void> testOperation (Operation<?, ?> operation, RetryPolicy retry)

This method is used for testing purposes only. It is used to inject errors in the connection pool.@return

public abstract OperationResult<Void> truncateColumnFamily (ColumnFamily<K, C> columnFamily)

Delete all rows in a column family@return

Throws
ConnectionException
OperationException
ConnectionException