validate_cql_key() is based on validate_key() from ThriftValidation. I
didn't name it thrift_validation.hh though because it's meant to work
on CQL model, not thrift. For instance, it's using our
schema::partition_key_type, which is not thrift-compatible.
The problem is that while we are converting some code, we don't want
to convert some aspects of it. For example we don't want to implement
indexing supporting yet. To better track those places, we insert a
statement in those places which can be easily tracked down when the
time comes. This patch adds a header where those statements are
grouped.
Alternative is to use comments, but comments are free text so we
can't force common syntax on them.
This model is meant to follow CQL more closely than the model in
Origin. We have direct representations for CQL rows and cells.
We avoid using thrift concepts here. Here's how some of the Origin's
classes map to this:
Mutation -> mutation
ColumnFamily -> partition
CellName -> clustering_key/clustering_prefix and column_id
Cell -> atomic_cell (not for collection types though)
Note about CounterMutation. CounterMutation is for modifying counter
tables. A counter table can only have one column, the counter
value. In Origin CounterMutation is a subclass of IMutation which
represents mutations on counter tables. The only field it adds is
consistency level. I think we don't need to have a separate class for
this, at least in the generic code, which simplifies things. We can
check whether the table is a counter table from the schema and we can
pass the consistency level from QueryOptions during serialization.
All usages I could find which deserialize value are
non-polymorphic. So there is no need to use boost::any() indirection
and polymorphic calls in most, if not all, cases.
Let the type class define deserialize_value/serialize_value
non-polymorphic members which work direclty on "value_type" and not
boost::any.
The way periodic timers are rearmed during timer completion causes
timer_settime() to be called twice for each periodic timer completion:
once during rearm and second time by enable_fn(). Fix it by providing
another function that only re-adds timer into timers container, but do
not call timer_settime().
Follow RFC793 section "SEGMENT ARRIVES".
There are 4 major cases:
1) If the state is CLOSED
2) If the state is LISTEN
3) If the state is SYN-SENT
4) If the state is other state
Note:
- This change is significant (more than 10 pages in RFC793 describing
this segment arrival handling).
- More test is needed. Good news is, so far, tcp_server(ping/txtx/rxrx)
tests and httpd work fine.