Add column type as enum (in particular in preparation for CASSANDRA-580)
Adding first part from CASSANDRA-580 wip patch rebased against trunk.
wouldn't RowType be a better description of the enum's purpose?
My opinion is that RowType is not perfect either as whatever name we choose, it will
describe the columns of a SuperColumn (damn SuperColumns ...), that are no row.
Maybe ContainerType or the longer ColumnContainerType ?
it describes whether the row contains columns or supercolumns, no?
Not only. That is, SuperColumn have a ColumnType too. Right now, this can only be Standard.
But 580 will introduce other kind, like a 'Version' ColumnType, that SuperColumn can contain.
I believe the long way to describe it is "The kind of IColumn a IColumnContainer contains".
SnakeYAML supports java enums. If you're going to do this, you should expect a correct enum in the config instead of doing extra parsing in DatabaseDescriptor.
I must be missing something, because it seems to me that Version shouldn't be part of ColumnType, it should be part of the timestamp stuff.
That is, a column and a supercolumn will both have a Version, which will either be a byte, or a long. As with today, SC would only need that for tombstone-ing.
Right now, in 580, I use the ColumnType enum to denote whether the Version (actually called Clock) is a byte or a long.
For this patch, it should be sufficient to just support Standard and Super.
(as discussed on IRC)
the plans are to name this RowType (since, CFs are restricted to one Column type)
RowType will only encompass: Super, Standard
What about ColumnFamilyType actually for this one ?
It seems a bit more precise to me and in the code, the function that will
return this enum arealready called getColumnFamilyType or
validateColumnFamily (but just proposing, RowType is shorter, I see
the advantages in that ).
Attaching the patch using the ColumnFamilyType name as it feel more natural to me.
I can switch back to RowType really quickly if there is a consensus for that, so feel free
committed, with a couple fixes where we were comparing an enum instance with .equals("Super").