org.apache.cassandra.db.context

## Interface IContext

- All Known Implementing Classes:
    CounterContext

      public interface IContext

  An opaque commutative context. Maintains a ByteBuffer context that represents a partitioned commutative value.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `IContext.ContextRelationship`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `IContext.ContextRelationship` | `diff(java.nio.ByteBuffer left, java.nio.ByteBuffer right)` Determine the relationship between two contexts.
    `java.nio.ByteBuffer` | `merge(java.nio.ByteBuffer left, java.nio.ByteBuffer right, Allocator allocator)` Return a context w/ an aggregated count for each node id.
    `java.lang.String` | `toString(java.nio.ByteBuffer context)` Human-readable String from context.

- - ### Method Detail

    - #### diff

          IContext.ContextRelationship diff(java.nio.ByteBuffer left,
                                          java.nio.ByteBuffer right)

      Determine the relationship between two contexts. EQUAL: Equal set of nodes and every count is equal. GREATER_THAN: Superset of nodes and every count is equal or greater than its corollary. LESS_THAN: Subset of nodes and every count is equal or less than its corollary. DISJOINT: Node sets are not equal and/or counts are not all greater or less than.
      Parameters:
        `left` - context.
        `right` - context.
      Returns:
        the ContextRelationship between the contexts.

    - #### merge

          java.nio.ByteBuffer merge(java.nio.ByteBuffer left,
                                  java.nio.ByteBuffer right,
                                  Allocator allocator)

      Return a context w/ an aggregated count for each node id.
      Parameters:
        `left` - context.
        `right` - context.
        `allocator` - an allocator to allocate the new context from.

    - #### toString

          java.lang.String toString(java.nio.ByteBuffer context)

      Human-readable String from context.
      Parameters:
        `context` - context.
      Returns:
        a human-readable String of the context.

Copyright © 2014 The Apache Software Foundation