Get Started

Get Started

These guides demonstrate how to get started quickly with Hazelcast IMDG and Hazelcast Jet.

Hazelcast IMDG

Learn how to store and retrieve data from a distributed key-value store using Hazelcast IMDG. In this guide you’ll learn how to:

  • Create a cluster of 3 members.
  • Start Hazelcast Management Center
  • Add data to the cluster using a sample client in the language of your choice
  • Add and remove some cluster members to demonstrate data balancing capabilities of Hazelcast

Hazelcast Jet

Learn how to build a distributed data processing pipeline in Java using Hazelcast Jet. In this guide you’ll learn how to:

  • Install Hazelcast Jet and form a cluster on your computer
  • Build a simple pipeline that receives a stream of data, does some calculations and outputs some results
  • Submit the pipeline as a job to the cluster and observe the results
  • Scale the cluster up and down while the job is still running

Hazelcast IMDG Python Client

Hazelcast IMDG enables you to use an unparalleled range of massively scalable data structures with your Python applications. You can:

  • Use the Hazelcast Near Cache feature to store frequently read data in your Python process. This provides faster read speeds than traditional caches such as Redis or Memcached.
  • Access all of the Hazelcast data structures plus distributed queues, topics, and more with the Hazelcast IMDG Python Client.
  • Support JSON or serialized objects.
Quick Start + Download

Quick Start + Download

Quick Start

You can install hazelcast python client via:
$ pip install hazelcast-python-client
Or
$ python setup.py install

Version Downloads Documentation
Hazelcast IMDG Python Client 4.0.0b1 (latest)
11/24/2020
Hazelcast IMDG Python Client 4.0
01/13/2021
Hazelcast IMDG Python Client 3.12.3
03/19/2020
Hazelcast IMDG Python Client 3.12.2
03/02/2020

For all downloads please see the Download Archives

Previous Releases
Code Samples

Code Samples

Map Queue Topic List Replicated Map Set MultiMap RingBuffer
Enable Code Wrap
import hazelcast

# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1
client = hazelcast.HazelcastClient()
# Get the Distributed Map from Cluster.
my_map = client.get_map("my-distributed-map").blocking()
# Standard Put and Get
my_map.put("key", "value")
my_map.get("key")
# Concurrent Map methods, optimistic updating
my_map.put_if_absent("somekey", "somevalue")
my_map.replace_if_same("key", "value", "newvalue")
# Shutdown this Hazelcast Client
client.shutdown()
Get this code sample on Github
import hazelcast

# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1
client = hazelcast.HazelcastClient()
# Get a Blocking Queue called "my-distributed-queue"
queue = client.get_queue("my-distributed-queue").blocking()
# Offer a String into the Distributed Queue
queue.offer("item")
# Poll the Distributed Queue and return the String
item = queue.poll()
# Timed blocking Operations
queue.offer("anotheritem", 0.5)
another_item = queue.poll(5)
# Indefinitely blocking Operations
queue.put("yetanotheritem")
print(queue.take())
# Shutdown this Hazelcast Client
client.shutdown()
Get this code sample on Github
import hazelcast


def print_on_message(topic_message):
    print("Got message", topic_message.message)


# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1
client = hazelcast.HazelcastClient()
# Get a Topic called "my-distributed-topic"
topic = client.get_topic("my-distributed-topic").blocking()
# Add a Listener to the Topic
topic.add_listener(print_on_message)
# Publish a message to the Topic
topic.publish("Hello to distributed world")
# Shutdown this Hazelcast Client
client.shutdown()
Get this code sample on Github
import hazelcast

# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1
client = hazelcast.HazelcastClient()
# Get the Distributed List from Cluster.
my_list = client.get_list("my-distributed-list").blocking()
# Add element to the list
my_list.add("item1")
my_list.add("item2")

# Remove the first element
print("Removed:", my_list.remove_at(0))
# There is only one element left
print("Current size is", my_list.size())
# Clear the list
my_list.clear()
# Shutdown this Hazelcast Client
client.shutdown()
Get this code sample on Github
import hazelcast

# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1
client = hazelcast.HazelcastClient()
# Get a Replicated Map called "my-replicated-map"
rmap = client.get_replicated_map("my-replicated-map").blocking()
# Put and Get a value from the Replicated Map
replaced_value = rmap.put("key", "value")
# key/value replicated to all members
print("replaced value =", replaced_value)
# Will be None as its first update
value = rmap.get("key")
# the value is retrieved from a random member in the cluster
print("value for key =", value)
# Shutdown this Hazelcast Client
client.shutdown()
Get this code sample on Github
import hazelcast

# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1
client = hazelcast.HazelcastClient()
# Get the Distributed Set from Cluster.
my_set = client.get_set("my-distributed-set").blocking()
# Add items to the set with duplicates
my_set.add("item1")
my_set.add("item1")
my_set.add("item2")
my_set.add("item2")
my_set.add("item2")
my_set.add("item3")
# Get the items. Note that there are no duplicates.
for item in my_set.get_all():
    print(item)
