[ 
https://issues.apache.org/jira/browse/METRON-1167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16159102#comment-16159102
 ] 

ASF GitHub Bot commented on METRON-1167:
----------------------------------------

Github user ottobackwards commented on a diff in the pull request:

    https://github.com/apache/metron/pull/740#discussion_r137864851
  
    --- Diff: 
metron-stellar/stellar-common/src/main/java/org/apache/metron/stellar/common/shell/StellarShell.java
 ---
    @@ -308,17 +315,68 @@ private void handleMagic( String rawExpression) {
                   .collect(Collectors.joining(", "));
           writeLine(functions);
     
    -    } else if(MAGIC_VARS.equals(command)) {
    +    } else if (MAGIC_VARS.equals(command)) {
     
    -      // list all variables
    +      // '%vars' -> list all variables in scope
           executor.getVariables()
    -              .forEach((k,v) -> writeLine(String.format("%s = %s", k, v)));
    +              .forEach((k, v) -> writeLine(String.format("%s = %s", k, 
v)));
    +
    +    } else if (MAGIC_GLOBALS.equals(command)) {
    +
    +      // '%globals' -> list all globals in scope
    +      Map<String, Object> globals = Collections.emptyMap();
    --- End diff --
    
    Nick. If I understand correctly, if there is no ZK, then this turns on the 
GLOBAL_CONFIG flag, and sets whatever properties.
    
    Is there any risk that other functions that check for GLOBAL_CONFIG can see 
the flag, but assuming the full config is present, when in this case only what 
the user has set is present?
    



> Define Session Specific Global Configuration Values in the REPL
> ---------------------------------------------------------------
>
>                 Key: METRON-1167
>                 URL: https://issues.apache.org/jira/browse/METRON-1167
>             Project: Metron
>          Issue Type: Improvement
>    Affects Versions: 0.4.0
>            Reporter: Nick Allen
>            Assignee: Nick Allen
>
> Many Stellar functions accept configuration values from the Global 
> configuration.  When using the REPL you can load the global configuration 
> values by launching the REPL with the -z option, which loads the global 
> configuration stored in Zookeeper.
> The only way to modify the global configuration within the REPL currently is 
> to do the following steps.
> 1. Retrieve the global configuration with conf := CONFIG_GET("global")
> 2. Alter that global configuration by modifying the JSON contained in the 
> `conf` variable.
> 3. Push the new global configuration using CONFIG_PUT("global", conf)
> 4. Close and then reopen the REPL.  Without restarting the REPL the new 
> global configuration is not loaded.
> I want a way to do this directly in the REPL, without restarting it, and also 
> in a way that does not modify the persisted global configuration in 
> Zookeeper.  I may be monkeying with something the REPL, but I don't want to 
> break one of my live Metron topologies.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to