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
- IOException
public void setKeyMarshaller(Marshaller marshaller)
setKeyMarshaller
in interface Index
marshaller
- public int getKeySize()
getKeySize
in interface HashIndexMBean
public void setKeySize(int keySize)
setKeySize
in interface HashIndexMBean
keySize
- the keySize to setpublic int getPageSize()
getPageSize
in interface HashIndexMBean
public void setPageSize(int pageSize)
pageSize
- the pageSize to setpublic int getNumberOfBins()
getNumberOfBins
in interface HashIndexMBean
public void setNumberOfBins(int numberOfBins)
numberOfBins
- public boolean isEnablePageCaching()
isEnablePageCaching
in interface HashIndexMBean
public void setEnablePageCaching(boolean enablePageCaching)
enablePageCaching
- the enablePageCaching to setpublic int getPageCacheSize()
getPageCacheSize
in interface HashIndexMBean
public void setPageCacheSize(int pageCacheSize)
pageCacheSize
- the pageCacheSize to setpublic boolean isTransient()
isTransient
in interface Index
isTransient
in interface IndexMBean
public 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()
Index
getSize
in interface HashIndexMBean
getSize
in interface Index
getSize
in interface IndexMBean
public int getActiveBins()
getActiveBins
in interface HashIndexMBean
public void load()
Index
public void unload() throws IOException
Index
unload
in interface Index
IOException
public void store(Object key, StoreEntry value) throws IOException
Index
store
in interface Index
IOException
public StoreEntry get(Object key) throws IOException
get
in interface Index
IOException
public StoreEntry remove(Object key) throws IOException
Index
remove
in interface Index
IOException
public boolean containsKey(Object key) throws IOException
containsKey
in interface Index
IOException
public void clear() throws IOException
Index
clear
in interface Index
IOException
public void delete() throws IOException
Index
delete
in interface Index
IOException
Copyright © 2005–2014 The Apache Software Foundation. All rights reserved.