Class 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 Description
      static org.apache.cassandra.hints.Hint.Serializer serializer  
    • 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)
      • isLive

        public boolean isLive()
        Returns:
        calculates whether or not it is safe to apply the hint without risking to resurrect any deleted data