Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 2.0 beta 2
    • Component/s: API
    • Labels:
      None

      Description

      I see a RangeTomstone test and methods in row mutation. However thrift's validate method throws exception when Deletion's have a slice predicate.

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Patch Available Patch Available
          21d 3h 18m 2 Edward Capriolo 02/May/13 16:23
          Patch Available Patch Available Open Open
          22d 3h 52m 2 Jonathan Ellis 21/May/13 04:51
          Open Open Resolved Resolved
          54d 18h 9m 1 Aleksey Yeschenko 14/Jul/13 23:01
          Aleksey Yeschenko made changes -
          Link This issue is related to CASSANDRA-7733 [ CASSANDRA-7733 ]
          Aleksey Yeschenko made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.0 beta 2 [ 12324760 ]
          Resolution Fixed [ 1 ]
          Hide
          Aleksey Yeschenko added a comment -

          Committed in b60f63d5438be5ea3f564e7d00e32d1fdb4001de.

          Show
          Aleksey Yeschenko added a comment - Committed in b60f63d5438be5ea3f564e7d00e32d1fdb4001de.
          Jonathan Ellis made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Hide
          Aleksey Yeschenko added a comment -

          You stack trace suggests that you haven't actually rebased against recent-ish trunk, as I recommened in the last comment. You should see no errors once you rebase, out of the box.

          Show
          Aleksey Yeschenko added a comment - You stack trace suggests that you haven't actually rebased against recent-ish trunk, as I recommened in the last comment. You should see no errors once you rebase, out of the box.
          Hide
          Edward Capriolo added a comment -

          I get it that all the other thrifts tests are written in python. but... The instructions here are not right.

          http://wiki.apache.org/cassandra/HowToContribute

          And I have installed all this python stuff and the tests are not working, out of the box.

          EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
          ======================================================================
          ERROR: system.test_thrift_server.TestMutations.test_bad_batch_calls
          ----------------------------------------------------------------------
          Traceback (most recent call last):
            File "/usr/lib/python2.7/site-packages/nose/case.py", line 133, in run
              self.runTest(result)
            File "/usr/lib/python2.7/site-packages/nose/case.py", line 151, in runTest
              test(result)
            File "/usr/lib64/python2.7/unittest/case.py", line 429, in __call__
              return self.run(*args, **kwds)
            File "/usr/lib64/python2.7/unittest/case.py", line 362, in run
              result.addError(self, sys.exc_info())
            File "/usr/lib/python2.7/site-packages/nose/proxy.py", line 131, in addError
              formatted = plugins.formatError(self.test, err)
            File "/usr/lib/python2.7/site-packages/nose/plugins/manager.py", line 94, in __call__
              return self.call(*arg, **kw)
            File "/usr/lib/python2.7/site-packages/nose/plugins/manager.py", line 136, in chain
              result = meth(*arg, **kw)
            File "/usr/lib/python2.7/site-packages/nose/plugins/capture.py", line 81, in formatError
              return (ec, self.addCaptureToErr(ev, output), tb)
            File "/usr/lib/python2.7/site-packages/nose/plugins/capture.py", line 106, in addCaptureToErr
              output, ln(u'>> end captured stdout <<')])
          TypeError: sequence item 0: expected string or Unicode, exceptions.SystemExit found
          
          

          This is what I am trying to add.

          [edward@jackintosh system]$ diff test_thrift_server.py /tmp/test_thrift_server.py 
          221a222,238
          >     def test_range_tombstone(self):
          >         _set_keyspace('Keyspace1')
          >         client.insert('keyrange1', ColumnParent('Standard1'), Column('a', 'a', 0), ConsistencyLevel.ONE)
          >         client.insert('keyrange1', ColumnParent('Standard1'), Column('b', 'b', 0), ConsistencyLevel.ONE)
          >         client.insert('keyrange1', ColumnParent('Standard1'), Column('c', 'c', 0), ConsistencyLevel.ONE)
          >         client.insert('keyrange1', ColumnParent('Standard1'), Column('d', 'd', 0), ConsistencyLevel.ONE)
          >         update_map = {'keyrange1': {'Standard1': [
          >             Mutation(deletion=Deletion(predicate=SlicePredicate(slice_range=SliceRange('b', 'c', False, 1000)))),
          >             ]}}
          >         client.batch_mutate(update_map, ConsistencyLevel.ONE)
          >         p = SlicePredicate(slice_range=SliceRange('', '', False, 10))
          >         column_parent = ColumnParent('Standard1')
          >         slice = [result.column
          >                  for result in client.get_slice('keyrange1', column_parent, p, ConsistencyLevel.ONE)]
          >         assert slice == [Column('a', 'a', 0), Column('c', 'c', 0), Column('d', 'd', 0)], slice
          > 
          > 
          

          I'm not a python developer.
          The python steps in the documentation are not correct.
          I have other stuff to do in life, then struggle with python.

          Q. Is it really necessary that we test a Java project in using python? Don't the current Java tests work and prove the feature works?

          Show
          Edward Capriolo added a comment - I get it that all the other thrifts tests are written in python. but... The instructions here are not right. http://wiki.apache.org/cassandra/HowToContribute And I have installed all this python stuff and the tests are not working, out of the box. EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE ====================================================================== ERROR: system.test_thrift_server.TestMutations.test_bad_batch_calls ---------------------------------------------------------------------- Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/nose/case.py", line 133, in run self.runTest(result) File "/usr/lib/python2.7/site-packages/nose/case.py", line 151, in runTest test(result) File "/usr/lib64/python2.7/unittest/case.py", line 429, in __call__ return self.run(*args, **kwds) File "/usr/lib64/python2.7/unittest/case.py", line 362, in run result.addError(self, sys.exc_info()) File "/usr/lib/python2.7/site-packages/nose/proxy.py", line 131, in addError formatted = plugins.formatError(self.test, err) File "/usr/lib/python2.7/site-packages/nose/plugins/manager.py", line 94, in __call__ return self.call(*arg, **kw) File "/usr/lib/python2.7/site-packages/nose/plugins/manager.py", line 136, in chain result = meth(*arg, **kw) File "/usr/lib/python2.7/site-packages/nose/plugins/capture.py", line 81, in formatError return (ec, self.addCaptureToErr(ev, output), tb) File "/usr/lib/python2.7/site-packages/nose/plugins/capture.py", line 106, in addCaptureToErr output, ln(u'>> end captured stdout <<')]) TypeError: sequence item 0: expected string or Unicode, exceptions.SystemExit found This is what I am trying to add. [edward@jackintosh system]$ diff test_thrift_server.py /tmp/test_thrift_server.py 221a222,238 > def test_range_tombstone(self): > _set_keyspace('Keyspace1') > client.insert('keyrange1', ColumnParent('Standard1'), Column('a', 'a', 0), ConsistencyLevel.ONE) > client.insert('keyrange1', ColumnParent('Standard1'), Column('b', 'b', 0), ConsistencyLevel.ONE) > client.insert('keyrange1', ColumnParent('Standard1'), Column('c', 'c', 0), ConsistencyLevel.ONE) > client.insert('keyrange1', ColumnParent('Standard1'), Column('d', 'd', 0), ConsistencyLevel.ONE) > update_map = {'keyrange1': {'Standard1': [ > Mutation(deletion=Deletion(predicate=SlicePredicate(slice_range=SliceRange('b', 'c', False, 1000)))), > ]}} > client.batch_mutate(update_map, ConsistencyLevel.ONE) > p = SlicePredicate(slice_range=SliceRange('', '', False, 10)) > column_parent = ColumnParent('Standard1') > slice = [result.column > for result in client.get_slice('keyrange1', column_parent, p, ConsistencyLevel.ONE)] > assert slice == [Column('a', 'a', 0), Column('c', 'c', 0), Column('d', 'd', 0)], slice > > I'm not a python developer. The python steps in the documentation are not correct. I have other stuff to do in life, then struggle with python. Q. Is it really necessary that we test a Java project in using python? Don't the current Java tests work and prove the feature works?
          Hide
          Aleksey Yeschenko added a comment -

          Please, move the test to test/system/test_thrift_server.py, where all the thrift tests belong (https://github.com/apache/cassandra/blob/trunk/test/system/test_thrift_server.py).

          You'll need to run 'ant gen-thrift-py' first in order to be able to run the them. And you might want to rebase against the latest trunk first, too.

          Show
          Aleksey Yeschenko added a comment - Please, move the test to test/system/test_thrift_server.py, where all the thrift tests belong ( https://github.com/apache/cassandra/blob/trunk/test/system/test_thrift_server.py ). You'll need to run 'ant gen-thrift-py' first in order to be able to run the them. And you might want to rebase against the latest trunk first, too.
          Edward Capriolo made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Hide
          Edward Capriolo added a comment -

          https://github.com/edwardcapriolo/cassandra/tree/range-tombstone-thrift supports and tests both range tombstones for thrift using standard column families and super column families.

          Show
          Edward Capriolo added a comment - https://github.com/edwardcapriolo/cassandra/tree/range-tombstone-thrift supports and tests both range tombstones for thrift using standard column families and super column families.
          Hide
          Aleksey Yeschenko added a comment -

          Or test/system/test_thrift_server.py

          Show
          Aleksey Yeschenko added a comment - Or test/system/test_thrift_server.py
          Hide
          Aleksey Yeschenko added a comment -

          cassandra-dtest is more of a personal preference. You could place this test into CassandraServerTest instead.

          Show
          Aleksey Yeschenko added a comment - cassandra-dtest is more of a personal preference. You could place this test into CassandraServerTest instead.
          Hide
          Edward Capriolo added a comment -

          As for not caring about thrift. ROFL don't get me started.

          Show
          Edward Capriolo added a comment - As for not caring about thrift. ROFL don't get me started.
          Hide
          Edward Capriolo added a comment -

          Right, the first test was more documentation. It shows that we no longer through an exception on this condition, but it does not have a great need. As for cassandra-dtest. I do not mind moving the test there, I assumed doing the change and providing in-project tests was the way to go??? I will add the super column support. I was not sure if that was handled by the first case.

          Show
          Edward Capriolo added a comment - Right, the first test was more documentation. It shows that we no longer through an exception on this condition, but it does not have a great need. As for cassandra-dtest. I do not mind moving the test there, I assumed doing the change and providing in-project tests was the way to go??? I will add the super column support. I was not sure if that was handled by the first case.
          Aleksey Yeschenko made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Hide
          Aleksey Yeschenko added a comment -

          I don't care deeply about thrift or supercolumns, but, if we are going to add this, this should be done right: when super_column is set, slice range should refer to the subcolumns - it's trivial to implement with composites.

          The test in the first commit is sort of useless. As for the test from the second commit - I'd rather see it in cassandra-dtest. Also should add a test for non-null super_column+slice range.

          Show
          Aleksey Yeschenko added a comment - I don't care deeply about thrift or supercolumns, but, if we are going to add this, this should be done right: when super_column is set, slice range should refer to the subcolumns - it's trivial to implement with composites. The test in the first commit is sort of useless. As for the test from the second commit - I'd rather see it in cassandra-dtest. Also should add a test for non-null super_column+slice range.
          Jonathan Ellis made changes -
          Reviewer iamaleksey
          Edward Capriolo made changes -
          Field Original Value New Value
          Status Open [ 1 ] Patch Available [ 10002 ]
          Hide
          Edward Capriolo added a comment -

          This is working. Will tentatively submit-for-review for guidance on what comes next.
          https://github.com/edwardcapriolo/cassandra/commit/175221f26143eb4135d8a80654aca57697a3a9c4

          Show
          Edward Capriolo added a comment - This is working. Will tentatively submit-for-review for guidance on what comes next. https://github.com/edwardcapriolo/cassandra/commit/175221f26143eb4135d8a80654aca57697a3a9c4
          Hide
          Edward Capriolo added a comment -

          https://github.com/edwardcapriolo/cassandra/commit/bcd2954380ad1cbcb45d99b1dd7b03eabadb6b94 , removed the validation exception, wrote a test to confirm the data can be passed now.

          Going to look around and see if some better end to end tests can be written.

          Show
          Edward Capriolo added a comment - https://github.com/edwardcapriolo/cassandra/commit/bcd2954380ad1cbcb45d99b1dd7b03eabadb6b94 , removed the validation exception, wrote a test to confirm the data can be passed now. Going to look around and see if some better end to end tests can be written.
          Edward Capriolo created issue -

            People

            • Assignee:
              Edward Capriolo
              Reporter:
              Edward Capriolo
              Reviewer:
              Aleksey Yeschenko
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development