-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-1437, 1438] Multi-user note management - user aware reload broadcast #1392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ZEPPELIN-1437, 1438] Multi-user note management - user aware reload broadcast #1392
Conversation
1f25a5a to
469360b
Compare
|
this is ready for review |
that's to sync only user workbench notes
2eeb873 to
781207e
Compare
|
rebased and CI is green |
|
|
||
| public NotebookAuthorization(ZeppelinConfiguration conf) { | ||
| this.conf = conf; | ||
| public static NotebookAuthorization init(ZeppelinConfiguration config) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
094de2e to
a2ce268
Compare
|
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 |
|
Tested and LGTM. Merge if there're no more discussions |
|
@Leemoonsoo is it possible to merge it in couple of hour? some of my work will depends on this PR :) |
…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)  ### 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
…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)  ### 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
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
What is the Jira issue?
Zeppelin-1437, ZEPPELIN-1438
How should this be tested?
Screenshots (if appropriate)
Questions: