Skip to content

Conversation

@khalidhuseynov
Copy link
Member

@khalidhuseynov khalidhuseynov commented Sep 1, 2016

What is this PR for?

This PR addresses part of multi-user note management in Zeppelin. One of the tasks namely listing notes per user on Zeppelin start was addressed in #1330. However that PR didn't solve all problems, and reloading notes was incomplete as well as socket broadcast was not user aware ZEPPELIN-1437, ZEPPELIN-1438. This PR addresses those issue.

What type of PR is it?

Improvement

Todos

  • - list notes per user on reload
  • - broadcast per user (multicast)
  • - tests
  • - use authorization module to filter notes on sync
  • - broadcast on permissions change
  • - discussion and review

What is the Jira issue?

Zeppelin-1437, ZEPPELIN-1438

How should this be tested?

  1. Start Zeppelin
  2. Login as user1, and user2 on different windows
  3. Each user should be able to see their own note workbench
  4. If note changed to private (readers, writers not empty), that note should disappear from others note workbench.

Screenshots (if appropriate)

reload_broadcast

Questions:

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

@khalidhuseynov khalidhuseynov force-pushed the feat/multi-user-notes branch 8 times, most recently from 1f25a5a to 469360b Compare September 20, 2016 13:42
@khalidhuseynov khalidhuseynov changed the title WIP [ZEPPELIN-1339] Multi-user note management [ZEPPELIN-1437] Multi-user note management Sep 20, 2016
@khalidhuseynov khalidhuseynov changed the title [ZEPPELIN-1437] Multi-user note management [ZEPPELIN-1437] Multi-user note management - user aware reload broadcast Sep 20, 2016
@khalidhuseynov
Copy link
Member Author

this is ready for review

@khalidhuseynov
Copy link
Member Author

rebased and CI is green


