tpalfy commented on a change in pull request #4510: URL: https://github.com/apache/nifi/pull/4510#discussion_r489601324
########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/java/org/apache/nifi/hazelcast/services/cachemanager/StandaloneHazelcastCacheManager.java ########## @@ -0,0 +1,155 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.hazelcast.services.cachemanager; + +import com.hazelcast.client.HazelcastClient; +import com.hazelcast.client.config.ClientConfig; +import com.hazelcast.core.HazelcastInstance; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.ValidationContext; +import org.apache.nifi.components.ValidationResult; +import org.apache.nifi.controller.ConfigurationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; +import org.apache.nifi.processor.util.StandardValidators; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +@Tags({"hazelcast", "cache"}) +@CapabilityDescription("A service that provides cache instances backed by Hazelcast running outside of NiFi.") +public class StandaloneHazelcastCacheManager extends IMapBasedHazelcastCacheManager { + + /** + * Used to involve some fluctuation into the backoff time. For details, please see Hazelcast documentation. + */ + private static final double BACKOFF_JITTER = 0.2; + + public static final PropertyDescriptor HAZELCAST_SERVER_ADDRESS = new PropertyDescriptor.Builder() + .name("hazelcast-server-address") + .displayName("Hazelcast Server Address") + .description("Address of the Hazelcast instance, using {host:port} format. In case there are multiple instances," + + " separate the instances using " + ADDRESS_SEPARATOR + ".") + .required(true) + .addValidator(StandardValidators.HOSTNAME_PORT_LIST_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .build(); + + public static final PropertyDescriptor HAZELCAST_RETRY_BACKOFF_INITIAL = new PropertyDescriptor.Builder() + .name("hazelcast-retry-backoff-initial") + .displayName("Hazelcast Initial Backoff") + .description("The amount of time the client waits until it tries to reestablish connection at the first time.") Review comment: ```suggestion .description("The amount of time the client waits before it tries to reestablish connection for the first time.") ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/java/org/apache/nifi/hazelcast/services/cachemanager/StandaloneHazelcastCacheManager.java ########## @@ -0,0 +1,155 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.hazelcast.services.cachemanager; + +import com.hazelcast.client.HazelcastClient; +import com.hazelcast.client.config.ClientConfig; +import com.hazelcast.core.HazelcastInstance; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.ValidationContext; +import org.apache.nifi.components.ValidationResult; +import org.apache.nifi.controller.ConfigurationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; +import org.apache.nifi.processor.util.StandardValidators; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +@Tags({"hazelcast", "cache"}) +@CapabilityDescription("A service that provides cache instances backed by Hazelcast running outside of NiFi.") +public class StandaloneHazelcastCacheManager extends IMapBasedHazelcastCacheManager { + + /** + * Used to involve some fluctuation into the backoff time. For details, please see Hazelcast documentation. + */ + private static final double BACKOFF_JITTER = 0.2; + + public static final PropertyDescriptor HAZELCAST_SERVER_ADDRESS = new PropertyDescriptor.Builder() + .name("hazelcast-server-address") + .displayName("Hazelcast Server Address") + .description("Address of the Hazelcast instance, using {host:port} format. In case there are multiple instances," + + " separate the instances using " + ADDRESS_SEPARATOR + ".") Review comment: ```suggestion .description("Addresses of one or more the Hazelcast instances, using {host:port} format, separated by " + ADDRESS_SEPARATOR + ".") ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/java/org/apache/nifi/hazelcast/services/cachemanager/StandaloneHazelcastCacheManager.java ########## @@ -0,0 +1,155 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.hazelcast.services.cachemanager; + +import com.hazelcast.client.HazelcastClient; +import com.hazelcast.client.config.ClientConfig; +import com.hazelcast.core.HazelcastInstance; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.ValidationContext; +import org.apache.nifi.components.ValidationResult; +import org.apache.nifi.controller.ConfigurationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; +import org.apache.nifi.processor.util.StandardValidators; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +@Tags({"hazelcast", "cache"}) +@CapabilityDescription("A service that provides cache instances backed by Hazelcast running outside of NiFi.") +public class StandaloneHazelcastCacheManager extends IMapBasedHazelcastCacheManager { + + /** + * Used to involve some fluctuation into the backoff time. For details, please see Hazelcast documentation. + */ + private static final double BACKOFF_JITTER = 0.2; + + public static final PropertyDescriptor HAZELCAST_SERVER_ADDRESS = new PropertyDescriptor.Builder() + .name("hazelcast-server-address") + .displayName("Hazelcast Server Address") + .description("Address of the Hazelcast instance, using {host:port} format. In case there are multiple instances," + + " separate the instances using " + ADDRESS_SEPARATOR + ".") + .required(true) + .addValidator(StandardValidators.HOSTNAME_PORT_LIST_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .build(); + + public static final PropertyDescriptor HAZELCAST_RETRY_BACKOFF_INITIAL = new PropertyDescriptor.Builder() + .name("hazelcast-retry-backoff-initial") + .displayName("Hazelcast Initial Backoff") + .description("The amount of time the client waits until it tries to reestablish connection at the first time.") + .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR) + .required(true) + .defaultValue("1 secs") + .build(); + + public static final PropertyDescriptor HAZELCAST_RETRY_BACKOFF_MAXIMUM = new PropertyDescriptor.Builder() + .name("hazelcast-retry-backoff-maximum") + .displayName("Hazelcast Maximum Backoff") + .description("The longest amount of time the client waits until it tries to reestablish connection.") Review comment: ```suggestion .description("The maximum amount of time the client waits before it tries to reestablish connection.") ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cacheclient.HazelcastMapCacheClient/additionalDetails.html ########## @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>HazelcastMapCacheClient</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>HazelcastMapCacheClient</h2> + +<p> + This implementation of distributed map cache is backed by Hazelcast. The Hazelcast connection is provided and maintained + by an instance of HazelcastCacheManager. One HazelcastCacheManager might serve multiple cache client. This implementation + uses the IMap data structure. The identifier of the Hazelcast IMap will be the same as the value of the property Hazelcast + Cache Name. It is suggested for all instance to use different cache name. Review comment: ```suggestion This implementation of distributed map cache is backed by Hazelcast. The Hazelcast connection is provided and maintained by an instance of HazelcastCacheManager. One HazelcastCacheManager might serve multiple cache clients. This implementation uses the IMap data structure. The identifier of the Hazelcast IMap will be the same as the value of the property Hazelcast Cache Name. It is recommended for all HazelcastMapCacheClient instances to use different cache names. ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/java/org/apache/nifi/hazelcast/services/cachemanager/StandaloneHazelcastCacheManager.java ########## @@ -0,0 +1,155 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.hazelcast.services.cachemanager; + +import com.hazelcast.client.HazelcastClient; +import com.hazelcast.client.config.ClientConfig; +import com.hazelcast.core.HazelcastInstance; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.ValidationContext; +import org.apache.nifi.components.ValidationResult; +import org.apache.nifi.controller.ConfigurationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; +import org.apache.nifi.processor.util.StandardValidators; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +@Tags({"hazelcast", "cache"}) +@CapabilityDescription("A service that provides cache instances backed by Hazelcast running outside of NiFi.") +public class StandaloneHazelcastCacheManager extends IMapBasedHazelcastCacheManager { + + /** + * Used to involve some fluctuation into the backoff time. For details, please see Hazelcast documentation. + */ + private static final double BACKOFF_JITTER = 0.2; + + public static final PropertyDescriptor HAZELCAST_SERVER_ADDRESS = new PropertyDescriptor.Builder() + .name("hazelcast-server-address") + .displayName("Hazelcast Server Address") + .description("Address of the Hazelcast instance, using {host:port} format. In case there are multiple instances," + + " separate the instances using " + ADDRESS_SEPARATOR + ".") + .required(true) + .addValidator(StandardValidators.HOSTNAME_PORT_LIST_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .build(); + + public static final PropertyDescriptor HAZELCAST_RETRY_BACKOFF_INITIAL = new PropertyDescriptor.Builder() + .name("hazelcast-retry-backoff-initial") + .displayName("Hazelcast Initial Backoff") + .description("The amount of time the client waits until it tries to reestablish connection at the first time.") + .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR) + .required(true) + .defaultValue("1 secs") + .build(); + + public static final PropertyDescriptor HAZELCAST_RETRY_BACKOFF_MAXIMUM = new PropertyDescriptor.Builder() + .name("hazelcast-retry-backoff-maximum") + .displayName("Hazelcast Maximum Backoff") + .description("The longest amount of time the client waits until it tries to reestablish connection.") + .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR) + .required(true) + .defaultValue("5 secs") + .build(); + + public static final PropertyDescriptor HAZELCAST_RETRY_BACKOFF_MULTIPLIER = new PropertyDescriptor.Builder() + .name("hazelcast-retry-backoff-multiplier") + .displayName("Hazelcast Backoff Multiplier") + .description("The multiplier the client uses to increase wait time for retries.") + .addValidator(StandardValidators.NUMBER_VALIDATOR) + .required(true) + .defaultValue("1.5") + .build(); + + public static final PropertyDescriptor HAZELCAST_CONNECTION_TIMEOUT = new PropertyDescriptor.Builder() + .name("hazelcast-connection-timeout") + .displayName("Hazelcast Connection Timeout") + .description("The maximum amount of time the client tries to connect or reconnect before abandon.") Review comment: ```suggestion .description("The maximum amount of time the client tries to connect or reconnect before giving up.") ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.EmbeddedHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>EmbeddedHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>EmbeddedHazelcastCacheManager</h2> + +<p> + This service starts and manages an embedded Hazelcast instance. The instance needs to listen on a port for + possible clients to join in. The cache manager will not join via this port but directly reaches data using the embedded + server instance. This behaviour comes from Hazelcast and not to be prevented but not used as the embedded manager + is intended to be serve as an internal cache storage. However, be aware: this might make the instance reachable + within the same network and it is possible for clients to join. +</p> + +<p> + The properties the service supports are provided in order to make it possible to run multiple instances of Hazelcast + (whatever if via EmbeddedHazelcastCacheManager or externally) without any interference. If no further instances are in + use, the port number and cluster name are not necessary to be set. Review comment: ```suggestion It is possible to have multiple independent Hazelcast instances on the same host (whether via EmbeddedHazelcastCacheManager or externally) without any interference by setting the properties accordingly. If there are no other instances, the port number and cluster name are not necessary to be set. (Default values will be used instead.) ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.StandaloneHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>StandaloneHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>StandaloneHazelcastCacheManager</h2> + +<p> + This service connects to one or more existing Hazelcast instances as client. Hazelcast 4.0.0 or newer version is required. + The connection to the server is kept alive using the Hazelcast's built in reconnection capability. This might be fine-tuned + by setting the following properties: Review comment: ```suggestion This service connects to one or more existing Hazelcast instances as client. Hazelcast 4.0.0 or newer version is required. The connection to the server is kept alive using Hazelcast's built in reconnection capability. This might be fine-tuned by setting the following properties: ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.EmbeddedHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>EmbeddedHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>EmbeddedHazelcastCacheManager</h2> + +<p> + This service starts and manages an embedded Hazelcast instance. The instance needs to listen on a port for + possible clients to join in. The cache manager will not join via this port but directly reaches data using the embedded + server instance. This behaviour comes from Hazelcast and not to be prevented but not used as the embedded manager + is intended to be serve as an internal cache storage. However, be aware: this might make the instance reachable + within the same network and it is possible for clients to join. +</p> + +<p> + The properties the service supports are provided in order to make it possible to run multiple instances of Hazelcast + (whatever if via EmbeddedHazelcastCacheManager or externally) without any interference. If no further instances are in + use, the port number and cluster name are not necessary to be set. +</p> + +<p> + The service supports multiple ways to set up NiFi cluster. This is controlled by the property, named "Hazelcast High + Availability Mode". The following values might be used: +</p> + +<h3>None</h3> + +<p> + This is the default value of the property. Used when sharing data within nodes are not desired. With this value, every + NiFi node in the cluster (if it is clustered) depends on it's local Hazelcast server, which are not connected into a + Hazelcast cluster. As part of this, the capability of the Hazelcast instances to connect with other servers (even outside + the NiFi cluster) is turned off. +</p> + +<h3>Cluster</h3> + +<p> + Can be used only in clustered node. Using this mode will result a single Hazelcast cluster consisting the embedded instances + from all the NiFi nodes created by the local instance of the same controller service. This mode assumes that, all the Hazelcast + servers are listening on the same port, thus having variable port number based on expression will prevent joining properly. +</p> + +<p> + The controller service gathers the necessary host list from NiFi cluster related information when the service is enabled. It is + not a prerequisite for all the node to successfully joined at this point, but the join must be initiated. When the controller + service is enabled at the start of the NiFi instance, the enabling of the service will be prevented until the point the node is + considered as clustered. +</p> + +<p> + If a node joins at a later point, the unity and health of the Hazelcast cluster depends on the Hazelcast's internal mechanism + for cluster merge. As the new node has a comprehensive list of the expected instances, including the already existing servers + and itself, the Hazelcast will be able to reach the expected state. Be aware: this takes significant time for the Hazelcast. + <i>Note: as this is provided by Hazelcast, it is not guaranteed that later releases will have exactly the same behaviour!</i> +</p> + +<h3>Explicit</h3> + +<p> + Explicit HA mode exists to allow more control over the Hazelcast cluster members. Like Cluster HA mode, this mode works with a + list of Hazelcast servers, but unlike that, it is not implicit. The mode works based on the property "Hazelcast Instances". This + list must contain all the instances expected to be part of the cluster. As the list is not bound to the NiFi cluster instances, + it is possible to provide a partial list of the cluster or adding instances run outside of NiFi. Review comment: ```suggestion Explicit HA mode allows more control over the Hazelcast cluster members. Like Cluster HA mode, this mode works with a list of Hazelcast servers, but instance discovery is not automatic. This mode works based on the property "Hazelcast Instances". This list must contain all the instances expected to be part of the cluster. As the list is not bound to the NiFi cluster instances, it is possible to provide a partial list of the cluster or adding instances running outside of NiFi. ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.StandaloneHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>StandaloneHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>StandaloneHazelcastCacheManager</h2> + +<p> + This service connects to one or more existing Hazelcast instances as client. Hazelcast 4.0.0 or newer version is required. + The connection to the server is kept alive using the Hazelcast's built in reconnection capability. This might be fine-tuned + by setting the following properties: +</p> + +<ul> + <li>Hazelcast Initial Backoff</li> + <li>Hazelcast Maximum Backoff</li> + <li>Hazelcast Backoff Multiplier</li> + <li>Hazelcast Connection Timeout</li> +</ul> + +<p> + In case the service is not capable to connect or abruptly disconnected it tries to reconnect after a backoff time. The + amount of waiting before the first attempt is defined by the Initial Backoff. If the connection is still not successful the + client waits gradually more between the attempts until the whole time of waiting does not reach the value of the connection + timeout. The backoff time after the first attempt is always based on the previous amount, multiplied by the Backoff Multiplier. + Note: the real backoff time might be slightly differ as some "jitter" is added to the calculation in order to avoid regularity. Review comment: ```suggestion If the service cannot connect or abruptly disconnected it tries to reconnect after a backoff time. The amount of time waiting before the first attempt is defined by the Initial Backoff. If the connection is still not successful the client waits gradually more between the attempts until the waiting time reaches the value set in the 'Hazelcast Maximum Backoff' property (or the connection timeout, whichever is smaller). The backoff time after the first attempt is always based on the previous amount, multiplied by the Backoff Multiplier. Note: the real backoff time might be slightly differ as some "jitter" is added to the calculation in order to avoid regularity. ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/java/org/apache/nifi/hazelcast/services/cachemanager/StandaloneHazelcastCacheManager.java ########## @@ -0,0 +1,155 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.hazelcast.services.cachemanager; + +import com.hazelcast.client.HazelcastClient; +import com.hazelcast.client.config.ClientConfig; +import com.hazelcast.core.HazelcastInstance; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.ValidationContext; +import org.apache.nifi.components.ValidationResult; +import org.apache.nifi.controller.ConfigurationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; +import org.apache.nifi.processor.util.StandardValidators; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +@Tags({"hazelcast", "cache"}) +@CapabilityDescription("A service that provides cache instances backed by Hazelcast running outside of NiFi.") +public class StandaloneHazelcastCacheManager extends IMapBasedHazelcastCacheManager { + + /** + * Used to involve some fluctuation into the backoff time. For details, please see Hazelcast documentation. + */ + private static final double BACKOFF_JITTER = 0.2; + + public static final PropertyDescriptor HAZELCAST_SERVER_ADDRESS = new PropertyDescriptor.Builder() + .name("hazelcast-server-address") + .displayName("Hazelcast Server Address") + .description("Address of the Hazelcast instance, using {host:port} format. In case there are multiple instances," + + " separate the instances using " + ADDRESS_SEPARATOR + ".") + .required(true) + .addValidator(StandardValidators.HOSTNAME_PORT_LIST_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) + .build(); + + public static final PropertyDescriptor HAZELCAST_RETRY_BACKOFF_INITIAL = new PropertyDescriptor.Builder() + .name("hazelcast-retry-backoff-initial") + .displayName("Hazelcast Initial Backoff") + .description("The amount of time the client waits until it tries to reestablish connection at the first time.") + .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR) + .required(true) + .defaultValue("1 secs") + .build(); + + public static final PropertyDescriptor HAZELCAST_RETRY_BACKOFF_MAXIMUM = new PropertyDescriptor.Builder() + .name("hazelcast-retry-backoff-maximum") + .displayName("Hazelcast Maximum Backoff") + .description("The longest amount of time the client waits until it tries to reestablish connection.") + .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR) + .required(true) + .defaultValue("5 secs") + .build(); + + public static final PropertyDescriptor HAZELCAST_RETRY_BACKOFF_MULTIPLIER = new PropertyDescriptor.Builder() + .name("hazelcast-retry-backoff-multiplier") + .displayName("Hazelcast Backoff Multiplier") + .description("The multiplier the client uses to increase wait time for retries.") Review comment: ```suggestion .description("A multiplier by which the wait time is increased before each attempt to reestablish connection.") ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cacheclient.HazelcastMapCacheClient/additionalDetails.html ########## @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>HazelcastMapCacheClient</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>HazelcastMapCacheClient</h2> + +<p> + This implementation of distributed map cache is backed by Hazelcast. The Hazelcast connection is provided and maintained + by an instance of HazelcastCacheManager. One HazelcastCacheManager might serve multiple cache client. This implementation + uses the IMap data structure. The identifier of the Hazelcast IMap will be the same as the value of the property Hazelcast + Cache Name. It is suggested for all instance to use different cache name. +</p> + +<p> + The implementation supports the atomic method family defined in AtomicDistributedMapCacheClient. This happens by maintaining + a revision identifier for every entry. The revision is a 8 byte long integer. It is increased during replacement. The value is kept + during modifications not part of the atomic method family but this is mainly for regular management of the entries. It is not + recommended to work with elements by mixing the two method families. Review comment: ```suggestion The implementation supports the atomic method family defined in AtomicDistributedMapCacheClient. This is achieved by maintaining a revision number for every entry. The revision is a 8 byte long integer. It is increased when the entry is updated. The value is kept during modifications not part of the atomic method family but this is mainly for regular management of the entries. It is not recommended to work with elements by mixing the two method families. ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.EmbeddedHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>EmbeddedHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>EmbeddedHazelcastCacheManager</h2> + +<p> + This service starts and manages an embedded Hazelcast instance. The instance needs to listen on a port for + possible clients to join in. The cache manager will not join via this port but directly reaches data using the embedded + server instance. This behaviour comes from Hazelcast and not to be prevented but not used as the embedded manager + is intended to be serve as an internal cache storage. However, be aware: this might make the instance reachable + within the same network and it is possible for clients to join. +</p> + +<p> + The properties the service supports are provided in order to make it possible to run multiple instances of Hazelcast + (whatever if via EmbeddedHazelcastCacheManager or externally) without any interference. If no further instances are in + use, the port number and cluster name are not necessary to be set. +</p> + +<p> + The service supports multiple ways to set up NiFi cluster. This is controlled by the property, named "Hazelcast High + Availability Mode". The following values might be used: Review comment: ```suggestion The service supports multiple ways to set up a Hazelcast cluster. This is controlled by the property, named "Hazelcast High Availability Mode". The following values might be used: ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cacheclient.HazelcastMapCacheClient/additionalDetails.html ########## @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>HazelcastMapCacheClient</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>HazelcastMapCacheClient</h2> + +<p> + This implementation of distributed map cache is backed by Hazelcast. The Hazelcast connection is provided and maintained + by an instance of HazelcastCacheManager. One HazelcastCacheManager might serve multiple cache client. This implementation + uses the IMap data structure. The identifier of the Hazelcast IMap will be the same as the value of the property Hazelcast + Cache Name. It is suggested for all instance to use different cache name. +</p> + +<p> + The implementation supports the atomic method family defined in AtomicDistributedMapCacheClient. This happens by maintaining + a revision identifier for every entry. The revision is a 8 byte long integer. It is increased during replacement. The value is kept + during modifications not part of the atomic method family but this is mainly for regular management of the entries. It is not + recommended to work with elements by mixing the two method families. +</p> + +<p> + The convention for all the entries is to reserve the first 8 bytes for the revision. The further content is the byte representation of + the actual payload, serialized by the implementation provided by the caller. Review comment: ```suggestion The convention for all the entries is to reserve the first 8 bytes for the revision. The rest of the content is the serialized payload. ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.EmbeddedHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>EmbeddedHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>EmbeddedHazelcastCacheManager</h2> + +<p> + This service starts and manages an embedded Hazelcast instance. The instance needs to listen on a port for + possible clients to join in. The cache manager will not join via this port but directly reaches data using the embedded + server instance. This behaviour comes from Hazelcast and not to be prevented but not used as the embedded manager + is intended to be serve as an internal cache storage. However, be aware: this might make the instance reachable + within the same network and it is possible for clients to join. +</p> + +<p> + The properties the service supports are provided in order to make it possible to run multiple instances of Hazelcast + (whatever if via EmbeddedHazelcastCacheManager or externally) without any interference. If no further instances are in + use, the port number and cluster name are not necessary to be set. +</p> + +<p> + The service supports multiple ways to set up NiFi cluster. This is controlled by the property, named "Hazelcast High + Availability Mode". The following values might be used: +</p> + +<h3>None</h3> + +<p> + This is the default value of the property. Used when sharing data within nodes are not desired. With this value, every + NiFi node in the cluster (if it is clustered) depends on it's local Hazelcast server, which are not connected into a + Hazelcast cluster. As part of this, the capability of the Hazelcast instances to connect with other servers (even outside + the NiFi cluster) is turned off. +</p> + +<h3>Cluster</h3> + +<p> + Can be used only in clustered node. Using this mode will result a single Hazelcast cluster consisting the embedded instances + from all the NiFi nodes created by the local instance of the same controller service. This mode assumes that, all the Hazelcast + servers are listening on the same port, thus having variable port number based on expression will prevent joining properly. Review comment: ```suggestion Can be used only in clustered node. Using this mode will result in a single Hazelcast cluster consisting of the embedded instances of all the NiFi nodes. This mode requires all Hazelcast servers listening on the same port. Having different port numbers (based on expression for example) would prevent the cluster from forming. ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.EmbeddedHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>EmbeddedHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>EmbeddedHazelcastCacheManager</h2> + +<p> + This service starts and manages an embedded Hazelcast instance. The instance needs to listen on a port for + possible clients to join in. The cache manager will not join via this port but directly reaches data using the embedded + server instance. This behaviour comes from Hazelcast and not to be prevented but not used as the embedded manager + is intended to be serve as an internal cache storage. However, be aware: this might make the instance reachable + within the same network and it is possible for clients to join. +</p> + +<p> + The properties the service supports are provided in order to make it possible to run multiple instances of Hazelcast + (whatever if via EmbeddedHazelcastCacheManager or externally) without any interference. If no further instances are in + use, the port number and cluster name are not necessary to be set. +</p> + +<p> + The service supports multiple ways to set up NiFi cluster. This is controlled by the property, named "Hazelcast High + Availability Mode". The following values might be used: +</p> + +<h3>None</h3> + +<p> + This is the default value of the property. Used when sharing data within nodes are not desired. With this value, every + NiFi node in the cluster (if it is clustered) depends on it's local Hazelcast server, which are not connected into a + Hazelcast cluster. As part of this, the capability of the Hazelcast instances to connect with other servers (even outside + the NiFi cluster) is turned off. Review comment: ```suggestion This is the default value. Used when sharing data between nodes is not required. With this value, every NiFi node in the cluster (if it is clustered) connects to its local Hazelcast server only. The Hazelcast servers do not form a cluster. ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.EmbeddedHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>EmbeddedHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>EmbeddedHazelcastCacheManager</h2> + +<p> + This service starts and manages an embedded Hazelcast instance. The instance needs to listen on a port for + possible clients to join in. The cache manager will not join via this port but directly reaches data using the embedded + server instance. This behaviour comes from Hazelcast and not to be prevented but not used as the embedded manager + is intended to be serve as an internal cache storage. However, be aware: this might make the instance reachable + within the same network and it is possible for clients to join. +</p> + +<p> + The properties the service supports are provided in order to make it possible to run multiple instances of Hazelcast + (whatever if via EmbeddedHazelcastCacheManager or externally) without any interference. If no further instances are in + use, the port number and cluster name are not necessary to be set. +</p> + +<p> + The service supports multiple ways to set up NiFi cluster. This is controlled by the property, named "Hazelcast High + Availability Mode". The following values might be used: +</p> + +<h3>None</h3> + +<p> + This is the default value of the property. Used when sharing data within nodes are not desired. With this value, every + NiFi node in the cluster (if it is clustered) depends on it's local Hazelcast server, which are not connected into a + Hazelcast cluster. As part of this, the capability of the Hazelcast instances to connect with other servers (even outside + the NiFi cluster) is turned off. +</p> + +<h3>Cluster</h3> + +<p> + Can be used only in clustered node. Using this mode will result a single Hazelcast cluster consisting the embedded instances + from all the NiFi nodes created by the local instance of the same controller service. This mode assumes that, all the Hazelcast + servers are listening on the same port, thus having variable port number based on expression will prevent joining properly. +</p> + +<p> + The controller service gathers the necessary host list from NiFi cluster related information when the service is enabled. It is + not a prerequisite for all the node to successfully joined at this point, but the join must be initiated. When the controller + service is enabled at the start of the NiFi instance, the enabling of the service will be prevented until the point the node is + considered as clustered. Review comment: ```suggestion The controller service automatically gathers the host list from the NiFi cluster itself when it is enabled. It is not required for all the nodes to have been successfully joined at this point, but the join must have been initiated. When the controller service is enabled at the start of the NiFi instance, the enabling of the service will be prevented until the node is considered clustered. ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.EmbeddedHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>EmbeddedHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>EmbeddedHazelcastCacheManager</h2> + +<p> + This service starts and manages an embedded Hazelcast instance. The instance needs to listen on a port for + possible clients to join in. The cache manager will not join via this port but directly reaches data using the embedded + server instance. This behaviour comes from Hazelcast and not to be prevented but not used as the embedded manager + is intended to be serve as an internal cache storage. However, be aware: this might make the instance reachable + within the same network and it is possible for clients to join. Review comment: ```suggestion This service starts and manages an embedded Hazelcast instance. The cache manager has accesses to the instance - and the data stored in it - directly. However, the instance sill opens a port for potential clients to join and this cannot be prevented. Note that this might leave the instance open for rogue clients to join. ``` ########## File path: nifi-nar-bundles/nifi-hazelcast-bundle/nifi-hazelcast-services/src/main/resources/org.apache.nifi.hazelcast.services.cachemanager.EmbeddedHazelcastCacheManager/additionalDetails.html ########## @@ -0,0 +1,86 @@ +<!DOCTYPE html> +<html lang="en"> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<head> + <meta charset="utf-8" /> + <title>EmbeddedHazelcastCacheManager</title> + <link rel="stylesheet" href="/nifi-docs/css/component-usage.css" type="text/css" /> +</head> + +<body> +<h2>EmbeddedHazelcastCacheManager</h2> + +<p> + This service starts and manages an embedded Hazelcast instance. The instance needs to listen on a port for + possible clients to join in. The cache manager will not join via this port but directly reaches data using the embedded + server instance. This behaviour comes from Hazelcast and not to be prevented but not used as the embedded manager + is intended to be serve as an internal cache storage. However, be aware: this might make the instance reachable + within the same network and it is possible for clients to join. +</p> + +<p> + The properties the service supports are provided in order to make it possible to run multiple instances of Hazelcast + (whatever if via EmbeddedHazelcastCacheManager or externally) without any interference. If no further instances are in + use, the port number and cluster name are not necessary to be set. +</p> + +<p> + The service supports multiple ways to set up NiFi cluster. This is controlled by the property, named "Hazelcast High + Availability Mode". The following values might be used: +</p> + +<h3>None</h3> + +<p> + This is the default value of the property. Used when sharing data within nodes are not desired. With this value, every + NiFi node in the cluster (if it is clustered) depends on it's local Hazelcast server, which are not connected into a + Hazelcast cluster. As part of this, the capability of the Hazelcast instances to connect with other servers (even outside + the NiFi cluster) is turned off. +</p> + +<h3>Cluster</h3> + +<p> + Can be used only in clustered node. Using this mode will result a single Hazelcast cluster consisting the embedded instances + from all the NiFi nodes created by the local instance of the same controller service. This mode assumes that, all the Hazelcast + servers are listening on the same port, thus having variable port number based on expression will prevent joining properly. +</p> + +<p> + The controller service gathers the necessary host list from NiFi cluster related information when the service is enabled. It is + not a prerequisite for all the node to successfully joined at this point, but the join must be initiated. When the controller + service is enabled at the start of the NiFi instance, the enabling of the service will be prevented until the point the node is + considered as clustered. +</p> + +<p> + If a node joins at a later point, the unity and health of the Hazelcast cluster depends on the Hazelcast's internal mechanism + for cluster merge. As the new node has a comprehensive list of the expected instances, including the already existing servers + and itself, the Hazelcast will be able to reach the expected state. Be aware: this takes significant time for the Hazelcast. + <i>Note: as this is provided by Hazelcast, it is not guaranteed that later releases will have exactly the same behaviour!</i> Review comment: ```suggestion Hazelcast can accept nodes that join at a later time. As the new node has a comprehensive list of the expected instances - including the already existing ones and itself - Hazelcast will be able to reach the expected state. Beware: this may take significant time. <i>Note: as this is provided by Hazelcast, it is not guaranteed that later releases will have the exact same behaviour!</i> ``` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
