Class VersionedValue

  • All Implemented Interfaces:
    java.lang.Comparable<VersionedValue>

    public class VersionedValue
    extends java.lang.Object
    implements java.lang.Comparable<VersionedValue>
    This abstraction represents the state associated with a particular node which an application wants to make available to the rest of the nodes in the cluster. Whenever a piece of state needs to be disseminated to the rest of cluster wrap the state in an instance of ApplicationState and add it to the Gossiper.

    e.g. if we want to disseminate load information for node A do the following:

     
     ApplicationState loadState = new ApplicationState(<string representation of load>);
     Gossiper.instance.addApplicationState("LOAD STATE", loadState);
     
     
    • Field Detail

      • DELIMITER_STR

        public static final java.lang.String DELIMITER_STR
      • STATUS_BOOTSTRAPPING

        public static final java.lang.String STATUS_BOOTSTRAPPING
        See Also:
        Constant Field Values
      • STATUS_BOOTSTRAPPING_REPLACE

        public static final java.lang.String STATUS_BOOTSTRAPPING_REPLACE
        See Also:
        Constant Field Values
      • REMOVAL_COORDINATOR

        public static final java.lang.String REMOVAL_COORDINATOR
        See Also:
        Constant Field Values
      • BOOTSTRAPPING_STATUS

        public static final java.util.Set<java.lang.String> BOOTSTRAPPING_STATUS
      • version

        public final int version
      • value

        public final java.lang.String value
    • Method Detail

      • unsafeMakeVersionedValue

        public static VersionedValue unsafeMakeVersionedValue​(java.lang.String value,
                                                              int version)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toBytes

        public byte[] toBytes()