public NotebookAuthorization(ZeppelinConfiguration conf) {
this.conf = conf;
public static NotebookAuthorization init(ZeppelinConfiguration config) {
Copy link
Member

@echarles echarles Sep 21, 2016

Choose a reason for hiding this comment

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

Why moving from constructor to init method (factory method pattern)?
Especially, the conf object is static, so calling multiple time init will override the conf field. The state of the NotebookAuthorization will not be consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

@echarles good point. actually that's more of a singleton pattern that gets instantiated once on init and can be retrieved by getInstance further on. the purpose of it was to enable other modules (e.g. storage in zengine) not having direct reference to notebookAuthorization, to be able to use its services without changing api. I believe for longer term authorization and storage modules can be refactored in a way that we don't need that pattern.

regarding overriding the conf field, you're right. I addressed it in 9cf1d88 so that it gets instantiated only once.

@khalidhuseynov khalidhuseynov changed the title [ZEPPELIN-1437] Multi-user note management - user aware reload broadcast [ZEPPELIN-1437, 1438] Multi-user note management - user aware reload broadcast Sep 27, 2016
@khalidhuseynov
Copy link
Member Author

i've addressed zeppelin-1438 here as well in last commit a2ce268, so user workbench should be updating user lists without manual reload, ready for review

@Leemoonsoo
Copy link
Member

Tested and LGTM.

Merge if there're no more discussions

@anthonycorbacho
Copy link
Contributor

@Leemoonsoo is it possible to merge it in couple of hour? some of my work will depends on this PR :)

@asfgit asfgit closed this in b77f9ea Oct 18, 2016
@khalidhuseynov khalidhuseynov deleted the feat/multi-user-notes branch October 18, 2016 03:14
darionyaphet pushed a commit to darionyaphet/zeppelin that referenced this pull request Oct 27, 2016
…broadcast

### What is this PR for?
This PR addresses part of multi-user note management in Zeppelin. One of the tasks namely listing notes per user on Zeppelin start was addressed in apache#1330. However that PR didn't solve all problems, and reloading notes was incomplete as well as socket broadcast was not user aware [ZEPPELIN-1437](https://issues.apache.org/jira/browse/ZEPPELIN-1437), [ZEPPELIN-1438](https://issues.apache.org/jira/browse/ZEPPELIN-1438). This PR addresses those issue.

### What type of PR is it?
Improvement

### Todos
* [x] - list notes per user on reload
* [x] - broadcast per user (multicast)
* [x] - tests
* [x] - use authorization module to filter notes on sync
* [x] - broadcast on permissions change
* [ ] - discussion and review

### What is the Jira issue?
[Zeppelin-1437](https://issues.apache.org/jira/browse/ZEPPELIN-1437), [ZEPPELIN-1438](https://issues.apache.org/jira/browse/ZEPPELIN-1438)

### How should this be tested?
1. Start Zeppelin
2. Login as user1, and user2 on different windows
3. Each user should be able to see their own note workbench
4. If note changed to private (readers, writers not empty), that note should disappear from others note workbench.

### Screenshots (if appropriate)
![reload_broadcast](https://cloud.githubusercontent.com/assets/1642088/18679507/e4a0161c-7f9a-11e6-9d57-0930abf4b780.gif)

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

Author: Khalid Huseynov <[email protected]>

Closes apache#1392 from khalidhuseynov/feat/multi-user-notes and squashes the following commits:

a2ce268 [Khalid Huseynov] broadcast note list on perm update - zeppelin-1438
9cf1d88 [Khalid Huseynov] fix init not to initialize every time
17eae84 [Khalid Huseynov] bugfix: add precondition for NP
781207e [Khalid Huseynov] bugfix: reload only once
537cc0e [Khalid Huseynov] apply filter from authorization in sync
09e6723 [Khalid Huseynov] notebookAuthorization as singleton
9427e62 [Khalid Huseynov] multicast fine grained note lists to users instead of broadcast
6614e2b [Khalid Huseynov] improve tests
1399407 [Khalid Huseynov] remove unused imports
d9c3bc9 [Khalid Huseynov] filter reload using predicates
92f37f5 [Khalid Huseynov] substitute old getAllNotes(subject) with new implementation
b7f19c9 [Khalid Huseynov] separate getAllNotes() and getAllNotes(subject)
17e2d4c [Khalid Huseynov] first draft
pedrozatta pushed a commit to pedrozatta/zeppelin that referenced this pull request Oct 27, 2016
…broadcast

### What is this PR for?
This PR addresses part of multi-user note management in Zeppelin. One of the tasks namely listing notes per user on Zeppelin start was addressed in apache#1330. However that PR didn't solve all problems, and reloading notes was incomplete as well as socket broadcast was not user aware [ZEPPELIN-1437](https://issues.apache.org/jira/browse/ZEPPELIN-1437), [ZEPPELIN-1438](https://issues.apache.org/jira/browse/ZEPPELIN-1438). This PR addresses those issue.

### What type of PR is it?
Improvement

### Todos
* [x] - list notes per user on reload
* [x] - broadcast per user (multicast)
* [x] - tests
* [x] - use authorization module to filter notes on sync
* [x] - broadcast on permissions change
* [ ] - discussion and review

### What is the Jira issue?
[Zeppelin-1437](https://issues.apache.org/jira/browse/ZEPPELIN-1437), [ZEPPELIN-1438](https://issues.apache.org/jira/browse/ZEPPELIN-1438)

### How should this be tested?
1. Start Zeppelin
2. Login as user1, and user2 on different windows
3. Each user should be able to see their own note workbench
4. If note changed to private (readers, writers not empty), that note should disappear from others note workbench.

### Screenshots (if appropriate)
![reload_broadcast](https://cloud.githubusercontent.com/assets/1642088/18679507/e4a0161c-7f9a-11e6-9d57-0930abf4b780.gif)

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

Author: Khalid Huseynov <[email protected]>

Closes apache#1392 from khalidhuseynov/feat/multi-user-notes and squashes the following commits:

a2ce268 [Khalid Huseynov] broadcast note list on perm update - zeppelin-1438
9cf1d88 [Khalid Huseynov] fix init not to initialize every time
17eae84 [Khalid Huseynov] bugfix: add precondition for NP
781207e [Khalid Huseynov] bugfix: reload only once
537cc0e [Khalid Huseynov] apply filter from authorization in sync
09e6723 [Khalid Huseynov] notebookAuthorization as singleton
9427e62 [Khalid Huseynov] multicast fine grained note lists to users instead of broadcast
6614e2b [Khalid Huseynov] improve tests
1399407 [Khalid Huseynov] remove unused imports
d9c3bc9 [Khalid Huseynov] filter reload using predicates
92f37f5 [Khalid Huseynov] substitute old getAllNotes(subject) with new implementation
b7f19c9 [Khalid Huseynov] separate getAllNotes() and getAllNotes(subject)
17e2d4c [Khalid Huseynov] first draft
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.

4 participants