├── .clang-format ├── .github ├── CODEOWNERS ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── actions │ ├── build-test │ │ ├── macos-x86_64 │ │ │ └── action.yml │ │ ├── ubuntu-i386 │ │ │ └── action.yml │ │ ├── ubuntu-x86_64 │ │ │ └── action.yml │ │ ├── unix │ │ │ └── action.yml │ │ └── windows │ │ │ └── action.yml │ └── coverage-report │ │ └── action.yml ├── config.env ├── dependabot.yml └── workflows │ ├── build-pr.yml │ ├── coverage-report.yaml │ ├── jira.yml │ ├── nightly-macos-x86_64.yml │ ├── nightly-ubuntu-i386.yml │ ├── nightly-ubuntu-x86_64.yml │ └── nightly-windows.yml ├── .gitignore ├── CMakeLists.txt ├── Doxyfile ├── LICENSE ├── README.md ├── Reference_Manual.md ├── asan_symbolize.py ├── cmake ├── Modules │ └── FindThrift.cmake ├── config.cmake.in └── utils.cmake ├── examples ├── CMakeLists.txt ├── Org.Website.Samples │ ├── CMakeLists.txt │ ├── CustomSerializerSample.cpp │ ├── EntryProcessorSample.cpp │ ├── ExecutorSample.cpp │ ├── GlobalSerializerSample.cpp │ ├── IdentifiedDataSerializableSample.cpp │ ├── ListSample.cpp │ ├── MapSample.cpp │ ├── MultiMapSample.cpp │ ├── PortableSerializableSample.cpp │ ├── QuerySample.cpp │ ├── QueueSample.cpp │ ├── ReplicatedMapSample.cpp │ ├── RingBufferSample.cpp │ ├── SetSample.cpp │ └── TopicSample.cpp ├── README.md ├── authentication │ ├── CMakeLists.txt │ ├── hazelcast-token-credentials.xml │ ├── hazelcast-username-password.xml │ ├── token_authentication.cpp │ └── username_password_authentication.cpp ├── aws │ ├── AwsClientWithKey.cpp │ ├── AwsClientWithNoKeyNoIAMRoleInsideAws.cpp │ ├── AwsClientWithNoKeyWithIAMRoleInsideAws.cpp │ └── CMakeLists.txt ├── backpressure │ ├── CMakeLists.txt │ └── EnableBackPressure.cpp ├── client-statistics │ ├── CMakeLists.txt │ ├── ClientStatistics.cpp │ └── hazelcast-management-center-enabled.xml ├── cloud-discovery │ ├── CMakeLists.txt │ ├── connect-cloud.cpp │ └── ssl-connect-cloud.cpp ├── cp │ ├── CMakeLists.txt │ ├── atomic_long.cpp │ ├── atomic_reference.cpp │ ├── counting_semphore.cpp │ ├── fenced_lock.cpp │ └── latch.cpp ├── distributed-collections │ ├── CMakeLists.txt │ ├── blockingqueue │ │ ├── CMakeLists.txt │ │ ├── Consumer.cpp │ │ └── Producer.cpp │ ├── itemlisteners │ │ ├── CMakeLists.txt │ │ ├── CollectionChanger.cpp │ │ └── item_listener.cpp │ ├── list │ │ ├── CMakeLists.txt │ │ ├── Reader.cpp │ │ └── Writer.cpp │ ├── ringbuffer │ │ ├── CMakeLists.txt │ │ └── RingbufferExample.cpp │ └── set │ │ ├── CMakeLists.txt │ │ ├── Reader.cpp │ │ └── Writer.cpp ├── distributed-executor-service │ └── README ├── distributed-map │ ├── CMakeLists.txt │ ├── basic │ │ ├── CMakeLists.txt │ │ ├── FillMap.cpp │ │ └── PrintAll.cpp │ ├── custom-attributes │ │ ├── CMakeLists.txt │ │ └── CarAttributeDemo.cpp │ ├── entry-listener │ │ ├── CMakeLists.txt │ │ ├── ModifyMap.cpp │ │ └── main.cpp │ ├── entry-processor │ │ ├── CMakeLists.txt │ │ ├── employee.h │ │ └── main.cpp │ ├── eviction │ │ ├── CMakeLists.txt │ │ └── EvictAll.cpp │ ├── index │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── locking │ │ ├── AbaProtectedOptimisticUpdate.cpp │ │ ├── CMakeLists.txt │ │ ├── OptimisticUpdate.cpp │ │ ├── PessimisticUpdate.cpp │ │ └── RacyUpdate.cpp │ ├── map-interceptor │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── multimap │ │ ├── CMakeLists.txt │ │ ├── MultimapPut.cpp │ │ └── PrintValues.cpp │ ├── near-cache │ │ ├── CMakeLists.txt │ │ ├── NearCacheSupport.h │ │ ├── NearCacheWithEvictionPolicy.cpp │ │ ├── NearCacheWithInvalidation.cpp │ │ ├── NearCacheWithMaxIdle.cpp │ │ ├── NearCacheWithMemoryFormatBinary.cpp │ │ ├── NearCacheWithMemoryFormatObject.cpp │ │ └── NearCacheWithTTL.cpp │ ├── partitionaware │ │ ├── CMakeLists.txt │ │ └── partitionAwarePutGet.cpp │ ├── query │ │ ├── CMakeLists.txt │ │ ├── employee.cpp │ │ ├── employee.h │ │ └── queryExample.cpp │ └── removeAll │ │ ├── CMakeLists.txt │ │ └── removeAllExample.cpp ├── distributed-primitives │ ├── CMakeLists.txt │ └── crdt-pncounter │ │ ├── CMakeLists.txt │ │ └── CrdtPNCounter.cpp ├── distributed-topic │ ├── CMakeLists.txt │ ├── basic-pub-sub │ │ ├── CMakeLists.txt │ │ ├── Publisher.cpp │ │ └── Subscriber.cpp │ └── reliabletopic │ │ ├── CMakeLists.txt │ │ ├── Publisher.cpp │ │ └── Subscriber.cpp ├── event-properties │ ├── CMakeLists.txt │ └── SetEventThreadCountAndMaxQueueSize.cpp ├── external-smart-client-discovery │ ├── CMakeLists.txt │ ├── README.md │ └── connect-external-client.cpp ├── invocation-timeouts │ ├── CMakeLists.txt │ └── SetInvocationTimeouts.cpp ├── learning-basics │ ├── CMakeLists.txt │ ├── configure-logging │ │ ├── CMakeLists.txt │ │ ├── custom_log_handler.cpp │ │ ├── disable_logging.cpp │ │ └── set_level.cpp │ ├── destroying-instances │ │ ├── CMakeLists.txt │ │ └── main.cpp │ └── unique-names │ │ ├── CMakeLists.txt │ │ └── main.cpp ├── monitoring │ ├── CMakeLists.txt │ └── cluster │ │ ├── CMakeLists.txt │ │ └── main.cpp ├── network-configuration │ ├── CMakeLists.txt │ ├── backup-ack │ │ ├── CMakeLists.txt │ │ └── disable_backup_ack.cpp │ ├── connection-strategy │ │ ├── CMakeLists.txt │ │ ├── DoNotReconnectToCluster.cpp │ │ ├── ReconnectAsync.cpp │ │ ├── StartAsync.cpp │ │ └── cluster_connection_retry.cpp │ ├── shuffle-memberlist │ │ ├── CMakeLists.txt │ │ └── ShuffleMemberList.cpp │ ├── socket-interceptor │ │ ├── CMakeLists.txt │ │ └── main.cpp │ └── tcpip │ │ ├── CMakeLists.txt │ │ └── main.cpp ├── pipeline │ ├── CMakeLists.txt │ └── PipeliningDemo.cpp ├── replicated-map │ ├── CMakeLists.txt │ ├── basics │ │ ├── CMakeLists.txt │ │ ├── FillReplicatedMap.cpp │ │ └── PrintAllReplicatedMap.cpp │ └── entry-listener │ │ ├── CMakeLists.txt │ │ ├── ListeningReplicatedMap.cpp │ │ └── ModifyReplicatedMap.cpp ├── serialization │ ├── CMakeLists.txt │ ├── compact │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── custom │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── generic-record │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── globalserializer │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── identified-data-serializable │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── json │ │ ├── CMakeLists.txt │ │ └── main.cpp │ ├── mixed-type-collection │ │ ├── CMakeLists.txt │ │ └── main.cpp │ └── portable │ │ ├── CMakeLists.txt │ │ └── main.cpp ├── soak-test │ ├── CMakeLists.txt │ ├── README.md │ └── soak_test.cpp ├── spi │ ├── CMakeLists.txt │ └── proxy │ │ ├── CMakeLists.txt │ │ └── main.cpp ├── sql │ ├── CMakeLists.txt │ ├── README │ ├── hazelcast-sql.xml │ ├── sql_advanced_query_options.cpp │ ├── sql_basic_query.cpp │ ├── sql_cancellation_example.cpp │ ├── sql_json_example.cpp │ ├── sql_order_by_limit_offset.cpp │ ├── sql_page_iterator_sync.cpp │ ├── sql_query_with_portable.cpp │ └── sql_row_iterator_sync.cpp ├── tls │ ├── BasicTLSClient.cpp │ ├── CMakeLists.txt │ └── mutual_authentication.cpp └── transactions │ ├── CMakeLists.txt │ └── transaction-basic │ ├── CMakeLists.txt │ └── TransactionBasic.cpp ├── hazelcast ├── generated-sources │ └── src │ │ └── hazelcast │ │ └── client │ │ └── protocol │ │ └── codec │ │ ├── codecs.cpp │ │ └── codecs.h ├── include │ └── hazelcast │ │ ├── client │ │ ├── address.h │ │ ├── aws │ │ │ ├── aws_client.h │ │ │ ├── impl │ │ │ │ ├── Constants.h │ │ │ │ ├── DescribeInstances.h │ │ │ │ └── Filter.h │ │ │ ├── security │ │ │ │ └── ec2_request_signer.h │ │ │ └── utility │ │ │ │ ├── aws_url_encoder.h │ │ │ │ └── cloud_utility.h │ │ ├── big_decimal.h │ │ ├── client_config.h │ │ ├── client_properties.h │ │ ├── cluster.h │ │ ├── config │ │ │ ├── client_aws_config.h │ │ │ ├── client_connection_strategy_config.h │ │ │ ├── client_flake_id_generator_config.h │ │ │ ├── client_network_config.h │ │ │ ├── cloud_config.h │ │ │ ├── config_pattern_matcher.h │ │ │ ├── connection_retry_config.h │ │ │ ├── eviction_config.h │ │ │ ├── eviction_policy.h │ │ │ ├── eviction_strategy_type.h │ │ │ ├── in_memory_format.h │ │ │ ├── index_config.h │ │ │ ├── logger_config.h │ │ │ ├── matcher │ │ │ │ └── matching_point_config_pattern_matcher.h │ │ │ ├── near_cache_config.h │ │ │ ├── reliable_topic_config.h │ │ │ ├── socket_options.h │ │ │ └── ssl_config.h │ │ ├── connection │ │ │ ├── AddressProvider.h │ │ │ ├── ClientConnectionManagerImpl.h │ │ │ ├── Connection.h │ │ │ ├── ConnectionListenable.h │ │ │ ├── ConnectionListener.h │ │ │ ├── HeartbeatManager.h │ │ │ ├── ReadHandler.h │ │ │ └── wait_strategy.h │ │ ├── distributed_object.h │ │ ├── endpoint.h │ │ ├── entry_event.h │ │ ├── entry_listener.h │ │ ├── entry_view.h │ │ ├── exception │ │ │ ├── iexception.h │ │ │ └── protocol_exceptions.h │ │ ├── execution_callback.h │ │ ├── flake_id_generator.h │ │ ├── hazelcast.h │ │ ├── hazelcast_client.h │ │ ├── hazelcast_json_value.h │ │ ├── iexecutor_service.h │ │ ├── ilist.h │ │ ├── imap.h │ │ ├── impl │ │ │ ├── AtomicLongInterface.h │ │ │ ├── BaseEventHandler.h │ │ │ ├── ClientLockReferenceIdGenerator.h │ │ │ ├── DistributedObjectInfo.h │ │ │ ├── EntryEventHandler.h │ │ │ ├── ItemEventHandler.h │ │ │ ├── Partition.h │ │ │ ├── hazelcast_client_instance_impl.h │ │ │ ├── metrics │ │ │ │ ├── metric_descriptor.h │ │ │ │ ├── metrics_compressor.h │ │ │ │ └── metrics_dictionary.h │ │ │ ├── statistics │ │ │ │ └── Statistics.h │ │ │ └── vector_clock.h │ │ ├── initial_membership_event.h │ │ ├── internal │ │ │ ├── config │ │ │ │ └── ConfigUtils.h │ │ │ ├── eviction │ │ │ │ ├── Evictable.h │ │ │ │ ├── EvictableEntryView.h │ │ │ │ ├── EvictableStore.h │ │ │ │ ├── EvictionCandidate.h │ │ │ │ ├── EvictionChecker.h │ │ │ │ ├── EvictionListener.h │ │ │ │ ├── EvictionPolicyComparator.h │ │ │ │ ├── EvictionPolicyEvaluator.h │ │ │ │ ├── EvictionPolicyEvaluatorProvider.h │ │ │ │ ├── EvictionStrategy.h │ │ │ │ ├── EvictionStrategyProvider.h │ │ │ │ ├── Expirable.h │ │ │ │ ├── MaxSizeChecker.h │ │ │ │ ├── eviction_configuration.h │ │ │ │ └── impl │ │ │ │ │ ├── comparator │ │ │ │ │ ├── LFUEvictionPolicyComparator.h │ │ │ │ │ ├── LRUEvictionPolicyComparator.h │ │ │ │ │ └── RandomEvictionPolicyComparator.h │ │ │ │ │ ├── evaluator │ │ │ │ │ └── DefaultEvictionPolicyEvaluator.h │ │ │ │ │ └── strategy │ │ │ │ │ ├── AbstractEvictionStrategy.h │ │ │ │ │ └── sampling │ │ │ │ │ ├── SampleableEvictableStore.h │ │ │ │ │ └── SamplingBasedEvictionStrategy.h │ │ │ ├── nearcache │ │ │ │ ├── NearCache.h │ │ │ │ ├── NearCacheManager.h │ │ │ │ ├── NearCacheRecord.h │ │ │ │ └── impl │ │ │ │ │ ├── DefaultNearCache.h │ │ │ │ │ ├── KeyStateMarkerImpl.h │ │ │ │ │ ├── NearCacheRecordMap.h │ │ │ │ │ ├── NearCacheRecordStore.h │ │ │ │ │ ├── SampleableNearCacheRecordMap.h │ │ │ │ │ ├── maxsize │ │ │ │ │ └── EntryCountNearCacheMaxSizeChecker.h │ │ │ │ │ ├── record │ │ │ │ │ ├── AbstractNearCacheRecord.h │ │ │ │ │ ├── NearCacheDataRecord.h │ │ │ │ │ └── NearCacheObjectRecord.h │ │ │ │ │ └── store │ │ │ │ │ ├── AbstractNearCacheRecordStore.h │ │ │ │ │ ├── BaseHeapNearCacheRecordStore.h │ │ │ │ │ ├── HeapNearCacheRecordMap.h │ │ │ │ │ ├── NearCacheDataRecordStore.h │ │ │ │ │ └── NearCacheObjectRecordStore.h │ │ │ ├── partition │ │ │ │ └── strategy │ │ │ │ │ └── StringPartitioningStrategy.h │ │ │ └── socket │ │ │ │ ├── BaseSocket.h │ │ │ │ ├── SSLSocket.h │ │ │ │ ├── SocketFactory.h │ │ │ │ └── TcpSocket.h │ │ ├── iqueue.h │ │ ├── iset.h │ │ ├── item_event.h │ │ ├── item_listener.h │ │ ├── itopic.h │ │ ├── lifecycle_event.h │ │ ├── lifecycle_listener.h │ │ ├── load_balancer.h │ │ ├── local_date.h │ │ ├── local_date_time.h │ │ ├── local_endpoint.h │ │ ├── local_time.h │ │ ├── map │ │ │ ├── NearCachedClientMapProxy.h │ │ │ ├── data_entry_view.h │ │ │ └── impl │ │ │ │ └── nearcache │ │ │ │ ├── InvalidationAwareWrapper.h │ │ │ │ └── KeyStateMarker.h │ │ ├── map_event.h │ │ ├── member.h │ │ ├── member_selectors.h │ │ ├── membership_event.h │ │ ├── membership_listener.h │ │ ├── monitor │ │ │ ├── impl │ │ │ │ ├── LocalMapStatsImpl.h │ │ │ │ └── NearCacheStatsImpl.h │ │ │ ├── local_map_stats.h │ │ │ └── near_cache_stats.h │ │ ├── multi_map.h │ │ ├── offset_date_time.h │ │ ├── partition_aware.h │ │ ├── pipelining.h │ │ ├── pn_counter.h │ │ ├── protocol │ │ │ ├── AuthenticationStatus.h │ │ │ ├── ClientExceptionFactory.h │ │ │ ├── ClientMessage.h │ │ │ ├── ClientMessageBuilder.h │ │ │ ├── ClientProtocolErrorCodes.h │ │ │ ├── EventMessageConst.h │ │ │ ├── IMessageHandler.h │ │ │ ├── Principal.h │ │ │ ├── ResponseMessageConst.h │ │ │ ├── UsernamePasswordCredentials.h │ │ │ └── codec │ │ │ │ ├── ErrorCodec.h │ │ │ │ └── builtin │ │ │ │ ├── custom_type_factory.h │ │ │ │ ├── list_cn_fixed_size_codec.h │ │ │ │ └── sql_page_codec.h │ │ ├── proxy │ │ │ ├── IListImpl.h │ │ │ ├── IMapImpl.h │ │ │ ├── IQueueImpl.h │ │ │ ├── ISetImpl.h │ │ │ ├── ITopicImpl.h │ │ │ ├── MultiMapImpl.h │ │ │ ├── PNCounterImpl.h │ │ │ ├── PartitionSpecificClientProxy.h │ │ │ ├── ProxyImpl.h │ │ │ ├── ReplicatedMapImpl.h │ │ │ ├── RingbufferImpl.h │ │ │ ├── SerializingProxy.h │ │ │ ├── TransactionalListImpl.h │ │ │ ├── TransactionalMapImpl.h │ │ │ ├── TransactionalMultiMapImpl.h │ │ │ ├── TransactionalObject.h │ │ │ ├── TransactionalQueueImpl.h │ │ │ ├── TransactionalSetImpl.h │ │ │ └── flake_id_generator_impl.h │ │ ├── query │ │ │ ├── entry_comparator.h │ │ │ ├── paging_predicate.h │ │ │ └── predicates.h │ │ ├── reliable_topic.h │ │ ├── replicated_map.h │ │ ├── ringbuffer.h │ │ ├── ringbuffer │ │ │ └── read_result_set.h │ │ ├── serialization │ │ │ ├── field_kind.h │ │ │ ├── generic_record.h │ │ │ ├── generic_record_builder.h │ │ │ ├── pimpl │ │ │ │ ├── compact │ │ │ │ │ ├── compact.h │ │ │ │ │ ├── compact_impl.h │ │ │ │ │ ├── compact_util.h │ │ │ │ │ ├── default_schema_service.h │ │ │ │ │ ├── field_descriptor.h │ │ │ │ │ ├── schema.h │ │ │ │ │ └── schema_writer.h │ │ │ │ ├── data.h │ │ │ │ ├── data_input.h │ │ │ │ └── data_output.h │ │ │ └── serialization.h │ │ ├── serialization_config.h │ │ ├── socket.h │ │ ├── socket_interceptor.h │ │ ├── spi │ │ │ ├── ClientContext.h │ │ │ ├── ClientProxy.h │ │ │ ├── DefaultObjectNamespace.h │ │ │ ├── EventHandler.h │ │ │ ├── InitializingObject.h │ │ │ ├── ProxyManager.h │ │ │ ├── impl │ │ │ │ ├── ClientClusterServiceImpl.h │ │ │ │ ├── ClientExecutionServiceImpl.h │ │ │ │ ├── ClientInvocation.h │ │ │ │ ├── ClientInvocationServiceImpl.h │ │ │ │ ├── ClientPartitionServiceImpl.h │ │ │ │ ├── ClientTransactionManagerServiceImpl.h │ │ │ │ ├── DefaultAddressProvider.h │ │ │ │ ├── ListenerMessageCodec.h │ │ │ │ ├── discovery │ │ │ │ │ ├── cloud_discovery.h │ │ │ │ │ └── remote_address_provider.h │ │ │ │ ├── listener │ │ │ │ │ ├── cluster_view_listener.h │ │ │ │ │ └── listener_service_impl.h │ │ │ │ └── sequence │ │ │ │ │ ├── AbstractCallIdSequence.h │ │ │ │ │ ├── CallIdFactory.h │ │ │ │ │ ├── CallIdSequence.h │ │ │ │ │ ├── CallIdSequenceWithBackpressure.h │ │ │ │ │ ├── CallIdSequenceWithoutBackpressure.h │ │ │ │ │ └── FailFastCallIdSequence.h │ │ │ └── lifecycle_service.h │ │ ├── sql │ │ │ ├── hazelcast_sql_exception.h │ │ │ ├── impl │ │ │ │ ├── query_id.h │ │ │ │ ├── query_utils.h │ │ │ │ ├── read_optimized_lru_cache.h │ │ │ │ ├── sql_error.h │ │ │ │ └── sql_error_code.h │ │ │ ├── sql_column_metadata.h │ │ │ ├── sql_column_type.h │ │ │ ├── sql_expected_result_type.h │ │ │ ├── sql_page.h │ │ │ ├── sql_result.h │ │ │ ├── sql_row_metadata.h │ │ │ ├── sql_service.h │ │ │ └── sql_statement.h │ │ ├── topic │ │ │ ├── impl │ │ │ │ ├── TopicEventHandlerImpl.h │ │ │ │ └── reliable │ │ │ │ │ └── ReliableTopicMessage.h │ │ │ ├── listener.h │ │ │ ├── message.h │ │ │ └── reliable_listener.h │ │ ├── transaction_context.h │ │ ├── transaction_options.h │ │ ├── transactional_list.h │ │ ├── transactional_map.h │ │ ├── transactional_multi_map.h │ │ ├── transactional_queue.h │ │ ├── transactional_set.h │ │ └── txn │ │ │ ├── TransactionProxy.h │ │ │ └── client_transaction_util.h │ │ ├── cp │ │ ├── cp.h │ │ └── cp_impl.h │ │ ├── logger.h │ │ └── util │ │ ├── AddressHelper.h │ │ ├── AddressUtil.h │ │ ├── Bits.h │ │ ├── ByteBuffer.h │ │ ├── Clearable.h │ │ ├── Closeable.h │ │ ├── Comparator.h │ │ ├── ConcurrentSet.h │ │ ├── Destroyable.h │ │ ├── Disposable.h │ │ ├── HashUtil.h │ │ ├── IOUtil.h │ │ ├── Iterable.h │ │ ├── Iterator.h │ │ ├── MurmurHash3.h │ │ ├── Named.h │ │ ├── Preconditions.h │ │ ├── SampleableConcurrentHashMap.h │ │ ├── Sync.h │ │ ├── SyncHttpClient.h │ │ ├── SyncHttpsClient.h │ │ ├── SynchronizedMap.h │ │ ├── SynchronizedQueue.h │ │ ├── Util.h │ │ ├── byte.h │ │ ├── concurrent │ │ ├── BackoffIdleStrategy.h │ │ ├── Cancellable.h │ │ ├── IdleStrategy.h │ │ └── locks │ │ │ └── LockSupport.h │ │ ├── exception_util.h │ │ ├── finally.h │ │ ├── hz_thread_pool.h │ │ ├── noop.h │ │ └── type_traits.h ├── src │ └── hazelcast │ │ ├── client │ │ ├── client_impl.cpp │ │ ├── cluster.cpp │ │ ├── compact.cpp │ │ ├── config.cpp │ │ ├── discovery.cpp │ │ ├── metrics.cpp │ │ ├── near_cache.cpp │ │ ├── network.cpp │ │ ├── protocol.cpp │ │ ├── proxy.cpp │ │ ├── query.cpp │ │ ├── serialization.cpp │ │ ├── spi.cpp │ │ ├── sql.cpp │ │ ├── stats.cpp │ │ └── transactions.cpp │ │ ├── cp │ │ ├── cp.cpp │ │ └── cp_impl.cpp │ │ ├── logger.cpp │ │ └── util │ │ └── util.cpp └── test │ ├── CMakeLists.googletest.in │ ├── CMakeLists.txt │ ├── README.md │ ├── benchmark │ ├── CMakeLists.txt │ ├── README.md │ └── hazelcast_benchmark.cpp │ ├── resources │ ├── client1-cert.pem │ ├── client1-key.pem │ ├── client2-cert.pem │ ├── client2-key.pem │ ├── compact.xml │ ├── cpp_client.crt │ ├── fragments_bytes.bin │ ├── hazelcast-cp-sessionless-semaphore.xml │ ├── hazelcast-cp.xml │ ├── hazelcast-default-ca.xml │ ├── hazelcast-lite-member.xml │ ├── hazelcast-ma-optional.xml │ ├── hazelcast-ma-required.xml │ ├── hazelcast-pncounter-consistency-lost-test.xml │ ├── hazelcast-serialization-little-endian.xml │ ├── hazelcast-sql-without-jet.xml │ ├── hazelcast-sql.xml │ ├── hazelcast-ssl-server1.xml │ ├── hazelcast-ssl.xml │ ├── hazelcast-test-executor.xml │ ├── hazelcast-token-credentials.xml │ ├── hazelcast-username-password.xml │ ├── hazelcast.xml │ ├── hot-restart.xml │ ├── keystore.jks │ ├── lock-expiration.xml │ ├── logger-config.txt │ ├── metrics_blob.bin │ ├── replicated-map-binary-in-memory-config-hazelcast.xml │ ├── sample_aws_response.xml │ ├── serialization.xml │ ├── server1-cert.pem │ ├── server2-cert.pem │ ├── short-heartbeat.xml │ └── truststore.jks │ └── src │ ├── CMakeLists.txt │ ├── ClientTest.cpp │ ├── ClientTest.h │ ├── CountDownLatchWaiter.h │ ├── HazelcastServer.h │ ├── HazelcastServerFactory.h │ ├── HazelcastTests1.cpp │ ├── HazelcastTests2.cpp │ ├── HazelcastTests3.cpp │ ├── HazelcastTests5.cpp │ ├── HazelcastTests7.cpp │ ├── HazelcastTests8.cpp │ ├── IdentifiedSerializables.h │ ├── TestHelperFunctions.h │ ├── compact │ ├── compact_field_kind_test.h │ ├── compact_generic_record_array_overloads.h │ ├── compact_generic_record_builder_test.h │ ├── compact_generic_record_integration_test.h │ ├── compact_generic_record_test.h │ ├── compact_helper.h │ ├── compact_mix.h │ ├── compact_nullable_primitive_interoperability_test.h │ ├── compact_rabin_fingerprint_test.h │ ├── compact_read_write_integration_test.h │ ├── compact_schema_fetch_on_read.h │ ├── compact_schema_replication_on_cluster_restart_test.h │ ├── compact_schema_replication_on_write_test.h │ ├── compact_schema_replication_stress_test.h │ ├── compact_schema_test.h │ ├── compact_schema_validation_test.h │ ├── compact_serialization_test.h │ ├── compact_test_base.h │ └── serialization │ │ ├── bits_dto.h │ │ ├── employee_dto.h │ │ ├── empty_main_dto.h │ │ ├── generic_record_factory.h │ │ ├── inner_dto.h │ │ ├── main_dto.h │ │ ├── named_compact.h │ │ ├── named_dto.h │ │ ├── nested_type.h │ │ ├── node_dto.h │ │ ├── nullable_primitive_object.h │ │ ├── primitive_object.h │ │ ├── sample_compact_type.h │ │ ├── stress_type.h │ │ ├── type_mismatch_obj.h │ │ ├── write_to_field_twice.h │ │ └── wrong_field_name_read_obj.h │ ├── compact_test.cpp │ ├── cp_test.cpp │ ├── cpp-controller │ ├── RemoteController.cpp │ ├── RemoteController.h │ ├── remote_controller_constants.cpp │ ├── remote_controller_constants.h │ ├── remote_controller_types.cpp │ └── remote_controller_types.h │ ├── executor │ └── tasks │ │ └── Tasks.h │ ├── logger_test.cpp │ ├── metrics_test.cpp │ ├── remote_controller_client.cpp │ ├── remote_controller_client.h │ ├── ringbuffer │ └── StartsWithStringFilter.h │ ├── serialization │ ├── Serializables.cpp │ └── Serializables.h │ └── sql_test.cpp ├── logo └── IMDG_blue_logo_square_RGB-dark_200px.png ├── sample_project ├── CMakeLists.txt └── client.cpp └── scripts ├── build-unix.sh ├── build-windows.bat ├── do-all-unix.sh ├── do-all-windows.bat ├── format-all.sh ├── install-boost.sh ├── install-thrift.sh ├── start-rc.bat ├── start-rc.sh ├── test-unix.sh ├── test-windows.bat ├── verify-installation-unix.sh ├── verify-installation-windows.bat └── windows-common.bat /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This is a comment. 2 | # Each line is a file pattern followed by one or more owners. 3 | 4 | # These owners will be the default owners for everything in 5 | # the repo. 6 | * @ihsandemir 7 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | #### Contributing 2 | If you would like to contribute to hazelcast-cpp-client; 3 | - Fork the original repo 4 | - Commit your contributions in a new branch 5 | - Send a Pull Request 6 | 7 | For detailed instructions for our git process: [Developing with Git](https://hazelcast.atlassian.net/wiki/display/COM/Developing+with+Git) 8 | 9 | In order to merge your pull request, we need the contributor to sign [Hazelcast Contributor Agreement](https://hazelcast.atlassian.net/wiki/display/COM/Hazelcast+Contributor+Agreement). You do not have to wait for approval for doing this step. 10 | 11 | Please make sure that your code passes `testLinux.sh` for Linux/Mac and `testWindows.bat` for MS Windows. The script executes builds and runs the unit tests for all bit and library versions. (Alternatively, you can also use `testLinuxSingleCase.sh` or `testWindowsSingleCase.sh` for testing with a specific bit aversion and library type. 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | C++ compiler version: 2 | Hazelcast Cpp client version: 3 | Hazelcast server version: 4 | Number of the clients: 5 | Cluster size, i.e. the number of Hazelcast cluster members: 6 | OS version (Windows/Linux/OSX): 7 | 8 | Please attach relevant logs and files for client and server side. 9 | 10 | #### Expected behaviour 11 | 12 | 13 | #### Actual behaviour 14 | 15 | 16 | #### Steps to reproduce the behaviour -------------------------------------------------------------------------------- /.github/config.env: -------------------------------------------------------------------------------- 1 | JAVA_VERSION=17 2 | JAVA_DISTRIBUTION=temurin 3 | MAVEN_VERSION=3.9.9 4 | HZ_VERSION=5.5.5 5 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | -------------------------------------------------------------------------------- /.github/workflows/coverage-report.yaml: -------------------------------------------------------------------------------- 1 | name: Code coverage report to Codecov 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | coverage: 10 | runs-on: ubuntu-latest 11 | 12 | name: Create and upload coverage 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v4 16 | 17 | - uses: ./.github/actions/coverage-report 18 | with: 19 | GH_TOKEN: ${{ secrets.GH_TOKEN }} 20 | BOOST_VERSION: 1.78.0 21 | THRIFT_VERSION: 0.13.0 22 | RUN_TESTS: true 23 | HAZELCAST_ENTERPRISE_KEY: ${{ secrets.HAZELCAST_ENTERPRISE_KEY }} 24 | AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} 25 | AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} 26 | HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ secrets.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }} 27 | 28 | - name: Publish on Codecov 29 | uses: codecov/codecov-action@v5 30 | with: 31 | files: coverage.info 32 | -------------------------------------------------------------------------------- /.github/workflows/jira.yml: -------------------------------------------------------------------------------- 1 | name: Create Jira issue 2 | 3 | on: 4 | issues: 5 | types: labeled 6 | 7 | jobs: 8 | jira: 9 | if: ${{ github.event.label.name == 'to-jira' }} 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Call composite action 13 | uses: hazelcast/github-jira-tool-action@v6 14 | with: 15 | JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} 16 | JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} 17 | JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} 18 | TARGET_JIRA_PROJECT: API 19 | JIRA_LABEL: C++ 20 | ISSUE_TYPE: Bug 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.out 6 | *.1 7 | *.gch 8 | *.exe 9 | *.ilk 10 | *.pdb 11 | *~ 12 | build*/* 13 | cpp/* 14 | .DS_Store 15 | 16 | # IDE configs 17 | .idea/* 18 | .vscode/ 19 | 20 | # Compiled Dynamic libraries 21 | *.so 22 | *.dylib 23 | .DS_Store 24 | 25 | # Compiled Static libraries 26 | *.lai 27 | *.la 28 | # *.a 29 | 30 | # Dependency files 31 | *.d 32 | 33 | # Test resources 34 | *.d 35 | tags 36 | 37 | # Compiled binaries and classes 38 | Release*/* 39 | 40 | # Java 41 | *.iml 42 | java/.idea 43 | java/target/* 44 | *.jar 45 | 46 | # Clangd 47 | .clangd 48 | compile_commands.json 49 | 50 | # Doxygen generated docs 51 | docs/ 52 | 53 | # Log files 54 | testLog.txt 55 | *.log 56 | 57 | -------------------------------------------------------------------------------- /cmake/config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(CMakeFindDependencyMacro) 4 | 5 | find_dependency(Boost 1.71 COMPONENTS thread chrono) 6 | 7 | if (@WITH_OPENSSL@) 8 | find_dependency(OpenSSL) 9 | endif() 10 | 11 | include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake) 12 | 13 | set_and_check(@PROJECT_NAME@_INCLUDE_DIRS @PACKAGE_INCLUDE_INSTALL_DIR@) 14 | set_and_check(@PROJECT_NAME@_LIBRARY_DIRS @PACKAGE_LIBRARY_INSTALL_DIR@) 15 | set(@PROJECT_NAME@_LIBRARIES @PROJECT_NAME@::@PROJECT_NAME@) 16 | 17 | check_required_components(@PROJECT_NAME@) 18 | -------------------------------------------------------------------------------- /examples/Org.Website.Samples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(MapSample MapSample.cpp) 17 | add_executable(MultiMapSample MultiMapSample.cpp) 18 | add_executable(TopicSample TopicSample.cpp) 19 | add_executable(EntryProcessorSample ./EntryProcessorSample.cpp) 20 | add_executable(QuerySample ./QuerySample.cpp) 21 | add_executable(QueueSample ./QueueSample.cpp) 22 | add_executable(RingBufferReaderSample RingBufferSample.cpp) 23 | add_executable(IdentifiedDataSerializableSample ./IdentifiedDataSerializableSample.cpp) 24 | add_executable(PortableSerializableSample ./PortableSerializableSample.cpp) 25 | add_executable(CustomSerializerSample ./CustomSerializerSample.cpp) 26 | add_executable(GlobalSerializerSample ./GlobalSerializerSample.cpp) 27 | add_executable(ListSample ./ListSample.cpp) 28 | add_executable(SetSample ./SetSample.cpp) 29 | add_executable(ReplicatedMapSample ./ReplicatedMapSample.cpp) 30 | add_executable(ExecutorSample ExecutorSample.cpp) 31 | -------------------------------------------------------------------------------- /examples/Org.Website.Samples/RingBufferSample.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | using namespace hazelcast::client; 19 | int 20 | main() 21 | { 22 | // Start the Hazelcast Client and connect to an already running Hazelcast 23 | // Cluster on 127.0.0.1 24 | auto hz = hazelcast::new_client().get(); 25 | auto rb = hz.get_ringbuffer("rb").get(); 26 | // add two items into ring buffer 27 | rb->add(100).get(); 28 | rb->add(200).get(); 29 | // we start from the oldest item. 30 | // if you want to start from the next item, call rb.tailSequence()+1 31 | int64_t sequence = rb->head_sequence().get(); 32 | std::cout << *rb->read_one(sequence).get() << std::endl; 33 | sequence++; 34 | std::cout << *rb->read_one(sequence).get() << std::endl; 35 | // Shutdown this Hazelcast Client 36 | hz.shutdown().get(); 37 | } 38 | -------------------------------------------------------------------------------- /examples/authentication/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(username_password_authentication username_password_authentication.cpp) 17 | add_executable(token_authentication token_authentication.cpp) 18 | -------------------------------------------------------------------------------- /examples/authentication/hazelcast-token-credentials.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | SGF6ZW 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /examples/authentication/hazelcast-username-password.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /examples/authentication/token_authentication.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | // You should use the config file hazelcast-token-credentials.xml when starting 19 | // the server so that the server will authenticate the client successfully. 20 | int 21 | main() 22 | { 23 | std::vector my_token = { 'S', 'G', 'F', '6', 'Z', 'W' }; 24 | 25 | hazelcast::client::client_config config; 26 | 27 | config.set_cluster_name("token-credentials-dev") 28 | .set_credentials( 29 | std::make_shared( 30 | my_token)); 31 | 32 | auto hz = hazelcast::new_client(std::move(config)).get(); 33 | 34 | auto map = hz.get_map("MyMap").get(); 35 | 36 | map->put(1, 100).get(); 37 | 38 | auto value = map->get(1).get(); 39 | 40 | if (value) { 41 | std::cout << "Value for key 1 is " << value.value() << std::endl; 42 | } 43 | 44 | std::cout << "Finished" << std::endl; 45 | 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /examples/authentication/username_password_authentication.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | // You should use the config file hazelcast-username-password.xml when starting 19 | // the server so that the server will authenticate the client successfully. 20 | int 21 | main() 22 | { 23 | hazelcast::client::client_config clientConfig; 24 | 25 | // set the username and password to match the server side config. 26 | clientConfig.set_credentials( 27 | std::make_shared< 28 | hazelcast::client::security::username_password_credentials>( 29 | "test-user", "test-pass")); 30 | 31 | auto hz = hazelcast::new_client(std::move(clientConfig)).get(); 32 | 33 | auto map = hz.get_map("MyMap").get(); 34 | 35 | map->put(1, 100).get(); 36 | 37 | auto value = map->get(1).get(); 38 | 39 | if (value) { 40 | std::cout << "Value for key 1 is " << value.value() << std::endl; 41 | } 42 | 43 | std::cout << "Finished" << std::endl; 44 | 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /examples/aws/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(awsClientWithKey AwsClientWithKey.cpp) 17 | add_executable(AwsClientWithNoKeyNoIAMRoleInsideAws AwsClientWithNoKeyNoIAMRoleInsideAws.cpp) 18 | add_executable(AwsClientWithNoKeyWithIAMRoleInsideAws AwsClientWithNoKeyWithIAMRoleInsideAws.cpp) 19 | -------------------------------------------------------------------------------- /examples/backpressure/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(enableBackPressure EnableBackPressure.cpp) 17 | -------------------------------------------------------------------------------- /examples/client-statistics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(clientStatistics ClientStatistics.cpp) 17 | -------------------------------------------------------------------------------- /examples/cloud-discovery/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(connect-cloud connect-cloud.cpp) 17 | add_executable(ssl-connect-cloud ssl-connect-cloud.cpp) 18 | -------------------------------------------------------------------------------- /examples/cp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(atomic_long atomic_long.cpp) 17 | add_executable(fenced_lock fenced_lock.cpp) 18 | add_executable(counting_semphore counting_semphore.cpp) 19 | add_executable(latch latch.cpp) 20 | add_executable(atomic_reference atomic_reference.cpp) 21 | -------------------------------------------------------------------------------- /examples/cp/atomic_reference.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | int 20 | main() 21 | { 22 | auto hz = hazelcast::new_client().get(); 23 | 24 | // Get an atomic_reference named 'my-ref' 25 | auto ref = hz.get_cp_subsystem().get_atomic_reference("my-ref").get(); 26 | 27 | // Set the value atomically 28 | ref->set(42).get(); 29 | // Read the value 30 | auto value = ref->get().get(); 31 | std::cout << "Value:" << value << "\n"; 32 | // Prints: 33 | // Value: 42 34 | // Try to replace the value with 'value' 35 | // with a compare-and-set atomic operation 36 | auto result = ref->compare_and_set(42, "value").get(); 37 | std::cout << "CAS result:" << result << "\n"; 38 | // Prints: 39 | // CAS result: 1 40 | 41 | std::cout << "Finished" << std::endl; 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /examples/cp/fenced_lock.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | int 20 | main() 21 | { 22 | auto hz = hazelcast::new_client().get(); 23 | 24 | // Get an fenced_lock named 'my-lock' 25 | auto lock = hz.get_cp_subsystem().get_lock("my-lock").get(); 26 | 27 | // Acquire the lock 28 | lock->lock().get(); 29 | try { 30 | // Your guarded code goes here 31 | } catch (...) { 32 | // Make sure to release the lock 33 | lock->unlock().get(); 34 | } 35 | 36 | // Try to acquire the lock 37 | auto success = lock->try_lock().get(); 38 | // Check for valid fencing token 39 | if (success) { 40 | try { 41 | // Your guarded code goes here 42 | } catch (...) { 43 | // Make sure to release the lock 44 | lock->unlock().get(); 45 | } 46 | } 47 | 48 | std::cout << "Finished" << std::endl; 49 | 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /examples/distributed-collections/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(blockingqueue) 17 | add_subdirectory(itemlisteners) 18 | add_subdirectory(list) 19 | add_subdirectory(set) 20 | add_subdirectory(ringbuffer) 21 | -------------------------------------------------------------------------------- /examples/distributed-collections/blockingqueue/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(blockingqueueconsumer ./Consumer.cpp) 17 | add_executable(blockingqueueproducer ./Producer.cpp) 18 | 19 | -------------------------------------------------------------------------------- /examples/distributed-collections/blockingqueue/Consumer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto queue = hz.get_queue("queue").get(); 24 | 25 | while (true) { 26 | auto item = queue->take().get(); 27 | if (item) { 28 | std::cout << "Consumed: " << item.value() << std::endl; 29 | 30 | if (item.value() == -1) { 31 | queue->put(-1).get(); 32 | break; 33 | } 34 | } else { 35 | std::cout << "Retrieved item is null." << std::endl; 36 | } 37 | std::this_thread::sleep_for(std::chrono::seconds(5)); 38 | } 39 | std::cout << "Consumer Finished!" << std::endl; 40 | 41 | std::cout << "Finished" << std::endl; 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /examples/distributed-collections/blockingqueue/Producer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto queue = hz.get_queue("queue").get(); 24 | 25 | for (int k = 1; k < 100; k++) { 26 | queue->put(k).get(); 27 | std::cout << "Producing: " << k << std::endl; 28 | std::this_thread::sleep_for(std::chrono::seconds(1)); 29 | } 30 | queue->put(-1).get(); 31 | std::cout << "Producer Finished!" << std::endl; 32 | 33 | std::cout << "Finished" << std::endl; 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /examples/distributed-collections/itemlisteners/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(itemlistener item_listener.cpp) 17 | add_executable(collectionchanger ./CollectionChanger.cpp) 18 | 19 | -------------------------------------------------------------------------------- /examples/distributed-collections/itemlisteners/CollectionChanger.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | int 20 | main() 21 | { 22 | auto hz = hazelcast::new_client().get(); 23 | 24 | auto queue = hz.get_queue("queue").get(); 25 | 26 | queue->put("foo") 27 | .then([=](boost::future f) { 28 | f.get(); 29 | queue->put("bar").get(); 30 | }) 31 | .get(); 32 | 33 | queue->take().get(); 34 | queue->take().get(); 35 | 36 | std::cout << "Changer Finished!" << std::endl; 37 | 38 | std::cout << "Finished" << std::endl; 39 | 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /examples/distributed-collections/list/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(listreader ./Reader.cpp) 17 | add_executable(listwriter ./Writer.cpp) 18 | 19 | -------------------------------------------------------------------------------- /examples/distributed-collections/list/Reader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto list = hz.get_list("list").get(); 24 | 25 | for (auto& item : list->to_array().get()) { 26 | std::cout << item << std::endl; 27 | } 28 | 29 | std::cout << "Reading finished!" << std::endl; 30 | 31 | std::cout << "Finished" << std::endl; 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /examples/distributed-collections/list/Writer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto list = hz.get_list("list").get(); 24 | 25 | list->add("Tokyo").then( 26 | boost::launch::deferred, [=](boost::future f) { 27 | if (f.get()) { 28 | std::cout << "First addition is successfull!!!" << '\n'; 29 | list->add("Paris").get(); 30 | list->add("London").get(); 31 | list->add("New York").get(); 32 | } 33 | }); 34 | 35 | std::cout << "Putting finished!" << std::endl; 36 | 37 | std::cout << "Finished" << std::endl; 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /examples/distributed-collections/ringbuffer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(ringbufferExample ./RingbufferExample.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/distributed-collections/set/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(setreader ./Reader.cpp) 17 | add_executable(setwriter ./Writer.cpp) 18 | 19 | -------------------------------------------------------------------------------- /examples/distributed-collections/set/Reader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto set = hz.get_set("set").get(); 24 | 25 | for (auto& item : set->to_array().get()) { 26 | std::cout << item << std::endl; 27 | } 28 | 29 | std::cout << "Reading finished!" << std::endl; 30 | 31 | std::cout << "Finished" << std::endl; 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /examples/distributed-collections/set/Writer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto set = hz.get_set("set").get(); 24 | 25 | set->add("Tokyo").get(); 26 | set->add("Paris").get(); 27 | set->add("London").get(); 28 | set->add("New York").get(); 29 | 30 | std::cout << "Putting finished!" << std::endl; 31 | 32 | std::cout << "Finished" << std::endl; 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /examples/distributed-executor-service/README: -------------------------------------------------------------------------------- 1 | Please see examples/Org.WebSite.Samples/ExecutorSample.cpp -------------------------------------------------------------------------------- /examples/distributed-map/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(basic) 17 | add_subdirectory(near-cache) 18 | add_subdirectory(query) 19 | add_subdirectory(custom-attributes) 20 | add_subdirectory(entry-listener) 21 | add_subdirectory(entry-processor) 22 | add_subdirectory(eviction) 23 | add_subdirectory(index) 24 | add_subdirectory(locking) 25 | add_subdirectory(map-interceptor) 26 | add_subdirectory(multimap) 27 | add_subdirectory(partitionaware) 28 | add_subdirectory(removeAll) 29 | -------------------------------------------------------------------------------- /examples/distributed-map/basic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(printall ./PrintAll.cpp) 17 | add_executable(fillmap ./FillMap.cpp) 18 | -------------------------------------------------------------------------------- /examples/distributed-map/basic/PrintAll.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto map = hz.get_map("map").get(); 24 | auto entries = map->entry_set().get(); 25 | for (auto& entry : map->entry_set().get()) { 26 | std::cout << entry.first << " " << entry.second << std::endl; 27 | } 28 | 29 | std::cout << "Finished" << std::endl; 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /examples/distributed-map/custom-attributes/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(customerattribute CarAttributeDemo.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/distributed-map/entry-listener/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(mapentrylistener main.cpp) 17 | add_executable(modifymap ModifyMap.cpp) 18 | 19 | -------------------------------------------------------------------------------- /examples/distributed-map/entry-listener/ModifyMap.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto map = hz.get_map("somemap").get(); 24 | 25 | std::string key{ "some string key" }; 26 | 27 | map->put(key, "1").get(); 28 | map->put(key, "2").get(); 29 | map->delete_entry(key).get(); 30 | 31 | std::cout << "Finished" << std::endl; 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /examples/distributed-map/entry-processor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(mapentryprocessor ./main.cpp employee.h) 17 | 18 | -------------------------------------------------------------------------------- /examples/distributed-map/eviction/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(evictAll EvictAll.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/distributed-map/index/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(queryindexedentry main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/distributed-map/locking/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(AbaProtectedOptimisticUpdate ./AbaProtectedOptimisticUpdate.cpp) 17 | add_executable(OptimisticUpdate ./OptimisticUpdate.cpp) 18 | add_executable(PessimisticUpdate ./PessimisticUpdate.cpp) 19 | add_executable(RacyUpdate ./RacyUpdate.cpp) 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/distributed-map/map-interceptor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(mapinterceptor ./main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/distributed-map/multimap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(PrintValues ./PrintValues.cpp) 17 | add_executable(MultimapPut ./MultimapPut.cpp) 18 | 19 | -------------------------------------------------------------------------------- /examples/distributed-map/multimap/MultimapPut.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto map = hz.get_multi_map("map").get(); 24 | 25 | map->put("a", "1").get(); 26 | map->put("a", "2").get(); 27 | map->put("b", "3").get(); 28 | 29 | std::cout << "Finished" << std::endl; 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /examples/distributed-map/multimap/PrintValues.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto map = hz.get_multi_map("map").get(); 24 | 25 | for (auto& key : map->key_set().get()) { 26 | std::cout << key << " -> ("; 27 | for (auto& value : map->get(key).get()) { 28 | std::cout << value << ", \n"; 29 | } 30 | std::cout << ")" 31 | << "\n"; 32 | } 33 | 34 | std::cout << "Finished" << std::endl; 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /examples/distributed-map/near-cache/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(NearCacheWithTTL ./NearCacheWithTTL.cpp NearCacheSupport.h) 17 | add_executable(NearCacheWithMemoryFormatObject ./NearCacheWithMemoryFormatObject.cpp NearCacheSupport.h) 18 | add_executable(NearCacheWithMemoryFormatBinary ./NearCacheWithMemoryFormatBinary.cpp NearCacheSupport.h) 19 | add_executable(NearCacheWithMaxIdle ./NearCacheWithMaxIdle.cpp NearCacheSupport.h) 20 | add_executable(NearCacheInvalidation ./NearCacheWithInvalidation.cpp NearCacheSupport.h) 21 | add_executable(NearCacheWithEvictionPolicy ./NearCacheWithEvictionPolicy.cpp NearCacheSupport.h) 22 | -------------------------------------------------------------------------------- /examples/distributed-map/partitionaware/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(partitionAwarePutGet ./partitionAwarePutGet.cpp) 17 | -------------------------------------------------------------------------------- /examples/distributed-map/query/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(queryMap queryExample.cpp employee.h employee.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/distributed-map/removeAll/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(removeAllExample removeAllExample.cpp) 17 | -------------------------------------------------------------------------------- /examples/distributed-primitives/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(crdt-pncounter) 17 | -------------------------------------------------------------------------------- /examples/distributed-primitives/crdt-pncounter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(crdtPNCounter CrdtPNCounter.cpp) 17 | -------------------------------------------------------------------------------- /examples/distributed-primitives/crdt-pncounter/CrdtPNCounter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto pnCounter = hz.get_pn_counter("pncounterexample").get(); 24 | 25 | std::cout << "Counter started with value:" << pnCounter->get().get() 26 | << std::endl; 27 | 28 | std::cout << "Counter new value after adding is: " 29 | << pnCounter->add_and_get(5).get() << std::endl; 30 | 31 | std::cout << "Counter new value before adding is: " 32 | << pnCounter->get_and_add(2).get() << std::endl; 33 | 34 | std::cout << "Counter new value is: " << pnCounter->get().get() 35 | << std::endl; 36 | 37 | std::cout << "Decremented counter by one to: " 38 | << pnCounter->decrement_and_get().get() << std::endl; 39 | 40 | std::cout << "Finished" << std::endl; 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /examples/distributed-topic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(basic-pub-sub) 17 | add_subdirectory(reliabletopic) 18 | -------------------------------------------------------------------------------- /examples/distributed-topic/basic-pub-sub/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(publisher ./Publisher.cpp) 17 | add_executable(subscriber ./Subscriber.cpp) 18 | 19 | -------------------------------------------------------------------------------- /examples/distributed-topic/basic-pub-sub/Publisher.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto topic = hz.get_topic("testtopic").get(); 24 | topic->publish("first message").get(); 25 | std::cout << "Published: Published the message." << std::endl; 26 | 27 | std::cout << "Finished" << std::endl; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /examples/distributed-topic/basic-pub-sub/Subscriber.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | #include 19 | 20 | int 21 | main() 22 | { 23 | auto hz = hazelcast::new_client().get(); 24 | 25 | auto topic = hz.get_topic("testtopic").get(); 26 | 27 | topic 28 | ->add_message_listener(hazelcast::client::topic::listener().on_received( 29 | [](hazelcast::client::topic::message&& msg) { 30 | std::cout << "Message received:" 31 | << msg.get_message_object().get().value() 32 | << std::endl; 33 | })) 34 | .get(); 35 | 36 | std::cout << "Subscriber: Added topic listener. Waiting 5 seconds for the " 37 | "published topic." 38 | << std::endl; 39 | std::this_thread::sleep_for(std::chrono::seconds(5)); 40 | 41 | std::cout << "Finished" << std::endl; 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /examples/distributed-topic/reliabletopic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(rtPublisher ./Publisher.cpp) 17 | add_executable(rtSubscriber ./Subscriber.cpp) 18 | 19 | -------------------------------------------------------------------------------- /examples/event-properties/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(setEventThreadCountAndMaxQueueSize SetEventThreadCountAndMaxQueueSize.cpp) 17 | -------------------------------------------------------------------------------- /examples/external-smart-client-discovery/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(connect-external-client connect-external-client.cpp) 17 | -------------------------------------------------------------------------------- /examples/external-smart-client-discovery/README.md: -------------------------------------------------------------------------------- 1 | # External Smart Client Discovery 2 | 3 | The client sends requests directly to cluster members in the smart client mode (default) in order to 4 | reduce hops to accomplish operations. Because of that, the client should know the addresses of 5 | members in the cluster. 6 | 7 | In cloud-like environments, or Kubernetes, there are usually two network interfaces, the private and 8 | the public network. When the client is in the same network as the members, it uses their private 9 | network addresses. Otherwise, if the client and the Hazelcast cluster are on different networks, the 10 | client cannot connect to members using their private network addresses. Hazelcast 4.2 introduced 11 | External Smart Client Discovery to solve that issue. 12 | 13 | In order to use this feature, make sure your cluster members are accessible from the network the 14 | client resides in, then set config `client_network_config()::use_public_address(true)` to true. You 15 | should specify the public address of at least one member in the configuration: 16 | 17 | ```c++ 18 | hazelcast::client::client_config config; 19 | constexpr int server_port = 5701; 20 | constexpr const char *server_public_address = "myserver.publicaddress.com"; 21 | config.get_network_config().use_public_address(true).add_address( 22 | hazelcast::client::address{server_public_address, server_port}); 23 | ``` 24 | 25 | This solution works everywhere without further configuration: Kubernetes, AWS, GCP, Azure, etc. as 26 | long as the corresponding plugin is enabled in Hazelcast server configuration. 27 | -------------------------------------------------------------------------------- /examples/invocation-timeouts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(setInvocationTimeouts SetInvocationTimeouts.cpp) 17 | -------------------------------------------------------------------------------- /examples/learning-basics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(configure-logging) 17 | add_subdirectory(destroying-instances) 18 | add_subdirectory(unique-names) 19 | -------------------------------------------------------------------------------- /examples/learning-basics/configure-logging/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(disable_logging ./disable_logging.cpp) 17 | add_executable(set_level ./set_level.cpp) 18 | add_executable(custom_log_handler ./custom_log_handler.cpp) 19 | 20 | -------------------------------------------------------------------------------- /examples/learning-basics/configure-logging/disable_logging.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | int 20 | main() 21 | { 22 | hazelcast::client::client_config config; 23 | 24 | // Setting the log level to hazelcast::logger::level::off 25 | // will disable the logs completely. 26 | config.get_logger_config().level(hazelcast::logger::level::off); 27 | 28 | auto hz = hazelcast::new_client(std::move(config)).get(); 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /examples/learning-basics/configure-logging/set_level.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | int 20 | main() 21 | { 22 | hazelcast::client::client_config config; 23 | 24 | config.get_logger_config().level(hazelcast::logger::level::finest); 25 | 26 | auto hz = hazelcast::new_client(std::move(config)).get(); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /examples/learning-basics/destroying-instances/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(learningdestroy ./main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/learning-basics/destroying-instances/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto q1 = hz.get_queue("q").get(); 24 | auto q2 = hz.get_queue("q").get(); 25 | 26 | q1->put("foo").get(); 27 | std::cout << "q1->size:" << q1->size().get() 28 | << " q2->size:" << q2->size().get() << std::endl; 29 | 30 | q1->destroy().get(); 31 | std::cout << "q1->size:" << q1->size().get() 32 | << " q2->size:" << q2->size().get() << std::endl; 33 | 34 | std::cout << "Finished" << std::endl; 35 | 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /examples/learning-basics/unique-names/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(learninguniquenames ./main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/learning-basics/unique-names/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto flakeIdGenerator = hz.get_flake_id_generator("idGenerator").get(); 24 | std::ostringstream out("somemap"); 25 | out << flakeIdGenerator->new_id().get(); 26 | auto map = hz.get_map(out.str()); 27 | 28 | std::cout << "Finished" << std::endl; 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /examples/monitoring/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(cluster) 17 | -------------------------------------------------------------------------------- /examples/monitoring/cluster/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(monitoringcluster ./main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/network-configuration/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(tcpip) 17 | add_subdirectory(socket-interceptor) 18 | add_subdirectory(shuffle-memberlist) 19 | add_subdirectory(connection-strategy) 20 | add_subdirectory(backup-ack) 21 | -------------------------------------------------------------------------------- /examples/network-configuration/backup-ack/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(disable_backup_ack disable_backup_ack.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/network-configuration/backup-ack/disable_backup_ack.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | // Disable the default backup ack feature 22 | auto hz = 23 | hazelcast::new_client( 24 | std::move( 25 | hazelcast::client::client_config().backup_acks_enabled(false))) 26 | .get(); 27 | 28 | // perform operations 29 | 30 | std::cout << "Finished" << std::endl; 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /examples/network-configuration/connection-strategy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(startAsync StartAsync.cpp) 17 | add_executable(doNotReconnect DoNotReconnectToCluster.cpp) 18 | add_executable(reconnectAsync ReconnectAsync.cpp) 19 | add_executable(cluster_connection_retry cluster_connection_retry.cpp) 20 | 21 | -------------------------------------------------------------------------------- /examples/network-configuration/shuffle-memberlist/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(shuffleMemberList ShuffleMemberList.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/network-configuration/socket-interceptor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(networksocketinterceptor ./main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/network-configuration/socket-interceptor/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | int 20 | main() 21 | { 22 | hazelcast::client::client_config config; 23 | config.set_socket_interceptor( 24 | hazelcast::client::socket_interceptor().on_connect( 25 | [](const hazelcast::client::socket& connected_socket) { 26 | std::cout << "Connected to remote host " 27 | << connected_socket.get_address() << std::endl; 28 | })); 29 | 30 | auto hz = hazelcast::new_client(std::move(config)).get(); 31 | 32 | std::cout << "Finished" << std::endl; 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /examples/network-configuration/tcpip/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(networkconfigurationtcpip ./main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/network-configuration/tcpip/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include 18 | 19 | int 20 | main() 21 | { 22 | const char* serverIp = "127.0.0.1"; 23 | const int port = 5701; 24 | hazelcast::client::client_config config; 25 | config.get_network_config() 26 | .add_address({ serverIp, port }) 27 | .add_addresses({ { "127.0.0.1", 5702 }, { "192.168.1.10", 5701 } }); 28 | 29 | auto hz = hazelcast::new_client(std::move(config)).get(); 30 | 31 | auto map = hz.get_map("test map"); 32 | 33 | std::cout << "Finished" << std::endl; 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /examples/pipeline/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(pipeliningDemo PipeliningDemo.cpp) 17 | -------------------------------------------------------------------------------- /examples/replicated-map/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(basics) 17 | add_subdirectory(entry-listener) 18 | -------------------------------------------------------------------------------- /examples/replicated-map/basics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(printAllReplicatedMap PrintAllReplicatedMap.cpp) 17 | add_executable(FillReplicatedMap ./FillReplicatedMap.cpp) 18 | -------------------------------------------------------------------------------- /examples/replicated-map/basics/FillReplicatedMap.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto map = hz.get_replicated_map("map").get(); 24 | 25 | map->put("1", "Tokyo").get(); 26 | map->put("2", "Paris").get(); 27 | map->put("3", "New York").get(); 28 | 29 | std::cout << "Finished loading map" << std::endl; 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /examples/replicated-map/basics/PrintAllReplicatedMap.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto map = hz.get_replicated_map("map").get(); 24 | for (auto& entry : map->entry_set().get()) { 25 | std::cout << entry.first << " " << entry.second << std::endl; 26 | } 27 | 28 | std::cout << "Finished" << std::endl; 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /examples/replicated-map/entry-listener/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(ListeningMember ListeningReplicatedMap.cpp) 17 | add_executable(ModifyMember ModifyReplicatedMap.cpp) 18 | -------------------------------------------------------------------------------- /examples/replicated-map/entry-listener/ModifyReplicatedMap.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto map = hz.get_replicated_map("somemap").get(); 24 | 25 | std::ostringstream out; 26 | out << time(NULL); 27 | const std::string& key = out.str(); 28 | 29 | map->put(key, "1").get(); 30 | map->put(key, "2").get(); 31 | map->remove(key).get(); 32 | 33 | std::cout << "Finished" << std::endl; 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /examples/serialization/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(identified-data-serializable) 17 | add_subdirectory(portable) 18 | add_subdirectory(custom) 19 | add_subdirectory(globalserializer) 20 | add_subdirectory(json) 21 | add_subdirectory(mixed-type-collection) 22 | add_subdirectory(compact) 23 | add_subdirectory(generic-record) -------------------------------------------------------------------------------- /examples/serialization/compact/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(compact ./main.cpp) -------------------------------------------------------------------------------- /examples/serialization/custom/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(custom ./main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/serialization/generic-record/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(generic-record ./main.cpp) -------------------------------------------------------------------------------- /examples/serialization/globalserializer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(globalSerializerExample ./main.cpp) 17 | -------------------------------------------------------------------------------- /examples/serialization/identified-data-serializable/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(identified-data-serializable ./main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/serialization/json/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(jsonExample ./main.cpp) 17 | -------------------------------------------------------------------------------- /examples/serialization/mixed-type-collection/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(mixed-type-collection ./main.cpp) 17 | -------------------------------------------------------------------------------- /examples/serialization/portable/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(portable ./main.cpp) 17 | 18 | -------------------------------------------------------------------------------- /examples/soak-test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(soak_test soak_test.cpp) 2 | -------------------------------------------------------------------------------- /examples/soak-test/README.md: -------------------------------------------------------------------------------- 1 | # Table of Contents 2 | 3 | * [Soak Test Description](#soak-test-description) 4 | * [Success Criteria](#success-criteria) 5 | 6 | # SoakTest Test Description 7 | 8 | The test setup at Hazelcast lab environment is: 9 | 10 | 1. Use 4 member cluster with 1 JVM per VM 11 | 2. The client test program exercises the following API calls from 32 threads in a random manner in a busy loop (See [SoakTest.cpp](soak_test.cpp)): 12 | + Put/Gets (number of keys: 1000, value size of 1 byte) 13 | + Predicates 14 | + MapListeners 15 | + EntryProcessors 16 |

