Class PageFile
- java.lang.Object
-
- org.apache.jackrabbit.oak.index.indexer.document.tree.store.PageFile
-
- All Implemented Interfaces:
MemoryObject
public class PageFile extends Object implements MemoryObject
A B-tree page (leaf, or inner node). An inner node contains one more value than keys. A leaf page has the same number of keys and values.
-
-
Constructor Summary
Constructors Constructor Description PageFile(boolean innerNode, long maxFileSizeBytes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(int index, String childKey, String newChildFileName)
void
appendRecord(String k, String v)
boolean
canSplit()
PageFile
copy()
long
estimatedMemory()
Get the estimate memory size.static PageFile
fromBytes(byte[] data, long maxFileSizeBytes)
String
getChildValue(int index)
String
getFileName()
String
getKey(int index)
int
getKeyIndex(String key)
List<String>
getKeys()
String
getNextKey(String largerThan)
String
getNextRoot()
long
getUpdate()
String
getValue(int index)
int
getValueCount()
void
insertRecord(int index, String key, String value)
boolean
isInnerNode()
boolean
isModified()
void
removeKey(int index)
void
removeRecord(int index)
void
removeValue(int index)
void
setFileName(String fileName)
void
setModified(boolean modified)
void
setNextRoot(String nextRoot)
void
setUpdate(long update)
void
setValue(int index, String value)
int
sizeInBytes()
byte[]
toBytes()
String
toString()
-
-
-
Method Detail
-
estimatedMemory
public long estimatedMemory()
Description copied from interface:MemoryObject
Get the estimate memory size. The value must not change afterwards, otherwise the memory calculation is wrong.- Specified by:
estimatedMemory
in interfaceMemoryObject
- Returns:
- the memory in bytes
-
setFileName
public void setFileName(String fileName)
-
getFileName
public String getFileName()
-
setUpdate
public void setUpdate(long update)
-
fromBytes
public static PageFile fromBytes(byte[] data, long maxFileSizeBytes)
-
toBytes
public byte[] toBytes()
-
copy
public PageFile copy()
-
setValue
public void setValue(int index, String value)
-
removeRecord
public void removeRecord(int index)
-
getUpdate
public long getUpdate()
-
sizeInBytes
public int sizeInBytes()
-
canSplit
public boolean canSplit()
-
getKeyIndex
public int getKeyIndex(String key)
-
getValue
public String getValue(int index)
-
getChildValue
public String getChildValue(int index)
-
getNextRoot
public String getNextRoot()
-
setNextRoot
public void setNextRoot(String nextRoot)
-
removeKey
public void removeKey(int index)
-
removeValue
public void removeValue(int index)
-
isInnerNode
public boolean isInnerNode()
-
getValueCount
public int getValueCount()
-
getKey
public String getKey(int index)
-
setModified
public void setModified(boolean modified)
-
isModified
public boolean isModified()
-
-