I'll a pass over the patch with you suggestions, but a few comments first.
why does IClock not implement Comparable instead of adding ClockRelationship?
That's because version clocks can be disjoint (but timestamp clocks don't).
I admit, without version clock in the patch, it may feel weird. This is one of those
"this patch is a step before the next patch from 580".
And I've decided to remove the DISJOINT case from ClockRelationship enum from
this patch because having it will require the addition of the notion of reconcilier, but this
seems beyond this patch to me.
... but more importantly doesn't
IClock oldClock = atomic.getAndSet(newClock);
temporarily set the reference to the new value (even it is smaller than the old), before fixing it to be the max? that would be a bug.
It do look like a bug (but maybe Kelvin could also comment on this one). Just
wanted to point out that the two previous atomicSetMax (for interger and long)
seem to be hit by the same curse. I can fix it for this patch, but should we
open a ticket for the other two ?
+ public static ColumnSerializer serializer(ClockType clockType)
the convention everywhere is that serializer() takes no arguments, the serialization op should inspect the clocktype instead
That not true, SuperColumn.serializer takes an AbstractType
But more seriously, I'll admit I'm not sure what's the best way to do that.
For serialization it's easy, we have the clock of the column. But for
deserialization, we would need somehow to write that on disk. I see two
options (at least two simple):
1) we use the 2 bytes used for the deletion & expiration flags. Feels a bit
like a hack though.
2) we add a new field in the serialized form of the column.
And the superColumn serializer would also need to know the clock type to
deserialize the markedDeletedAt field. Here we can't use any existing flags.
Overall, it seems to me like a waste of perfectly good cpu cycles and space
just to avoid having an argument to a function (not a lot, granted, but still).
Unless ... I'm not completely awaken yet and I miss something much easier.