Skip to content

Commit

Permalink
NIFI-7590 In 'CassandraSessionProvider.onDisabled' setting Cassandra-…
Browse files Browse the repository at this point in the history
…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 <turcsanyi@apache.org>
  • Loading branch information
tpalfy authored and turcsanyip committed Jun 30, 2020
1 parent 0450278 commit 197df57
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
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;
Expand Down Expand Up @@ -182,19 +181,11 @@ public void onEnabled(final ConfigurationContext context) {
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;
}
}

Expand Down

0 comments on commit 197df57

Please sign in to comment.