DRILL-1776: C++ Client. Add interface to get application context.

Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/621527d5
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/621527d5
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/621527d5

Branch: refs/heads/master
Commit: 621527d580e447c38952fa9046703811388b670c
Parents: 07f276d
Author: Xiao Meng <xiaom...@gmail.com>
Authored: Mon Nov 24 14:41:55 2014 -0800
Committer: Parth Chandra <pchan...@maprtech.com>
Committed: Tue Jan 6 09:07:42 2015 -0800

----------------------------------------------------------------------
 contrib/native/client/src/clientlib/drillClient.cpp     | 3 +++
 contrib/native/client/src/include/drill/drillClient.hpp | 4 ++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/621527d5/contrib/native/client/src/clientlib/drillClient.cpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/clientlib/drillClient.cpp 
b/contrib/native/client/src/clientlib/drillClient.cpp
index 70058ec..a8cfe8c 100644
--- a/contrib/native/client/src/clientlib/drillClient.cpp
+++ b/contrib/native/client/src/clientlib/drillClient.cpp
@@ -294,6 +294,9 @@ RecordIterator* DrillClient::submitQuery(Drill::QueryType 
t, const std::string&
     return pIter;
 }
 
+void* DrillClient::getApplicationContext(QueryHandle_t handle){
+    return ((DrillClientQueryResult*)handle)->getListenerContext();
+}
 std::string& DrillClient::getError(){
     return m_pImpl->getError()->msg;
 }

http://git-wip-us.apache.org/repos/asf/drill/blob/621527d5/contrib/native/client/src/include/drill/drillClient.hpp
----------------------------------------------------------------------
diff --git a/contrib/native/client/src/include/drill/drillClient.hpp 
b/contrib/native/client/src/include/drill/drillClient.hpp
index 65c07d6..490c823 100644
--- a/contrib/native/client/src/include/drill/drillClient.hpp
+++ b/contrib/native/client/src/include/drill/drillClient.hpp
@@ -238,6 +238,10 @@ class DECLSPEC_DRILL_CLIENT DrillClient{
          * back. The listener callback will return the handle in the ctx 
parameter.
          */
         status_t submitQuery(Drill::QueryType t, const std::string& plan, 
pfnQueryResultsListener listener, void* listenerCtx, QueryHandle_t* qHandle);
+        /*
+         * Get the application context from query handle
+         */
+        static void* getApplicationContext(QueryHandle_t handle);
 
         /*
          * Submit a query asynchronously and wait for results to be returned 
through an iterator that returns

Reply via email to