Config

class IntType[source]

Bases: object

Integer type options that can be used by serialization service.

VAR = 0

Integer types will be serialized as 8, 16, 32, 64 bit integers or as Java BigInteger according to their value. This option may cause problems when the Python client is used in conjunction with statically typed language clients such as Java or .NET.

BYTE = 1

Integer types will be serialized as a 8 bit integer(as Java byte)

SHORT = 2

Integer types will be serialized as a 16 bit integer(as Java short)

INT = 3

Integer types will be serialized as a 32 bit integer(as Java int)

LONG = 4

Integer types will be serialized as a 64 bit integer(as Java long)

BIG_INT = 5

Integer types will be serialized as Java BigInteger. This option can handle integer types which are less than -2^63 or greater than or equal to 2^63. However, when this option is set, serializing/de-serializing integer types is costly.

class EvictionPolicy[source]

Bases: object

Near Cache eviction policy options.

NONE = 0

No eviction.

LRU = 1

Least Recently Used items will be evicted.

LFU = 2

Least frequently Used items will be evicted.

RANDOM = 3

Items will be evicted randomly.

class InMemoryFormat[source]

Bases: object

Near Cache in memory format of the values.

BINARY = 0

As Hazelcast serialized bytearray data.

OBJECT = 1

As the actual object.

class SSLProtocol[source]

Bases: object

SSL protocol options.

TLSv1+ requires at least Python 2.7.9 or Python 3.4 build with OpenSSL 1.0.1+ TLSv1_3 requires at least Python 2.7.15 or Python 3.7 build with OpenSSL 1.1.1+

SSLv2 = 0

SSL 2.0 Protocol. RFC 6176 prohibits SSL 2.0. Please use TLSv1+.

SSLv3 = 1

SSL 3.0 Protocol. RFC 7568 prohibits SSL 3.0. Please use TLSv1+.

TLSv1 = 2

TLS 1.0 Protocol described in RFC 2246.

TLSv1_1 = 3

TLS 1.1 Protocol described in RFC 4346.

TLSv1_2 = 4

TLS 1.2 Protocol described in RFC 5246.

TLSv1_3 = 5

TLS 1.3 Protocol described in RFC 8446.

class QueryConstants[source]

Bases: object

Contains constants for Query.

KEY_ATTRIBUTE_NAME = '__key'

Attribute name of the key.

THIS_ATTRIBUTE_NAME = 'this'

Attribute name of the value.

class UniqueKeyTransformation[source]

Bases: object

Defines an assortment of transformations which can be applied to unique key values.

OBJECT = 0

Extracted unique key value is interpreted as an object value. Non-negative unique ID is assigned to every distinct object value.

LONG = 1

Extracted unique key value is interpreted as a whole integer value of byte, short, int or long type. The extracted value is up casted to long (if necessary) and unique non-negative ID is assigned to every distinct value.

RAW = 2

Extracted unique key value is interpreted as a whole integer value of byte, short, int or long type. The extracted value is up casted to long (if necessary) and the resulting value is used directly as an ID.

class IndexType[source]

Bases: object

Type of the index.

SORTED = 0

Sorted index. Can be used with equality and range predicates.

HASH = 1

Hash index. Can be used with equality predicates.

BITMAP = 2

Bitmap index. Can be used with equality predicates.

class ReconnectMode[source]

Bases: object

Reconnect options.

OFF = 0

Prevent reconnect to cluster after a disconnect.

ON = 1

Reconnect to cluster by blocking invocations.

ASYNC = 2

Reconnect to cluster without blocking invocations. Invocations will receive ClientOfflineError

class TopicOverloadPolicy[source]

Bases: object

A policy to deal with an overloaded topic; a topic where there is no place to store new messages.

The reliable topic uses a hazelcast.proxy.ringbuffer.Ringbuffer to store the messages. A ringbuffer doesn’t track where readers are, so it has no concept of a slow consumers. This provides many advantages like high performance reads, but it also gives the ability to the reader to re-read the same message multiple times in case of an error.

A ringbuffer has a limited, fixed capacity. A fast producer may overwrite old messages that are still being read by a slow consumer. To prevent this, we may configure a time-to-live on the ringbuffer.

Once the time-to-live is configured, the TopicOverloadPolicy controls how the publisher is going to deal with the situation that a ringbuffer is full and the oldest item in the ringbuffer is not old enough to get overwritten.

Keep in mind that this retention period (time-to-live) can keep messages from being overwritten, even though all readers might have already completed reading.

DISCARD_OLDEST = 0

Using this policy, a message that has not expired can be overwritten.

No matter the retention period set, the overwrite will just overwrite the item.

This can be a problem for slow consumers because they were promised a certain time window to process messages. But it will benefit producers and fast consumers since they are able to continue. This policy sacrifices the slow producer in favor of fast producers/consumers.

DISCARD_NEWEST = 1

The message that was to be published is discarded.

BLOCK = 2

The caller will wait till there space in the ringbuffer.

ERROR = 3

The publish call immediately fails.