[
https://issues.apache.org/jira/browse/METRON-1529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16442756#comment-16442756
]
ASF GitHub Bot commented on METRON-1529:
----------------------------------------
GitHub user nickwallen opened a pull request:
https://github.com/apache/metron/pull/997
METRON-1529 CONFIG_GET Fails to Retrieve Latest Config When Run in Zeppelin
REPL
The cache used to back the `CONFIG_GET` does not update when changes are
made in Zookeeper. This problem only occurs when the REPL is run in Zeppelin.
It does not occur when the REPL is run in the CLI.
[METRON-1529](https://issues.apache.org/jira/browse/METRON-1529) includes step
to replicate the issue.
**NOTE:** This change is dependent on #982 . It should only be merged
after #982.
## Changes
The root cause is not clear, but must be due to the way in which Zeppelin
launches the interpreters and keeps them isolated from the core of Zeppelin
itself.
That being said, there really is no need for a cache to back `CONFIG_GET`.
The function should always go to Zookeeper to get the latest configuration
values. This simplifies the implementation and solves the problem at-hand.
The changes relevant to this PR include the following.
*
[`metron-platform/metron-management/src/main/java/org/apache/metron/management/ConfigurationFunctions.java`](https://github.com/apache/metron/compare/master...nickwallen:METRON-1529?expand=1#diff-00b9178e2e80b694bac96e387f434ec9)
*
[`metron-platform/metron-management/src/test/java/org/apache/metron/management/ConfigurationFunctionsTest.java`](https://github.com/apache/metron/compare/master...nickwallen:METRON-1529?expand=1#diff-187b5eaaf0be7dc001aaa47388444036)
*
[`metron-platform/metron-common/src/main/java/org/apache/metron/common/configuration/ConfigurationsUtils.java`](https://github.com/apache/metron/compare/master...nickwallen:METRON-1529?expand=1#diff-b8d2f6514e881628a94f49e342bc7be)
## Testing
* The unit tests were enhanced to validate this change.
* I have validate this change in the CentOS dev environment
* I have tested this in the Zeppelin REPL by following the steps outlined
in [METRON-1529](https://issues.apache.org/jira/browse/METRON-1529).

* I have tested this in the CLI REPL by launching the REPL using the
following command and then running the same set of Stellar commands.
java -cp
"metron-stellar/stellar-common/target/stellar-common-0.4.3.jar:metron-platform/metron-management/target/metron-management-0.4.3.jar:metron-platform/metron-parsers/target/metron-parsers-0.4.3-uber.jar:~/.m2/repository/org/slf4j/slf4j-simple/1.7.9/slf4j-simple-1.7.25.jar"
org.apache.metron.stellar.common.shell.cli.StellarShell -z localhost:2181

## Pull Request Checklist
- [ ] Is there a JIRA ticket associated with this PR? If not one needs to
be created at [Metron
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
- [ ] Does your PR title start with METRON-XXXX where XXXX is the JIRA
number you are trying to resolve? Pay particular attention to the hyphen "-"
character.
- [ ] Has your PR been rebased against the latest commit within the target
branch (typically master)?
- [ ] Have you included steps to reproduce the behavior or problem that is
being changed or addressed?
- [ ] Have you included steps or a guide to how the change may be verified
and tested manually?
- [ ] Have you ensured that the full suite of tests and checks have been
executed in the root metron folder via:
- [ ] Have you written or updated unit tests and or integration tests to
verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] Have you verified the basic functionality of the build by building
and running locally with Vagrant full-dev environment or the equivalent?
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/nickwallen/metron METRON-1529
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metron/pull/997.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #997
----
commit e1556ee59014d00c8e24ceaf68b94b0df4d449ec
Author: nickwallen <nick@...>
Date: 2018-04-17T13:43:16Z
METRON-1529 CONFIG_GET Fails to Retrieve Latest Config When Run in Zeppelin
REPL
commit 5e08e28b4f2c67679199fe0bf4af3b66c99630e6
Author: Nick Allen <nick@...>
Date: 2018-04-18T15:36:15Z
Merge remote-tracking branch 'apache/master' into METRON-1529
----
> CONFIG_GET Fails to Retrieve Latest Config When Run in Zeppelin REPL
> --------------------------------------------------------------------
>
> Key: METRON-1529
> URL: https://issues.apache.org/jira/browse/METRON-1529
> Project: Metron
> Issue Type: Bug
> Reporter: Nick Allen
> Assignee: Nick Allen
> Priority: Minor
>
> The configuration values retrieve by CONFIG_GET are incorrect when run in the
> Zeppelin REPL. The cache backing CONFIG_GET retrieves the correct value when
> the function is initialized. If the value is changed either in the same
> session or by an external process, the cache is never updated to the latest
> value. Restarting the Zeppelin REPL session and forcing reinitialization
> will cause the correct, latest value to be retrieved.
> Do the following in a Zeppelin Notebook to replicate the bug.
> 1. Follow the README to install the Stellar Zeppelin Interpreter.
> 2. In Zeppelin > Interpreters > Stellar, set the zookeeper URL property.
> {code}
> zookeeper.url = localhost:2181
> {code}
> 3. In Zeppelin > Interpreters > Stellar, set the following additional
> dependencies.
> | artifact | exclude
> |
> | org.apache.metron:metron-management:0.4.3 |
> |
> | org.apache.metron:metron-common:0.4.3 |
> |
> | io.thekraken:grok:0.1.0 |
> org.apache.commons:commons-lang3 |
> | org.apache.commons:commons-lang3:3.2 |
> |
>
>
> 4. Create a notebook and run the following.
> {code}
> CONFIG_GET("GLOBAL")
> {
> "k6" : "v6"
> }
> {code}
> {code}
> CONFIG_PUT("GLOBAL", '{ "k7":"v7" }')
> {code}
> {code}
> CONFIG_GET("GLOBAL")
> {
> "k6" : "v6"
> }
> {code}
> 5. The last result shold be "k7"/"v7", but is instead the old value "k6"/"v6".
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)