public class HashIndex extends Object implements Index, HashIndexMBean
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BIN_SIZE |
static int |
DEFAULT_KEY_SIZE |
static int |
DEFAULT_LOAD_FACTOR |
static int |
DEFAULT_PAGE_SIZE |
static int |
MAXIMUM_CAPACITY |
| Constructor and Description |
|---|
HashIndex(File directory,
String name,
IndexManager indexManager)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
clear the index
|
boolean |
containsKey(Object key) |
void |
delete()
delete all state associated with the index
|
StoreEntry |
get(Object key) |
int |
getActiveBins() |
int |
getKeySize() |
int |
getLoadFactor() |
int |
getMaximumCapacity() |
int |
getNumberOfBins() |
int |
getPageCacheSize() |
int |
getPageSize() |
int |
getSize()
return the size of the index
|
int |
getThreshold() |
boolean |
isEnablePageCaching() |
boolean |
isTransient() |
void |
load()
load indexes
|
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 |
setLoadFactor(int loadFactor) |
void |
setMaximumCapacity(int maximumCapacity) |
void |
setNumberOfBins(int numberOfBins) |
void |
setPageCacheSize(int pageCacheSize) |
void |
setPageSize(int pageSize) |
void |
setThreshold(int threshold) |
void |
store(Object key,
StoreEntry value)
store the key, item
|
String |
toString() |
void |
unload()
unload indexes
|
public static final int DEFAULT_PAGE_SIZE
public static final int DEFAULT_KEY_SIZE
public static final int DEFAULT_BIN_SIZE
public static final int MAXIMUM_CAPACITY
public static final int DEFAULT_LOAD_FACTOR
public HashIndex(File directory, String name, IndexManager indexManager) throws IOException
directory - name - indexManager - IOExceptionpublic void setKeyMarshaller(Marshaller marshaller)
setKeyMarshaller in interface Indexmarshaller - public int getKeySize()
getKeySize in interface HashIndexMBeanpublic void setKeySize(int keySize)
setKeySize in interface HashIndexMBeankeySize - the keySize to setpublic int getPageSize()
getPageSize in interface HashIndexMBeanpublic void setPageSize(int pageSize)
pageSize - the pageSize to setpublic int getNumberOfBins()
getNumberOfBins in interface HashIndexMBeanpublic void setNumberOfBins(int numberOfBins)
numberOfBins - public boolean isEnablePageCaching()
isEnablePageCaching in interface HashIndexMBeanpublic void setEnablePageCaching(boolean enablePageCaching)
enablePageCaching - the enablePageCaching to setpublic int getPageCacheSize()
getPageCacheSize in interface HashIndexMBeanpublic void setPageCacheSize(int pageCacheSize)
pageCacheSize - the pageCacheSize to setpublic boolean isTransient()
isTransient in interface IndexisTransient in interface IndexMBeanpublic int getThreshold()
public void setThreshold(int threshold)
threshold - the threshold to setpublic int getLoadFactor()
public void setLoadFactor(int loadFactor)
loadFactor - the loadFactor to setpublic int getMaximumCapacity()
public void setMaximumCapacity(int maximumCapacity)
maximumCapacity - the maximumCapacity to setpublic int getSize()
IndexgetSize in interface HashIndexMBeangetSize in interface IndexgetSize in interface IndexMBeanpublic int getActiveBins()
getActiveBins in interface HashIndexMBeanpublic void unload() throws IOException
Indexunload in interface IndexIOExceptionpublic void store(Object key, StoreEntry value) throws IOException
Indexstore in interface IndexIOExceptionpublic StoreEntry get(Object key) throws IOException
get in interface IndexIOExceptionpublic StoreEntry remove(Object key) throws IOException
Indexremove in interface IndexIOExceptionpublic boolean containsKey(Object key) throws IOException
containsKey in interface IndexIOExceptionpublic void clear() throws IOException
Indexclear in interface IndexIOExceptionpublic void delete() throws IOException
Indexdelete in interface IndexIOExceptionCopyright © 2005–2017. All rights reserved.