Core

Hazelcast Core objects and constants.

class MemberInfo(address: hazelcast.core.Address, member_uuid: uuid.UUID, attributes: Dict[str, str], lite_member: bool, version: hazelcast.core.MemberVersion, _, address_map: Dict[hazelcast.core.EndpointQualifier, hazelcast.core.Address])[source]

Bases: object

Represents a member in the cluster with its address, uuid, lite member status, attributes, version, and address map.

address

Address of the member.

uuid

UUID of the member.

attributes

Configured attributes of the member.

lite_member

True if the member is a lite member, False otherwise. Lite members do not own any partition.

version

Hazelcast codebase version of the member.

address_map

Dictionary of server socket addresses per EndpointQualifier of this member.

class Address(host: str, port: int)[source]

Bases: object

Represents an address of a member in the cluster.

host

Host of the address.

port

Port of the address.

class ProtocolType[source]

Bases: object

Types of server sockets.

A member typically responds to several types of protocols for member-to-member, client-member protocol, WAN communication etc. The default configuration uses a single server socket to listen for all kinds of protocol types configured, while Advanced Network Config of the server allows configuration of multiple server sockets.

MEMBER = 0

Type of member server sockets.

CLIENT = 1

Type of client server sockets.

WAN = 2

Type of WAN server sockets.

REST = 3

Type of REST server sockets.

MEMCACHE = 4

Type of Memcached server sockets.

class EndpointQualifier(protocol_type: int, identifier: Optional[str])[source]

Bases: object

Uniquely identifies groups of network connections sharing a common ProtocolType and the same network settings, when Hazelcast server is configured with Advanced Network Configuration enabled.

In some cases, just the ProtocolType is enough (e.g. since there can be only a single member server socket).

When just the ProtocolType is not enough (for example when configuring outgoing WAN connections to 2 different target clusters), an identifier is used to uniquely identify the network configuration.

property protocol_type: int

Protocol type of the endpoint.

property identifier: Optional[str]

Unique identifier for same-protocol-type endpoints.

class DistributedObjectEventType[source]

Bases: object

Type of the distributed object event.

CREATED = 'CREATED'

DistributedObject is created.

DESTROYED = 'DESTROYED'

DistributedObject is destroyed.

class DistributedObjectEvent(name: str, service_name: str, event_type: str, source: uuid.UUID)[source]

Bases: object

Distributed Object Event

name

Name of the distributed object.

service_name

Service name of the distributed object.

event_type

Event type. Either CREATED or DESTROYED.

source

UUID of the member that fired the event.

class SimpleEntryView(key: hazelcast.types.KeyType, value: hazelcast.types.ValueType, cost: int, creation_time: int, expiration_time: int, hits: int, last_access_time: int, last_stored_time: int, last_update_time: int, version: int, ttl: int, max_idle: int)[source]

Bases: Generic[hazelcast.types.KeyType, hazelcast.types.ValueType]

EntryView represents a readonly view of a map entry.

key

The key of the entry.

value

The value of the entry.

cost

The cost in bytes of the entry.

creation_time

The creation time of the entry.

expiration_time

The expiration time of the entry.

hits

Number of hits of the entry.

last_access_time

The last access time for the entry.

last_stored_time

The last store time for the value.

last_update_time

The last time the value was updated.

version

The version of the entry.

ttl

The last set time to live milliseconds.

max_idle

The last set max idle time in milliseconds.

class HazelcastJsonValue(value: Any)[source]

Bases: object

HazelcastJsonValue is a wrapper for JSON formatted strings.

It is preferred to store HazelcastJsonValue instead of Strings for JSON formatted strings. Users can run predicates and use indexes on the attributes of the underlying JSON strings.

HazelcastJsonValue is queried using Hazelcast’s querying language.

In terms of querying, numbers in JSON strings are treated as either Long or Double in the Java side. str, bool and None are treated as String, boolean and null respectively.

HazelcastJsonValue keeps given string as it is. Strings are not checked for being valid. Ill-formatted JSON strings may cause false positive or false negative results in queries.

HazelcastJsonValue can also be constructed from JSON serializable objects. In that case, objects are converted to JSON strings and stored as such. If an error occurs during the conversion, it is raised directly.

None values are not allowed.

to_string() str[source]

Returns unaltered string that was used to create this object.

Returns

The original string.

loads() Any[source]

Deserializes the string that was used to create this object and returns as Python object.

Returns

The Python object represented by the original string.

class MemberVersion(major: int, minor: int, patch: int)[source]

Bases: object

Determines the Hazelcast codebase version in terms of major.minor.patch version.

class MapEntry(key: Optional[hazelcast.types.KeyType] = None, value: Optional[hazelcast.types.ValueType] = None)[source]

Bases: Generic[hazelcast.types.KeyType, hazelcast.types.ValueType]

Represents the entry of a Map, with key and value fields.

property key: hazelcast.types.KeyType

Key of the entry.

property value: hazelcast.types.ValueType

Value of the entry.