smolnar82 opened a new pull request #233: KNOX-2160 - Monitoring and processing refreshable service parameters URL: https://github.com/apache/knox/pull/233 ## What changes were proposed in this pull request? Monitoring a pre-defined folder for service parameter changes and, if there was a change in the `refreshable-service-parameters.xml`, processing the new service parameters. ## How was this patch tested? Added and updated JUnit tests then executed them: ``` $ mvn clean -Dshellcheck=true -T1C verify -Prelease,package ... [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 02:37 min [INFO] Finished at: 2020-01-08T12:16:47+01:00 [INFO] Final Memory: 156M/1615M [INFO] ------------------------------------------------------------------------ ``` Additionally, the following E2E testing took place locally: - deployed Knox with my changes - set -`gateway.refreshable.service.parameters.folder=/Users/smolnar/test/conf_dir` -`gateway.refreshable.service.parameters.folder.monitor.interval=10000` in `gateway-site.xml` - produced `/Users/smolnar/test/conf_dir/refreshable-service-parameters.xml` (used the same sample I added as a new JUnit test resource) - started Knox (confirmed - using remote debugging - that the monitoring thread got created) - created `cdp-proxy-api` provider/descriptor pair (with HIVE, RANGER and NIFI services; gave the dummy URLs) - edited the content of `/Users/smolnar/test/conf_dir/refreshable-service-parameters.xml` - confirmed that `cdp-proxy-api` got re-deployed: saw the proper log messages and checked the re-deployed topology content in the Admin UI - changed the service parameters in the Admin UI too Relevant `gateway.log` messages: ``` 2020-01-08 12:32:59,484 INFO knox.gateway (DefaultTopologyService.java:refreshServiceParameters(855)) - Refreshing service parameters... 2020-01-08 12:32:59,494 INFO knox.gateway (DefaultTopologyService.java:refreshServiceParameters(857)) - Refreshed service parameters in cdp-proxy-api ... 2020-01-08 12:33:03,733 INFO knox.gateway (DefaultTopologyService.java:onFileChange(946)) - Generated topology cdp-proxy-api.xml because the associated descriptor cdp-proxy-api.json changed. 2020-01-08 12:33:06,179 INFO knox.gateway (GatewayServer.java:handleCreateDeployment(998)) - Deploying topology cdp-proxy-api to /Users/smolnar/test/knoxGateway/data/deployments/cdp-proxy-api.topo.16f84eded98 2020-01-08 12:33:06,179 INFO knox.gateway (GatewayServer.java:internalDeactivateTopology(917)) - Deactivating topology cdp-proxy-api 2020-01-08 12:33:06,238 INFO knox.gateway (DefaultGatewayServices.java:initializeContribution(164)) - Credential store found for the cluster: cdp-proxy-api - no need to create one. 2020-01-08 12:33:06,607 INFO knox.gateway (GatewayServer.java:internalActivateTopology(883)) - Activating topology cdp-proxy-api 2020-01-08 12:33:06,607 INFO knox.gateway (GatewayServer.java:internalActivateArchive(893)) - Activating topology cdp-proxy-api archive %2F 2020-01-08 12:33:06,666 INFO knox.gateway (GatewayServer.java:cleanupTopologyDeployments(356)) - Deleting backup deployed topology /Users/smolnar/test/knoxGateway/data/deployments/cdp-proxy-api.topo.16f84d7c1d0 ```
---------------------------------------------------------------- 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] With regards, Apache Git Services
