+ *
*
* manager = HelixManagerFactory.getZKHelixManager(
* clusterName, instanceName, ROLE, zkAddr);
* // ROLE can be participant, spectator or a controller
* manager.connect();
* manager.addSOMEListener();
- * manager.start()
* After start is invoked the subsequent interactions will be via listener onChange callbacks
* There will be 3 scenarios for onChange callback, which can be determined using NotificationContext.type
* INIT -> will be invoked the first time the listener is added
@@ -47,6 +47,7 @@
* FINALIZE -> will be invoked when listener is removed or session expires
* manager.disconnect()
*
+ *
*
Default implementations available
* @see HelixStateMachineEngine HelixStateMachineEngine for participant
* @see RoutingTableProvider RoutingTableProvider for spectator
@@ -54,7 +55,8 @@
*/
public interface HelixManager {
- public static final String ALLOW_PARTICIPANT_AUTO_JOIN = "ALLOW_PARTICIPANT_AUTO_JOIN";
+ public static final String ALLOW_PARTICIPANT_AUTO_JOIN =
+ ZKHelixManager.ALLOW_PARTICIPANT_AUTO_JOIN;
/**
* Start participating in the cluster operations. All listeners will be
@@ -98,6 +100,7 @@ public interface HelixManager {
* @param listener
* @deprecated replaced by addInstanceConfigChangeListener()
*/
+ @Deprecated
void addConfigChangeListener(ConfigChangeListener listener) throws Exception;
/**
@@ -130,14 +133,6 @@ void addConfigChangeListener(ScopedConfigChangeListener listener, ConfigScopePro
void addCurrentStateChangeListener(CurrentStateChangeListener listener, String instanceName,
String sessionId) throws Exception;
- /**
- * @see HealthStateChangeListener#onHealthChange(String, List, NotificationContext)
- * @param listener
- * @param instanceName
- */
- void addHealthStateChangeListener(HealthStateChangeListener listener, String instanceName)
- throws Exception;
-
/**
* @see ExternalViewChangeListener#onExternalViewChange(List, NotificationContext)
* @param listener
@@ -150,6 +145,12 @@ void addHealthStateChangeListener(HealthStateChangeListener listener, String ins
*/
void addControllerListener(ControllerChangeListener listener);
+ /**
+ * Add message listener for controller
+ * @param listener
+ */
+ void addControllerMessageListener(MessageListener listener);
+
/**
* Removes the listener. If the same listener was used for multiple changes,
* all change notifications will be removed.