public class TermBytes extends Object implements Accountable
Contains the term bytes and the minimal distinguishing prefix (MDP) length of this term.
The MDP is the minimal prefix that distinguishes a term from its immediate previous term (terms are alphabetically sorted).
The incremental encoding suffix is the suffix starting at the last byte of the MDP (inclusive).
Example: For the block
client color company companies"color" - MDP is "co" - incremental encoding suffix is "olor".
Modifier and Type | Field and Description |
---|---|
protected int |
mdpLength |
protected BytesRef |
term |
NULL_ACCOUNTABLE
Constructor and Description |
---|
TermBytes(int mdpLength,
BytesRef term) |
Modifier and Type | Method and Description |
---|---|
static int |
computeMdpLength(BytesRef previousTerm,
BytesRef currentTerm)
Computes the length of the minimal distinguishing prefix (MDP) between
a current term and its previous term (terms are alphabetically sorted).
|
int |
getMdpLength() |
int |
getSuffixLength() |
int |
getSuffixOffset() |
BytesRef |
getTerm() |
long |
ramBytesUsed() |
TermBytes |
reset(int mdpLength,
BytesRef term) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChildResources
protected int mdpLength
protected BytesRef term
public TermBytes(int mdpLength, BytesRef term)
public int getMdpLength()
TermBytes
public BytesRef getTerm()
public int getSuffixOffset()
TermBytes
public int getSuffixLength()
TermBytes
public static int computeMdpLength(BytesRef previousTerm, BytesRef currentTerm)
Example: If previous="car" and current="cartridge", then MDP length is 4. It is the length of the minimal prefix distinguishing "cartridge" from "car", that is, the length of "cart".
TermBytes
public long ramBytesUsed()
ramBytesUsed
in interface Accountable
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.