com.h3c.util.persistence.cassandra.index

## Interface ShardStrategy<K extends Serializable,C>

- Type Parameters:
    `K` - type of the row key to implement the shard strategy on.
    `C` - type of the column name or column key.
  All Known Implementing Classes:
    HashShardStrategy, StringShardStrategy

      public interface ShardStrategy<K extends Serializable,C>

  Strategy used to distribute columns into multiple rows so they are handled by different nodes in Cassandra.

  Writing always to one key (when using wide rows in secondary indexes) means that all writes for that key will go to one node.

  Wide rows also have a 2 billion size restriction. So if a row could have more than 2 billion columns applying a shard strategy is mandatory.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `K` | `getRowKey(C columnName)` Gets the row key to be used for the given column name.

- - ### Method Detail

    - #### getRowKey

          K getRowKey(C columnName)

      Gets the row key to be used for the given column name.
      Parameters:
        `columnName` - column name to fins a sharded key for. This could be part of the column name if the shard strategy is applied to a single component of a composite column name.
      Returns:
        a sharded key for the given column name.

Copyright © 2014. All Rights Reserved.