[storm] Update or add pattern with Storm

Gerdus van Zyl gerdusvanzyl at gmail.com
Fri Oct 10 11:26:06 BST 2008


I currently do this:
store = getStore()
rcount = store.find(customer,customer.lastname==u"Sparrow").count()
exists = (rcount > 0)
print exists

Which is simple as dirt, what code do you use? And why do you say it's not
efficient?

~Gerdus

On Fri, Oct 10, 2008 at 5:58 AM, Justin Warren <daedalus at eigenmagic.com>wrote:

> Hi folks,
>
> I need to implement a pretty common pattern: My code discovers some
> information about the state of the real world, and then needs to compare
> this discovered information with what is stored in the database.
>
> If an object already exists in the database, information about its state
> needs to be updated. If it doesn't exist, it needs to be added.
>
> I have code that works, but it's not efficient. I figure there must be a
> better way.
>
> What is an efficient way of implementing this pattern with Storm?
>
> --
> Justin Warren <daedalus at eigenmagic.com>
>
>
> --
> storm mailing list
> storm at lists.canonical.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/storm
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20081010/14b0a2f3/attachment.htm 


More information about the storm mailing list