Skip to content

Conversation

@Leemoonsoo
Copy link
Member

What is this PR for?

ResourcePool is introduced by ZEPPELIN-619.
However, it didn't provide any automatic resource release on paragraph / note removal unlike paragraph scope angular object which is quite helpful in practical use.

This PR adds noteId and paragraphId to ResourceId, so resource can be identified by noteId and paragraphId in addition to resourcePoolId and name.
By using informations in ResourceId, automatically release resource when note / paragraph remove.

So now, it's possible to put InterpreterResult into the resource pool safely, which might be useful for ZEPPELIN-374 and ZEPPELIN-533.

What type of PR is it?

Improvement

Todos

  • - Add noteId and paragraphId to ResourceId
  • - Release resource when note / paragraph remove
  • - Put InterpreterResult into resource pool
  • - Unit test

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-713

How should this be tested?

You can get resourcePool from InterpreterContext and print items inside of spark interpreter. (note. resource pool is not spark interpreter specific feature. But so far spark interpreter provides user api to access it)

You can see InterpreterResult is automatically shared to resourcePool and they're removed on note/paragraph remove.

%md
hello world

%spark
// print items in resource pool.
import collection.JavaConversions._
val pool = z.getInterpreterContext.getResourcePool
pool.getAll.foreach(i=>println(i + " " + i.get))

Screenshots (if appropriate)

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 ZEPPELIN-713 branch 2 times, most recently from 54cc78a to 473dd6f Compare March 5, 2016 20:39
@Leemoonsoo
Copy link
Member Author

Please review.

@Leemoonsoo
Copy link
Member Author

Merge if there're no more discussions

@felixcheung
Copy link
Member

LGTM

@asfgit asfgit closed this in 85a2ad3 Mar 15, 2016
fireboy1919 pushed a commit to fireboy1919/incubator-zeppelin that referenced this pull request Apr 5, 2016
…rcePool

ResourcePool is introduced by ZEPPELIN-619.
However, it didn't provide any automatic resource release on paragraph / note removal unlike paragraph scope angular object which is quite helpful in practical use.

This PR adds noteId and paragraphId to ResourceId, so resource can be identified by noteId and paragraphId in addition to resourcePoolId and name.
By using informations in ResourceId, automatically release resource when note / paragraph remove.

So now, it's possible to put InterpreterResult into the resource pool safely, which might be useful for ZEPPELIN-374 and ZEPPELIN-533.

Improvement

* [x] - Add noteId and paragraphId to ResourceId
* [x] - Release resource when note / paragraph remove
* [x] - Put InterpreterResult into resource pool
* [x] - Unit test

https://issues.apache.org/jira/browse/ZEPPELIN-713

You can get resourcePool from InterpreterContext and print items inside of spark interpreter. (note. resource pool is not spark interpreter specific feature. But so far spark interpreter provides user api to access it)

You can see InterpreterResult is automatically shared to resourcePool and they're removed on note/paragraph remove.

```
%md
hello world

%spark
// print items in resource pool.
import collection.JavaConversions._
val pool = z.getInterpreterContext.getResourcePool
pool.getAll.foreach(i=>println(i + " " + i.get))
```

* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Lee moon soo <moon@apache.org>

Closes apache#763 from Leemoonsoo/ZEPPELIN-713 and squashes the following commits:

473dd6f [Lee moon soo] Update test
b2e4fcc [Lee moon soo] put interpreter result into resource pool
11d138c [Lee moon soo] Remove resource on note / paragraph removal
onkarshedge pushed a commit to onkarshedge/incubator-zeppelin that referenced this pull request May 11, 2016
…rcePool

### What is this PR for?
ResourcePool is introduced by ZEPPELIN-619.
However, it didn't provide any automatic resource release on paragraph / note removal unlike paragraph scope angular object which is quite helpful in practical use.

This PR adds noteId and paragraphId to ResourceId, so resource can be identified by noteId and paragraphId in addition to resourcePoolId and name.
By using informations in ResourceId, automatically release resource when note / paragraph remove.

So now, it's possible to put InterpreterResult into the resource pool safely, which might be useful for ZEPPELIN-374 and ZEPPELIN-533.

### What type of PR is it?
Improvement

### Todos
* [x] - Add noteId and paragraphId to ResourceId
* [x] - Release resource when note / paragraph remove
* [x] - Put InterpreterResult into resource pool
* [x] - Unit test

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-713

### How should this be tested?
You can get resourcePool from InterpreterContext and print items inside of spark interpreter. (note. resource pool is not spark interpreter specific feature. But so far spark interpreter provides user api to access it)

You can see InterpreterResult is automatically shared to resourcePool and they're removed on note/paragraph remove.

```
%md
hello world

%spark
// print items in resource pool.
import collection.JavaConversions._
val pool = z.getInterpreterContext.getResourcePool
pool.getAll.foreach(i=>println(i + " " + i.get))
```

### Screenshots (if appropriate)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Lee moon soo <moon@apache.org>

Closes apache#763 from Leemoonsoo/ZEPPELIN-713 and squashes the following commits:

473dd6f [Lee moon soo] Update test
b2e4fcc [Lee moon soo] put interpreter result into resource pool
11d138c [Lee moon soo] Remove resource on note / paragraph removal
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