You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by Andrew Xor <an...@gmail.com> on 2015/02/09 03:42:42 UTC

Trident State storage

​Hi,

 I've come across a topology that I need to have a persistent state​ which
will be a bit large in size; but for this example let's assume that I have
a simple count scenario. Now If I declare it as static inside the state
class such as:

public class MyState implements State {
    static int count;

    @Override
    public void beginCommit(Lond txid) {;}

    @Override
    public void commit(Long txid) {;}

    /* this method will be called from the BaseStateUpdater */
    public void updateCount() {count++;}
}

Will the updated count be transferred each time it is updated? Also if it
is indeed transferred, then if I have only one worker performing that task
(phint will be 1) will it be transferred again (I assume that it won't but
I just want to be sure)?

Finally (since the documentation is not very clear on that subject) what is
the best way to keep a large matrix or another big blob of data that needs
to be incrementally updated for each batch without paying the huge transfer
cost if you increase the parallelism hint.

Regards,

A.