[storm] How can I make my own "store"?

Jason Baker jbaker at zeomega.com
Wed Sep 23 02:10:56 BST 2009


I'm having a bit of a problem.  For some of our data, we need to use bulk
loading (in this case SQL*Loader).  What I'd like to do is come up with some
kind of object that we can drop in instead of the store that will handle the
bulk loading.  That's the easy part.
The hard part is in making storm recognize this new object.  Consider the
following example:

    class A(object):
        a_id = Int(primary=True)

    class B(object):
        b_id = Int(primary=True)
        a_id = Int()
        a = Reference(a_id, A.a_id)

    some_b = store.find(B, ...)
    some_a = A()
    some_b.a = some_a

As I understand it, the last line will add some_a to the store it was pulled
from (although I may have the reference relationship the wrong way around).
 This can have disastrous results when working with SQL*Loader as it could
result in the object getting inserted via the store and getting inserted via
the bulk inserter.

Is there any way to make this work?  I'm guessing that I could make the
object belong to my store if I add it under a "store" key in obj_info.  Is
it worth attempting this, or is there a better way to do this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20090922/192d83a2/attachment-0002.htm 


More information about the storm mailing list