thenatog commented on a change in pull request #4613:
URL: https://github.com/apache/nifi/pull/4613#discussion_r520231085



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/state/providers/zookeeper/ZooKeeperStateProvider.java
##########
@@ -133,20 +147,52 @@ public ZooKeeperStateProvider() {
         return properties;
     }
 
-
     @Override
     public synchronized void init(final StateProviderInitializationContext 
context) {
         connectionString = context.getProperty(CONNECTION_STRING).getValue();
         rootNode = context.getProperty(ROOT_NODE).getValue();
         timeoutMillis = 
context.getProperty(SESSION_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue();
 
+        final Properties stateProviderProperties = new Properties();
+        
stateProviderProperties.setProperty(NiFiProperties.ZOOKEEPER_SESSION_TIMEOUT, 
String.valueOf(timeoutMillis));
+        
stateProviderProperties.setProperty(NiFiProperties.ZOOKEEPER_CONNECT_TIMEOUT, 
String.valueOf(timeoutMillis));
+        
stateProviderProperties.setProperty(NiFiProperties.ZOOKEEPER_ROOT_NODE, 
rootNode);
+        
stateProviderProperties.setProperty(NiFiProperties.ZOOKEEPER_CONNECT_STRING, 
connectionString);
+
+        zooKeeperClientConfig = 
ZooKeeperClientConfig.createConfig(combineProperties(nifiProperties, 
stateProviderProperties));

Review comment:
       If you're happy, I might leave the existing properties as-is so that the 
configuration for the file is still backwards compatible, and I'll simply 
enable the required=true for the property. I've fixed a small issue with the 
StandardStateManagerProvider.java validator execution order so startup fails if 
the property is not present. This will make the error log message relevant 
again, and uses the connect string validator.
   
   We could make these properties not required in the state-management.xml and 
instead inherited from nifi.properties, but for now I guess I'll stick with 
what's expected and keep them in this file. If you think we should instead 
inherit from nifi.properties by default I can do that too so let me know what 
you think.




----------------------------------------------------------------
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]


Reply via email to