public class

ZkHelixConnection

extends Object
implements IZkStateListener HelixConnection
java.lang.Object
   ↳ org.apache.helix.manager.zk.ZkHelixConnection

Summary

Public Constructors
ZkHelixConnection(String zkAddr)
Public Methods
void addConfigChangeListener(HelixRole role, ScopedConfigChangeListener listener, ClusterId clusterId, HelixConfigScope.ConfigScopeProperty scope)
add config change listener for a scope
void addConnectionStateListener(HelixConnectionStateListener listener)
add connection state listener
void addControllerListener(HelixRole role, ControllerChangeListener listener, ClusterId clusterId)
add controller listener
void addControllerMessageListener(HelixRole role, MessageListener listener, ClusterId clusterId)
add controller message listener
void addCurrentStateChangeListener(HelixRole role, CurrentStateChangeListener listener, ClusterId clusterId, ParticipantId participantId, SessionId sessionId)
add current state change listener
void addExternalViewChangeListener(HelixRole role, ExternalViewChangeListener listener, ClusterId clusterId)
add external view change listener
void addIdealStateChangeListener(HelixRole role, IdealStateChangeListener listener, ClusterId clusterId)
add ideal state change listener
void addInstanceConfigChangeListener(HelixRole role, InstanceConfigChangeListener listener, ClusterId clusterId)
add instance config change listener
void addLiveInstanceChangeListener(HelixRole role, LiveInstanceChangeListener listener, ClusterId clusterId)
add live-instance listener using this connection
void addMessageListener(HelixRole role, MessageListener listener, ClusterId clusterId, ParticipantId participantId)
add message listener
synchronized void connect()
start connection
ClusterAccessor createClusterAccessor(ClusterId clusterId)
create a cluster-accessor
HelixAdmin createClusterManagementTool()
Provides admin interface to setup and modify cluster
HelixController createController(ClusterId clusterId, ControllerId controllerId)
create a helix-controller
HelixDataAccessor createDataAccessor(ClusterId clusterId)
create a data-accessor
ClusterMessagingService createMessagingService(HelixRole role)
create messaging service using this connection
HelixMultiClusterController createMultiClusterController(ClusterId clusterId, ControllerId controllerId)
create a multi-cluster controller
HelixParticipant createParticipant(ClusterId clusterId, ParticipantId participantId)
create a helix-participant
HelixPropertyStore<ZNRecord> createPropertyStore(ClusterId clusterId)
create a default property-store for a cluster
synchronized void disconnect()
close connection
ConfigAccessor getConfigAccessor()
get config accessor
HelixManagerProperties getHelixProperties()
get helix properties
String getHelixVersion()
get helix version
SessionId getSessionId()
get session id
int getSessionTimeout()
get session timeout
synchronized void handleNewSession()
synchronized void handleStateChanged(Watcher.Event.KeeperState state)
synchronized boolean isConnected()
test if connection is started
void removeConnectionStateListener(HelixConnectionStateListener listener)
remove connection state listener
boolean removeListener(HelixRole role, Object listener, PropertyKey key)
remove a listener
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.I0Itec.zkclient.IZkStateListener
From interface org.apache.helix.HelixConnection

Public Constructors

public ZkHelixConnection (String zkAddr)

Public Methods

public void addConfigChangeListener (HelixRole role, ScopedConfigChangeListener listener, ClusterId clusterId, HelixConfigScope.ConfigScopeProperty scope)

add config change listener for a scope

public void addConnectionStateListener (HelixConnectionStateListener listener)

add connection state listener

public void addControllerListener (HelixRole role, ControllerChangeListener listener, ClusterId clusterId)

add controller listener

public void addControllerMessageListener (HelixRole role, MessageListener listener, ClusterId clusterId)

add controller message listener

public void addCurrentStateChangeListener (HelixRole role, CurrentStateChangeListener listener, ClusterId clusterId, ParticipantId participantId, SessionId sessionId)

add current state change listener

public void addExternalViewChangeListener (HelixRole role, ExternalViewChangeListener listener, ClusterId clusterId)

add external view change listener

public void addIdealStateChangeListener (HelixRole role, IdealStateChangeListener listener, ClusterId clusterId)

add ideal state change listener

public void addInstanceConfigChangeListener (HelixRole role, InstanceConfigChangeListener listener, ClusterId clusterId)

add instance config change listener

public void addLiveInstanceChangeListener (HelixRole role, LiveInstanceChangeListener listener, ClusterId clusterId)

add live-instance listener using this connection

public void addMessageListener (HelixRole role, MessageListener listener, ClusterId clusterId, ParticipantId participantId)

add message listener

public synchronized void connect ()

start connection

public ClusterAccessor createClusterAccessor (ClusterId clusterId)

create a cluster-accessor

Returns
  • cluster-accessor

public HelixAdmin createClusterManagementTool ()

Provides admin interface to setup and modify cluster

Returns
  • instantiated HelixAdmin

public HelixController createController (ClusterId clusterId, ControllerId controllerId)

create a helix-controller

Returns
  • helix-controller

public HelixDataAccessor createDataAccessor (ClusterId clusterId)

create a data-accessor

Returns
  • data-accessor

public ClusterMessagingService createMessagingService (HelixRole role)

create messaging service using this connection

Returns
  • messaging-service

public HelixMultiClusterController createMultiClusterController (ClusterId clusterId, ControllerId controllerId)

create a multi-cluster controller

public HelixParticipant createParticipant (ClusterId clusterId, ParticipantId participantId)

create a helix-participant

Returns
  • helix-participant

public HelixPropertyStore<ZNRecord> createPropertyStore (ClusterId clusterId)

create a default property-store for a cluster

Returns
  • property-store

public synchronized void disconnect ()

close connection

public ConfigAccessor getConfigAccessor ()

get config accessor

Returns
  • config accessor

public HelixManagerProperties getHelixProperties ()

get helix properties

Returns
  • helix-properties

public String getHelixVersion ()

get helix version

Returns
  • helix version

public SessionId getSessionId ()

get session id

Returns
  • session id of current connection

public int getSessionTimeout ()

get session timeout

Returns
  • session timeout in millisecond

public synchronized void handleNewSession ()

Throws
Exception

public synchronized void handleStateChanged (Watcher.Event.KeeperState state)

Throws
Exception

public synchronized boolean isConnected ()

test if connection is started

Returns
  • true if connection is started, false otherwise

public void removeConnectionStateListener (HelixConnectionStateListener listener)

remove connection state listener

public boolean removeListener (HelixRole role, Object listener, PropertyKey key)

remove a listener