简体   繁体   English

如何遍历KeyValueStore中的所有元素

[英]how to go through all element in KeyValueStore

I have a KeyValueStore of type KeyValueStore>. 我有一个类型为KeyValueStore>的KeyValueStore。 I don't know the range of the keys. 我不知道键的范围。 Is there any way I can iterate through the whole keyvaluestore in samza? 有什么办法可以遍历samza中的整个keyvaluestore? Thanks 谢谢

Sure. 当然。 Use the all() method on the KeyValueStore instance. 在KeyValueStore实例上使用all()方法。 That will return an iterator which you can use to scan the whole store. 这将返回一个迭代器,可用于扫描整个商店。

http://samza.apache.org/learn/documentation/0.12/api/javadocs/org/apache/samza/storage/kv/KeyValueStore.html#all-- http://samza.apache.org/learn/documentation/0.12/api/javadocs/org/apache/samza/storage/kv/KeyValueStore.html#all--

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM