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 addConfigChangeListener(HelixRole role, ConfigChangeListener listener, ClusterId clusterId)
add config change listener
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 addHealthStateChangeListener(HelixRole role, HealthStateChangeListener listener, ClusterId clusterId, ParticipantId participantId)
add health state 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
void connect()
start connection
HelixAutoController createAutoController(ClusterId clusterId, ControllerId controllerId)
create an autonomous helix-controller
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 messasing service using this connection
HelixParticipant createParticipant(ClusterId clusterId, ParticipantId participantId)
create a helix-participant
ParticipantAccessor createParticipantAccessor(ClusterId clusterId)
create a participant accessor
HelixPropertyStore<ZNRecord> createPropertyStore(ClusterId clusterId)
create a default property-store for a cluster
ResourceAccessor createResourceAccessor(ClusterId clusterId)
create a resource accessor
void disconnect()
close connection
ConfigAccessor getConfigAccessor()
get config accessor TODO replace with new ConfigAccessor
HelixManagerProperties getHelixProperties()
get helix properties
String getHelixVersion()
get helix version
SessionId getSessionId()
get session id
int getSessionTimeout()
get session timeout
void handleNewSession()
void handleStateChanged(Watcher.Event.KeeperState state)
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 addConfigChangeListener (HelixRole role, ConfigChangeListener listener, ClusterId clusterId)

add config change listener

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 addHealthStateChangeListener (HelixRole role, HealthStateChangeListener listener, ClusterId clusterId, ParticipantId participantId)

add health state 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 void connect ()

start connection

public HelixAutoController createAutoController (ClusterId clusterId, ControllerId controllerId)

create an autonomous helix-controller

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 messasing service using this connection

Returns
  • messaging-service

public HelixParticipant createParticipant (ClusterId clusterId, ParticipantId participantId)

create a helix-participant

Returns
  • helix-participant

public ParticipantAccessor createParticipantAccessor (ClusterId clusterId)

create a participant accessor

Returns
  • participant-accessor

public HelixPropertyStore<ZNRecord> createPropertyStore (ClusterId clusterId)

create a default property-store for a cluster

Returns
  • property-store

public ResourceAccessor createResourceAccessor (ClusterId clusterId)

create a resource accessor

Returns
  • resource accessor

public void disconnect ()

close connection

public ConfigAccessor getConfigAccessor ()

get config accessor TODO replace with new ConfigAccessor

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 void handleNewSession ()

Throws
Exception

public void handleStateChanged (Watcher.Event.KeeperState state)

Throws
Exception

public 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