Package com.qfs.chunk

Interface IConcurrentChunkLong

    • Method Detail

      • writeLongVolatile

        void writeLongVolatile​(int position,
                               long value)
        Writes a long primitive value in this chunk in a volatile fashion.
        Parameters:
        position - the position to write the value to
        value - the value to write
        See Also:
        IChunkLong.writeLong(int, long)
      • readLongVolatile

        long readLongVolatile​(int position)
        Reads a long primitive value from this chunk in a volatile fashion.

        An exception will be thrown if the value is not of the right type.

        Parameters:
        position - the position to read the value from
        Returns:
        the value stored at the given position
        See Also:
        IChunkLong.readLong(int)
      • compareAndSet

        boolean compareAndSet​(int position,
                              long expectedValue,
                              long updatedValue)
        Atomically sets the given position of this chunk to the given updated value if the current value stored at this position equals the expected value.
        Parameters:
        position - the position to update
        expectedValue - the expected value
        updatedValue - the new value
        Returns:
        true if successful, or false if the actual value was not equal to the expected value