-
30. Re: remote cache entrySet stream throws unsupported exception
william.burns Jun 8, 2017 1:13 PM (in response to sea_shankar)Okay I talked with a few other guys and unfortunately compatibility mode won't work without creating a new module that has the class file in it and modifying the core module in ISPN to depend on that. This is not an acceptable solution. There may be an alternative way, but we are looking at some things on our side. I will update you as soon as I know if it is works or not
-
31. Re: remote cache entrySet stream throws unsupported exception
sea_shankar Jun 8, 2017 12:13 PM (in response to william.burns)Thanks a lot, appreciate it!
-
32. Re: remote cache entrySet stream throws unsupported exception
william.burns Jun 8, 2017 1:39 PM (in response to sea_shankar)I am saddened to say that the only way currently to get this to work with a user supplied class is by doing the module approach I mentioned previously. Unfortunately this is really not an acceptable usage for an actual installation. anistor was actually working on a proposal of changes to allow this to work in the ways I had guided you. Once again I am terribly sorry that this doesn't work the way I highlighted, as it should work You may want to watch out for a discussion on our dev mailing list https://lists.jboss.org/mailman/listinfo/infinispan-dev as we discuss how this should be implemented properly.
My guess is that this might work in 9.1 (expected currently by the end of the month), but I can't promise that.
For the current time frame though you can only use primitive wrappers, byte[] and String for values in a ServerTask. I don't know if you can tweak your code to do that? Luckily in your case it would just need to be the key as your value isn't even queried to perform this operation.
-
33. Re: remote cache entrySet stream throws unsupported exception
sea_shankar Jun 8, 2017 1:54 PM (in response to william.burns)Ahhh that's unfortunate. For the time being I should be able to do a .toString on the SimpleKey object and store that as they key. Is there a task created for this which I can look at to see when it's completed? I can revisit this later and change it, once it's released.
Thanks a lot for all your help!
-
34. Re: remote cache entrySet stream throws unsupported exception
sea_shankar Jun 8, 2017 1:59 PM (in response to william.burns)Btw, in order for me use getCacheManager().getCache("cache") in server task, does this mean including the infinispan-embedded dependency and create a CacheManager in the server task? Currently I only have a RemoteCacheManager in my configs.
-
35. Re: remote cache entrySet stream throws unsupported exception
william.burns Jun 8, 2017 2:11 PM (in response to sea_shankar)In regards to what to follow, there is no formal JIRA about this. [ISPN-7710] CompatibilityProtoStreamMarshaller can't be set in server - JBoss Issue Tracker is closely related though.
In regards to dependency all you should need is a dependency on the tasks-api artifact as that already has a dependency on core. In your case the ServerTask doesn't use a RemoteCacheManager or RemoteCache as it is ran directly in the server and thus only deals with CacheManager and Cache instances directly.
-
36. Re: remote cache entrySet stream throws unsupported exception
sea_shankar Jun 8, 2017 4:56 PM (in response to william.burns)Yup understood it deals with CacheManger. When I put the dependency for tasks and tasks-api, and I try to use CacheManger like so:
CacheManager cm = new CacheManger()
Cache<Object,Object> = cm.getCache("hello").
CacheManager is not recognized.
Just add tasks-api to pom.xml right?
-
37. Re: remote cache entrySet stream throws unsupported exception
sea_shankar Jun 8, 2017 9:31 PM (in response to william.burns)Ahhh nvm, I updated to 9.1.0 Alpha 1 and that looks like cache manager is has been added to TaskContext. Everything works now, thanks for all you help! Cheers!
-
38. Re: remote cache entrySet stream throws unsupported exception
william.burns Jun 9, 2017 10:44 AM (in response to sea_shankar)Ah I didn't realize it was only in 9.0 and newer, sorry about that. Awesome news that it is working now for you though!
-
39. Re: remote cache entrySet stream throws unsupported exception
galder.zamarreno Jun 14, 2017 11:27 AM (in response to sea_shankar)I think what you're looking for is what I did in this repository:
https://github.com/infinispan-demos/swiss-transport-datagrid
In that repository, I use remote server tasks to do distributed processing.
The task itself is DelayRatioTask but to get it working, there's a few things that you need to do:
1. As you've seen, it currently requires compatibility mode to be enabled. In my case, I provided converted the entities into protostream entities via a proto file.
2. You need to get the server to use the compatibility protostream marshaller for compatibility, but this requires tweaking the server configuration. See bottom of README.
3. Adding proto files requires touching a cache that can't really be accessed easily if accessed remotely (not in localhost), hence you need a custom build. My branch here does this and also adds changes in 2.
4. You need to register the proto files in the client (easy) and in the server (not so easy). See this extra server task.
5. That extra server task acts as a way to deploy the domain objects so that when the compatibility marshaller kicks in, it can find the classes.
A lot to chew, but I'd suggest for now that you try to get the analytics demo in that repo running. There's a detailed blog post too if you want do things step by step.
ISPN-7710, ISPN-7711 and ISPN-7811 are JIRAs we've created to improve all of this.
-
40. Re: remote cache entrySet stream throws unsupported exception
sea_shankar Jun 14, 2017 11:47 AM (in response to galder.zamarreno)Hi Galder, thanks for the response! For the time being I have it working with String key and not doing any complicated query. I have book marked your project in the event we need to more complex server tasks.
-
41. Re: remote cache entrySet stream throws unsupported exception
galder.zamarreno Jun 15, 2017 4:18 AM (in response to sea_shankar)Yeah, sticking to primary types avoid all these problems. While I was working on the demo above, I decided to try using POJOs on purpouse which uncovered a few issues. I've just sent a few pull requests to make sure the demo can run with a standard server implementation, so hopefully it'll be much easier to use with 9.0.2.
Thanks a lot for trying out server tasks! They are quite useful actually, but yeah, we need to improve their documentation. Once they can run out of the box fine, even with POJOs, I'll add some documentation.
-
42. Re: remote cache entrySet stream throws unsupported exception
galder.zamarreno Jul 6, 2017 4:30 AM (in response to galder.zamarreno)This demo does no longer require a custom Infinispan build. It now works with Infinispan 9.0.3.Final. More info in this blog post.