Class NodeInfo

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

    public final class NodeInfo
    extends java.lang.Object
    implements java.lang.Comparable<NodeInfo>
    Class to make referencing worker nodes more intuitive. Mainly to avoid implicit association by array indexes.
    • Constructor Detail

      • NodeInfo

        public NodeInfo​(WorkerInfo workerInfo)
        Instantiates a new Node info.
        Parameters:
        workerInfo - the worker info
    • Method Detail

      • getCapacity

        public java.lang.String getCapacity()
        Gets capacity.
        Returns:
        the worker capacity in bytes
      • getFreeSpacePercent

        public int getFreeSpacePercent()
        Gets free space percent.
        Returns:
        the worker free space as a percentage
      • getLastHeartbeat

        public java.lang.String getLastHeartbeat()
        Gets last heartbeat.
        Returns:
        the time of the last worker heartbeat
      • getHost

        public java.lang.String getHost()
        Gets host.
        Returns:
        the worker host
      • getWebPort

        public int getWebPort()
        Gets web port.
        Returns:
        the worker port
      • getState

        public java.lang.String getState()
        Gets state.
        Returns:
        the worker state
      • getUptimeClockTime

        public java.lang.String getUptimeClockTime()
        Gets uptime clock time.
        Returns:
        the worker uptime
      • getUsedMemory

        public java.lang.String getUsedMemory()
        Gets used memory.
        Returns:
        the worker used capacity in bytes
      • getUsedSpacePercent

        public int getUsedSpacePercent()
        Gets used space percent.
        Returns:
        the worker used space as a percentage
      • getWorkerId

        public long getWorkerId()
        Gets worker id.
        Returns:
        the worker id
      • getBlockCount

        public long getBlockCount()
        Gets worker block count.
        Returns:
        the worker block count
      • getVersion

        public java.lang.String getVersion()
        Gets worker version.
        Returns:
        the worker version
      • getRevision

        public java.lang.String getRevision()
        Gets worker revision.
        Returns:
        the worker revision
      • compareTo

        public int compareTo​(NodeInfo o)
        Compare NodeInfo by lexicographical order of their associated host.
        Specified by:
        compareTo in interface java.lang.Comparable<NodeInfo>
        Parameters:
        o - the comparison term
        Returns:
        a positive value if this.getHost is lexicographically "bigger" than o.getHost, 0 if the hosts are equal, a negative value otherwise.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object