org.apache.activemq.kaha.impl.index.tree
Class TreeIndex

java.lang.Object
  extended by org.apache.activemq.kaha.impl.index.tree.TreeIndex
All Implemented Interfaces:
Index

public class TreeIndex
extends Object
implements Index

BTree implementation


Constructor Summary
TreeIndex(File directory, String name, IndexManager indexManager)
          Constructor
 
Method Summary
 void clear()
          clear the index
 boolean containsKey(Object key)
           
 void delete()
          delete all state associated with the index
 StoreEntry get(Object key)
           
 int getKeySize()
           
 int getPageCacheSize()
           
 int getPageSize()
           
 int getSize()
          return the size of the index
 boolean isEnablePageCaching()
           
 boolean isTransient()
           
 void load()
          load indexes
protected  void openIndexFile()
           
 StoreEntry remove(Object key)
          remove the index key
 void setEnablePageCaching(boolean enablePageCaching)
           
 void setKeyMarshaller(Marshaller marshaller)
          Set the marshaller for key objects
 void setKeySize(int keySize)
           
 void setPageCacheSize(int pageCacheSize)
           
 void setPageSize(int pageSize)
           
 void store(Object key, StoreEntry value)
          store the key, item
 void unload()
          unload indexes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeIndex

public TreeIndex(File directory,
                 String name,
                 IndexManager indexManager)
          throws IOException
Constructor

Parameters:
directory -
name -
indexManager -
Throws:
IOException
Method Detail

setKeyMarshaller

public void setKeyMarshaller(Marshaller marshaller)
Set the marshaller for key objects

Specified by:
setKeyMarshaller in interface Index
Parameters:
marshaller -

getKeySize

public int getKeySize()
Returns:
the keySize

setKeySize

public void setKeySize(int keySize)
Parameters:
keySize - the keySize to set

getPageSize

public int getPageSize()
Returns:
the pageSize

setPageSize

public void setPageSize(int pageSize)
Parameters:
pageSize - the pageSize to set

isTransient

public boolean isTransient()
Specified by:
isTransient in interface Index
Returns:
true if the index is transient

isEnablePageCaching

public boolean isEnablePageCaching()
Returns:
the enablePageCaching

setEnablePageCaching

public void setEnablePageCaching(boolean enablePageCaching)
Parameters:
enablePageCaching - the enablePageCaching to set

getPageCacheSize

public int getPageCacheSize()
Returns:
the pageCacheSize

setPageCacheSize

public void setPageCacheSize(int pageCacheSize)
Parameters:
pageCacheSize - the pageCacheSize to set

load

public void load()
Description copied from interface: Index
load indexes

Specified by:
load in interface Index

unload

public void unload()
            throws IOException
Description copied from interface: Index
unload indexes

Specified by:
unload in interface Index
Throws:
IOException

store

public void store(Object key,
                  StoreEntry value)
           throws IOException
Description copied from interface: Index
store the key, item

Specified by:
store in interface Index
Throws:
IOException

get

public StoreEntry get(Object key)
               throws IOException
Specified by:
get in interface Index
Returns:
the entry
Throws:
IOException

remove

public StoreEntry remove(Object key)
                  throws IOException
Description copied from interface: Index
remove the index key

Specified by:
remove in interface Index
Returns:
StoreEntry removed
Throws:
IOException

containsKey

public boolean containsKey(Object key)
                    throws IOException
Specified by:
containsKey in interface Index
Returns:
true if it contains the key
Throws:
IOException

clear

public void clear()
           throws IOException
Description copied from interface: Index
clear the index

Specified by:
clear in interface Index
Throws:
IOException

delete

public void delete()
            throws IOException
Description copied from interface: Index
delete all state associated with the index

Specified by:
delete in interface Index
Throws:
IOException

openIndexFile

protected void openIndexFile()
                      throws IOException
Throws:
IOException

getSize

public int getSize()
Description copied from interface: Index
return the size of the index

Specified by:
getSize in interface Index
Returns:


Copyright © 2005-2013 The Apache Software Foundation. All Rights Reserved.