Class BufferBuilder

    • Method Detail

      • getDataType

        public Buffer.DataType getDataType()
        Gets the data type of the internal buffer.
      • setDataType

        public void setDataType​(Buffer.DataType dataType)
        Sets the data type of the internal buffer.
      • append

        public int append​(ByteBuffer source)
        Append as many data as possible from source. Not everything might be copied if there is not enough space in the underlying MemorySegment
        Returns:
        number of copied bytes
      • commit

        public void commit()
        Make the change visible to the readers. This is costly operation (volatile access) thus in case of bulk writes it's better to commit them all together instead one by one.
      • finish

        public int finish()
        Mark this BufferBuilder and associated BufferConsumer as finished - no new data writes will be allowed.

        This method should be idempotent to handle failures and task interruptions. Check FLINK-8948 for more details.

        Returns:
        number of written bytes.
      • isFinished

        public boolean isFinished()
      • isFull

        public boolean isFull()
      • getWritableBytes

        public int getWritableBytes()
      • getCommittedBytes

        public int getCommittedBytes()
      • getMaxCapacity

        public int getMaxCapacity()
      • trim

        public void trim​(int newSize)
        The result capacity can not be greater than allocated memorySegment. It also can not be less than already written data.