Author |
Message
|
alethea |
Posted: Mon Jul 25, 2016 12:30 pm Post subject: Get All from GlobalCache without specifying any Key info |
|
|
Apprentice
Joined: 30 Jul 2007 Posts: 45
|
Hi All,
I created MBGlobalMap Object to put and get GlobalCache Values. To get a specific CacheValue I am passing a key one at time. All this is working fine.
My question is, how can I get all the key value pairs currently available in GlobalCache (without passing any Key information to Get).
Thanks and Regards |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Jul 25, 2016 9:32 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
From the POC that I did with IIB V9 you could not do what you wanted. This seemed to be a deliberate limitation of the API available from IIB without going for the full Global Cache (and paying the extra license). I might be wrong though.
We gave up with it because it was just too much of a 'faff' to use. Using the global cache didn't give us any worthwhile performance increase that would compensate for the extra complexity of maintaining the Cache subsystem. YMMV (and only proper testing will give you the answer that is appropriate for your environment)
Things may have changed with IIB10 but I don't know. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 26, 2016 4:14 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
|
Back to top |
|
 |
stoney |
Posted: Tue Jul 26, 2016 4:43 am Post subject: |
|
|
Centurion
Joined: 03 Apr 2013 Posts: 140
|
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 26, 2016 4:53 am Post subject: Re: Get All from GlobalCache without specifying any Key info |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
alethea wrote: |
My question is, how can I get all the key value pairs currently available in GlobalCache (without passing any Key information to Get).
Thanks and Regards |
Well you should have dug a little bit deeper:
See chaining method calls:
Code: |
getJavaMap().keySet() |
returns the keyset for the Map.
With the key set you should be able to address all entries in the map...
Now this may make little sense as there are a lot of other methods that may be more appropriate, like checking if the map contains an object matching a specific key...
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
stoney |
Posted: Tue Jul 26, 2016 5:02 am Post subject: |
|
|
Centurion
Joined: 03 Apr 2013 Posts: 140
|
Do you really think we didn't try that already?
Code: |
2016-07-26 14:00:01.507 194 java.lang.UnsupportedOperationException: This method is not supported
2016-07-26 14:00:01.507 194 at com.ibm.ws.objectgrid.JavaMapImpl.keySet(JavaMapImpl.java:278) |
|
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 26, 2016 5:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
stoney wrote: |
Do you really think we didn't try that already?
Code: |
2016-07-26 14:00:01.507 194 java.lang.UnsupportedOperationException: This method is not supported
2016-07-26 14:00:01.507 194 at com.ibm.ws.objectgrid.JavaMapImpl.keySet(JavaMapImpl.java:278) |
|
Then it's PMR time because the Cache API says:
Quote: |
getJavaMap(): Returns an implementation of java.util.Map that is backed by this ObjectMap |
Now if you cannot use the keySet() method (part of java.util.Map) the statement above is not true..., right?
Just out of curiosity, is the entrySet() method supported??  _________________ MQ & Broker admin |
|
Back to top |
|
 |
alethea |
Posted: Wed Jul 27, 2016 8:14 am Post subject: |
|
|
Apprentice
Joined: 30 Jul 2007 Posts: 45
|
Thanks to all for your responses and directions.
 |
|
Back to top |
|
 |
anurag.munjal |
Posted: Mon Jul 03, 2017 12:47 am Post subject: heyaa |
|
|
 Voyager
Joined: 08 Apr 2012 Posts: 97
|
Hey folks,
am struggling with something similar!
unable to see all entries in WXS map.
any outcomes of this thread that can be useful for me? Thanks _________________ - Anurag
------------------------
Be Simple, Be Happy |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jul 03, 2017 4:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You can use a combination of getNextKey() and getAll(List)
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
anurag.munjal |
Posted: Tue Jul 04, 2017 8:28 pm Post subject: are they even available |
|
|
 Voyager
Joined: 08 Apr 2012 Posts: 97
|
Hello, thanks much for your response.
Are these java functions even available?
getNextKey() and getAll(List)
i tried both of them but dont see them in the JCN by default. do we need to add some external jar or some import or something?  _________________ - Anurag
------------------------
Be Simple, Be Happy |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jul 05, 2017 3:45 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you don't see them in the IIB javadoc, then why would they be available using the IIB functions?
Why are you trying to review the entire contents of the global cache? It reallyd doesn't seem like a useful thing to me.
Particularly since you can put data into the cache as you add and remove records, that can answer questions you need.
If you are, somehow, trying to produce a tool that shows the entire contents of the global cache, then you shouldn't use an IIB flow to do that. It seems like a very good way to crash an IIB runtime (server? node?) because of memory issues.
If you use a standalone program, you can probably link directly to the extremeScale client libraries, rather than using the IIB libraries. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
|