Skip to content

ZOOKEEPER-3659 Make WatchManagerFactory log more readable #1194

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rabi-kumar
Copy link
Contributor

According to ticket ZOOKEEPER-3659 we need to make WatchManagerFactory more readable. For this I have made the following changes:

  • Introduce a parameter in createWatchManager
  • Use the passed parameter in logger of WatchManagerFactory
  • Make necessary changes in DataTree, WatchManagerFactoryTest

Please do let me know if made changes makes sense or if I missed anything else so that additional changes could be made.

@rabi-kumar
Copy link
Contributor Author

@maoling Calling for review.

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.

Is it possible to use different WatchManagers for child and data watches?

@maoling
Copy link
Member

maoling commented Feb 14, 2020

@anmolnar

Is it possible to use different WatchManagers for child and data watches?

Could you please give us more context?
@ravowlga123
I found another similar issue(ZOOKEEPER-3722 you may also interested in :)

@anmolnar
Copy link
Contributor

anmolnar commented Feb 14, 2020

@maoling Currently the config options don't allow using different watch managers for child and data watcher. Hence I don't see the point of logging them separately.

@maoling
Copy link
Member

maoling commented Feb 18, 2020

  • Yes, child and data watcher cannot set different watchManager
  • the problem is that the absolutely same log prints twice which will confuse users. If we don't logging them separately, we can make the log only print one time? e.g.
    public static String watchManagerName;
    static {
        watchManagerName = System.getProperty(ZOOKEEPER_WATCH_MANAGER_NAME);
        if (watchManagerName == null) {
            watchManagerName = WatchManager.class.getName();
        }
        LOG.info("Using {} as watch manager", watchManagerName);
    }
    public static IWatchManager createWatchManager() throws IOException {

@anmolnar WDYT?

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