Class PagedBytes.Reader

    • Constructor Detail

      • Reader

        public Reader​(PagedBytes pagedBytes)
    • Method Detail

      • fillSlice

        public BytesRef fillSlice​(BytesRef b,
                                  long start,
                                  int length)
        Gets a slice out of PagedBytes starting at start with a given length. Iff the slice spans across a block border this method will allocate sufficient resources and copy the paged data.

        Slices spanning more than one block are not supported.

        NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
      • fill

        public BytesRef fill​(BytesRef b,
                             long start)
        Reads length as 1 or 2 byte vInt prefix, starting at start.

        Note: this method does not support slices spanning across block borders.

        Returns:
        the given BytesRef
        NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
      • fillAndGetIndex

        public int fillAndGetIndex​(BytesRef b,
                                   long start)
        Reads length as 1 or 2 byte vInt prefix, starting at start. *

        Note: this method does not support slices spanning across block borders.

        Returns:
        the internal block number of the slice.
        NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
      • fillAndGetStart

        public long fillAndGetStart​(BytesRef b,
                                    long start)
        Reads length as 1 or 2 byte vInt prefix, starting at start and returns the start offset of the next part, suitable as start parameter on next call to sequentially read all BytesRef.

        Note: this method does not support slices spanning across block borders.

        Returns:
        the start offset of the next part, suitable as start parameter on next call to sequentially read all BytesRef.
        NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
      • fillSliceWithPrefix

        public BytesRef fillSliceWithPrefix​(BytesRef b,
                                            long start)
        Gets a slice out of PagedBytes starting at start, the length is read as 1 or 2 byte vInt prefix. Iff the slice spans across a block border this method will allocate sufficient resources and copy the paged data.

        Slices spanning more than one block are not supported.

        NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
      • getBlocks

        public byte[][] getBlocks()
        NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
      • getBlockEnds

        public int[] getBlockEnds()
        NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.