public class BTreeIndex<Key,Value> extends java.lang.Object implements Index<Key,Value>
| Modifier and Type | Class and Description |
|---|---|
static interface |
BTreeIndex.Prefixer<Key>
Interface used to determine the simple prefix of two keys.
|
static class |
BTreeIndex.StringPrefixer
StringPrefixer is a Prefixer implementation that works on strings.
|
| Constructor and Description |
|---|
BTreeIndex() |
BTreeIndex(long rootPageId) |
BTreeIndex(Page page) |
BTreeIndex(PageFile pageFile,
long rootPageId) |
BTreeIndex(PageFile pageFile,
Page page) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(Transaction tx)
clear the index
|
boolean |
containsKey(Transaction tx,
Key key) |
Value |
get(Transaction tx,
Key key) |
java.util.Map.Entry<Key,Value> |
getFirst(Transaction tx) |
Marshaller<Key> |
getKeyMarshaller() |
java.util.Map.Entry<Key,Value> |
getLast(Transaction tx) |
int |
getMaxLeafDepth(Transaction tx) |
int |
getMinLeafDepth(Transaction tx) |
PageFile |
getPageFile() |
long |
getPageId() |
BTreeIndex.Prefixer<Key> |
getPrefixer() |
Marshaller<Value> |
getValueMarshaller() |
boolean |
isEmpty(Transaction tx) |
boolean |
isTransient() |
java.util.Iterator<java.util.Map.Entry<Key,Value>> |
iterator(Transaction tx) |
java.util.Iterator<java.util.Map.Entry<Key,Value>> |
iterator(Transaction tx,
Key initialKey) |
java.util.Iterator<java.util.Map.Entry<Key,Value>> |
iterator(Transaction tx,
Key initialKey,
Key maxKey) |
void |
load(Transaction tx)
load indexes
|
void |
printStructure(Transaction tx,
java.io.OutputStream out) |
void |
printStructure(Transaction tx,
java.io.PrintWriter out) |
Value |
put(Transaction tx,
Key key,
Value value)
store the key, item
|
Value |
remove(Transaction tx,
Key key)
remove the index key
|
void |
setKeyMarshaller(Marshaller<Key> keyMarshaller)
Set the marshaller for key objects
|
void |
setPageFile(PageFile pageFile) |
void |
setPageId(long pageId) |
void |
setPrefixer(BTreeIndex.Prefixer<Key> prefixer) |
void |
setValueMarshaller(Marshaller<Value> valueMarshaller)
Set the marshaller for key objects
|
void |
unload(Transaction tx)
unload indexes
|
void |
visit(Transaction tx,
BTreeVisitor<Key,Value> visitor) |
public BTreeIndex()
public BTreeIndex(long rootPageId)
public BTreeIndex(Page page)
public BTreeIndex(PageFile pageFile, long rootPageId)
public void load(Transaction tx) throws java.io.IOException
Indexpublic void unload(Transaction tx)
Indexpublic boolean containsKey(Transaction tx, Key key) throws java.io.IOException
containsKey in interface Index<Key,Value>java.io.IOExceptionpublic Value get(Transaction tx, Key key) throws java.io.IOException
public Value put(Transaction tx, Key key, Value value) throws java.io.IOException
Indexpublic Value remove(Transaction tx, Key key) throws java.io.IOException
Indexpublic boolean isTransient()
isTransient in interface Index<Key,Value>public void clear(Transaction tx) throws java.io.IOException
Indexpublic int getMinLeafDepth(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic int getMaxLeafDepth(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic void printStructure(Transaction tx, java.io.PrintWriter out) throws java.io.IOException
java.io.IOExceptionpublic void printStructure(Transaction tx, java.io.OutputStream out) throws java.io.IOException
java.io.IOExceptionpublic boolean isEmpty(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx) throws java.io.IOException
public java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx, Key initialKey) throws java.io.IOException
java.io.IOExceptionpublic java.util.Iterator<java.util.Map.Entry<Key,Value>> iterator(Transaction tx, Key initialKey, Key maxKey) throws java.io.IOException
java.io.IOExceptionpublic void visit(Transaction tx, BTreeVisitor<Key,Value> visitor) throws java.io.IOException
java.io.IOExceptionpublic java.util.Map.Entry<Key,Value> getFirst(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic java.util.Map.Entry<Key,Value> getLast(Transaction tx) throws java.io.IOException
java.io.IOExceptionpublic PageFile getPageFile()
public long getPageId()
public Marshaller<Key> getKeyMarshaller()
public void setKeyMarshaller(Marshaller<Key> keyMarshaller)
IndexsetKeyMarshaller in interface Index<Key,Value>public Marshaller<Value> getValueMarshaller()
public void setValueMarshaller(Marshaller<Value> valueMarshaller)
IndexsetValueMarshaller in interface Index<Key,Value>public BTreeIndex.Prefixer<Key> getPrefixer()
public void setPrefixer(BTreeIndex.Prefixer<Key> prefixer)
public void setPageFile(PageFile pageFile)
public void setPageId(long pageId)
Copyright © 2005-2016 Red Hat, Inc.. All Rights Reserved.