Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Features
- Distributed, CRDT based counter, called **PNCounter**
- Distributed concurrency primitives from CP Subsystem such as
**FencedLock**, **Semaphore**, **AtomicLong**
- Integration with `Hazelcast Cloud <https://cloud.hazelcast.com/>`__
- Integration with `Hazelcast Viridian <https://viridian.hazelcast.com/>`__
- Support for serverless and traditional web service architectures with
**Unisocket** and **Smart** operation modes
- Ability to listen to client lifecycle, cluster state, and distributed
Expand Down
3 changes: 1 addition & 2 deletions docs/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ features:
- Client Near Cache Stats
- Client Runtime Stats
- Client Operating Systems Stats
- Hazelcast Cloud Discovery
- Hazelcast Viridian Discovery
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we use this term in Java client docs? @Serdaro Should we update them as well? FYI

- Smart Client
- Unisocket Client
- Lifecycle Service
- Hazelcast Cloud Discovery
- IdentifiedDataSerializable Serialization
- Portable Serialization
- Custom Serialization
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Features
- Distributed, CRDT based counter, called **PNCounter**
- Distributed concurrency primitives from CP Subsystem such as
**FencedLock**, **Semaphore**, **AtomicLong**
- Integration with `Hazelcast Cloud <https://cloud.hazelcast.com/>`__
- Integration with `Hazelcast Viridian <https://viridian.hazelcast.com/>`__
- Support for serverless and traditional web service architectures with
**Unisocket** and **Smart** operation modes
- Ability to listen to client lifecycle, cluster state, and distributed
Expand Down
8 changes: 4 additions & 4 deletions docs/setting_up_client_network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ their certificate authorities so that the members can know which
clients they can trust. See the
:ref:`securing_client_connection:mutual authentication` section.

Enabling Hazelcast Cloud Discovery
----------------------------------
Enabling Hazelcast Viridian Discovery
-------------------------------------

Hazelcast Python client can discover and connect to Hazelcast clusters
running on `Hazelcast Cloud <https://cloud.hazelcast.com/>`__. For this,
provide authentication information as ``cluster_name`` and enable cloud
running on `Hazelcast Viridian <https://viridian.hazelcast.com/>`__. For this,
provide authentication information as ``cluster_name`` and enable Viridian
discovery by setting your ``cloud_discovery_token`` as shown below.

.. code:: python
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
{
"cell_type": "markdown",
"source": [
"We are ready to connect our cluster from Python program. Hazelcast uses config settings to find your cluster. We are providing our Viridian tokens for configuration to connect Hazelcast Cloud. After seeing the `Connection successful.` message, we can create mappings for our data. \n",
"We are ready to connect our cluster from Python program. Hazelcast uses config settings to find your cluster. We are providing a token to the configuration to connect Hazelcast Viridian. After seeing the `Connection successful.` message, we can create mappings for our data. \n",
"\n",
"Reminder: If you want to connect to a local cluster in Jupyter Notebook, you should download the notebook file and remove the Viridian configuration options inside `hazelcast.HazelcastClient()` functional call."
],
Expand All @@ -217,7 +217,6 @@
"execution_count": null,
"outputs": [],
"source": [
"hazelcast.discovery.HazelcastCloudDiscovery._CLOUD_URL_BASE = \"api.viridian.hazelcast.com\"\n",
"client = hazelcast.HazelcastClient(\n",
" cluster_name=CLUSTER_NAME,\n",
" cloud_discovery_token=DISCOVERY_TOKEN,\n",
Expand Down
2 changes: 1 addition & 1 deletion hazelcast/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def _create_address_provider(self):
if address_list_provided and cloud_enabled:
raise IllegalStateError(
"Only one discovery method can be enabled at a time. "
"Cluster members given explicitly: %s, Hazelcast Cloud enabled: %s"
"Cluster members given explicitly: %s, Hazelcast Viridian enabled: %s"
% (address_list_provided, cloud_enabled)
)

Expand Down
12 changes: 6 additions & 6 deletions hazelcast/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@

class HazelcastCloudAddressProvider:
"""Provides initial addresses for client to find and connect to a node
and resolves private IP addresses of Hazelcast Cloud service.
and resolves private IP addresses of Hazelcast Viridian service.
"""

def __init__(self, token, connection_timeout):
self.cloud_discovery = HazelcastCloudDiscovery(token, connection_timeout)
self._private_to_public = dict()

def load_addresses(self):
"""Loads member addresses from Hazelcast Cloud endpoint.
"""Loads member addresses from Hazelcast Viridian endpoint.

Returns:
tuple[list[hazelcast.core.Address], list[hazelcast.core.Address]]: The possible member addresses
Expand All @@ -30,7 +30,7 @@ def load_addresses(self):
# Every private address is primary
return list(nodes.keys()), []
except Exception as e:
_logger.warning("Failed to load addresses from Hazelcast Cloud: %s", e)
_logger.warning("Failed to load addresses from Hazelcast Viridian: %s", e)
return [], []

def translate(self, address):
Expand Down Expand Up @@ -58,11 +58,11 @@ def refresh(self):
try:
self._private_to_public = self.cloud_discovery.discover_nodes()
except Exception as e:
_logger.warning("Failed to load addresses from Hazelcast.cloud: %s", e)
_logger.warning("Failed to load addresses from Hazelcast Viridian: %s", e)


class HazelcastCloudDiscovery:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the name of the class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't change that, as it is sometimes used in the wild for monkey patching the coordinator URL. We would break people's code. The same goes for the configuration element cloud_discovery_token

"""Discovery service that discover nodes via Hazelcast.cloud
"""Service that discovers nodes via Hazelcast Viridian.
https://api.viridian.hazelcast.com/cluster/discovery?token=<TOKEN>
"""

Expand All @@ -78,7 +78,7 @@ def __init__(self, token, connection_timeout):
self._ctx = ssl.create_default_context()

def discover_nodes(self):
"""Discovers nodes from Hazelcast.cloud.
"""Discovers nodes from Hazelcast Viridian.

Returns:
dict[hazelcast.core.Address, hazelcast.core.Address]: Dictionary that maps private
Expand Down