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 voidaddChild(int index, String childKey, String newChildFileName)voidappendRecord(String k, String v)booleancanSplit()PageFilecopy()longestimatedMemory()Get the estimate memory size.static PageFilefromBytes(byte[] data, long maxFileSizeBytes)StringgetChildValue(int index)StringgetFileName()StringgetKey(int index)intgetKeyIndex(String key)List<String>getKeys()StringgetNextKey(String largerThan)StringgetNextRoot()longgetUpdate()StringgetValue(int index)intgetValueCount()voidinsertRecord(int index, String key, String value)booleanisInnerNode()booleanisModified()voidremoveKey(int index)voidremoveRecord(int index)voidremoveValue(int index)voidsetFileName(String fileName)voidsetModified(boolean modified)voidsetNextRoot(String nextRoot)voidsetUpdate(long update)voidsetValue(int index, String value)intsizeInBytes()byte[]toBytes()StringtoString()
-
-
-
Method Detail
-
estimatedMemory
public long estimatedMemory()
Description copied from interface:MemoryObjectGet the estimate memory size. The value must not change afterwards, otherwise the memory calculation is wrong.- Specified by:
estimatedMemoryin 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()
-
-