Package org.apache.cassandra.hints
Class Hint
java.lang.Object
org.apache.cassandra.hints.Hint
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
mutation 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
FieldsModifier and TypeFieldDescriptionstatic intstatic final org.apache.cassandra.hints.Hint.Serializer -
Method Summary
-
Field Details
-
serializer
public static final org.apache.cassandra.hints.Hint.Serializer serializer -
maxHintTTL
public static volatile int maxHintTTL
-
-
Method Details
-
create
- Parameters:
mutation- the hinted mutationcreationTime- time of this hint's creation (in milliseconds since epoch)
-
create
-
isLive
public boolean isLive()- Returns:
- calculates whether or not it is safe to apply the hint without risking to resurrect any deleted data
-