Hint (apache-cassandra API)
Date: 2018-02-14

org.apache.cassandra.hints

## Class Hint

- java.lang.Object
- - org.apache.cassandra.hints.Hint

-     public final class Hint
      extends java.lang.Object

  Encapsulates the hinted mutation, its creation time, and the gc grace seconds param for each table involved. - Why do we need to track hint creation time? - We must exclude updates for tables that have been truncated after hint's creation, otherwise the result is data corruption. - Why do we need to track gc grace seconds? - Hints can stay in storage for a while before being applied, and without recording gc grace seconds (+ creation time), if we apply the mutation blindly, we risk resurrecting a deleted value, a tombstone for which had been already compacted away while the hint was in storage. We also look at the smallest current value of the gcgs param for each affected table when applying the hint, and use creation time + min(recorded gc gs, current gcgs + current gc grace) as the overall hint expiration time. This allows now to safely reduce gc gs on tables without worrying that an applied old hint might resurrect any data.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static org.apache.cassandra.hints.Hint.Serializer` | `serializer`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Hint` | `create(Mutation mutation, long creationTime)`
    `static Hint` | `create(Mutation mutation, long creationTime, int gcgs)`

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

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

- - ### Field Detail

    - #### serializer

          public static final org.apache.cassandra.hints.Hint.Serializer serializer

  - ### Method Detail

    - #### create

          public static Hint create(Mutation mutation,
                                    long creationTime)

      Parameters:
        `mutation` - the hinted mutation
        `creationTime` - time of this hint's creation (in milliseconds since epoch)

    - #### create

          public static Hint create(Mutation mutation,
                                    long creationTime,
                                    int gcgs)

Copyright © 2018 The Apache Software Foundation