GitHub user Leemoonsoo opened a pull request:

    https://github.com/apache/zeppelin/pull/1951

    [ZEPPELIN-2020] Invoke method from resource

    ### What is this PR for?
    This PR provides a way to invoke method remotely against the resource in 
the resource pool.
    This will be particularly useful the object in the resource pool is 
non-serializable (like jdbc connection, spark dataframe).
    
    This PR extends data access API of Resource from
    
    ```
    class Resource {
      // get object
      public Object get();
    }
    ```
    
    to 
    ```
    class Resource {
      // get object
      public Object get()
    
      // call method of object and get return value
      public Object invokeMethod(String methodName, Class [] paramTypes, Object 
[] params);
    
      // call method of object and save return value into resourcepool
      public Object invokeMethod(String methodName, Class [] paramTypes, Object 
[] params, String returnResourceName);
    }
    
    
    ### What type of PR is it?
    Feature
    
    ### Todos
    * [x] - API for remote method invocation and get result
    * [x] - API for remote method invocation and store result into resource pool
    * [x] - Unittest
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/ZEPPELIN-2020
    
    ### How should this be tested?
    Unittest included 
    
    ### Questions:
    * Does the licenses files need update? no
    * Is there breaking changes for older versions? no
    * Does this needs documentation? no


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Leemoonsoo/zeppelin 
invoke_method_from_resource

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/1951.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1951
    
----
commit 74b502e9c89aebe09c932f0798817a1c5398bead
Author: Lee moon soo <[email protected]>
Date:   2017-01-26T00:39:42Z

    Support method invocation on the resource in local,remote resource pool

commit a0adbde37f5aa79ef63a422e5a38ca95f8127f2a
Author: Lee moon soo <[email protected]>
Date:   2017-01-26T02:12:03Z

    make RemoteResource.invokeMethod returns Resource when return resource name 
is specified

----


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to