Monday, 05 March 2018
A SWIG based framework to build Hotrod client prototype in your preferred language
If your are working on a non Java/C++/C#/JS application and you need to interact with Infinispan via Hotrod you may be interested in the idea behind the HotSwig[1] project.
Hotswig proposes a framework to build Hotrod client prototypes quickly and for a generic SWIG[2] supported language. As people familiar with C++ and C# Infinispan native clients know, SWIG plays a role in both the projects:
-
is used to build the base of the C# client wrapping the C++ core with a C# layer;
-
is used in the C project to run (part of) the Java test suite against the client, in this way: a Java wrapper is built via SWIG to make the C client looks like its Java big brother so it can be tested with the Java test suite.
The main goal was to produce for a specific language an almost complete client reusing the C++ core features and the following workflow has been setup to do that:
-
the whole C interface is processed by SWIG. The resulting wrapper exposes almost all the C functions;
-
a user friendly adaptation layer is build on top of the SWIG result.
This approach doesn’t work for the HotSwig goal, mainly because the effort need by the second step is usually not-negligible and prevents the rapid development of prototype in a generic language.
In the HotSwig approach, this limitation is removed moving the adaptation layer from the target language to the C++ side and then letting SWIG generate a ready to use client prototype. So the HotSwig workflow is the following:
-
build an adaptation facade around the C core to make it SWIG friendly (do the adaptation work once for all on the C side);
-
explicitly define what we want in the produced SWIG wrapper (keep things simple excluding everything by default);
-
run SWIG to produce the client.
At the moment HotSwig is just a proof of concept, but you can try to run it and produce a ready to work Infinispan client for the language you need. Examples are already provided for python, ruby and Octave, but HotSwig should work with all the SWIG supported languages. If you get it to run in your preferred programming language, please share your experience with us.
I’ve listed here[3] some tasks for the roadmap, with the idea to test the flexibility of the framework trying to extend it in different directions. Maybe the idea is good and it can grow up from a PoC to something that can really help devs. You can add you ideas of course.
So if you need to do math against your Infinispan data set why don’t you try the Octave client? Or maybe you want to do analytics with R, or presentation with PHP. Or you just like parenthesis and you want to use Lisp. Or you’re working for the Klingon empire and you must use ylDoghQo'[4]… well ok just joking now…
Thanks for reading!
Cheers The Infinispan Team
Tags: hotrod ruby cpp-client python
Monday, 29 May 2017
Hotrod clients C++/C# 8.1.1.Final released!
Dear Infinispanners,
we’re pleased to announce that 8.1.1.Final release for C++/C# clients is out!
Check the release notes and browse the source code, effort this time has been put in reducing code complexity.
This is the first release built by our new CI Jenkins environment, this is supposed to not affect the binaries but if you feel that something has gone wrong please fill a jira issue.
Enjoy and thanks for reading!
The Infinispan Team
Tags: c++ release minor release final cpp-client dotnet-client c#
Wednesday, 11 January 2017
Near Cache for native C++/C# Client example
Dear Readers,
as mentioned in our previous post about the new C++/C# release 8.1.0.Beta1, clients are now equipped with near cache support.
The near cache is an additional cache level that keeps the most recently used cache entries in an "in memory" data structure. Near cached objects are synchronized with the remote server value in the background and can be get as fast as a map[] operation.
So, your client tends to periodically focus the operations on a subset of your entries? This feature could be of help: it’s easy to use, just enable it and you’ll have near cache seamless under the wood.
A C++ example of a cache with near cache configuration
The last line does the magic, the INVALIDATED mode is the active mode for the near cache (default mode is DISABLED which means no near cache, see Java docs), maxEntries is the maximum number of entries that can be stored nearly. If the near cache is full the oldest entry will be evicted. Set maxEntries=0 for unbounded cache (do you have enough memory?) Now a full example of application that just does some gets and puts and counts how many of them are served remote and how many are served nearly. As you can see the cache object is an instance of the "well known" RemoteCache class
Entries values in the near cache are kept aligned with the remote cache state via the events subsystem: if something changes in the server, an update event (modified, expired, removed) is sent to the client that updates the cache accordingly.
By the way: do you know that C++/C# clients can subscribe listener to events? In the next "native" post we will see how.
Cheers! and thank you for reading.
Tags: c++ hotrod near caching 8.1.0 cpp-client dotnet-client c#
Wednesday, 04 January 2017
Hotrod clients C++/C# 8.1.0.Beta1 released!
New Year, New (Beta) Clients!
I’m pleased to announce that the C++/C# clients version 8.1.0.Beta1 are out! The big news in this release is:
-
Near Caching Support
Find the bits in the usual place: http://infinispan.org/hotrod-clients/
Features list for 8.1 is almost done… not bad :) Feedbacks, proposals, hints and lines of code are welcome!
Happy New Year, The Infinispan Team
Tags: c++ release hotrod 8.1.0 cpp-client dotnet-client c#
Friday, 11 November 2016
Hotrod clients C++/C# 8.1.0.Alpha2 released!
Dear Infinispan community,
I’m pleased to announce that the C++/C# clients version 8.1.0.Alpha2 are out!
Some of the good news coming with this release:
-
more bugs fixed than added
-
SNI support
-
C++ Client listener for remote events
Download it from the usual link http://infinispan.org/hotrod-clients/
We’re trying to keep track of the 8.1 trip at this Jira url: Features list for 8.1 Feedbacks, proposals, hints are welcome!
Cheers, The Infinispan Team
Tags: c++ release hotrod cpp-client dotnet-client c#
Thursday, 01 September 2016
Hotrod clients C/C# 8.0.0.Final released!
Dear Infinispan community, I’m glad to announce the Final release of the C++ and C# clients version 8.0.0.
You can find the download on the Infinispan web site:
Major new features for this release are:
-
queries
-
remote script execution
-
asynchronous operation (C++ only)
plus several minor and internal updates that partially fill the gap between C++/C# and the Java client.
Some posts about the 8 serie of the C++/C# clients have been already published on this blog, you can recall them clicking through the list below.
The equivalent C# examples are collected here:
Enjoy!
Tags: c++ release hotrod cpp-client dotnet-client c#
Monday, 27 October 2014
Infinispan HotRod C++ Client 7.0.0.CR2
Dear community,
Infinispan HotRod C++ Client 7.0.0.CR2 is now available.
This is mostly a bug-fix release. I would like bring to your attention the following changes:
For the complete list of changes please consult the release notes. Visit our downloads section to find the latest release. If you have any questions please check our forums, our mailing lists or ping us directly on IRC.
Thanks to everyone involved for the changes and bug reports contributed!
Tags: hotrod cpp-client release candidate
Monday, 13 January 2014
A new quick start guide for remote queries over Hot Rod
Following up on the previous post on Infinispan remote queries, we’ve prepared a quick start guide to get you up and running with remote queries in minutes.
It’s a simple Java application that places some data in a remote cache and then retrieves it using queries over Hot Rod. On top of that, the project also contains a C companion app contributed by https://github.com/isavin[Ion Savin] that uses the https://github.com/infinispan/cpp-client/[C Hot Rod client] and is able to read and write (but not query, yet) the same data, demonstrating interoperability between C and Java clients. At this point the Protobuf encoding support comes in a few C external helper classes rather than being part of the C++ client, but this is going to improve in the upcoming versions. The code for this app is hosted on Github under the jboss-jdg-quickstarts project. Please note this tutorial was written for the JBoss Data Grid (JDG), but it applies to Infinispan as well. We welcome you to try it and let us know what you think!
Tags: jdg hotrod quick start cpp-client remote query