Class Flow


  • public class Flow
    extends java.lang.Object
    The class represents a Flow between a Segment client and the SegmentStore. It consists of a flowId and a requestSequenceNumber. The flowId is used to represent the communication between Segment clients and the SegmentStore which uses an underlying connection pool. This flowId is unique per connection pool and a Flow is always tied to a specific network connection. The requestSequenceNumber is used to represent the requestSequence for a given Flow.
    • Constructor Summary

      Constructors 
      Constructor Description
      Flow​(int flowId, int requestSequenceNumber)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long asLong()
      Return a long representation of Flow.
      protected boolean canEqual​(java.lang.Object other)  
      static Flow create()
      Create a new Flow.
      boolean equals​(java.lang.Object o)  
      static Flow from​(long flowAsLong)
      Obtain a Flow from a long representation.
      int getFlowId()  
      long getNextSequenceNumber()
      Obtain a long representation of Flow with the next sequence number.
      int hashCode()  
      static int toFlowID​(long requestID)
      Obtain a FlowID from a long representation.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Flow

        public Flow​(int flowId,
                    int requestSequenceNumber)
    • Method Detail

      • create

        public static Flow create()
        Create a new Flow.
        Returns:
        Flow.
      • from

        public static Flow from​(long flowAsLong)
        Obtain a Flow from a long representation.
        Parameters:
        flowAsLong - a long representation of Flow.
        Returns:
        Flow.
      • toFlowID

        public static int toFlowID​(long requestID)
        Obtain a FlowID from a long representation.
        Parameters:
        requestID - request identifier.
        Returns:
        Flow ID.
      • asLong

        public long asLong()
        Return a long representation of Flow.
        Returns:
        long representation.
      • getNextSequenceNumber

        public long getNextSequenceNumber()
        Obtain a long representation of Flow with the next sequence number.
        Returns:
        long representation of Flow with the next sequence number.
      • toString

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

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

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

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

        public int getFlowId()