You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client library can handle polymorphic objects such that you can use a base class type structure, such as IMap, you can put and get derived types. This support exists for IdentifiedDataSerializable, Portable and Custom objects.
324
+
The client library can handle polymorphic objects such that you can use a base class type structure, such as `IMap`, you can put and get derived types. This support exists for `IdentifiedDataSerializable`, `Portable` and custom objects.
325
325
326
326
You can find the polymorphic usage examples at examples/distributed-map/mixed-map folder.
327
327
328
-
For IdentifiedDataSerializable objects, you need to register a factory implementation of type serialization::DataSerializableFactory. See the below example:
328
+
For `IdentifiedDataSerializable` objects, you need to register a factory implementation of type `serialization::DataSerializableFactory`. See the below example:
329
329
```
330
330
class PolymorphicDataSerializableFactory : public serialization::DataSerializableFactory {
331
331
public:
@@ -352,7 +352,7 @@ public:
352
352
new PolymorphicDataSerializableFactory()));
353
353
```
354
354
355
-
Similarly for Portable types you need to register a factory of type serialization::PortableFactory.
355
+
Similarly for `Portable` types you need to register a factory of type `serialization::PortableFactory`.
Using raw pointer based API may improve performance if you are using the API to return multiple values such as values, keySet, and entrySet. In this case, cost of deserialization is delayed until the item is actually accessed.
437
437
438
438
# Mixed Object Types Supporting HazelcastClient
439
-
Sometimes, you may need to use Hazelcast data structures with objects of different types. For example, you may want to put int, string, identifieddataserializable, etc. objects into the same Hazelcast IMap data structure. You can do this by using the mixed type adopted HazelcastClient. You can adopt the client in this way:
439
+
Sometimes, you may need to use Hazelcast data structures with objects of different types. For example, you may want to put `int`, `string`, `IdentifiedDataSerializable`, etc. objects into the same Hazelcast `IMap` data structure. You can do this by using the mixed type adopted `HazelcastClient`. You can adopt the client in this way:
The mixedtype::HazelcastClient interface is designed to provide you the data structures which allows you to work with any object types in a mixed manner. For example, the interface allows you to provide the key and value type differently for each map.put call. An example usage is shown below:
445
+
The `mixedtype::HazelcastClient` interface is designed to provide you the data structures which allows you to work with any object types in a mixed manner. For example, the interface allows you to provide the key and value type differently for each map.put call. An example usage is shown below:
@@ -452,7 +452,7 @@ The mixedtype::HazelcastClient interface is designed to provide you the data str
452
452
TypedData result = map.get<int>(3);
453
453
```
454
454
455
-
As you can see in the above code snippet, we are putting int, string and MyCustomObject to the same map. Both the key and value can be of different type for each map.put call.
455
+
As you can see in the above code snippet, we are putting `int`, `string` and MyCustomObject to the same map. Both the key and value can be of different type for each map.put call.
456
456
457
457
If you want to use mixed type map with near cache, then you should use the MixedNearCacheConfig class and add config to the ClientConfig using the addMixedNearCacheConfig method. See the below example:
458
458
```
@@ -487,6 +487,17 @@ The TypedData class is a wrapper class for the serialized binary data. It presen
487
487
488
488
TypedData does late deserialization of the data only when the get method is called.
489
489
490
+
This TypedData allows you to retrieve the data type of the underlying binary to be used when being deserialized. This class represents the type of a Hazelcast serializable object. The fields can take the following values:
491
+
1. <b>Primitive types</b>: `factoryId=-1`, `classId=-1`, `typeId` is the type ID for that primitive as listed in
492
+
`SerializationConstants`
493
+
2. <b>Array of primitives</b>: `factoryId=-1`, `classId=-1`, `typeId` is the type ID for that array as listed in
494
+
`SerializationConstants`
495
+
3. <b>IdentifiedDataSerializable</b>: `factoryId`, `classId` and `typeId` are non-negative values as registered by
496
+
the `DataSerializableFactory`.
497
+
4. <b>Portable</b>: `factoryId`, `classId` and `typeId` are non-negative values as registered by the `PortableFactory`.
498
+
5. <b>Custom serialized objects</b>: `factoryId=-1`, `classId=-1`, `typeId` is the non-negative type ID as
499
+
registered for the custom object.
500
+
490
501
# Query API
491
502
492
503
C++ client API allows you to query map values, keys and entries using predicates. It also allows you to use Hazelcast Map's `executeOnKey` and `executeOnEntries` methods with predicates. You can run a processor on a subset of entries with these methods.
@@ -530,23 +541,23 @@ This example query returns the values between 5 and 10, inclusive. You can find
530
541
531
542
# Ringbuffer
532
543
533
-
You can benefit from Hazelcast Ringbuffer using the C++ client library. You can start by obtaining the Ringbuffer using the `HazelcastClient` as usual, as shown below:
544
+
You can benefit from Hazelcast `Ringbuffer` using the C++ client library. You can start by obtaining the `Ringbuffer` using the `HazelcastClient` as usual, as shown below:
Ringbuffer interface allows you to add a new item to the Ringbuffer or read an entry at a sequence number.
550
+
`Ringbuffer` interface allows you to add a new item to the `Ringbuffer` or read an entry at a sequence number.
540
551
541
-
You can query the Ringbuffer capacity which is configured at the server side.
552
+
You can query the `Ringbuffer` capacity which is configured at the server side.
542
553
543
554
# Reliable Topic
544
555
545
556
You can use Reliable Topic if you do not want to miss any messages during failures. Hazelcast Reliable Topic provides a very similar interface to Topic structure but it has several configuration options.
546
557
547
-
Reliable Topic implementation depends on the Ringbuffer data structure. The data is kept in the Hazelcast cluster's Ringbuffer structure. These Ringbuffer structures' names start with "\_hz\_rb\_".
558
+
Reliable Topic implementation depends on the `Ringbuffer` data structure. The data is kept in the Hazelcast cluster's `Ringbuffer` structure. These `Ringbuffer` structures' names start with "\_hz\_rb\_".
548
559
549
-
Reliable Topic also supports batch reads from the Ringbuffer. You can optimize the internal working of listener using the method `ReliableTopicConfig::setReadBatchSize`.
560
+
Reliable Topic also supports batch reads from the `Ringbuffer`. You can optimize the internal working of listener using the method `ReliableTopicConfig::setReadBatchSize`.
550
561
551
562
# Map Near Cache
552
563
Map can be configured to work with near cache enabled. Near cache allows local caching of entries fetched from the cluster at the client side. The local cache is updated when the client does a get request for a map entry. The locally cached entries are updated automatically as any change occurs in the map data in the cluster. Special internal event listeners are utilized for this purpose.
0 commit comments