Executing server tasks that contain POJOs
by Galder Zamarreño
Hi all,
For a demo I'm giving next week, I'd like to show how to use distributed streams via a remote server task. All server tasks that we have in testsuite rely on primitives but in my case I wanted to use POJOs.
To do that, I needed to get compatibility mode working in such way that those POJOs could be unmarshalled for the server task. Since in another demo I'm showing Protostream based POJOs, I thought I'd try to use that as mechanism to unmarshall POJOs server side.
We have a test for such scenario [1], but the reality (running on a proper server) is anything that simple. Here's a list of things I've found out while creating a WordCount example that relies on a POJO:
1. Out of the box, it's impossible to set compatibility marshaller to org.infinispan.query.remote.CompatibilityProtoStreamMarshaller [1] because "org.infinispan.main" classloader can't access that class. I worked around that by tweaking the module.xml to have an optional dependency to "org.infinispan.remote-query.server" module.
2. After doing that, I had to register the protofile and associated classes remotely in the server. Again, there's no out of the box mechanism for that, so I created a remote server task that would do that [3].
3. Finally, with all that in place, I was able to complete the WordCount test [4] with a final caveat: the return of the word count, and words protofile registration, tasks return objects that are not marshalled by the compatibility marshaller, so I had to make sure that the remote cache manager used for those tasks uses the default marshaller.
Clearly we need to improve on this, and we have plans to address these issues (with new upcoming transcoding capabilities), but I thought it'd be worth mentioning the problems found in case anyone else encounters them before transcoding is in place.
Cheers,
[1] https://github.com/galderz/datagrid-patterns/blob/master/server-config/do...
[2] https://github.com/galderz/datagrid-patterns/blob/master/server-config/or...
[3] https://github.com/galderz/datagrid-patterns/blob/master/analytics-stream...
[4] https://github.com/galderz/datagrid-patterns/blob/master/analytics-stream...
--
Galder Zamarreño
Infinispan, Red Hat
7 years, 9 months
JDK 9 Developer Preview is now available on java.net
by Rory O'Donnell
Hi Galder,
*JDK 9 Developer Preview is now available on java.net [1]
*
Developer Preview milestone: - A reasonably stable build suitable for
broad testing by the developer community is available.
JDK 9 Builds 163 and higher include all planned features.
*Attention annotation processing users and authors - * Request for
feedback on annotation processing API changes made in JDK 9.
As has been done previously during Java SE 7 and Java SE 8, the JSR 269
annotation processing API is undergoing a maintenance review (MR) as
part of Java SE 9. Details of the changes in JDK 9 Early Access build
163 & build 164 available here [2]
Please report experiences running processors under JDK 9 and feedback on
the API changes to the compiler-dev mailing list.
(If you haven’t already subscribed to that list then please do so first,
otherwise your message will be discarded as spam.)
Rgds, Rory
[1] https://jdk9.java.net/download/
[2]
http://mail.openjdk.java.net/pipermail/compiler-dev/2017-April/010896.html
--
Rgds,Rory O'Donnell
Quality Engineering Manager
7 years, 9 months
Proto file for indexed and non-indexed use case?
by Galder Zamarreño
Hi Adrian,
I had a question regarding proto files. I have a single domain of objects that I want to use for two different use cases.
In the first use case, I want the proto files to be indexed so I define the comments and related @Indexed/@Field...etc annotations.
In the second use case, I'm merely using proto files as way to achieve compatibility mode, and I don't want any indexing to be done at all (cache is distributed with only compatibility and protostream marshaller enabled).
Do I need a separate .proto file for this second use case where I remove the commented sections that enable indexing? Or can I use the one for the first use case? I really want to avoid any indexing happening in the second use case since it'd slow down things for no reason.
Cheers,
--
Galder Zamarreño
Infinispan, Red Hat
7 years, 9 months
My Weekly report
by Tristan Tarrant
I won't be able to attend today's meeting, so here's my summary / plan:
- ISPN-7683 unregister the topology cache on Hot Rod server stop
- ISPN-7678 prevent endpoint restart on default cache reconfiguration
- still some snags due to the Hot Rod server wanting to prestart
caches, which I want to remove
- Did the 9.0 release
- Updated the embedded tutorial
- Made some fixes to the website (roadmap, features, etc)
- Some security work
- Hot Rod authn by default (Digest)
- generate the certificate chains on the fly for the testsuite to
avoid cert rot and issues with alternate JDKs
- Initial design for fine-grained security, will share soon
- Resumed work on the threadlocal-less secure cache for better server
performance
- I also need to introduce "identity-shipping", so that running
streams in a secure context will apply the same identity across all nodes.
--
Tristan Tarrant
Infinispan Lead
JBoss, a division of Red Hat
7 years, 9 months