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

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

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

    https://github.com/apache/incubator-metron/pull/345#discussion_r86785336
  
    --- Diff: 
metron-analytics/metron-profiler-client/src/main/java/org/apache/metron/profiler/client/stellar/GetProfile.java
 ---
    @@ -132,35 +144,33 @@
     
       private static final Logger LOG = 
LoggerFactory.getLogger(GetProfile.class);
     
    -  /**
    -   * A client that can retrieve profile values.
    -   */
    +
    +  // Global configuration from client context, used to help create 
profiler client.
    +  private Map<String, Object> global;
    +
    +  // Cached client that can retrieve profile values.
       private ProfilerClient client;
     
    +  // Cached value of config override map used to construct the previously 
cached client.
    +  private Map cachedConfigOverrideMap = null;
    +
       /**
        * Initialization.
        */
       @Override
       public void initialize(Context context) {
    -
         // ensure the required capabilities are defined
         Context.Capabilities[] required = { GLOBAL_CONFIG };
         validateCapabilities(context, required);
    -    Map<String, Object> global = (Map<String, Object>) 
context.getCapability(GLOBAL_CONFIG).get();
    -
    -    // create the profiler client
    -    RowKeyBuilder rowKeyBuilder = getRowKeyBuilder(global);
    -    ColumnBuilder columnBuilder = getColumnBuilder(global);
    -    HTableInterface table = getTable(global);
    -    client = new HBaseProfilerClient(table, rowKeyBuilder, columnBuilder);
    +    global = (Map<String, Object>) 
context.getCapability(GLOBAL_CONFIG).get();
    --- End diff --
    
    If the global config changes, you probably want to pick that up 
post-initialization.  I would calling 
`context.getCapability(GLOBAL_CONFIG).get()` from the apply rather than caching 
a copy.


> Define Profile Period When Calling PROFILE_GET
> ----------------------------------------------
>
>                 Key: METRON-532
>                 URL: https://issues.apache.org/jira/browse/METRON-532
>             Project: Metron
>          Issue Type: Improvement
>            Reporter: Nick Allen
>            Assignee: Matt Foley
>
> The Profiler Client currently offers the PROFILE_GET Stellar function to 
> access profile data.  The work done for METRON-529 allowed the user to 
> customize the profile period using Metron global properties.  
> A user may need to access historical profiles with different durations and 
> would want to specify the period as part of the call to the Profiler Client, 
> rather than in the Metron global properties.
> This would be especially necessary should METRON-530 be completed allowing 
> different profiles to use different period durations simultaneously.
> There is some discussion of this attached to METRON-529.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to