cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward Capriolo (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-6147) Allow Thrift opt-in to server-side timestamps
Date Thu, 06 Mar 2014 01:41:43 GMT


Edward Capriolo commented on CASSANDRA-6147:

I was considering adding this feature to deletes as well because the same logic holds. Here
is the problem:

struct Deletion {
    1: optional i64 timestamp,
    2: optional binary super_column,
    3: optional SlicePredicate predicate,

  void remove(1:required binary key,
              2:required ColumnPath column_path,
              3:required i64 timestamp,
              4:ConsistencyLevel consistency_level=ConsistencyLevel.ONE)
       throws (1:InvalidRequestException ire, 2:UnavailableException ue, 3:TimedOutException

        else if (!del.isSetTimestamp())
            throw new org.apache.cassandra.exceptions.InvalidRequestException("Deletion timestamp
is not optional for non commutative column family " + metadata.cfName);

Because remove requires a timestamp and deletion does not. We can not remove that. What we
can do is set it to optional, throw an exception server side and them maybe later (1 year)
truly allow it to be optional and not throw the exception.

I update my branch with Nate's change. I also modified the interface file to document the

> Allow Thrift opt-in to server-side timestamps
> ---------------------------------------------
>                 Key: CASSANDRA-6147
>                 URL:
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: API
>            Reporter: Edward Capriolo
>            Assignee: Edward Capriolo
>            Priority: Minor
>             Fix For: 2.1 beta2
> Thrift users are still forced to generate timestamps on the client side. Currently the
way the thrift bindings are generated users are forced to supply timestamps. There are two
solutions I see.
> * -1 as timestamp means "generate on the server side"
> This is a breaking change, for those using -1 as a timestamp (which should effectively
be no one.
> * Prepare yourself....
> Our thrift signatures are wrong, you can't overload methods in thrift
> thrift.get(byte [], byte[], ts) 
> should REALLY be changed to 
> GetRequest g =  new GetRequest()
> g.setName()
> g.setValue()
> g.setTs() ///optional 
> thrift. get( g )
> I know no one is going to want to make this change because thrift is quasi/dead but it
would allow us to evolve thrift in a meaningful way. We could simple add these new methods
under different names as well.

This message was sent by Atlassian JIRA

View raw message