public class

ZkCallbackHandler

extends Object
implements IZkChildListener IZkDataListener
java.lang.Object
   ↳ org.apache.helix.manager.zk.ZkCallbackHandler

Class Overview

This is a copy of CallbackHandler We need to synchronize on ZkHelixConnection instead ofHelixManager to avoid dead-lock. Otherwise an example deadlock scenario would be: 1) main-thread calls ZkHelixConnection#disconnect(), results in: - ZkHelixController#reset(), holding ZkHelixConnection, waiting HelixConnectionAdaptor 2) zk-event-thread calls CallbackHandler#handleChildChange(), results in: - CallbackHandler#invoke(), holding HelixConnectionAdaptor, waiting ZkHelixConnection TODO remove code duplication

Summary

Public Constructors
ZkCallbackHandler(HelixRole role, ZkClient client, PropertyKey propertyKey, Object listener, EventType[] eventTypes, HelixConstants.ChangeType changeType)
Public Methods
EventType[] getEventTypes()
Object getListener()
String getPath()
void handleChildChange(String parentPath, List<String> currentChilds)
void handleDataChange(String dataPath, Object data)
void handleDataDeleted(String dataPath)
void init()
Invoke the listener so that it sets up the initial values from the zookeeper if any exists
void invoke(NotificationContext changeContext)
void reset()
Invoke the listener for the last time so that the listener could clean up resources
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.I0Itec.zkclient.IZkChildListener
From interface org.I0Itec.zkclient.IZkDataListener

Public Constructors

public ZkCallbackHandler (HelixRole role, ZkClient client, PropertyKey propertyKey, Object listener, EventType[] eventTypes, HelixConstants.ChangeType changeType)

Public Methods

public EventType[] getEventTypes ()

public Object getListener ()

public String getPath ()

public void handleChildChange (String parentPath, List<String> currentChilds)

public void handleDataChange (String dataPath, Object data)

public void handleDataDeleted (String dataPath)

public void init ()

Invoke the listener so that it sets up the initial values from the zookeeper if any exists

public void invoke (NotificationContext changeContext)

Throws
Exception

public void reset ()

Invoke the listener for the last time so that the listener could clean up resources