You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by 胡永亮/Bob <hu...@neusoft.com> on 2016/09/23 08:00:46 UTC

How to get all keys of cache most quickly?

Hi, everyone, 

    About this question, I search the mail list and Ignite java doc, but no suitable answer was found.

    My use case is, I have a cache whose structure is IgniteCache<String, Map<Long, List<baselink>>>.
    I want loop all entries to remove some entries in Map value.

    So, first, I want to get all keys, and according to key I will use EntryProcessor to handle every Map value in remote server.

    If I get all keys like the following code snippet:
    IgniteCache<String, Map<Long, List<baselink>>>  mapMatchingData = IgniteManager.getInstance().getMapMatchingData();
    Iterator<Cache.Entry<String, Map<Long, List<baselink>>>>  it1 = mapMatchingData.iterator();
    while(it1.hasNext()){
     Cache.Entry<String, Map<Long, List<baselink>>> cEntry = it1.next();
     String car_key = cEntry.getKey();

    If this, I have a worry: are the Map values got from remote server? If got, I think the performache is bad.

    Wish to get a help, thanks.



Bob


---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s)
is intended only for the use of the intended recipient and may be confidential and/or privileged of
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying
is strictly prohibited, and may be unlawful.If you have received this communication in error,please
immediately notify the sender by return e-mail, and delete the original message and all copies from
your system. Thank you.
---------------------------------------------------------------------------------------------------

Re: How to get all keys of cache most quickly?

Posted by vkulichenko <va...@gmail.com>.
Bob,

See my response here:
http://apache-ignite-users.70518.x6.nabble.com/A-very-slow-code-of-using-entryprocessor-why-td7902.html

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-to-get-all-keys-of-cache-most-quickly-tp7899p7924.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.