Hi Tommy,
This seems weird. flush() does not do anything. Also, I tried the same
thing you were showing, I can see the value from *store.get("foo")*...
Simply do
private KeyValueStore<String, String> store;
public void init(Config config, TaskContext context) {
this.store = (KeyValueStore<String, String>)
context.getStore("printout-stats");
}
public void process(IncomingMessageEnvelope envelope, MessageCollector
collector, TaskCoordinator coordinator) {
store.put("foo", "bar");
System.out.println(" foo result " + fooResult);
}
Maybe others in the community have better ideas why it happens.
Thanks,
Fang, Yan
[email protected]
+1 (206) 849-4108
On Thu, Jan 8, 2015 at 6:12 PM, Tommy Becker <[email protected]> wrote:
> We are writing some tasks that make use of the RocksDb kv store, and a
> couple of us here have seen the same strange behavior. Essentially, get()
> seems to not return values that were previously put(), until flush() is
> called. But even if flush isn't called, the put values will be returned by
> store.all(). A colleague took a look and saw that
> RocksDbKeyValueStore.flush() doesn't do anything of consequence, but we
> haven't yet looked deeper. To summarize, the behavior seems to be:
>
> store.put("foo", "bar);
> store.get("foo") returns null ??
> store.all() returns an iterator containing ("foo", "bar")
> store.flush();
> store.get("foo") returns "bar" as expected
>
> Is this behavior intended?
>
> ________________________________
>
> This email and any attachments may contain confidential and privileged
> material for the sole use of the intended recipient. Any review, copying,
> or distribution of this email (or any attachments) by others is prohibited.
> If you are not the intended recipient, please contact the sender
> immediately and permanently delete this email and any attachments. No
> employee or agent of TiVo Inc. is authorized to conclude any binding
> agreement on behalf of TiVo Inc. by email. Binding agreements with TiVo
> Inc. may only be made by a signed written agreement.
>