You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@helix.apache.org by Changgeng Li <li...@gmail.com> on 2015/07/10 06:03:31 UTC

HelixManager is deprecated?

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);

Re: HelixManager is deprecated?

Posted by Zhen Zhang <ne...@gmail.com>.
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....@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 <ne...@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...@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);
>>>
>>>
>>
>

Re: HelixManager is deprecated?

Posted by kishore g <g....@gmail.com>.
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 <ne...@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...@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);
>>
>>
>

Re: HelixManager is deprecated?

Posted by Changgeng Li <li...@gmail.com>.
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 <ne...@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...@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);
>>
>>
>

Re: HelixManager is deprecated?

Posted by Zhen Zhang <ne...@gmail.com>.
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...@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);
>
>