Skip to content

Conversation

philip-sterne
Copy link

  • Ability to batch counter increments and decrements. This functions in exactly the same form as table.batch(), except one now calls:
cb = table.counter_batch()
cb.counter_inc('row-key', 'cf1:counter1')
cb.counter_inc('row-key', 'cf1:counter2')
cb.send()

Or alternatively, one can use a context manager:

with table.counter_batch(batch_size=1000) as cb:
    cb.counter_inc('row-key', 'cf1:counter1')
    cb.counter_inc('row-key', 'cf1:counter2')
  • Added reverse table scans:
for key, data in table.scan(reverse=True):
    print key, data

which will return the data in reversed order

@landscape-bot
Copy link

Code Health
Repository health increased by 0.31% when pulling c9048bf on TAKEALOT:master into 9cbd718 on wbolster:master.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.35% when pulling 6663a88 on TAKEALOT:master into 9cbd718 on wbolster:master.

@landscape-bot
Copy link

Code Health
Repository health increased by 0.33% when pulling 2d4ed1f on TAKEALOT:master into 9cbd718 on wbolster:master.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is incorrect. if the (row, column) tuple was already present this count will be wrong. i guess len(self.batch) is a better count ;)

@gabrii
Copy link

gabrii commented Jun 12, 2018

I've solved the merge conflicts and the patch_counter problem, out of the need to use this in pyhton3. Third PR about this feature. Time to merge! :)
#192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants