You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by percent620 <pe...@163.com> on 2016/09/08 22:35:33 UTC

how to get all keys and values stored into ignite cache for ignite1.6?

Hello,

I have request to get all the keys and values from igniteCache for ignite
1.6 version?

Can anyone tell me how to do that? thanks!!!



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/how-to-get-all-keys-and-values-stored-into-ignite-cache-for-ignite1-6-tp7612.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: how to get all keys and values stored into ignite cache for ignite1.6?

Posted by Vladislav Pyatkov <vl...@gmail.com>.
Hi,

Yes, you need to use ScanQuery[1] over partition (look at the
setPartition(int)[1] method). The query will be iterate over entry in a
particular partition.

To aware which partitions are storing in local node, use the code snippet:

Affinity aff = ignite.affinity(cacheName);
ClusterNode locNode = ignite.cluster().localNode();
int[] parts = aff.primaryPartitions(locNode);

[1]: https://apacheignite.readme.io/docs/cache-queries#scan-queries
[2]:
https://ignite.apache.org/releases/mobile/org/apache/ignite/cache/query/ScanQuery.html#setPartition(java.lang.Integer)

On Fri, Sep 9, 2016 at 10:15 AM, Yitzhak Molko <yi...@symbolab.com>
wrote:

> Is it possible to iterate through all key values on primary partition of
> the node on this node?
>
> Thanks,
> Yitzhak
>
> On Fri, Sep 9, 2016, 02:28 vkulichenko <va...@gmail.com>
> wrote:
>
>> IgniteCache is Iterable, so you can just iterate through its contents.
>>
>> -Val
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.
>> 70518.x6.nabble.com/how-to-get-all-keys-and-values-
>> stored-into-ignite-cache-for-ignite1-6-tp7612p7615.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
> --
>
> Yitzhak Molko
>



-- 
Vladislav Pyatkov

Re: how to get all keys and values stored into ignite cache for ignite1.6?

Posted by Yitzhak Molko <yi...@symbolab.com>.
Is it possible to iterate through all key values on primary partition of
the node on this node?

Thanks,
Yitzhak

On Fri, Sep 9, 2016, 02:28 vkulichenko <va...@gmail.com>
wrote:

> IgniteCache is Iterable, so you can just iterate through its contents.
>
> -Val
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/how-to-get-all-keys-and-values-stored-into-ignite-cache-for-ignite1-6-tp7612p7615.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>
-- 

Yitzhak Molko

Re: how to get all keys and values stored into ignite cache for ignite1.6?

Posted by vkulichenko <va...@gmail.com>.
IgniteCache is Iterable, so you can just iterate through its contents.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/how-to-get-all-keys-and-values-stored-into-ignite-cache-for-ignite1-6-tp7612p7615.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.