Class HelixStatusMessageChannel

  • All Implemented Interfaces:
    StatusMessageChannel

    public class HelixStatusMessageChannel
    extends java.lang.Object
    implements StatusMessageChannel
    The control message changed built on Helix message service.

    It will convert Venice message to helix message when sending and reverse this process when receiving.

    Only one Helix message type is used, so channel is similar to a dispatcher that receive all of control messages and dispatch them to related handlers.

    • Field Detail

      • DEFAULT_SEND_MESSAGE_TIME_OUT

        public static final int DEFAULT_SEND_MESSAGE_TIME_OUT
        See Also:
        Constant Field Values
      • HELIX_MESSAGE_TYPE

        public static final java.lang.String HELIX_MESSAGE_TYPE
        See Also:
        Constant Field Values
      • VENICE_MESSAGE_CLASS

        public static final java.lang.String VENICE_MESSAGE_CLASS
        See Also:
        Constant Field Values
      • VENICE_MESSAGE_FIELD

        public static final java.lang.String VENICE_MESSAGE_FIELD
        See Also:
        Constant Field Values
    • Method Detail

      • sendToController

        public void sendToController​(StatusMessage message,
                                     int retryCount,
                                     long retryDurationMs)
        Description copied from interface: StatusMessageChannel
        Send message to controller. If met any error during the sending, retry it after retryDurationMs until retry @retryCount times.
        Specified by:
        sendToController in interface StatusMessageChannel
        retryCount - retry how many times.
        retryDurationMs - the duration between two retries.
      • sendToStorageNodes

        public void sendToStorageNodes​(java.lang.String clusterName,
                                       StatusMessage message,
                                       java.lang.String resourceName,
                                       int retryCount)
        Description copied from interface: StatusMessageChannel
        Send message to all storage nodes in the given cluster. If met any error during the sending, retry it after retryDurationMs until retry @retryCount times.
        Specified by:
        sendToStorageNodes in interface StatusMessageChannel
      • convertHelixMessageToVeniceMessage

        protected StatusMessage convertHelixMessageToVeniceMessage​(org.apache.helix.model.Message helixMessage)
        Convert Helix message to Venice Message.
        Parameters:
        helixMessage -
        Returns:
      • convertVeniceMessageToHelixMessage

        protected org.apache.helix.model.Message convertVeniceMessageToHelixMessage​(StatusMessage veniceMessage)
        Convert Venice message to Helix message.
        Parameters:
        veniceMessage -
        Returns:
      • getHandler

        protected <T extends StatusMessageStatusMessageHandler getHandler​(java.lang.Class<T> clazz)
        Get the handler for given Venice message type.
        Type Parameters:
        T -
        Parameters:
        clazz -
        Returns: