com.h3c.util.persistence.cassandra.entitymgr

## Class EntityManager

- java.lang.Object
- - com.h3c.util.persistence.cassandra.entitymgr.EntityManager

-     public class EntityManager
      extends Object

  `EntityManager` is the persistence module that is responsible for all interactions with Cassandra database. It interfaces with the `Dao` at one end and with Astyanax Client for Cassandra at the other end.

  The basic responsibility of EntityManager is to support CRUD operations. The other responsibilities include creation of Column Families, supporting Astyanax operations and so on.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `EntityManager(ConnectionManager connManager)` Constructor.
    `protected` | `EntityManager(com.netflix.astyanax.Keyspace keyspace)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<K extends Serializable,C extends Serializable & Comparable<C>> long` | `countColumns(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, K rowKey)` `countColumns(com.netflix.astyanax.model.ColumnFamily<K, C>, K)` counts the number of columns in a given row of a given column family.
    `<K extends Serializable,C> int` | `countRows(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily)` `countRows(ColumnFamily)` retrieves a count of all rows in a given column family
    `static void` | `createColumnFamily(ColumnFamilyDefinition<?,?> cf)` `createColumnFamily(com.h3c.util.persistence.cassandra.entitymgr.ColumnFamilyDefinition<?, ?>)` creates a new Cassandra Column Family.This method is a single way to create a Cassandra Column Family in the DAO framework.
    `<K extends Serializable,C extends Serializable & Comparable<C>> void` | `delete(com.netflix.astyanax.model.ColumnFamily<K,C> columnFamily, K rowKey, ColumnName<C,?> columnName)` Deletes a single column.
    `<K extends Serializable,C extends Serializable & Comparable<C>> void` | `deleteColumns(com.netflix.astyanax.model.ColumnFamily<K,C> columnFamily, K rowKey, Collection<ColumnName<C,?>> columnsNames)` Deletes a collection of columns.
    `static void` | `dropColumnFamily(com.netflix.astyanax.model.ColumnFamily<?,?> cf)` Drops a column family.
    `void` | `executeOperation()` `executeOperation()` executes a Write Operation.
    `<I extends Serializable,K extends Serializable & Comparable<K>> CassandraStorable<I,K>` | `get(com.netflix.astyanax.model.ColumnFamily<I,K> cf, Provider<ColumnDecoder<K,?>,ColumnName<K,?>> decoderProvider, I id)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a row from a Cassandra Column Family.
    `<K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, Collection<K> rows, Collection<ColumnName<C,?>> columns, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a collection of rows with specified columns.
    `<K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, Collection<K> rowKeys, ColumnName<C,?> startColumn, ColumnName<C,?> endColumn, boolean reversed, int limit, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a collection of specified rows and a specified range of columns in each row.
    `<K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, Collection<K> rowKeys, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoderProvider)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves Cassandra multiple rows from a column family.
    `<K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> cf, ColumnName<C,?> column, boolean key, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves rows using index.
    `<K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> cf, ColumnName<C,?> column, int key, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves rows using index.
    `<K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> cf, ColumnName<C,?> column, String key, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves rows using index.
    `<K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, K rowKey, ByteBuffer startColumn, ByteBuffer endColumn, boolean reversed, int limit, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` is used to retrieve a range of pre-constructed columns.
    `<K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, K rowKey, com.netflix.astyanax.model.ByteBufferRange range, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a list of columns based on a column range.
    `<K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, K rowKey, Collection<ColumnName<C,?>> columns, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` is used for reading a non-contiguous set of columns from the database.
    `<K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, K rowKey, ColumnName<C,?> startColumn, ColumnName<C,?> endColumn, boolean reversed, int limit, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` is used to retrieve a range of simple columns.
    `<K extends Serializable,C extends Serializable & Comparable<C>> MarkPage<Column<C,?>>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, K rowKey, MarkPageRequest<C> request, com.netflix.astyanax.serializers.CompositeRangeBuilder range, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)`
    `<K extends Serializable,C extends Serializable & Comparable<C>> MarkPage<Column<C,?>>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, K rowKey, MarkPageRequest<C> request, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)`
    `<K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, K rowKey, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder, ColumnName<C,?>... columnNames)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a set of non-contiguous columns as per the user request.
    `<K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>>` | `get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)` `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves all rows of a given Column Family.
    `<I extends Serializable,K extends Serializable & Comparable<K>> void` | `prepareDeleteMutation(com.netflix.astyanax.model.ColumnFamily<I,K> colFamily, I rowKey, Collection<ColumnName<K,?>> colNames)`
    `<K extends Serializable,C> void` | `prepareDeleteMutation(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily, K id)` `prepareDeleteMutation(com.netflix.astyanax.model.ColumnFamily<K, C>, K)` creates a delete Mutation and adds it to the `MutationBatch`.
    `<I extends Serializable,K extends Serializable & Comparable<K>,P extends Storable<I>> void` | `prepareMutation(com.netflix.astyanax.model.ColumnFamily<I,K> colFamily, P storable)` `prepareMutation(com.netflix.astyanax.model.ColumnFamily<I, K>, P)` creates a write mutation and adds it to the `MutationBatch`.
    `static void` | `setKeySpace(com.netflix.astyanax.Keyspace keyspace)`
    `static void` | `truncateColumnFamily(com.netflix.astyanax.model.ColumnFamily<?,?> cf)` Deletes all data from a column family.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EntityManager

          public EntityManager(ConnectionManager connManager)

      Constructor. It takes the Keyspace Configuration and prepares an Astyanax Mutation batch ready for doing any Mutation. This is applicable only for Write Operations. For Reads, we prepare a query using the Astyanax `Keyspace` object.
      Parameters:
        `connManager` - The Connection Manager object that contains all relevant keyspace/database configuration.

    - #### EntityManager

          protected EntityManager(com.netflix.astyanax.Keyspace keyspace)

  - ### Method Detail

    - #### setKeySpace

          public static void setKeySpace(com.netflix.astyanax.Keyspace keyspace)

    - #### createColumnFamily

          public static void createColumnFamily(ColumnFamilyDefinition<?,?> cf)
                                         throws PersistenceConnException

      `createColumnFamily(com.h3c.util.persistence.cassandra.entitymgr.ColumnFamilyDefinition<?, ?>)` creates a new Cassandra Column Family.This method is a single way to create a Cassandra Column Family in the DAO framework.

      Any DAO that needs to create a Column Family needs to follow these steps. 1. Define a Column Family Definition with the following parameters. a. Column Family Name b. Key Validator - This is the data type of the Row Key/Primary Key c. Default Validator - This is the Default data type of Column Value. If the column validators are not specified, Cassandra will use Default validator to validate the inserted values. d. Comparator - This is the data type of the Column Name. In Cassandra, a Column is a Tuple(Column Name, Column Value, Timestamp). Each have their own data types. The Comparator validates the inserted column name and also sorts columns in ascending order. e. Secondary Indexes - These are Cassandra Native Secondary Indexes. They should have a validator, index name and index type defined. Index Type is always "KEYS" because thats the only type of secondary index that is natively supported. Validator is the same as described above. Index name is generally the name of the column. f. CF Meta data - Every column in a static column family is known at the data modelling time. These columns have their own data type and hence a validator. This can be specified in the column definition as well. 2. The Column Family Definition should be passed down to this method.

      Parameters:
        `cf` - ColumnFamily Definition that contains enough information to create a column family in cassandra.
      Throws:
        `PersistenceConnException` - If Astyanax is unable to create a column family it throws a ConnectionException and should be handled in the upper layers.

    - #### dropColumnFamily

          public static void dropColumnFamily(com.netflix.astyanax.model.ColumnFamily<?,?> cf)
                                       throws PersistenceConnException

      Drops a column family.
      Parameters:
        `cf` - column family to drop.
      Throws:
        `PersistenceConnException` - if errors occur while executing the operation.

    - #### truncateColumnFamily

          public static void truncateColumnFamily(com.netflix.astyanax.model.ColumnFamily<?,?> cf)
                                           throws PersistenceConnException

      Deletes all data from a column family.
      Parameters:
        `cf` - column family to truncate.
      Throws:
        `PersistenceConnException` - if errors occur while executing the operation.

    - #### prepareDeleteMutation

          public <K extends Serializable,C> void prepareDeleteMutation(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                              K id)

      `prepareDeleteMutation(com.netflix.astyanax.model.ColumnFamily<K, C>, K)` creates a delete Mutation and adds it to the `MutationBatch`. The dao calls this method repetatively for every row that needs to be deleted. This helps to delete all rows in a single batch operation.
      Parameters:
        `colFamily` - The column family that needs to be operated on.
        `id` - The Row Key of the row that needs to be deleted.

    - #### prepareDeleteMutation

          public <I extends Serializable,K extends Serializable & Comparable<K>> void prepareDeleteMutation(com.netflix.astyanax.model.ColumnFamily<I,K> colFamily,
                                                                                                  I rowKey,
                                                                                                  Collection<ColumnName<K,?>> colNames)

    - #### prepareMutation

          public <I extends Serializable,K extends Serializable & Comparable<K>,P extends Storable<I>> void prepareMutation(com.netflix.astyanax.model.ColumnFamily<I,K> colFamily,
                                                                                                                  P storable)

      `prepareMutation(com.netflix.astyanax.model.ColumnFamily<I, K>, P)` creates a write mutation and adds it to the `MutationBatch`. The dao calls this method repetatively for each row that needs to be written. Also, rows of different column families can be added to the same MutationBatch. This helps in keeping the Commit Log in a stable condition. Should there be a failure, the log is replayed. try { //TODO : Support Paging return null; //return convertToStorable(result, decoder); } catch (ConnectionException e) { throw new RuntimeException(e); }
      Parameters:
        `colFamily` - Column family to which a row needs to be written.
        `storable` - This is a Cassandra row that needs to be written.

    - #### get

          public <I extends Serializable,K extends Serializable & Comparable<K>> CassandraStorable<I,K> get(com.netflix.astyanax.model.ColumnFamily<I,K> cf,
                                                                                                  Provider<ColumnDecoder<K,?>,ColumnName<K,?>> decoderProvider,
                                                                                                  I id)
                                                                                              throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a row from a Cassandra Column Family. The fetched row is identified by the supplied Row Key/Primary key from the DAO.
      Parameters:
        `cf` - The Column Family to read from.
        `decoderProvider` - The Decoder Provider for all columns of the given column family. This decoder provider is customised for a CF and hence each CF needs to provide an implementation of DecoderProvider
        `id` - The Row Key of the row to be read
      Returns:
        A single Cassandra Row.
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown.

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                  K rowKey,
                                                                                                  com.netflix.astyanax.model.ByteBufferRange range,
                                                                                                  Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                                              throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a list of columns based on a column range. It does not retrieve the entire row. This is a variation of the entire row read using Astyanax slice queries. This method is used for reading composite column slices.
      Parameters:
        `colFamily` - Column Family to retrieve data from
        `rowKey` - The Row to retrieve columns from
        `range` - The ByteBuffer slice Range
        `decoder` - Decoder for the given column Family.
      Returns:
        Storable object with columns that satisfy the query
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                  K rowKey,
                                                                                                  ColumnName<C,?> startColumn,
                                                                                                  ColumnName<C,?> endColumn,
                                                                                                  boolean reversed,
                                                                                                  int limit,
                                                                                                  Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                                              throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` is used to retrieve a range of simple columns. The order of retrieval and the size of the retrieved set can be specified in this method.
      Parameters:
        `colFamily` - Column Family to retrieve columns from
        `rowKey` - Row key to lookup data columns
        `startColumn` - First column in the range
        `endColumn` - Last column in the range
        `reversed` - True if the order should be reversed. Note that for reversed, startColumn should be greater than endColumn.
        `limit` - Maximum number of columns to return
        `decoder` - Decoder for the given column family.
      Returns:
        A Single Row with columns in the specified range
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                  K rowKey,
                                                                                                  ByteBuffer startColumn,
                                                                                                  ByteBuffer endColumn,
                                                                                                  boolean reversed,
                                                                                                  int limit,
                                                                                                  Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                                              throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` is used to retrieve a range of pre-constructed columns. This method is used for retrieving composite columns bounded by a start and a end. The order can be reversed and the size of columns can be limited to a certain number of columns.
      Parameters:
        `colFamily` - Column Family to retrieve data from
        `rowKey` - Row Key to look up
        `startColumn` - First Column in the Composite Column Range
        `endColumn` - Last Column in the Composite Column Range
        `reversed` - True if the order needs to be reversed. For reversed, startColumn should be greater than endColumn
        `limit` - The maximum number of columns to retrieve.
        `decoder` - Column Decoder for the Column Family.
      Returns:
        A Single row with the columns requested.
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                  K rowKey,
                                                                                                  Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder,
                                                                                                  ColumnName<C,?>... columnNames)
                                                                                              throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a set of non-contiguous columns as per the user request. This method expects a set of columns to read.
      Parameters:
        `colFamily` - Column Family to retrieve data from
        `rowKey` - Row Key to look up data
        `decoder` - The Column Decoder for the Column Family
        `columnNames` - The set of Columns to be read
      Returns:
        A single row with requested columns with values.
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> CassandraStorable<K,C> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                  K rowKey,
                                                                                                  Collection<ColumnName<C,?>> columns,
                                                                                                  Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                                              throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` is used for reading a non-contiguous set of columns from the database.
      Parameters:
        `colFamily` - Column Family to retrieve data from
        `rowKey` - Row Key to lookup a row
        `columns` - Collection of Columns to read
        `decoder` - Decoder for the Column Family
      Returns:
        A Single Row consisting of the columns specified *
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                              Collection<K> rowKeys,
                                                                                                              Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoderProvider)
                                                                                                          throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves Cassandra multiple rows from a column family. This method is generally used to get the final result set in a read operation with filters.
      Parameters:
        `colFamily` - Column Family to read from
        `rowKeys` - The collection of rowKeys to read from
        `decoderProvider` - Decoder Provider for each column of this column family
      Returns:
        A list of records from the Column Family
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                              Collection<K> rows,
                                                                                                              Collection<ColumnName<C,?>> columns,
                                                                                                              Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                                                          throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a collection of rows with specified columns. This method expects a set of Rows and a set of Columns to be read from the Database. This method improves the read response time as it does not read the entire row for each row key specified.
      Parameters:
        `colFamily` - Column Family to read data
        `rows` - A set of row keys to be read
        `columns` - A set of columns to read in each row
        `decoder` - Column decoder for the given Column Family
      Returns:
        A set of Rows with a set of specified columns
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                              Collection<K> rowKeys,
                                                                                                              ColumnName<C,?> startColumn,
                                                                                                              ColumnName<C,?> endColumn,
                                                                                                              boolean reversed,
                                                                                                              int limit,
                                                                                                              Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                                                          throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves a collection of specified rows and a specified range of columns in each row.
      Parameters:
        `colFamily` - Column Family to retrieve data from
        `rowKeys` - A set of row keys to read
        `startColumn` - First column of the range in each row
        `endColumn` - Last column of the range in each row
        `reversed` - True if read is done in reverse order. In reverse order read, the start column should be greater than end column
        `limit` - Maximum number of columns in the range.
        `decoder` - Column decoder for the given Column Family
      Returns:
        A set of rows with the range of specified set of columns.
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                              Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves all rows of a given Column Family.
      Parameters:
        `colFamily` - Column Family to read all rows from
        `decoder` - Column decoder for the given column family
      Returns:
        All rows of a given column family

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> MarkPage<Column<C,?>> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                 K rowKey,
                                                                                                 MarkPageRequest<C> request,
                                                                                                 Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                        throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException

      Throws:
        `com.netflix.astyanax.connectionpool.exceptions.ConnectionException`

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> MarkPage<Column<C,?>> get(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                                 K rowKey,
                                                                                                 MarkPageRequest<C> request,
                                                                                                 com.netflix.astyanax.serializers.CompositeRangeBuilder range,
                                                                                                 Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                        throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException

      Throws:
        `com.netflix.astyanax.connectionpool.exceptions.ConnectionException`

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>> get(com.netflix.astyanax.model.ColumnFamily<K,C> cf,
                                                                                                              ColumnName<C,?> column,
                                                                                                              boolean key,
                                                                                                              Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                                                          throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves rows using index.
      Parameters:
        `cf` - Column Family from which to read rows
        `column` - Column to determine secondary index
        `key` - boolean key to search index
        `decoder` - Column decoder for the given column family
      Returns:
        rows found in secondary index with key
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>> get(com.netflix.astyanax.model.ColumnFamily<K,C> cf,
                                                                                                              ColumnName<C,?> column,
                                                                                                              String key,
                                                                                                              Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                                                          throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves rows using index.
      Parameters:
        `cf` - Column Family from which to read rows
        `column` - Column to determine secondary index
        `key` - string key to search index
        `decoder` - Column decoder for the given column family
      Returns:
        rows found in secondary index with key
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### get

          public <K extends Serializable,C extends Serializable & Comparable<C>> Collection<CassandraStorable<K,C>> get(com.netflix.astyanax.model.ColumnFamily<K,C> cf,
                                                                                                              ColumnName<C,?> column,
                                                                                                              int key,
                                                                                                              Provider<ColumnDecoder<C,?>,ColumnName<C,?>> decoder)
                                                                                                          throws PersistenceConnException

      `get(com.netflix.astyanax.model.ColumnFamily<I, K>, com.h3c.util.Provider<com.h3c.util.persistence.cassandra.entitymgr.column.ColumnDecoder<K, ?>, com.h3c.util.persistence.cassandra.entitymgr.column.ColumnName<K, ?>>, I)` retrieves rows using index.
      Parameters:
        `cf` - Column Family from which to read rows
        `column` - Column to determine secondary index
        `key` - integer key to search index
        `decoder` - Column decoder for the given column family
      Returns:
        rows found in secondary index with key
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### countColumns

          public <K extends Serializable,C extends Serializable & Comparable<C>> long countColumns(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily,
                                                                                         K rowKey)
                            throws PersistenceConnException

      `countColumns(com.netflix.astyanax.model.ColumnFamily<K, C>, K)` counts the number of columns in a given row of a given column family. `countColumns(com.netflix.astyanax.model.ColumnFamily<K, C>, K)` counts the number of columns in a given row of a given column family.
      Parameters:
        `colFamily` - The column family to read from
        `rowKey` - The Row Key of the Column Family to count columns from.
      Returns:
        A count of columns that are present in the row
      Throws:
        `PersistenceConnException` - If the connection to the DB cannot be established, this exception is thrown

    - #### countRows

          public <K extends Serializable,C> int countRows(com.netflix.astyanax.model.ColumnFamily<K,C> colFamily)
                        throws PersistenceException

      `countRows(ColumnFamily)` retrieves a count of all rows in a given column family
      Parameters:
        `colFamily` - Column Family to get the count from.
      Returns:
        Number of rows in the column family
      Throws:
        `PersistenceException` - A General Persistence Exception.

    - #### delete

          public <K extends Serializable,C extends Serializable & Comparable<C>> void delete(com.netflix.astyanax.model.ColumnFamily<K,C> columnFamily,
                                                                                   K rowKey,
                                                                                   ColumnName<C,?> columnName)

      Deletes a single column.
      Parameters:
        `columnName` - name of the column to delete.
        `rowKey` - row key.
        `columnFamily` - column family.

    - #### deleteColumns

          public <K extends Serializable,C extends Serializable & Comparable<C>> void deleteColumns(com.netflix.astyanax.model.ColumnFamily<K,C> columnFamily,
                                                                                          K rowKey,
                                                                                          Collection<ColumnName<C,?>> columnsNames)

      Deletes a collection of columns.
      Parameters:
        `columnsNames` - names of the columns to delete.
        `rowKey` - row key.
        `columnFamily` - column family.

    - #### executeOperation

          public void executeOperation()
                                throws PersistenceConnException

      `executeOperation()` executes a Write Operation.
      Throws:
        `PersistenceConnException` - If the connection to Database is not established, then this exception is thrown.

Copyright © 2014. All Rights Reserved.