You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by Vimal-Das <gi...@git.apache.org> on 2016/09/03 11:19:25 UTC

[GitHub] incubator-carbondata pull request #123: [CARBONDATA-204] Clear queryStatisti...

Github user Vimal-Das commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/123#discussion_r77435539
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/carbon/querystatistics/DriverQueryStatisticsRecorder.java ---
    @@ -78,106 +82,142 @@ public synchronized void recordStatisticsForDriver(QueryStatistic statistic, Str
        */
       public void logStatisticsAsTableDriver() {
         synchronized (lock) {
    -      String tableInfo = collectDriverStatistics();
    -      if (null != tableInfo) {
    -        LOGGER.statistic(tableInfo);
    +      for (String key: queryStatisticsMap.keySet()) {
    +        // print sql_parse_t,load_meta_t,block_allocation_t,block_identification_t
    +        // or just print block_allocation_t,block_identification_t
    +        if (queryStatisticsMap.get(key).size() >= 2) {
    --- End diff --
    
    The call can return null, because the keyset obtained reflects the state of map when the .keySet() method was called, later changes in the map will not be reflected. So, if the element is removed in the meantime, get() can return null.
    
    Solution: use an iterator over entrySet()


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---