mirror of https://github.com/apache/nifi.git
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 <turcsanyi@apache.org>
This commit is contained in:
parent
045027892a
commit
197df577ac
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue