Skip to content

Conversation

Leemoonsoo
Copy link
Member

@Leemoonsoo Leemoonsoo commented Jan 26, 2017

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 when 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 Resource invokeMethod(String methodName, Class [] paramTypes, Object [] params, String returnResourceName);
}

What type of PR is it?

Feature

Todos

  • - API for remote method invocation and get result
  • - API for remote method invocation and store result into resource pool
  • - 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

@Leemoonsoo Leemoonsoo force-pushed the invoke_method_from_resource branch from a0adbde to 30e62f2 Compare January 26, 2017 20:15
try {
o = Resource.deserializeObject(object);
} catch (IOException e) {
logger.error(e.getMessage(), e);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it fail / exit then without passing o along? Since o can be null in that case

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to put null into getInvokeResponse, otherwise, https://github.com/apache/zeppelin/pull/1951/files#diff-5d91426e574ad85664eb7a7857ef6e90R207 may not finish.

@Leemoonsoo
Copy link
Member Author

Merge to master if no further discussions

@asfgit asfgit closed this in 42bcf42 Jan 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants