-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-3778] Cluster synchronize notes & authorization #3387
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
Conversation
This comment has been minimized.
This comment has been minimized.
|
@zjffdu , @felixcheung , Please help me review code, Thanks! |
felixcheung
left a comment
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.
| private BiFunction<Address, byte[], byte[]> subscribeClusterEvent = (address, data) -> { | ||
| private BiFunction<Address, byte[], byte[]> subscribeClusterIntpEvent = (address, data) -> { | ||
| String message = new String(data); | ||
| if (LOGGER.isDebugEnabled()) { |
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 is if (LOGGER.isDebugEnabled()) { needed? LOGGER.debug should be enough?
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.
Because need to synchronize the create, rename, delete, set read permissions, write permissions, execute permissions, so need to synchronize the more information, there will be a lot of synchronization information in the log file.
So need add if (LOGGER.isDebugEnabled())
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.
I'm not sure I understand. you are saying logging is useful for debugging, and there could be a lot of information.
isn't debug log will be filtered out if debug log is not enabled?
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.
In the development phase, the debug information is very useful for developers, but after the development is completed, the debug information will be very much. In the log log file, there is a lot of synchronization information, which affects the system administrator to check whether the system is normal.
So, I think these debug messages don't need to be printed to the log file after development. :-)
| String jsonSet = message.get("set"); | ||
| Gson gson = new Gson(); | ||
| Set<String> set = gson.fromJson(jsonSet, new TypeToken<Set<String>>() { | ||
| }.getType()); |
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.
can this be joined to the line before? formatting is a bit strange.
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.
Modified to this?
Set<String> set = gson.fromJson(jsonSet, new TypeToken<Set<String>>() {}.getType());
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.
seem that way. new TypeToken<Set<String>>() {} (together) seems to be how it is used.
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.
Ok, I am going to change it.
|
Hi, @felixcheung , This is a good question. #3387 (review)
If rename is effective, the deletion will fail. |
|
sure, that's assuming for example, it does look like if there are two move or rename concurrently there is a chance the note will be duplicated server1 server2 then both execute these concurrently |
|
@felixcheung , Thank you for asking this question. :-) |
|
Will merge if no more comments |
What is this PR for?
In cluster mode, The user creates, modifies, and deletes the note on any of the zeppelin servers.
All need to be notified to all the zeppelin servers in the cluster to synchronize the update of Notebook. Failure to do so will result in the user not being able to continue while switching to another server.
What type of PR is it?
[Feature]
What is the Jira issue?
How should this be tested?
Screenshots (if appropriate)
Sync note event
Sync note Authorization
Questions: