Class BytesRefBlockPool

    • Field Detail

      • BASE_RAM_BYTES

        private static final long BASE_RAM_BYTES
    • Constructor Detail

      • BytesRefBlockPool

        public BytesRefBlockPool()
      • BytesRefBlockPool

        public BytesRefBlockPool​(ByteBlockPool byteBlockPool)
    • Method Detail

      • reset

        void reset()
        Reset this buffer to the empty state.
      • hash

        int hash​(int start)
        Computes the hash of the BytesRef at the given start. This is equivalent of doing:
             BytesRef bytes = new BytesRef();
             fillTerm(bytes, start);
             BytesRefHash.doHash(bytes.bytes, bytes.pos, bytes.len);
          
        It just saves the work of filling the BytesRef.
      • equals

        boolean equals​(int start,
                       BytesRef b)
        Computes the equality between the BytesRef at the start position with the provided BytesRef. This is equivalent of doing:
             BytesRef bytes = new BytesRef();
             fillTerm(bytes, start);
             Arrays.equals(bytes.bytes, bytes.offset, bytes.offset + length, b.bytes, b.offset, b.offset + b.length);
          
        It just saves the work of filling the BytesRef.
      • ramBytesUsed

        public long ramBytesUsed()
        Description copied from interface: Accountable
        Return the memory usage of this object in bytes. Negative values are illegal.
        Specified by:
        ramBytesUsed in interface Accountable