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

    https://github.com/apache/trafodion/pull/1537#discussion_r183941529
  
    --- Diff: core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp ---
    @@ -530,11 +542,39 @@ static void* SessionWatchDog(void* arg)
                     okToGo = false;
                 }
             }
    -
    -
    -           while(!record_session_done && okToGo)
    -           {
    -                   REPOS_STATS repos_stats = repos_queue.get_task();
    +        vector< vector<string> > query_list;
    +        vector<string> session_start;
    +        vector<string> statement_new_query;
    +        vector<string> session_stat_aggregation;
    +
    +        session_start.push_back("upsert into 
Trafodion.\"_REPOS_\".metric_session_table values");
    +        statement_new_query.push_back("insert into 
Trafodion.\"_REPOS_\".metric_query_table values");
    +        session_stat_aggregation.push_back("insert into 
Trafodion.\"_REPOS_\".metric_query_aggr_table values");
    +
    +        query_list.push_back(session_start);
    +        query_list.push_back(statement_new_query);
    +        query_list.push_back(session_stat_aggregation);
    +
    +        int query_limit = statisticsCacheSize;
    +        int time_limit = aggrInterval;
    +        //0:None 1:update 2:insert/upsert cache limit 3:achieve timeline
    +        int execute_flag = REPOS_EXECUTE_NONE;
    +        clock_t time_start = clock();
    +        clock_t time_end= clock();
    +
    +        REPOS_STATS repos_stats;
    +        while(!record_session_done && okToGo)
    +        {
    +            time_start = clock();
    +            while(repos_queue.isEmpty() && (((time_end = clock()) - 
time_start) / 1000000 < time_limit));
    --- End diff --
    
    Thanks. Of course not. The existing behavior is that as long as there is 
data in the queue, it will be published into repository immediately. 
statisticsCacheSize just determines the number of data cached in the queue. if 
it is set to 1, the data will be sent immediately once it goes into the queue, 
like  'The existing behavior'. @venkat1m 


---

Reply via email to