curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cammckenzie <...@git.apache.org>
Subject [GitHub] curator pull request: [CURATOR-247] Extend Curator's connection st...
Date Tue, 01 Sep 2015 01:36:54 GMT
Github user cammckenzie commented on a diff in the pull request:

    https://github.com/apache/curator/pull/97#discussion_r38378657
  
    --- Diff: curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
---
    @@ -103,23 +106,34 @@
         public CuratorFrameworkImpl(CuratorFrameworkFactory.Builder builder)
         {
             ZookeeperFactory localZookeeperFactory = makeZookeeperFactory(builder.getZookeeperFactory());
    -        this.client = new CuratorZookeeperClient(localZookeeperFactory, builder.getEnsembleProvider(),
builder.getSessionTimeoutMs(), builder.getConnectionTimeoutMs(), new Watcher()
    -        {
    -            @Override
    -            public void process(WatchedEvent watchedEvent)
    -            {
    -                CuratorEvent event = new CuratorEventImpl(CuratorFrameworkImpl.this,
CuratorEventType.WATCHED, watchedEvent.getState().getIntValue(), unfixForNamespace(watchedEvent.getPath()),
null, null, null, null, null, watchedEvent, null, null);
    -                processEvent(event);
    -            }
    -        }, builder.getRetryPolicy(), builder.canBeReadOnly());
    +        this.client = new CuratorZookeeperClient
    +            (
    +                localZookeeperFactory,
    +                builder.getEnsembleProvider(),
    +                builder.getSessionTimeoutMs(),
    +                builder.getConnectionTimeoutMs(),
    +                new Watcher()
    +                {
    +                    @Override
    +                    public void process(WatchedEvent watchedEvent)
    +                    {
    +                        CuratorEvent event = new CuratorEventImpl(CuratorFrameworkImpl.this,
CuratorEventType.WATCHED, watchedEvent.getState().getIntValue(), unfixForNamespace(watchedEvent.getPath()),
null, null, null, null, null, watchedEvent, null, null);
    +                        processEvent(event);
    +                    }
    +                },
    +                builder.getRetryPolicy(),
    +                builder.canBeReadOnly(),
    +                builder.getConnectionHandlingPolicy()
    +            );
     
    +        internalConnectionHandler = builder.getConnectionHandlingPolicy().isEmulatingClassicHandling()
? new ClassicInternalConnectionHandler() : new StandardInternalConnectionHandler();
    --- End diff --
    
    Is there a reason that this needs to be a separate instance rather than just a reference
to the connection handler from the builder?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message