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);
     
     
    • 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()