The test code captures any exception and logs to a file. 17 | 18 | 3. Run 10 clients on one lab machine and this machine only runs clients (i.e. no server at this machine) 19 | 20 | 4. Run the tests for 24 hours. Verify that: 21 | + Make sure that all the client processes are up and running before killing the clients after 24 hours. 22 | + Analyse the output file: Make sure that there are no exceptions printed. 23 | 24 | # Success Criteria 25 | 1. No exceptions printed. 26 | 2. All client processes are up and running after 48 hours with no problem. -------------------------------------------------------------------------------- /examples/spi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(proxy) 17 | -------------------------------------------------------------------------------- /examples/spi/proxy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(spiproxy ./main.cpp) 17 | -------------------------------------------------------------------------------- /examples/spi/proxy/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #include 17 | 18 | int 19 | main() 20 | { 21 | auto hz = hazelcast::new_client().get(); 22 | 23 | auto map = hz.get_distributed_object( 24 | "queue distributed object") 25 | .get(); 26 | 27 | std::cout << "Finished" << std::endl; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /examples/sql/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(sql_basic_query sql_basic_query.cpp) 17 | add_executable(sql_query_with_portable sql_query_with_portable.cpp) 18 | add_executable(sql_cancellation_example sql_cancellation_example.cpp) 19 | add_executable(sql_json_example sql_json_example.cpp) 20 | add_executable(sql_order_by_limit_offset sql_order_by_limit_offset.cpp) 21 | add_executable(sql_page_iterator_sync sql_page_iterator_sync.cpp) 22 | add_executable(sql_row_iterator_sync sql_row_iterator_sync.cpp) 23 | add_executable(sql_advanced_query_options sql_advanced_query_options.cpp) 24 | -------------------------------------------------------------------------------- /examples/sql/README: -------------------------------------------------------------------------------- 1 | You need to configure the server to start with jet enabled. You can do this by adding the following line to the 2 | hazelcast config xml file (or similarly with yaml or embedded server configuration): 3 | 4 | ``` 5 | 6 | ``` 7 | 8 | A sample xml file is shared in this example folder. 9 | -------------------------------------------------------------------------------- /examples/sql/hazelcast-sql.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /examples/tls/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(basicTLSClient ./BasicTLSClient.cpp) 17 | add_executable(mutual_authentication ./mutual_authentication.cpp) 18 | -------------------------------------------------------------------------------- /examples/transactions/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_subdirectory(transaction-basic) 17 | -------------------------------------------------------------------------------- /examples/transactions/transaction-basic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | add_executable(transactionbasic ./TransactionBasic.cpp) 17 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/aws/impl/Constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/util/export.h" 19 | 20 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 21 | #pragma warning(push) 22 | #pragma warning(disable : 4251) // for dll export 23 | #endif 24 | 25 | namespace hazelcast { 26 | namespace client { 27 | namespace aws { 28 | namespace impl { 29 | struct HAZELCAST_API Constants 30 | { 31 | static const char* DATE_FORMAT; 32 | static const char* DOC_VERSION; 33 | static const char* SIGNATURE_METHOD_V4; 34 | static const char* GET; 35 | static const char* ECS_CREDENTIALS_ENV_VAR_NAME; 36 | }; 37 | }; // namespace impl 38 | } // namespace aws 39 | } // namespace client 40 | } // namespace hazelcast 41 | 42 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 43 | #pragma warning(pop) 44 | #endif 45 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/aws/utility/aws_url_encoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | 20 | #include "hazelcast/util/export.h" 21 | 22 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 23 | #pragma warning(push) 24 | #pragma warning(disable : 4251) // for dll export 25 | #endif 26 | 27 | namespace hazelcast { 28 | namespace client { 29 | namespace aws { 30 | namespace utility { 31 | class HAZELCAST_API aws_url_encoder 32 | { 33 | public: 34 | static std::string url_encode(const std::string& value); 35 | 36 | private: 37 | static std::string escape_encode(const std::string& value); 38 | }; 39 | } // namespace utility 40 | } // namespace aws 41 | } // namespace client 42 | } // namespace hazelcast 43 | 44 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 45 | #pragma warning(pop) 46 | #endif 47 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/config/cloud_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/util/export.h" 19 | 20 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 21 | #pragma warning(push) 22 | #pragma warning(disable : 4251) // for dll export 23 | #endif 24 | 25 | namespace hazelcast { 26 | namespace client { 27 | namespace config { 28 | /** 29 | * hazelcast.cloud configuration to let the client connect the cluster via 30 | * hazelcast.cloud 31 | */ 32 | struct HAZELCAST_API cloud_config 33 | { 34 | bool enabled{ false }; 35 | std::string discovery_token; 36 | }; 37 | } // namespace config 38 | } // namespace client 39 | } // namespace hazelcast 40 | 41 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 42 | #pragma warning(pop) 43 | #endif 44 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/config/eviction_policy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/util/export.h" 19 | 20 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 21 | #pragma warning(push) 22 | #pragma warning(disable : 4251) // for dll export 23 | #endif 24 | 25 | namespace hazelcast { 26 | namespace client { 27 | namespace config { 28 | enum HAZELCAST_API eviction_policy 29 | { 30 | /** 31 | * Least Recently Used 32 | */ 33 | LRU, 34 | /** 35 | * Least Frequently Used 36 | */ 37 | LFU, 38 | /** 39 | * None 40 | */ 41 | NONE, 42 | /** 43 | * Randomly 44 | */ 45 | RANDOM 46 | }; 47 | } 48 | } // namespace client 49 | } // namespace hazelcast 50 | 51 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 52 | #pragma warning(pop) 53 | #endif 54 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/config/in_memory_format.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/util/export.h" 19 | 20 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 21 | #pragma warning(push) 22 | #pragma warning(disable : 4251) // for dll export 23 | #endif 24 | 25 | namespace hazelcast { 26 | namespace client { 27 | namespace config { 28 | enum HAZELCAST_API in_memory_format 29 | { 30 | /** 31 | * As Binary 32 | */ 33 | BINARY, 34 | /** 35 | * As Object 36 | */ 37 | OBJECT 38 | }; 39 | } 40 | } // namespace client 41 | } // namespace hazelcast 42 | 43 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 44 | #pragma warning(pop) 45 | #endif 46 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/connection/ConnectionListenable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/client/connection/ConnectionListener.h" 20 | 21 | namespace hazelcast { 22 | namespace client { 23 | namespace connection { 24 | /** 25 | * Provides connection listen capabilities. 26 | */ 27 | class HAZELCAST_API ConnectionListenable 28 | { 29 | public: 30 | /** 31 | * Registers a ConnectionListener. 32 | * 33 | * If the same listener is registered multiple times, it will be notified 34 | * multiple times. 35 | * 36 | * @param listener the ConnectionListener to add. 37 | * @throws null_pointer if listener is null. 38 | */ 39 | virtual void add_connection_listener( 40 | const std::shared_ptr& listener) = 0; 41 | }; 42 | } // namespace connection 43 | } // namespace client 44 | } // namespace hazelcast 45 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/connection/ConnectionListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/util/export.h" 20 | #include "hazelcast/client/connection/Connection.h" 21 | 22 | namespace hazelcast { 23 | namespace client { 24 | namespace connection { 25 | class HAZELCAST_API ConnectionListener 26 | { 27 | public: 28 | virtual void connection_added( 29 | const std::shared_ptr connection) = 0; 30 | 31 | virtual void connection_removed( 32 | const std::shared_ptr connection) = 0; 33 | }; 34 | } // namespace connection 35 | } // namespace client 36 | } // namespace hazelcast 37 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/impl/DistributedObjectInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/util/export.h" 19 | #include 20 | 21 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 22 | #pragma warning(push) 23 | #pragma warning(disable : 4251) // for dll export 24 | #endif 25 | 26 | namespace hazelcast { 27 | namespace client { 28 | namespace impl { 29 | class HAZELCAST_API DistributedObjectInfo 30 | { 31 | public: 32 | DistributedObjectInfo(); 33 | 34 | DistributedObjectInfo(const std::string& serviceName, 35 | const std::string& name); 36 | 37 | const std::string& get_service_name() const; 38 | 39 | const std::string& get_name() const; 40 | 41 | private: 42 | std::string serviceName; 43 | std::string name; 44 | }; 45 | } // namespace impl 46 | } // namespace client 47 | } // namespace hazelcast 48 | 49 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 50 | #pragma warning(pop) 51 | #endif 52 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/impl/metrics/metrics_dictionary.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include "hazelcast/util/byte.h" 24 | #include "hazelcast/util/export.h" 25 | 26 | namespace hazelcast { 27 | namespace client { 28 | namespace impl { 29 | namespace metrics { 30 | 31 | class HAZELCAST_API metrics_dictionary 32 | { 33 | private: 34 | using map = std::map; 35 | 36 | public: 37 | using const_iterator = map::const_iterator; 38 | 39 | int get_dictionary_id(const std::string& word); 40 | 41 | const_iterator begin() const noexcept; 42 | const_iterator end() const noexcept; 43 | std::size_t size() const noexcept; 44 | 45 | private: 46 | map word_to_id; 47 | }; 48 | 49 | } // namespace metrics 50 | } // namespace impl 51 | } // namespace client 52 | } // namespace hazelcast 53 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/internal/partition/strategy/StringPartitioningStrategy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | namespace hazelcast { 22 | namespace client { 23 | namespace internal { 24 | namespace partition { 25 | namespace strategy { 26 | class StringPartitioningStrategy 27 | { 28 | public: 29 | static std::string get_base_name(const std::string& name); 30 | 31 | static std::string get_partition_key(const std::string& key); 32 | }; 33 | } // namespace strategy 34 | } // namespace partition 35 | } // namespace internal 36 | 37 | } // namespace client 38 | } // namespace hazelcast 39 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/monitor/local_map_stats.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | #include "hazelcast/util/export.h" 20 | 21 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 22 | #pragma warning(push) 23 | #pragma warning(disable : 4251) // for dll export 24 | #endif 25 | 26 | namespace hazelcast { 27 | namespace client { 28 | namespace monitor { 29 | class near_cache_stats; 30 | 31 | class HAZELCAST_API local_map_stats 32 | { 33 | public: 34 | virtual ~local_map_stats() = default; 35 | 36 | /** 37 | * Returns statistics related to the Near Cache. 38 | * 39 | * @return statistics object for the Near Cache 40 | */ 41 | virtual std::shared_ptr get_near_cache_stats() 42 | const = 0; 43 | }; 44 | } // namespace monitor 45 | } // namespace client 46 | } // namespace hazelcast 47 | 48 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 49 | #pragma warning(pop) 50 | #endif 51 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/protocol/AuthenticationStatus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/util/export.h" 19 | 20 | namespace hazelcast { 21 | namespace client { 22 | namespace protocol { 23 | enum HAZELCAST_API authentication_status 24 | { 25 | AUTHENTICATED = 0, 26 | CREDENTIALS_FAILED = 1, 27 | SERIALIZATION_VERSION_MISMATCH = 2, 28 | NOT_ALLOWED_IN_CLUSTER = 3 29 | }; 30 | } 31 | } // namespace client 32 | } // namespace hazelcast 33 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/protocol/EventMessageConst.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"), 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | namespace hazelcast { 19 | namespace client { 20 | namespace protocol { 21 | enum EventMessageConst 22 | { 23 | EVENT_MEMBER = 200, 24 | EVENT_MEMBERLIST = 201, 25 | EVENT_MEMBERATTRIBUTECHANGE = 202, 26 | EVENT_ENTRY = 203, 27 | EVENT_ITEM = 204, 28 | EVENT_TOPIC = 205, 29 | EVENT_PARTITIONLOST = 206, 30 | EVENT_DISTRIBUTEDOBJECT = 207, 31 | EVENT_CACHEINVALIDATION = 208, 32 | EVENT_MAPPARTITIONLOST = 209, 33 | EVENT_CACHE = 210, 34 | EVENT_CACHEBATCHINVALIDATION = 211, 35 | 36 | // ENTERPRISE 37 | EVENT_QUERYCACHESINGLE = 212, 38 | EVENT_QUERYCACHEBATCH = 213, 39 | 40 | EVENT_CACHEPARTITIONLOST = 214, 41 | EVENT_IMAPINVALIDATION = 215, 42 | EVENT_IMAPBATCHINVALIDATION = 216, 43 | EVENT_PARTITIONS = 217 44 | }; 45 | } 46 | } // namespace client 47 | } // namespace hazelcast 48 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/protocol/IMessageHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | #include "hazelcast/util/export.h" 22 | 23 | namespace hazelcast { 24 | namespace client { 25 | namespace spi { 26 | namespace impl { 27 | class ClientInvocation; 28 | } 29 | } // namespace spi 30 | 31 | namespace connection { 32 | class Connection; 33 | } 34 | 35 | namespace protocol { 36 | class HAZELCAST_API IMessageHandler 37 | { 38 | public: 39 | virtual ~IMessageHandler() = default; 40 | 41 | virtual void handle_client_message( 42 | const std::shared_ptr& invocation, 43 | const std::shared_ptr& response) = 0; 44 | }; 45 | } // namespace protocol 46 | } // namespace client 47 | } // namespace hazelcast 48 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/protocol/ResponseMessageConst.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"), 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/util/export.h" 20 | 21 | namespace hazelcast { 22 | namespace client { 23 | namespace protocol { 24 | HAZELCAST_API enum ResponseMessageConst { 25 | // VOID = 100, 26 | BOOLEAN = 101, 27 | INTEGER = 102, 28 | LONG = 103, 29 | STRING = 104, 30 | DATA = 105, 31 | LIST_DATA = 106, 32 | AUTHENTICATION = 107, 33 | PARTITIONS = 108, 34 | EXCEPTION = 109, 35 | SET_DISTRIBUTED_OBJECT = 110, 36 | ENTRY_VIEW = 111, 37 | JOB_PROCESS_INFO = 112, 38 | SET_DATA = 113, 39 | SET_ENTRY = 114, 40 | READ_RESULT_SET = 115, 41 | CACHE_KEY_ITERATOR_RESULT = 116, 42 | LIST_ENTRY = 117 43 | }; 44 | } 45 | } // namespace client 46 | } // namespace hazelcast 47 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/protocol/codec/builtin/custom_type_factory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/util/export.h" 20 | #include "hazelcast/client/sql/sql_column_metadata.h" 21 | 22 | namespace hazelcast { 23 | namespace client { 24 | namespace protocol { 25 | namespace codec { 26 | namespace builtin { 27 | class HAZELCAST_API custom_type_factory 28 | { 29 | public: 30 | static sql::sql_column_metadata create_sql_column_metadata( 31 | std::string name, 32 | int32_t type, 33 | bool is_nullable_exists, 34 | bool nullability); 35 | }; 36 | 37 | } // namespace builtin 38 | } // namespace codec 39 | } // namespace protocol 40 | } // namespace client 41 | } // namespace hazelcast 42 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/proxy/PartitionSpecificClientProxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/client/proxy/ProxyImpl.h" 19 | 20 | namespace hazelcast { 21 | namespace client { 22 | namespace proxy { 23 | /** 24 | * Base class for proxies of distributed objects that lives in on partition. 25 | */ 26 | class HAZELCAST_API PartitionSpecificClientProxy : public proxy::ProxyImpl 27 | { 28 | protected: 29 | PartitionSpecificClientProxy(const std::string& service_name, 30 | const std::string& object_name, 31 | spi::ClientContext* context); 32 | 33 | void on_initialize() override; 34 | 35 | int partition_id_; 36 | }; 37 | } // namespace proxy 38 | } // namespace client 39 | } // namespace hazelcast 40 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/proxy/ProxyImpl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/client/spi/ClientProxy.h" 19 | #include "hazelcast/client/proxy/SerializingProxy.h" 20 | 21 | namespace hazelcast { 22 | namespace client { 23 | namespace proxy { 24 | class HAZELCAST_API ProxyImpl 25 | : public spi::ClientProxy 26 | , public SerializingProxy 27 | { 28 | protected: 29 | ProxyImpl(const std::string& service_name, 30 | const std::string& object_name, 31 | spi::ClientContext* context); 32 | 33 | ~ProxyImpl() override; 34 | }; 35 | } // namespace proxy 36 | } // namespace client 37 | } // namespace hazelcast 38 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/proxy/TransactionalListImpl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/client/proxy/TransactionalObject.h" 19 | 20 | namespace hazelcast { 21 | namespace client { 22 | namespace proxy { 23 | class HAZELCAST_API TransactionalListImpl : public proxy::TransactionalObject 24 | { 25 | public: 26 | /** 27 | * Returns the size of the list 28 | * @return size 29 | */ 30 | boost::future size(); 31 | 32 | public: 33 | TransactionalListImpl(const std::string& object_name, 34 | txn::TransactionProxy& context); 35 | 36 | boost::future add(const serialization::pimpl::data& e); 37 | 38 | boost::future remove(const serialization::pimpl::data& e); 39 | }; 40 | } // namespace proxy 41 | } // namespace client 42 | } // namespace hazelcast 43 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/proxy/TransactionalQueueImpl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/client/proxy/TransactionalObject.h" 19 | 20 | namespace hazelcast { 21 | namespace client { 22 | namespace proxy { 23 | class HAZELCAST_API TransactionalQueueImpl : public TransactionalObject 24 | { 25 | public: 26 | /** 27 | * Transactional implementation of IQueue::size() 28 | * 29 | * @see IQueue::size() 30 | */ 31 | boost::future size(); 32 | 33 | public: 34 | TransactionalQueueImpl(const std::string& name, 35 | txn::TransactionProxy& transaction_proxy); 36 | 37 | boost::future offer(const serialization::pimpl::data& e, 38 | std::chrono::milliseconds timeout); 39 | 40 | boost::future> poll_data( 41 | std::chrono::milliseconds timeout); 42 | }; 43 | } // namespace proxy 44 | } // namespace client 45 | } // namespace hazelcast 46 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/proxy/TransactionalSetImpl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/client/proxy/TransactionalObject.h" 19 | 20 | namespace hazelcast { 21 | namespace client { 22 | namespace proxy { 23 | class HAZELCAST_API TransactionalSetImpl : public TransactionalObject 24 | { 25 | public: 26 | /** 27 | * Returns the size of the set 28 | * @return size 29 | */ 30 | boost::future size(); 31 | 32 | public: 33 | TransactionalSetImpl(const std::string& name, 34 | txn::TransactionProxy& transaction_proxy); 35 | 36 | boost::future add_data(const serialization::pimpl::data& e); 37 | 38 | boost::future remove_data(const serialization::pimpl::data& e); 39 | }; 40 | } // namespace proxy 41 | } // namespace client 42 | } // namespace hazelcast 43 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/query/entry_comparator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/client/serialization/serialization.h" 19 | #include "hazelcast/util/Comparator.h" 20 | 21 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 22 | #pragma warning(push) 23 | #pragma warning(disable : 4251) // for dll export 24 | #endif 25 | 26 | namespace hazelcast { 27 | namespace client { 28 | namespace query { 29 | template 30 | class entry_comparator : public util::Comparator> 31 | { 32 | public: 33 | int compare(const std::pair*, 34 | const std::pair*) const override 35 | { 36 | return 0; 37 | } 38 | }; 39 | } // namespace query 40 | } // namespace client 41 | } // namespace hazelcast 42 | 43 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 44 | #pragma warning(pop) 45 | #endif 46 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/serialization/pimpl/compact/compact_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/client/exception/protocol_exceptions.h" 19 | 20 | namespace hazelcast { 21 | namespace client { 22 | namespace serialization { 23 | namespace pimpl { 24 | 25 | struct compact_util 26 | { 27 | compact_util() = delete; 28 | 29 | static exception::hazelcast_serialization 30 | exception_for_unexpected_null_value(const std::string& field_name, 31 | const std::string& method_prefix, 32 | const std::string& method_suffix); 33 | 34 | static exception::hazelcast_serialization 35 | exception_for_unexpected_null_value_in_array( 36 | const std::string& field_name, 37 | const std::string& method_prefix, 38 | const std::string& method_suffix); 39 | }; 40 | 41 | } // namespace pimpl 42 | } // namespace serialization 43 | } // namespace client 44 | } // namespace hazelcast -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/serialization/pimpl/compact/schema_writer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/client/serialization/pimpl/compact/schema.h" 20 | 21 | namespace hazelcast { 22 | namespace client { 23 | namespace serialization { 24 | namespace pimpl { 25 | 26 | class HAZELCAST_API schema_writer 27 | { 28 | public: 29 | explicit schema_writer(std::string type_name); 30 | void add_field(std::string field_name, enum field_kind kind); 31 | schema build() &&; 32 | 33 | private: 34 | std::unordered_map field_definition_map_; 35 | std::string type_name_; 36 | }; 37 | 38 | } // namespace pimpl 39 | } // namespace serialization 40 | } // namespace client 41 | } // namespace hazelcast -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/spi/InitializingObject.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/util/export.h" 19 | 20 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 21 | #pragma warning(push) 22 | #pragma warning(disable : 4251) // for dll export 23 | #endif 24 | 25 | namespace hazelcast { 26 | namespace client { 27 | namespace spi { 28 | /** 29 | * Can be implemented by DistributedObject (proxies) to indicate that they want 30 | * to be initialized. 31 | */ 32 | class HAZELCAST_API InitializingObject 33 | { 34 | public: 35 | virtual ~InitializingObject() = default; 36 | 37 | virtual void initialize() = 0; 38 | }; 39 | } // namespace spi 40 | } // namespace client 41 | } // namespace hazelcast 42 | 43 | #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64) 44 | #pragma warning(pop) 45 | #endif 46 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/sql/impl/query_id.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include "hazelcast/util/export.h" 23 | 24 | namespace hazelcast { 25 | namespace client { 26 | namespace sql { 27 | namespace impl { 28 | 29 | struct HAZELCAST_API query_id 30 | { 31 | boost::uuids::uuid member_id; 32 | boost::uuids::uuid local_id; 33 | }; 34 | 35 | std::ostream HAZELCAST_API & 36 | operator<<(std::ostream& os, const query_id& id); 37 | 38 | } // namespace impl 39 | } // namespace sql 40 | } // namespace client 41 | } // namespace hazelcast 42 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/sql/impl/sql_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | #include 23 | 24 | #include "hazelcast/util/export.h" 25 | 26 | namespace hazelcast { 27 | namespace client { 28 | namespace sql { 29 | namespace impl { 30 | 31 | struct HAZELCAST_API sql_error 32 | { 33 | int32_t code; 34 | boost::optional message; 35 | boost::uuids::uuid originating_member_id; 36 | boost::optional suggestion; 37 | }; 38 | 39 | } // namespace impl 40 | } // namespace sql 41 | } // namespace client 42 | } // namespace hazelcast 43 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/sql/sql_column_metadata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | 20 | #include "hazelcast/util/export.h" 21 | #include "hazelcast/client/sql/sql_column_type.h" 22 | 23 | namespace hazelcast { 24 | namespace client { 25 | namespace sql { 26 | 27 | struct HAZELCAST_API sql_column_metadata 28 | { 29 | std::string name; 30 | sql_column_type type; 31 | bool nullable; 32 | 33 | friend bool HAZELCAST_API operator==(const sql_column_metadata& lhs, 34 | const sql_column_metadata& rhs); 35 | }; 36 | 37 | } // namespace sql 38 | } // namespace client 39 | } // namespace hazelcast 40 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/client/sql/sql_expected_result_type.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/util/export.h" 19 | 20 | namespace hazelcast { 21 | namespace client { 22 | namespace sql { 23 | 24 | enum class HAZELCAST_API sql_expected_result_type 25 | { 26 | any = 0, 27 | rows = 1, 28 | update_count = 2 29 | }; 30 | 31 | } 32 | } // namespace client 33 | } // namespace hazelcast 34 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/AddressUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | #include "hazelcast/util/export.h" 22 | #include "hazelcast/util/AddressHelper.h" 23 | 24 | namespace hazelcast { 25 | namespace util { 26 | class HAZELCAST_API AddressUtil 27 | { 28 | public: 29 | static AddressHolder get_address_holder(const std::string& address); 30 | 31 | static AddressHolder get_address_holder(const std::string& address, 32 | int default_port); 33 | 34 | static boost::asio::ip::address get_by_name(const std::string& host); 35 | 36 | private: 37 | static boost::asio::ip::address get_by_name(const std::string& host, 38 | const std::string& service); 39 | }; 40 | 41 | } // namespace util 42 | } // namespace hazelcast 43 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/Clearable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/util/export.h" 20 | 21 | namespace hazelcast { 22 | namespace util { 23 | class HAZELCAST_API Clearable 24 | { 25 | public: 26 | virtual ~Clearable(); 27 | 28 | virtual void clear() = 0; 29 | }; 30 | } // namespace util 31 | } // namespace hazelcast 32 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/Closeable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/util/export.h" 20 | 21 | namespace hazelcast { 22 | namespace util { 23 | class HAZELCAST_API Closeable 24 | { 25 | public: 26 | virtual ~Closeable(); 27 | 28 | virtual void close(const std::string& close_reason) = 0; 29 | }; 30 | } // namespace util 31 | } // namespace hazelcast 32 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/Comparator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | namespace hazelcast { 19 | namespace util { 20 | template 21 | class Comparator 22 | { 23 | public: 24 | virtual ~Comparator() = default; 25 | 26 | /** 27 | * @lhs First value to compare 28 | * @rhs Second value to compare 29 | * @return Returns < 0 if lhs is less, >0 if lhs is greater, else returns 0. 30 | */ 31 | virtual int compare(const T* lhs, const T* rhs) const = 0; 32 | }; 33 | } // namespace util 34 | } // namespace hazelcast 35 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/Destroyable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/util/export.h" 20 | 21 | namespace hazelcast { 22 | namespace util { 23 | class HAZELCAST_API Destroyable 24 | { 25 | public: 26 | virtual ~Destroyable(); 27 | 28 | virtual void destroy() = 0; 29 | }; 30 | } // namespace util 31 | } // namespace hazelcast 32 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/Disposable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/util/export.h" 20 | 21 | namespace hazelcast { 22 | namespace util { 23 | /** 24 | * A {@code Disposable} is a container of data and/or resources that can be 25 | * disposed. 26 | * {@link #dispose()} method is called to dispose contained data and/or 27 | * resources. 28 | */ 29 | class HAZELCAST_API Disposable 30 | { 31 | public: 32 | virtual ~Disposable() = default; 33 | 34 | /** 35 | * Disposes this object and releases any data and/or resources associated 36 | * with it. If this object is already disposed then invoking this 37 | * method has no effect. 38 | */ 39 | virtual void dispose() = 0; 40 | }; 41 | } // namespace util 42 | } // namespace hazelcast 43 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/HashUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include "hazelcast/util/export.h" 19 | namespace hazelcast { 20 | namespace util { 21 | class HAZELCAST_API HashUtil 22 | { 23 | public: 24 | /** 25 | * A function that calculates the index (e.g. to be used in an array/list) 26 | * for a given hash. The returned value will always be equal or larger than 27 | * 0 and will always be smaller than 'length'. 28 | * 29 | * The reason this function exists is to deal correctly with negative and 30 | * especially the Integer.MIN_VALUE; since that can't be used safely with a 31 | * Math.abs function. 32 | * 33 | * @param length the length of the array/list 34 | * @return the mod of the hash 35 | * @throws illegal_argument if mod smaller than 1. 36 | */ 37 | static int hash_to_index(int hash, int length); 38 | }; 39 | } // namespace util 40 | } // namespace hazelcast 41 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/IOUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | #include "hazelcast/util/Closeable.h" 23 | #include "hazelcast/client/exception/iexception.h" 24 | 25 | namespace hazelcast { 26 | namespace util { 27 | class HAZELCAST_API IOUtil 28 | { 29 | public: 30 | template 31 | static std::string to_string(T value) 32 | { 33 | std::stringstream s; 34 | s << value; 35 | return s.str(); 36 | } 37 | 38 | template 39 | static T to_value(const std::string& str) 40 | { 41 | std::stringstream s(str); 42 | T value; 43 | s >> value; 44 | return value; 45 | } 46 | 47 | static void close_resource(Closeable* closable, 48 | const char* close_reason = nullptr); 49 | }; 50 | 51 | template<> 52 | bool 53 | IOUtil::to_value(const std::string& str); 54 | 55 | } // namespace util 56 | } // namespace hazelcast 57 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/Iterable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | #include 20 | 21 | #include "hazelcast/util/Iterator.h" 22 | 23 | namespace hazelcast { 24 | namespace util { 25 | template 26 | class Iterable 27 | { 28 | public: 29 | virtual ~Iterable() = default; 30 | 31 | /** 32 | * Returns an iterator over a set of elements of type T. 33 | * 34 | * @return an Iterator. 35 | */ 36 | virtual Iterator* iterator() 37 | { 38 | assert(0); 39 | return NULL; 40 | } 41 | }; 42 | } // namespace util 43 | } // namespace hazelcast 44 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/Named.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | #include "hazelcast/util/export.h" 22 | 23 | namespace hazelcast { 24 | namespace util { 25 | class HAZELCAST_API Named 26 | { 27 | public: 28 | virtual ~Named() {} 29 | 30 | virtual const std::string get_name() const = 0; 31 | }; 32 | } // namespace util 33 | } // namespace hazelcast 34 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/byte.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | namespace hazelcast { 19 | typedef unsigned char byte; 20 | } 21 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/finally.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | #include 19 | #include "hazelcast/util/export.h" 20 | 21 | namespace hazelcast { 22 | namespace util { 23 | /** 24 | * Utility class to set a lambda to run when current context finishes 25 | */ 26 | class HAZELCAST_API finally 27 | { 28 | std::function functor; 29 | 30 | public: 31 | finally(const std::function& functor) 32 | : functor(functor) 33 | {} 34 | ~finally() { functor(); } 35 | }; 36 | } // namespace util 37 | } // namespace hazelcast -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/noop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include "hazelcast/util/export.h" 20 | 21 | namespace hazelcast { 22 | namespace util { 23 | /** 24 | * void no-operation function 25 | * \tparam Args argument types 26 | */ 27 | template 28 | inline void 29 | noop(Args...) 30 | {} 31 | } // namespace util 32 | } // namespace hazelcast 33 | -------------------------------------------------------------------------------- /hazelcast/include/hazelcast/util/type_traits.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #pragma once 4 | 5 | namespace hazelcast { 6 | namespace util { 7 | template 8 | using enable_if_rvalue_ref_trait = 9 | typename std::enable_if::value, 10 | EnabledT>::type; 11 | } 12 | } // namespace hazelcast -------------------------------------------------------------------------------- /hazelcast/test/CMakeLists.googletest.in: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.10) 2 | 3 | project(googletest-download NONE) 4 | 5 | include(ExternalProject) 6 | ExternalProject_Add(googletest 7 | GIT_REPOSITORY https://github.com/google/googletest.git 8 | GIT_TAG release-1.10.0 9 | SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" 10 | BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build" 11 | CONFIGURE_COMMAND "" 12 | BUILD_COMMAND "" 13 | INSTALL_COMMAND "" 14 | TEST_COMMAND "" 15 | ) -------------------------------------------------------------------------------- /hazelcast/test/README.md: -------------------------------------------------------------------------------- 1 | We use thrift networking library to utilize the hazelcast-remote-controller. It is used to start and stop members and create stop clusters. 2 | 3 | - The thrift library should be installed and the cmake should be able to find it. 4 | -------------------------------------------------------------------------------- /hazelcast/test/benchmark/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | cmake_minimum_required(VERSION 3.10) 17 | 18 | project(hazelcast-cpp-client-benchmark 19 | VERSION 4.1.1 20 | DESCRIPTION "Hazelcast C++ Client Benchmark Project" 21 | LANGUAGES CXX) 22 | 23 | # Set the C++ standard 24 | set(CMAKE_CXX_STANDARD 11) 25 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 26 | 27 | find_package(benchmark REQUIRED) 28 | find_package(hazelcast-cpp-client REQUIRED) 29 | 30 | add_executable(hazelcast_benchmark hazelcast_benchmark.cpp) 31 | target_link_libraries(hazelcast_benchmark benchmark::benchmark benchmark::benchmark_main hazelcast-cpp-client::hazelcast-cpp-client) 32 | -------------------------------------------------------------------------------- /hazelcast/test/benchmark/README.md: -------------------------------------------------------------------------------- 1 | #Dependencies: 2 | - [google benchmark](https://github.com/google/benchmark): Mac OS: brew install google-benchmark 3 | - hazelcast-cpp-client 4 | - Boost 5 | 6 | #Build Instructions: 7 | mkdir build 8 | cd build 9 | cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/path/to/boost/install/dir;/path/to/hazelcast-cpp-client/install/dir 10 | make 11 | 12 | #Running Instructions 13 | Run inside build directory as: 14 | ```shell 15 | ./hazelcast_benchmark 16 | ``` 17 | 18 | Print the options: 19 | ```shell 20 | ./hazelcast_benchmark --help 21 | ``` 22 | You can play with the number of repetitions, output format, aggregates, minimum bencmark time, etc. 23 | 24 | The test is using 32 threads by default, you can change it in the source code. 25 | -------------------------------------------------------------------------------- /hazelcast/test/resources/client1-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDUzCCAjugAwIBAgIEYtZhRjANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJV 3 | UzEMMAoGA1UECBMDQmFyMQwwCgYDVQQHEwNGb28xCzAJBgNVBAoTAkhaMQwwCgYD 4 | VQQLEwNEUkUxFDASBgNVBAMTC2Zvby5iYXIuY29tMB4XDTE3MDgwNzEyMjYyOFoX 5 | DTI3MDYxNjEyMjYyOFowWjELMAkGA1UEBhMCVVMxDDAKBgNVBAgTA0JhcjEMMAoG 6 | A1UEBxMDRm9vMQswCQYDVQQKEwJIWjEMMAoGA1UECxMDRFJFMRQwEgYDVQQDEwtm 7 | b28uYmFyLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKL+xBBd 8 | OLIlMIN54lStfR97DEdDhHu4qyKThhDnX8hDAoiYz4xrtiDsE2PnBqTht/VSMg9d 9 | 5t02/Mp27Xem7UnBnM+uH8gUfZGuVjeyYVcZuKr8UEBK1TJPJ9ujSYfGvXlMbATx 10 | 0UzraUFn7DGH0x8U7XoZnEWHZKEn8+Rev2XbUqzI7jpcADn5IWXbUuzQC+fHuf4l 11 | G1/+JhXzdlItNdQyC2pYvNl2NCtTGbQHpUZ/fzyzQVSg67QiNE/lhIS+h6qr8zox 12 | mJ/iTqHpyss7fKNn/BVahDZndYeh6ErT88PjDIffOlGTKmCxSkhnhW06uAVa+NN8 13 | RdA1f5HuLjnOg1sCAwEAAaMhMB8wHQYDVR0OBBYEFNn+zJY4Z6Pb5Qdw91GmVq// 14 | qKiZMA0GCSqGSIb3DQEBCwUAA4IBAQAoxqXhg+FPIgVYX+/F/VL7CIiJOr9nwZB8 15 | g9gE2PcIOrQQtFwgoNsuMGdqClv2M0RBFtXk6xlk8GVEfOPzRWmVpPZ9lElew6BD 16 | sdXP/1W4eltKNJSakZEPETiEUWhUpcqkHWzuFDtG2XDf75j05YbGOyl1VQJvZ9wP 17 | XDI/rjEqKxDg6bm1r+c5HUq+Xe3wBEhQgLcYkNag1E9n8h/7bSPMp8YDrsoFQjKv 18 | QIGmFUR1Um6we9lX7eaInXzrho9o4+O8T9mw30Iapkpl93WlEn8VuACXOXH0a4Se 19 | uiXSX/9tHzdC0O4ygWOg9GTNw3fIvUiZkDgF91gYgV2/i2OPbpUn 20 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /hazelcast/test/resources/client2-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDUzCCAjugAwIBAgIELChsqzANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJV 3 | UzEMMAoGA1UECBMDQmFyMQwwCgYDVQQHEwNGb28xCzAJBgNVBAoTAkhaMQwwCgYD 4 | VQQLEwNEUkUxFDASBgNVBAMTC2Zvby5iYXIuY29tMB4XDTE3MDgwNzEyMjYyOVoX 5 | DTI3MDYxNjEyMjYyOVowWjELMAkGA1UEBhMCVVMxDDAKBgNVBAgTA0JhcjEMMAoG 6 | A1UEBxMDRm9vMQswCQYDVQQKEwJIWjEMMAoGA1UECxMDRFJFMRQwEgYDVQQDEwtm 7 | b28uYmFyLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKAXHMGv 8 | anqYQQE/PO75/9OZwJojX/VgFHLUPE6sNPGCPZAaNNqAGTBniOqmFhkW/9WJA9wq 9 | fIvMx5Blbc3Ictc7Crhopf4dsoiSobmTrZ+hwZjlPMHM70DcTtKUeB3vwhrH0HTd 10 | PHFFGV4X6oYdJCt8qubIyU6DcoTiIYkSI/R7of2CEfLCkPymBtJj20c9oTReaew9 11 | mW/rrUj0RrH75gvs3ZCGXBQyBAhwv9VqyDSIORj5uo785EDk53OV5Qj7JfKuIfax 12 | cXIH7jq3L4TVos9q1E7QDorvuxGwqDMxrMdyqgnSkOagJ7/PINhsYdW6X8d8m/n5 13 | B3UPvy+Z/s4chPcCAwEAAaMhMB8wHQYDVR0OBBYEFAWHXjsl8atiO0qurSm18CY0 14 | 6c+hMA0GCSqGSIb3DQEBCwUAA4IBAQB6ipD1AaO5AMMpry/m2QB/lDiRmhK5VtNK 15 | GflYrOyjtWKuWBC4n8dWfavqiGSOX7MDerilRt+FMrtgdEZet+sHdMqo139/Zk6J 16 | k0AcsMHE2M8larah1T/ah7fOpQAJEK6SB6x9LKruJwQIj1juGBFGAo8YrigKQY9u 17 | IKWjqOjcK0js4fHLZVGdmHxpU2fAs9UTeFF4EztchRzg30McrUKCiN9sLC0jdm2O 18 | VYLTLC4PcBzAGPBFuIz+MxA+BU5iECZWjXrGKIUw57AtMf4owj4leBuoywLH0iHa 19 | RAvKPHwtknKBSfL4Gqle1zYy2OlyMPqr3TOc+BpPmJp/OWFEVVus 20 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /hazelcast/test/resources/compact.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | compact-dev 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /hazelcast/test/resources/cpp_client.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICUzCCAbygAwIBAgIEUiROSjANBgkqhkiG9w0BAQUFADBuMQswCQYDVQQGEwJU 3 | UjERMA8GA1UECBMISXN0YW5idWwxETAPBgNVBAcTCElzdGFuYnVsMRIwEAYDVQQK 4 | EwlIYXplbGNhc3QxDDAKBgNVBAsMA1ImRDEXMBUGA1UEAxMOSGF6ZWxjYXN0LCBJ 5 | bmMwHhcNMTMwOTAyMDgzNzMwWhcNMjMwNzEyMDgzNzMwWjBuMQswCQYDVQQGEwJU 6 | UjERMA8GA1UECBMISXN0YW5idWwxETAPBgNVBAcTCElzdGFuYnVsMRIwEAYDVQQK 7 | EwlIYXplbGNhc3QxDDAKBgNVBAsMA1ImRDEXMBUGA1UEAxMOSGF6ZWxjYXN0LCBJ 8 | bmMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJVr0Aj6B6nFef8hdLflwwLB 9 | 271XPuI9+KMZwPnEwivPqRtbs3Bj9IiyzM5RavZxqrUHrnoTgeMLZhw08GS1WG+K 10 | BTlTkjHJ5NHbBwImBfvLzXTQo/KfmvWph+AlJm4j0iPAKWfrwiI2vnLuiNhCs0GZ 11 | KYOZaysosqScKWRWLYM/AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAEvQo6VdQri4S 12 | EtjgktSDTS2WcRXKE6RvESoOp7OfOenI6KeS0K81KCJ7ha+ILjl6iwj4Jkwm3Si1 13 | XGFx/wcILQkjXm6tBl4EC6YrpJq1EXR6MyP6GcDk1mQ9QfA/Vf6ocsAiBxUX4WDl 14 | 0yfw/PKQ1CfbCkIFYhFaM2gyAeDdkF8= 15 | -----END CERTIFICATE----- 16 | -------------------------------------------------------------------------------- /hazelcast/test/resources/fragments_bytes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hazelcast/hazelcast-cpp-client/899bf94297b556858082a066176531eae70c749d/hazelcast/test/resources/fragments_bytes.bin -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-default-ca.xml: -------------------------------------------------------------------------------- 1 | 5 | ssl-dev 6 | 7 | 8 | 9 | 10 | com.hazelcast.nio.ssl.ClasspathSSLContextFactory 11 | 12 | 13 | com/hazelcast/nio/ssl/letsencrypt.jks 14 | 123456 15 | SunX509 16 | TLSv1.2 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-lite-member.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | lite-dev 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-ma-optional.xml: -------------------------------------------------------------------------------- 1 | 5 | ssl-dev 6 | 7 | 8 | 9 | com.hazelcast.nio.ssl.ClasspathSSLContextFactory 10 | 11 | 12 | com/hazelcast/nio/ssl-mutual-auth/server1.keystore 13 | password 14 | com/hazelcast/nio/ssl-mutual-auth/server1_knows_client1/server1.truststore 15 | 16 | password 17 | SunX509 18 | OPTIONAL 19 | SunX509 20 | TLSv1.2 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-ma-required.xml: -------------------------------------------------------------------------------- 1 | 5 | ssl-dev 6 | 7 | 8 | 9 | com.hazelcast.nio.ssl.ClasspathSSLContextFactory 10 | 11 | 12 | com/hazelcast/nio/ssl-mutual-auth/server1.keystore 13 | password 14 | com/hazelcast/nio/ssl-mutual-auth/server1_knows_client1/server1.truststore 15 | 16 | password 17 | SunX509 18 | REQUIRED 19 | SunX509 20 | TLSv1.2 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-pncounter-consistency-lost-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | consistency-lost-dev 23 | 24 | 25 | 5 26 | 27 | 28 | 29 | 2147483647 30 | 2147483647 31 | 32 | 33 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-sql-without-jet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | sql-dev 4 | 5 | 6 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-sql.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | sql-dev 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-ssl-server1.xml: -------------------------------------------------------------------------------- 1 | 5 | ssl-dev 6 | 7 | 8 | 9 | 10 | com.hazelcast.nio.ssl.ClasspathSSLContextFactory 11 | 12 | 13 | com/hazelcast/nio/ssl-mutual-auth/server1.keystore 14 | password 15 | SunX509 16 | TLSv1.2 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-test-executor.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | executor-test 23 | 24 | 25 | 26 | com.hazelcast.client.test.IdentifiedFactory 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-token-credentials.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | token-credentials-dev 23 | 24 | 25 | 26 | 27 | 28 | SGF6ZW 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hazelcast-username-password.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | 22 | username-pass-dev 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /hazelcast/test/resources/hot-restart.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | hot-restart-test 23 | 24 | 25 | hot-restart 26 | hot-backup 27 | 120 28 | 900 29 | FULL_RECOVERY_ONLY 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /hazelcast/test/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hazelcast/hazelcast-cpp-client/899bf94297b556858082a066176531eae70c749d/hazelcast/test/resources/keystore.jks -------------------------------------------------------------------------------- /hazelcast/test/resources/lock-expiration.xml: -------------------------------------------------------------------------------- 1 | 5 | TestIssue1005 6 | 7 | 8 | 3 9 | 0 10 | 1 11 | 12 | 13 | -------------------------------------------------------------------------------- /hazelcast/test/resources/logger-config.txt: -------------------------------------------------------------------------------- 1 | * GLOBAL: 2 | FORMAT = %datetime{%d/%M/%Y %h:%m:%s,%g} %level: [%thread] %msg 3 | FILENAME = "testLog.txt" 4 | ENABLED = true 5 | TO_FILE = true 6 | TO_STANDARD_OUTPUT = false 7 | SUBSECOND_PRECISION = 3 8 | PERFORMANCE_TRACKING = false 9 | MAX_LOG_FILE_SIZE = 2097152 10 | 11 | * INFO: 12 | FORMAT = "%datetime{%d/%M/%Y %h:%m:%s,%g} %level %msg" 13 | 14 | * WARNING: 15 | ENABLED = false -------------------------------------------------------------------------------- /hazelcast/test/resources/metrics_blob.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hazelcast/hazelcast-cpp-client/899bf94297b556858082a066176531eae70c749d/hazelcast/test/resources/metrics_blob.bin -------------------------------------------------------------------------------- /hazelcast/test/resources/replicated-map-binary-in-memory-config-hazelcast.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 21 | replicated-map-binary-test 22 | 23 | 24 | BINARY 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /hazelcast/test/resources/serialization.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | serialization-dev 4 | 5 | -------------------------------------------------------------------------------- /hazelcast/test/resources/server1-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDUzCCAjugAwIBAgIEI2J/sTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJV 3 | UzEMMAoGA1UECBMDQmFyMQwwCgYDVQQHEwNGb28xCzAJBgNVBAoTAkhaMQwwCgYD 4 | VQQLEwNEUkUxFDASBgNVBAMTC2Zvby5iYXIuY29tMB4XDTE3MDgwNzEyMjYyN1oX 5 | DTI3MDYxNjEyMjYyN1owWjELMAkGA1UEBhMCVVMxDDAKBgNVBAgTA0JhcjEMMAoG 6 | A1UEBxMDRm9vMQswCQYDVQQKEwJIWjEMMAoGA1UECxMDRFJFMRQwEgYDVQQDEwtm 7 | b28uYmFyLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKv/z3l/ 8 | gJVUELF+pKkn0NV1rJq5aQGOMi1RE8cMbmmY9qz35Bo932VWJa6YJdkpBovnubuV 9 | SsFu6/tp2DKrZ27v0IdQegsQMdnOfe2nbniRa6V/78z/2MF5BsH+dcnhgdecqqen 10 | uYv2UW6f6ZjpP4pjRIYJ02CIOFGEsf9PVehn815KEwhgoWkz7gVHVafmYbmLW93e 11 | CeVzK7a3/ELSmNlG0PDl0RmM0QnVZnCgCVJHK2yYbjGiosCLxHflwgf9hO9JTwnx 12 | 1LYjuUY2wJeDPFfW/bS6bQ/hBuYlYW3t2agBFGEbhmNj95ReDdXSpfXcYL3KICqQ 13 | sx32vMgVsy1fL+ECAwEAAaMhMB8wHQYDVR0OBBYEFACbwiUEgAeQ1NEN2TJ04Zn3 14 | FgedMA0GCSqGSIb3DQEBCwUAA4IBAQCKw8JegZGGYLv1vXAZLvr2qx37JWhlaq3w 15 | No7SrB2h8WfJaBoSULk27m4IrgXC5Rzahl9YMWYSDb7y4vPTXaLT54sy97yE14d+ 16 | Kut8txTLsLfvTqyiNGBHUZL0nkGvcrs1pjRN1EwXi5pMuxqHbvBs834xUJzwXGEv 17 | fsVyf1OTLd0nU0WIoGCnI2Jm4yHqfN1789GIiRmcZMgMlunI5391UXP7PgWg9abi 18 | MzpiahvnWbpzuT/ETHXNIVFFLC21SMAw1G14ahdEfz+8ipH0CoQ3neIeF9kULXKC 19 | QvnHwDQlPJGycP++cJoiSPQoS1ihbMC36E3PI/INv1zpNaHrzqlG 20 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /hazelcast/test/resources/server2-cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDUzCCAjugAwIBAgIEDXVHLjANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJV 3 | UzEMMAoGA1UECBMDQmFyMQwwCgYDVQQHEwNGb28xCzAJBgNVBAoTAkhaMQwwCgYD 4 | VQQLEwNEUkUxFDASBgNVBAMTC2Zvby5iYXIuY29tMB4XDTE3MDgwNzEyMjYyN1oX 5 | DTI3MDYxNjEyMjYyN1owWjELMAkGA1UEBhMCVVMxDDAKBgNVBAgTA0JhcjEMMAoG 6 | A1UEBxMDRm9vMQswCQYDVQQKEwJIWjEMMAoGA1UECxMDRFJFMRQwEgYDVQQDEwtm 7 | b28uYmFyLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMcBdREB 8 | G6ZzdIisiQdNBisZo85yLo5jj2j18UQ4deDaLucgS0WgsPzNCXI7J/Q4qrVS04Mo 9 | 1xGmx2NNGfh2NYzgmrvzbU/Q8sj8j55Yml8n39/1nb1OzpAJSz/Q6mKR1bCzuW1e 10 | t/+7UFSI+mHudzM3cW1J+JBRu6y0kGGGueapUi3N9v9Ua9O/XWJo7AdE2LFpx0g7 11 | QuKXLXlbesHbeGSEZCbJq+Ej8LmO0AUbX9IhNk8j0OYgOdJ8Ru8Lsd4nM+6WKCK5 12 | Tx4XxKTn3fXA+bIS0LfaI/OViIYVd4xwdU2wdB/k/6kb6txWJCdom9Vy3n4tGsFE 13 | Y5GaBhRiuqqV7Z0CAwEAAaMhMB8wHQYDVR0OBBYEFMtJ7selX81GdXYIK6BjTY4+ 14 | l3aBMA0GCSqGSIb3DQEBCwUAA4IBAQCfqKSU/tY/hNI4m2toxFLS7KTAIfoEFscz 15 | D9PQbA/4GQxIhrKEy1Zh20VWY0bsKQE3ZPLjyf/OGaZcFelmCnTZ0CvdoSA75iEA 16 | UpOL5VJROHHB/Rwm7gVNXtBvssy1AfLbBOndtvGkHw9DAHV2stLVxwifWzuFOPxV 17 | vVXonEBdlF/MbODNFHbSmjziH6i25wBWOp1ADvpm6OI4ELmGGyLw1mRuAhffVr8R 18 | u9ECRnj/25O/C7YSjBtuajPwKmncssIhRMZCiiNGIUJ7uMr0yKRramBerEa1Qck5 19 | XU41VDAPijajphCDhVrKKq6U0NOaql4wTN85LcZykqGmEB6Pq6Iu 20 | -----END CERTIFICATE----- -------------------------------------------------------------------------------- /hazelcast/test/resources/short-heartbeat.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 22 | short-heartbeat-cluster 23 | 24 | 25 | 2000 26 | 2 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /hazelcast/test/resources/truststore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hazelcast/hazelcast-cpp-client/899bf94297b556858082a066176531eae70c749d/hazelcast/test/resources/truststore.jks -------------------------------------------------------------------------------- /hazelcast/test/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.10) 2 | 3 | FILE(GLOB_RECURSE TEST_SOURCES "./*cpp") 4 | FILE(GLOB_RECURSE TEST_HEADERS "./*h") 5 | 6 | add_executable(client_test ${TEST_SOURCES} ${TEST_HEADERS}) 7 | 8 | target_compile_definitions( 9 | client_test 10 | PRIVATE HAZELCAST_VERSION="${PROJECT_VERSION}" 11 | ) 12 | 13 | if (MSVC) 14 | target_compile_options(client_test PRIVATE /bigobj) 15 | endif() 16 | 17 | find_package(Thrift 0.13.0 REQUIRED) 18 | 19 | target_link_libraries( 20 | client_test 21 | PRIVATE hazelcast-cpp-client ${GTEST_TARGETS} thrift::thrift 22 | ) 23 | -------------------------------------------------------------------------------- /hazelcast/test/src/CountDownLatchWaiter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | #pragma once 17 | 18 | namespace hazelcast { 19 | namespace client { 20 | namespace test { 21 | 22 | class CountDownLatchWaiter 23 | { 24 | public: 25 | CountDownLatchWaiter& add(boost::latch& latch1); 26 | 27 | boost::cv_status wait_for(boost::chrono::steady_clock::duration duration); 28 | 29 | void reset(); 30 | 31 | private: 32 | std::vector latches_; 33 | }; 34 | 35 | } // namespace test 36 | } // namespace client 37 | } // namespace hazelcast 38 | -------------------------------------------------------------------------------- /hazelcast/test/src/compact_test.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #include "compact/compact_serialization_test.h" 18 | #include "compact/compact_rabin_fingerprint_test.h" 19 | #include "compact/compact_nullable_primitive_interoperability_test.h" 20 | #include "compact/compact_schema_replication_on_write_test.h" 21 | #include "compact/compact_schema_replication_on_cluster_restart_test.h" 22 | #include "compact/compact_schema_validation_test.h" 23 | #include "compact/compact_schema_replication_stress_test.h" 24 | #include "compact/compact_schema_fetch_on_read.h" 25 | #include "compact/compact_read_write_integration_test.h" 26 | #include "compact/compact_field_kind_test.h" 27 | #include "compact/compact_generic_record_builder_test.h" 28 | #include "compact/compact_generic_record_test.h" 29 | #include "compact/compact_generic_record_integration_test.h" 30 | #include "compact/compact_generic_record_array_overloads.h" -------------------------------------------------------------------------------- /hazelcast/test/src/cpp-controller/remote_controller_constants.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Autogenerated by Thrift Compiler (0.13.0) 3 | * 4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 5 | * @generated 6 | */ 7 | #include "remote_controller_constants.h" 8 | 9 | namespace hazelcast { 10 | namespace client { 11 | namespace test { 12 | namespace remote { 13 | 14 | const remote_controllerConstants g_remote_controller_constants; 15 | 16 | remote_controllerConstants::remote_controllerConstants() {} 17 | 18 | } // namespace remote 19 | } // namespace test 20 | } // namespace client 21 | } // namespace hazelcast 22 | -------------------------------------------------------------------------------- /hazelcast/test/src/cpp-controller/remote_controller_constants.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Autogenerated by Thrift Compiler (0.13.0) 3 | * 4 | * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING 5 | * @generated 6 | */ 7 | #ifndef remote_controller_CONSTANTS_H 8 | #define remote_controller_CONSTANTS_H 9 | 10 | #include "remote_controller_types.h" 11 | 12 | namespace hazelcast { 13 | namespace client { 14 | namespace test { 15 | namespace remote { 16 | 17 | class remote_controllerConstants 18 | { 19 | public: 20 | remote_controllerConstants(); 21 | }; 22 | 23 | extern const remote_controllerConstants g_remote_controller_constants; 24 | 25 | } // namespace remote 26 | } // namespace test 27 | } // namespace client 28 | } // namespace hazelcast 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /hazelcast/test/src/remote_controller_client.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2008-2025, Hazelcast, Inc. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #pragma once 18 | 19 | #include 20 | #include 21 | 22 | #include "cpp-controller/RemoteController.h" 23 | 24 | namespace hazelcast { 25 | namespace client { 26 | namespace test { 27 | 28 | std::string 29 | remote_controller_address(); 30 | 31 | remote::RemoteControllerClient& 32 | remote_controller_client(); 33 | 34 | member::version 35 | cluster_version(); 36 | 37 | } // namespace test 38 | } // namespace client 39 | } // namespace hazelcast 40 | -------------------------------------------------------------------------------- /logo/IMDG_blue_logo_square_RGB-dark_200px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hazelcast/hazelcast-cpp-client/899bf94297b556858082a066176531eae70c749d/logo/IMDG_blue_logo_square_RGB-dark_200px.png -------------------------------------------------------------------------------- /sample_project/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | project(HazelcastClientSample) 4 | 5 | set(CMAKE_CXX_STANDARD 11) 6 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 7 | 8 | find_package(hazelcast-cpp-client CONFIG REQUIRED) 9 | 10 | 11 | add_executable(client client.cpp) 12 | target_link_libraries(client PRIVATE hazelcast-cpp-client::hazelcast-cpp-client) -------------------------------------------------------------------------------- /sample_project/client.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | int main() { 3 | auto hz = hazelcast::new_client().get(); // Connects to the cluster 4 | 5 | auto personel = hz.get_map("personel_map").get(); 6 | personel->put("Alice", "IT").get(); 7 | personel->put("Bob", "IT").get(); 8 | personel->put("Clark", "IT").get(); 9 | std::cout << "Added IT personel. Logging all known personel" << std::endl; 10 | for (const auto &entry : personel->entry_set().get()) { 11 | std::cout << entry.first << " is in " << entry.second << " department." << std::endl; 12 | } 13 | 14 | return 0; 15 | } -------------------------------------------------------------------------------- /scripts/build-windows.bat: -------------------------------------------------------------------------------- 1 | @REM Builds the library using CMake on Windows 2 | @REM The script should be run from the project's root directory 3 | @REM This environment variables are the parameters to this script: 4 | @REM - BUILD_DIR : build directory 5 | @REM - BIT_VERSION : target platform architecture (32 or 64) 6 | @REM - INSTALL : install after the build finishes (set to ON) 7 | @REM - BUILD_CONFIGURATION : config to use when building (Release, Debug, etc.) 8 | @REM - CXXFLAGS : additional compiler flags 9 | @REM 10 | @REM Command line arguments are forwarded to CMake. 11 | @REM 12 | 13 | @call .\scripts\windows-common.bat 14 | 15 | REM print variables for debugging 16 | @echo SOLUTION_TYPE = %SOLUTION_TYPE% 17 | @echo PLATFORM = %PLATFORM% 18 | @echo BUILD_DIR = %BUILD_DIR% 19 | 20 | REM remove the given build directory if already exists 21 | @rd /s /q %BUILD_DIR% 22 | @mkdir %BUILD_DIR% 23 | 24 | @echo Configuring... 25 | cmake -S . -B %BUILD_DIR% ^ 26 | -A %PLATFORM% ^ 27 | -DCMAKE_CONFIGURATION_TYPES=%BUILD_CONFIGURATION% ^ 28 | %* ^ 29 | || exit /b 1 30 | 31 | @echo Building... 32 | cmake --build %BUILD_DIR% --verbose --parallel --config %BUILD_CONFIGURATION% || exit /b 1 33 | 34 | 35 | if "%INSTALL%" == "ON" ( 36 | @echo Installing... 37 | cmake --install %BUILD_DIR% --config %BUILD_CONFIGURATION% || exit /b 1 38 | ) 39 | 40 | 41 | exit /b 0 42 | -------------------------------------------------------------------------------- /scripts/do-all-unix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Builds, tests and installs the library, and verifies the installation on UNIX-like platforms 4 | # The script should be run from the project's root directory 5 | # 6 | # This environment variables are the parameters to this script: 7 | # - BIT_VERSION : target platform architecture (32 or 64) 8 | # - BUILD_TYPE : Release, Debug, etc. 9 | # - LIBRARY_TYPE : SHARED or STATIC 10 | # - WITH_OPENSSL : ON or OFF 11 | # - COVERAGE: ON or OFF 12 | # 13 | 14 | # exit if a command returns non-zero status 15 | set -e 16 | 17 | export BUILD_DIR=build 18 | export INSTALL=ON 19 | 20 | DESTINATION=$(pwd)/destination 21 | 22 | # set BUILD_SHARED_LIBS depending on LIBRARY_TYPE 23 | BUILD_SHARED_LIBS=ON 24 | if [ "$LIBRARY_TYPE" == "STATIC" ]; then 25 | BUILD_SHARED_LIBS=OFF; 26 | fi 27 | 28 | ./scripts/build-unix.sh \ 29 | -DCMAKE_INSTALL_PREFIX=$DESTINATION \ 30 | -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS \ 31 | -DWITH_OPENSSL=$WITH_OPENSSL \ 32 | -DBUILD_TESTS=ON \ 33 | -DBUILD_EXAMPLES=OFF 34 | 35 | ./scripts/test-unix.sh 36 | 37 | if [ "$COVERAGE" == "ON" ]; then 38 | gcovr --xml-pretty -o cpp_coverage.xml \ 39 | --delete \ 40 | -r "$(pwd)/hazelcast" -e "$(pwd)/hazelcast/test" \ 41 | "$(pwd)/$BUILD_DIR" 42 | fi 43 | 44 | export BUILD_DIR=build-examples 45 | 46 | ./scripts/verify-installation-unix.sh \ 47 | -DCMAKE_PREFIX_PATH=$DESTINATION -DWITH_OPENSSL=$WITH_OPENSSL 48 | -------------------------------------------------------------------------------- /scripts/format-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Formats all source and header files using ClangFormat. 4 | # However, you should probably use git-clang-format or your IDE to format your 5 | # changes before committing. 6 | 7 | find hazelcast/generated-sources hazelcast/include hazelcast/src hazelcast/test/src examples \ 8 | | grep -E '\.(cpp|h)$' \ 9 | | xargs clang-format -i 10 | -------------------------------------------------------------------------------- /scripts/install-boost.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Installs Boost from source 4 | # usage: ./install-boost.sh 5 | 6 | set -o errexit ${RUNNER_DEBUG:+-x} 7 | 8 | if [[ "$#" -ne 1 ]]; then 9 | echo "usage: $0 " 10 | exit 1 11 | fi 12 | 13 | TARBALL_NAME=boost_$(echo "$1" | tr . _) 14 | 15 | curl --silent --location "https://archives.boost.io/release/${1}/source/${TARBALL_NAME}.tar.gz" | tar xzf - 16 | pushd "${TARBALL_NAME}" 17 | ./bootstrap.sh 18 | ./b2 --with-thread --with-chrono install 19 | popd 20 | -------------------------------------------------------------------------------- /scripts/install-thrift.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Installs Apache Thrift from source 4 | # usage ./install-thrift.sh 5 | 6 | set -e 7 | 8 | if [ "$#" -ne 1 ]; then 9 | echo "usage: $0 " 10 | exit 1 11 | fi 12 | 13 | curl --silent -Lo thrift-$1.tar.gz https://archive.apache.org/dist/thrift/$1/thrift-$1.tar.gz 14 | tar xzf thrift-$1.tar.gz 15 | cd thrift-$1/build 16 | cmake .. -DBUILD_COMPILER=OFF -DBUILD_TESTING=OFF -DBUILD_TUTORIALS=OFF -DBUILD_LIBRARIES=ON \ 17 | -DBUILD_CPP=ON -DBUILD_AS3=OFF -DBUILD_C_GLIB=OFF -DBUILD_JAVA=OFF -DBUILD_PYTHON=OFF \ 18 | -DBUILD_HASKELL=OFF -DWITH_OPENSSL=OFF -DWITH_LIBEVENT=OFF -DWITH_ZLIB=OFF \ 19 | -DWITH_QT5=OFF 20 | cmake --build . --target install 21 | -------------------------------------------------------------------------------- /scripts/verify-installation-unix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Builds the examples using an installed library 4 | # The script should be run from the project's root directory 5 | # 6 | # This environment variables are the parameters to this script: 7 | # - BUILD_DIR : build directory 8 | # - BIT_VERSION : target platform architecture (32 or 64) 9 | # - CXXFLAGS : additional compiler flags 10 | # 11 | # Command line arguments are forwarded to CMake. 12 | # 13 | 14 | # exit if a command returns non-zero status 15 | set -e 16 | 17 | # set -m32 or -m64 if a BIT_VERSION is given 18 | if [ -n "$BIT_VERSION" ]; then 19 | CXXFLAGS="$CXXFLAGS -m$BIT_VERSION" 20 | fi 21 | 22 | # export flags variable to be used by CMake 23 | export CXXFLAGS 24 | 25 | # remove the given build directory if already exists 26 | if [ -d "$BUILD_DIR" ]; then 27 | echo "Given build directory $BUILD_DIR exists. Removing for a clean build." 28 | rm -rf $BUILD_DIR 29 | fi 30 | 31 | SOURCE_DIR=$(pwd)/examples 32 | 33 | mkdir $BUILD_DIR 34 | cd $BUILD_DIR 35 | 36 | echo "Configuring..." 37 | cmake $SOURCE_DIR "$@" 38 | 39 | echo "Building..." 40 | VERBOSE=1 cmake --build . 41 | 42 | -------------------------------------------------------------------------------- /scripts/verify-installation-windows.bat: -------------------------------------------------------------------------------- 1 | @REM Builds the examples using an installed library 2 | @REM The script should be run from the project's root directory 3 | @REM 4 | @REM This environment variables are the parameters to this script: 5 | @REM - BUILD_DIR : build directory 6 | @REM - BIT_VERSION : target platform architecture (32 or 64) 7 | @REM - BUILD_CONFIGURATION : config to use when building (Release, Debug, etc.) 8 | @REM 9 | @REM Command line arguments are forwarded to CMake. 10 | @REM 11 | 12 | @call .\scripts\windows-common.bat 13 | 14 | REM remove the given build directory if already exists 15 | @rd /s /q %BUILD_DIR% 16 | @mkdir %BUILD_DIR% 17 | 18 | echo "Configuring..." 19 | cmake -S .\examples -B %BUILD_DIR% ^ 20 | -A %PLATFORM% ^ 21 | -DCMAKE_CONFIGURATION_TYPES=%BUILD_CONFIGURATION% ^ 22 | -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake ^ 23 | %* ^ 24 | || exit /b 1 25 | 26 | echo "Building..." 27 | cmake --build %BUILD_DIR% --verbose --parallel --config %BUILD_CONFIGURATION% || exit /b 1 28 | -------------------------------------------------------------------------------- /scripts/windows-common.bat: -------------------------------------------------------------------------------- 1 | @REM Sets Windows-spesific environment variables used in build-windows.bat and verify-installation.bat. 2 | @REM This is a helper script and should not be run by itself. 3 | 4 | if %BIT_VERSION% == 32 ( 5 | @set PLATFORM="win32" 6 | ) else ( 7 | @set PLATFORM="x64" 8 | ) 9 | --------------------------------------------------------------------------------