ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Get All from GlobalCache without specifying any Key info

Post new topic  Reply to topic
 Get All from GlobalCache without specifying any Key info « View previous topic :: View next topic » 
Author Message
alethea
PostPosted: Mon Jul 25, 2016 12:30 pm    Post subject: Get All from GlobalCache without specifying any Key info Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Mon Jul 25, 2016 9:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 26, 2016 4:14 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

smdavies99 wrote:

We gave up with it because it was just too much of a 'faff' to use.


https://www.google.com/search?q=faff&oq=faff&ie=UTF-8
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
stoney
PostPosted: Tue Jul 26, 2016 4:43 am    Post subject: Reply with quote

Centurion

Joined: 03 Apr 2013
Posts: 140

smdavies99 wrote:
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.


Here's the Javadoc for the WXS API that IIB uses under the covers:

http://www.ibm.com/support/knowledgecenter/SSTVLU_8.6.1/com.ibm.websphere.extremescale.javadoc.doc/topics/com/ibm/websphere/objectgrid/ObjectMap.html

Note the lack of a get/getAll() method that doesn't require a key or set of keys.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 26, 2016 4:53 am    Post subject: Re: Get All from GlobalCache without specifying any Key info Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
stoney
PostPosted: Tue Jul 26, 2016 5:02 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Jul 26, 2016 5:23 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
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
View user's profile Send private message Send e-mail
alethea
PostPosted: Wed Jul 27, 2016 8:14 am    Post subject: Reply with quote

Apprentice

Joined: 30 Jul 2007
Posts: 45

Thanks to all for your responses and directions.
Back to top
View user's profile Send private message
anurag.munjal
PostPosted: Mon Jul 03, 2017 12:47 am    Post subject: heyaa Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Mon Jul 03, 2017 4:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

You can use a combination of getNextKey() and getAll(List)
Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
anurag.munjal
PostPosted: Tue Jul 04, 2017 8:28 pm    Post subject: are they even available Reply with quote

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
View user's profile Send private message
mqjeff
PostPosted: Wed Jul 05, 2017 3:45 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Get All from GlobalCache without specifying any Key info
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.