helix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhen Zhang <nehzgn...@gmail.com>
Subject Re: HelixManager is deprecated?
Date Sat, 11 Jul 2015 06:07:25 GMT
One way is to use the new HelixConnection API like this:
https://gist.github.com/zzhang5/9bbfc50d9f08f558f1df

This gives you whether HelixConnection#connect is invoked. If you really
want to monitor the zookeeper connection state, you probably need something
like this:
https://github.com/apache/helix/blob/helix-0.6.x/helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixManager.java#L596

However ZkHeilxConnection#_zkclient is not exposed, and it doesn't seem to
be a clean way to get it. Alternatively, you can use
HelixConnection#addLiveInstanceChangeListener. This gives you a callback
when the HelixManager instance goes away.

On Thu, Jul 9, 2015 at 10:46 PM, kishore g <g.kishore@gmail.com> wrote:

> If you are using 0.7.1, it's probably better to use  helixconnection
> directly instead of helixmanager.
>
> Kanak/Jason, can you please confirm.
> any recommendation workaround before this is fixed?
>
> Seems the latest tutorial is updated not to use HelixManager for
> controller and participant.
>
> On Thu, Jul 9, 2015 at 10:02 PM, Zhen Zhang <nehzgnahz@gmail.com> wrote:
>
>> This seems to be a bug. Need to fix it. Created a jira to track this:
>> https://issues.apache.org/jira/browse/HELIX-605
>>
>>
>> On Thu, Jul 9, 2015 at 9:03 PM, Changgeng Li <li.changgeng@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> We are relying on HelixManager.isConnected() method for health check.
>>>
>>>
>>> Following code print true in 0.6.2, but print false in 0.7.1
>>>
>>> HelixManager helixManager = HelixManagerFactory.getZKHelixManager(
>>>         "test-cluster",
>>>         "localhost_9001",
>>>         InstanceType.CONTROLLER_PARTICIPANT,
>>>         "localhost:2181"
>>> );
>>> helixManager.connect();
>>> Thread.sleep(5000);
>>> System.out.println("connected: " + helixManager.isConnected());
>>> Thread.sleep(5000);
>>>
>>>
>>
>

Mime
View raw message