[ZEPPELIN-3778] Cluster synchronize notes & authorization#3387
[ZEPPELIN-3778] Cluster synchronize notes & authorization#3387xunliu wants to merge 2 commits intoapache:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
|
@zjffdu , @felixcheung , Please help me review code, Thanks! |
| 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.
why is if (LOGGER.isDebugEnabled()) { needed? LOGGER.debug should be enough?
There was a problem hiding this comment.
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.
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.
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.
can this be joined to the line before? formatting is a bit strange.
There was a problem hiding this comment.
Modified to this?
Set<String> set = gson.fromJson(jsonSet, new TypeToken<Set<String>>() {}.getType());
There was a problem hiding this comment.
seem that way. new TypeToken<Set<String>>() {} (together) seems to be how it is used.
There was a problem hiding this comment.
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: