4.0.0
This document includes the new features, enhancements, and fixed issues for Hazelcast C++ Client 4.0.0 release.
This is a major API breaking release. We switched to the new Hazelcast Open Binary Protocol v2.0 with this release of the client so that it can used with server versions 4.0 and later.
The following are the major changes performed in this release:
New Features
-
New Client Protocol: We have implemented the new Hazelcast Open Binary protocol version 2. This new protocol eliminates some of the message size limitations of the previous version and solves the problems of backward compatibility of custom field definitions.
-
C++11 Support: The client code has been upgraded to use the C++11 features. The API has been changed to reflect the C++11 usages.
-
Fully Async API: Almost all API methods now return
boost::futurewhich allows async programming for all the API calls.boost::futurealso supports continuations which can be very useful for async programming. You can also use utilities such asboost::when_all,boost::wait_for_all,boost::when_anyto handle multiple futures. -
new_client Factory Method: We made the
hazelcast_clientconstructor as private and provided the newhazelcast::new_clientAPI to obtain and start a new client. The new API returns a future from which you can actually obtain the client or do an async continuation to the future. -
No Binary Release: We now have full support for cmake install and also cmake
find_package(hazelcast)support for projects using Hazelcast. The release version numbering is also updated to reflect the 3 digit numbering support of Linux/Unix/Windows environments. Current version library produces library version4.0.0. We decreased the client compile time from source code (you can download source zip or git checkout thev4.0.0tag) so that it made more sense to make source distributions and let you compile it in your own environments. This also works better when you use certain boost and openssl versions. Please see the documentation for further details. -
CP Subsystem: Hazelcast IMDG 4.0 has introduced CP concurrency primitives with respect to the CAP principle, i.e., they always maintain linearizability and prefer consistency over availability during network partitions and client or server failures. All data structures within CP Subsystem are available through the
hazelcast_client::get_cp_subsystem()API. In favor of CP subsystem API, we have removed the legacyIAtomicLong,ISemaphore, andICountDownLatch.hAPIs. The new API provides CPatomic_long,latch,counting_semaphore,fenced_lockandatomic_reference. -
Exponential Retry Configuration: We removed the
getConnectionAttemptLimitandsetAttemptPeriodconfigurations and replaced them with the exponential backoff configurationconnection_retry_configin the connection strategy configuration. The client by default tries to connect to the cluster starting with a small timeout time and exponentially increases the timeout up to a configured maximum. This allows a faster connection attempt and more dynamic configuration. -
optional: The new API usesboost::optionalfor return types where it is possible to return nullable objects. This is more efficient and simpler API than using theshared_ptrapproach. -
New Backup Aware Client: The client is now by default processing the backup event notifications. When an operation with sync backup is sent by a client to the Hazelcast member(s), the acknowledgment of the operation's backup is sent to the client by the backup replica member(s). This improves the performance of the client operations. You can turn off this feature back to the old behavior using the
client_config::backup_acks_enabled(bool)API.
Enhancements
-
API Mixed Type Support: We have removed the old RawPointer API. The new API allows you to pass the type of object for each method call. Hence, this new API can now support mixed types, and you do not need to provide a specific object type when instantiating a Hazelcast structure such as
imap. -
Single External Dependency: We only depend on the Boost library. You need to have Boost installed in your environment. Particularly, we depend on
boost::threadandboost::asio. -
IO Level Design Change: We now use asio for SSL and non-SSL sockets. This eliminates the socket descriptor number limitation of the previous implementation which used the
selectsystem API. We also utilizeasio::thread_poolfor our internal executor implementation. -
Non-blocking Atomics: Eliminated the previous lock based atomic implementations and switched fully to the
std::atomicstandard library. -
Serialization Changes: We have changed the way how object serializations are coded so that the serialization is mostly resolved at compile-time. The new serialization does not need any specific configurations but it simply fails at compile-time if not implemented correctly, e.g., missing method. The new serialization also allows keeping your legacy classes (see the
hz_serializer<T>specializations). -
Group Name Removal: Group configuration has been removed. We now have
cluster_namein theClientConfigAPI which has replaced theGroupConfig. -
New Listener API: You can now use the listener APIs with lambda and
std::functionobjects. -
New Logger Configuration: We have introduced a new
logger_configAPI and a new way to configure integrating your logger. -
Snake Case: API naming has been changed from camelCase to snake_case.
-
Version API. [#612]
Fixes
The following major issue has been fixed for this release.
- Missing default ctor for HazelcastJsonValue. [#589]
You can find the full list of closed issues here.
Known Issues
There are no known issues for this release.
Installation
See Installing section for installing the library.