Skip to content

Conversation

@maoling
Copy link
Member

@maoling maoling commented Feb 18, 2019

  • it's a very useful CLI for users to use, test, debug the watch function.
  • the watch cmd is one-off and it will be blocking until something has changed.
  • Although we already have ls -w /foo to watch the child change, get -w /foo to watch the data change,this new cli is also valuable and user-fridendly in a perspective view of watch.
  • In the further, we can add -f option: watch a node forever, add -R option to watch all the events under a dir.
  • this CLI just calls the api about watch in the zookeeper.java,the correctness of function has been tested in the WatcherFuncTest,so add no UTs.But a very detailed test evidence has included in the jira

@maoling maoling closed this Mar 10, 2019
@maoling maoling reopened this Mar 10, 2019
if (e.getType() == Event.EventType.None) {
return;
}
if (e.getState() == Event.KeeperState.SyncConnected) {
Copy link

Choose a reason for hiding this comment

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

Does this capture every state that might be encountered? Would it be possible to receive a Disconnected or an AuthFailed event and is there something that might gracefully handle them?

The code for this change looks good to me outside of these questions.

Copy link
Member Author

Choose a reason for hiding this comment

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

@enixon Yes,agreed!

@enixon
Copy link

enixon commented Oct 13, 2019

I like this. Code looks good to me - my only thought for improvement is whether we can move the action on the watch firing into the callback so that this operation can be nonblocking.

Anyone else have thoughts?

@maoling
Copy link
Member Author

maoling commented Oct 15, 2019

@enixon

  • Now CLI:watch supports nonblocking(default) or blocking mode with option:-b

Copy link
Contributor

@anmolnar anmolnar left a comment

Choose a reason for hiding this comment

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

+1 lgtm.
Please rebase.

@maoling
Copy link
Member Author

maoling commented Nov 19, 2019

@anmolnar Thanks for your review
I forward my work to PR-1149. Let me close this PR

@maoling maoling closed this Nov 19, 2019
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.

3 participants