You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by tu...@apache.org on 2020/06/30 19:58:19 UTC

[nifi] branch master updated: NIFI-7590 In 'CassandraSessionProvider.onDisabled' setting Cassandra-related references properly to null after closing them so that they can be renewed in 'onEnabled' (which creates them only if set to 'null', leaving them closed otherwise).

This is an automated email from the ASF dual-hosted git repository.

turcsanyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 197df57  NIFI-7590 In 'CassandraSessionProvider.onDisabled' setting Cassandra-related references properly to null after closing them so that they can be renewed in 'onEnabled' (which creates them only if set to 'null', leaving them closed otherwise).
197df57 is described below

commit 197df577ac9ade19dd1c2c807231212757bbd3d7
Author: Tamas Palfy <ta...@gmail.com>
AuthorDate: Tue Jun 30 17:36:18 2020 +0200

    NIFI-7590 In 'CassandraSessionProvider.onDisabled' setting Cassandra-related references properly to null after closing them so that they can be renewed in 'onEnabled' (which creates them only if set to 'null', leaving them closed otherwise).
    
    NIFI-7590 Removed 'CassandraSessionProvider.onStopped'.
    
    This closes #4373.
    
    Signed-off-by: Peter Turcsanyi <tu...@apache.org>
---
 .../org/apache/nifi/service/CassandraSessionProvider.java   | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-services/src/main/java/org/apache/nifi/service/CassandraSessionProvider.java b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-services/src/main/java/org/apache/nifi/service/CassandraSessionProvider.java
index a917ecb..89b1924 100644
--- a/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-services/src/main/java/org/apache/nifi/service/CassandraSessionProvider.java
+++ b/nifi-nar-bundles/nifi-cassandra-bundle/nifi-cassandra-services/src/main/java/org/apache/nifi/service/CassandraSessionProvider.java
@@ -33,7 +33,6 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription;
 import org.apache.nifi.annotation.documentation.Tags;
 import org.apache.nifi.annotation.lifecycle.OnDisabled;
 import org.apache.nifi.annotation.lifecycle.OnEnabled;
-import org.apache.nifi.annotation.lifecycle.OnStopped;
 import org.apache.nifi.authentication.exception.ProviderCreationException;
 import org.apache.nifi.cassandra.CassandraSessionProviderService;
 import org.apache.nifi.components.PropertyDescriptor;
@@ -182,19 +181,11 @@ public class CassandraSessionProvider extends AbstractControllerService implemen
     public void onDisabled(){
         if (cassandraSession != null) {
             cassandraSession.close();
+            cassandraSession = null;
         }
         if (cluster != null) {
             cluster.close();
-        }
-    }
-
-    @OnStopped
-    public void onStopped() {
-        if (cassandraSession != null) {
-            cassandraSession.close();
-        }
-        if (cluster != null) {
-            cluster.close();
+            cluster = null;
         }
     }