[
https://issues.apache.org/jira/browse/CASSANDRA-6147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13924465#comment-13924465
]
Edward Capriolo commented on CASSANDRA-6147:
--------------------------------------------
This won't work ;( So only insert can have auto-timestamps.
{quote}
+ def test_cf_remove_optional(self):
+ _set_keyspace('Keyspace1')
+ _insert_simple()
+ client.remove(key='key1', column_path=ColumnPath('Standard1',
column='c1'), consistency_level=ConsistencyLevel.ONE)
+ _expect_missing(lambda: client.get('key1', ColumnPath('Standard1',
column='c1'), ConsistencyLevel.ONE))
+
{quote}
{quote}
gen-thrift-py:
[echo] Generating Thrift Python code from
/home/edward/Documents/java/cassandra/interface/cassandra.thrift...
[exec]
[WARNING:/home/edward/Documents/java/cassandra/interface/cassandra.thrift:701]
optional keyword is ignored in argument lists.
[exec]
[exec]
[WARNING:/home/edward/Documents/java/cassandra/interface/cassandra.thrift:701]
optional keyword is ignored in argument lists.
[exec]
BUILD SUCCESSFUL
Total time: 1 second
[edward@jackintosh cassandra]$ PYTHONPATH=test nosetests
--tests=system.test_thrift_server:TestMutations.test_cf_remove_optional
E
======================================================================
ERROR: system.test_thrift_server.TestMutations.test_cf_remove_optional
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File
"/home/edward/Documents/java/cassandra/test/system/test_thrift_server.py", line
887, in test_cf_remove_optional
client.remove(key='key1', column_path=ColumnPath('Standard1', column='c1'),
consistency_level=ConsistencyLevel.ONE)
TypeError: remove() takes exactly 5 arguments (4 given)
{quote}
I am not sure if there is a language that can benefit from optional, java can't
and python cant.
> Allow Thrift opt-in to server-side timestamps
> ---------------------------------------------
>
> Key: CASSANDRA-6147
> URL: https://issues.apache.org/jira/browse/CASSANDRA-6147
> 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
(v6.2#6252)