# Shutdown this Hazelcast Client
client.shutdown()
Get this code sample on Github
import hazelcast

# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1
client = hazelcast.HazelcastClient()
# Get the Distributed MultiMap from Cluster.
multi_map = client.get_multi_map("my-distributed-multimap").blocking()
# Put values in the map against the same key
multi_map.put("my-key", "value1")
multi_map.put("my-key", "value2")
multi_map.put("my-key", "value3")
# Print out all the values for associated with key called "my-key"
values = multi_map.get("my-key")
print(values)
# remove specific key/value pair
multi_map.remove("my-key", "value2")
# Shutdown this Hazelcast Client
client.shutdown()
Get this code sample on Github
import hazelcast

# Start the Hazelcast Client and connect to an already running Hazelcast Cluster on 127.0.0.1
client = hazelcast.HazelcastClient()
rb = client.get_ringbuffer("rb").blocking()
# add two items into ring buffer
rb.add(100)
rb.add(200)
# we start from the oldest item.
# if you want to start from the next item, call rb.tailSequence()+1
sequence = rb.head_sequence()
print(rb.read_one(sequence))
sequence += 1
print(rb.read_one(sequence))
# Shutdown this Hazelcast Client
client.shutdown()
Get this code sample on Github
Roadmap

Roadmap

Python Client 4.0 (Released in January 2021)

  • Hazelcast IMDG 4.0 Changes: Client protocol enhancements, architectural improvements, Serialization improvements.
  • CP Subsystem Support: New Concurrency APIs including FencedLock, AtomicLong, Semaphore, CountDownLatch, and AtomicReference.
  • Backup Acknowledgment: Significantly improved client performance by eliminating the sync backup wait from the client and send the backup ACK to the client.
  • Ownerless Client: Simpler design to track member leaves and joins to the cluster.

Python Client Backlog

  • Integrations with Flask: Standard caching and session backend support for Flask, a lightweight WSGI web application framework.
  • Hazelcast for Django: Use Hazelcast instead of the default cache in Django.
  • Sessions in Django: Session backend for Django that stores sessions in a Hazelcast.
  • Hazelcast Dashboard for Django: Hazelcast monitoring in django admin.
  • Hazelcast Celery Brocker: An integration with Celery, a distributed task queue.
  • Integrations with Apache Airflow: Hazelcast hooks and sensors for Apache Airflow, an open-source workflow management platform.
Client Features

Features Implemented for this Client

DATA STRUCTURES

Python Client

Map

Queue

Set

List

MultiMap

ReplicatedMap

RingBuffer

Topic

Reliable Topic

JCache

N/A

Cardinality Estimator

CONCURRENCY PRIMITIVES

Python Client

Lock

Condition

Semaphore

AtomicLong

AtomicReference

ID Generator

CountDownLatch

CRDT PN Counter

Flake ID Generator

DISTRIBUTED PROCESSING

Python Client

Distributed Executor Service

Event Listeners

Sub-Listener Interfaces for Map Listener

Entry Processor

TRANSACTIONS

Python Client

TxnMap

TxnMultiMap

TxnQueue

TxnList

TxnSet

QUERY

Python Client

Query (Predicates)

Paging predicates

Partition predicate

Built-in Predicates

Continuous Query Caching

N/A

Listener with Predicate

Projections

Fast Aggregations

NEAR CACHE

Python Client

Near Cache Support

HD Memory

N/A

Preload Cache from Last Used

Eventual Consistency Control

CONFIGURATION

Python Client

Declarative Configuration (XML/JSON/YAML)

Programmatic Configuration

Client Configuration Import

Fail Fast on Invalid Configuration

SECURITY

Python Client

SSL Support

XA Transactions

Mutual Authentication

Authorization

Custom Authentication Modules

MANAGEMENT CENTER

Python Client

Management Center Integration / Awareness

Client Near Cache Stats

Client Runtime Stats

Client Operating Systems Stats

CLOUD

Python Client

Hazelcast Cloud

Kubernetes

AWS

Azure

Google Cloud Platform

Pivotal Cloud Foundry

Docker

Apache jclouds

Consul

etcd

Eureka

Heroku

Zookeeper

INFRASTRUCTURE

Python Client

Smart Client

Unisocket Client

Lifecycle Service

HeartBeat

Backup Acknowledgment to Client

Diagnostics

SERIALIZATION

Python Client

DataSerializable

N/A

IdentifiedDataSerializable

Portable Serialization

Portable Serialization

Global Serializers

CLIENT CONNECTIVITY

Python Client

Connection Strategy

Connection Retry

Blue/Green Deployments and Disaster Recovery

Support for Clients & Languages

Jump into the discussion on our groups.

Join Us On Slack