Class StatusMessage

  • Direct Known Subclasses:
    KillOfflinePushMessage, StoreStatusMessage

    public abstract class StatusMessage
    extends java.lang.Object
    Venice control message which is used to transfer command and status between storage node and controller, so that controller could control the whole cluster and make the global decision.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String messageId  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected StatusMessage()
      Default constructor, only used in constructor of sub-class.
      protected StatusMessage​(java.util.Map<java.lang.String,​java.lang.String> fields)
      Create message from given fields map.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String generateMessageId()  
      java.util.Map<java.lang.String,​java.lang.String> getFields()
      Get K-V paris of all the fields in message.
      java.lang.String getMessageId()
      Get Id of message.
      protected static java.lang.String getOptionalField​(java.util.Map<java.lang.String,​java.lang.String> fields, java.lang.String key)  
      protected static java.lang.String getRequiredField​(java.util.Map<java.lang.String,​java.lang.String> fields, java.lang.String key)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • messageId

        protected final java.lang.String messageId
    • Constructor Detail

      • StatusMessage

        protected StatusMessage​(java.util.Map<java.lang.String,​java.lang.String> fields)
        Create message from given fields map. Should be override in each sub-class.
        Parameters:
        fields -
      • StatusMessage

        protected StatusMessage()
        Default constructor, only used in constructor of sub-class. So visible level is protected but not public.
    • Method Detail

      • getMessageId

        public final java.lang.String getMessageId()
        Get Id of message.
        Returns:
      • getFields

        public java.util.Map<java.lang.String,​java.lang.String> getFields()
        Get K-V paris of all the fields in message.
        Returns:
      • getRequiredField

        protected static java.lang.String getRequiredField​(java.util.Map<java.lang.String,​java.lang.String> fields,
                                                           java.lang.String key)
      • getOptionalField

        protected static java.lang.String getOptionalField​(java.util.Map<java.lang.String,​java.lang.String> fields,
                                                           java.lang.String key)
      • generateMessageId

        public static java.lang.String generateMessageId()