|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.kaha.impl.container.BaseContainerImpl
org.apache.activemq.kaha.impl.container.MapContainerImpl
public final class MapContainerImpl
Implementation of a MapContainer
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Field Summary | |
|---|---|
protected File |
directory
|
protected Index |
index
|
protected Marshaller |
keyMarshaller
|
protected Marshaller |
valueMarshaller
|
| Fields inherited from class org.apache.activemq.kaha.impl.container.BaseContainerImpl |
|---|
closed, containerId, dataManager, indexList, indexManager, initialized, loaded, persistentIndex, root |
| Constructor Summary | |
|---|---|
MapContainerImpl(File directory,
ContainerId id,
IndexItem root,
IndexManager indexManager,
DataManager dataManager,
boolean persistentIndex)
|
|
| Method Summary | |
|---|---|
void |
clear()
empty the container |
boolean |
containsKey(Object key)
|
boolean |
containsValue(Object o)
|
void |
delete()
Clean up all state associated with this container. |
Set |
entrySet()
|
Object |
get(Object key)
Get the value associated with the key |
StoreEntry |
getEntry(Object key)
Get the StoreEntry associated with the key |
StoreEntry |
getFirst()
Get the StoreEntry for the first value in the Map |
int |
getIndexBinSize()
|
int |
getIndexKeySize()
|
int |
getIndexLoadFactor()
|
int |
getIndexMaxBinSize()
|
IndexMBean |
getIndexMBean()
|
int |
getIndexPageSize()
|
protected IndexLinkedList |
getItemList()
|
Object |
getKey(StoreEntry item)
Get the Key object from it's location |
StoreEntry |
getLast()
Get the StoreEntry for the last value item of the Map |
StoreEntry |
getNext(StoreEntry entry)
Get the next StoreEntry value from the map |
StoreEntry |
getPrevious(StoreEntry entry)
Get the previous StoreEntry from the map |
Object |
getValue(StoreEntry item)
Get the value from it's location |
void |
init()
|
boolean |
isEmpty()
|
Set |
keySet()
|
void |
load()
The container is created or retrieved in an unloaded state. |
StoreEntry |
place(Object key,
Object value)
Add an entry to the Store Map |
Object |
put(Object key,
Object value)
Add an entry |
void |
putAll(Map t)
Add add entries in the supplied Map |
StoreEntry |
refresh(StoreEntry entry)
It's possible that a StoreEntry could be come stale this will return an upto date entry for the StoreEntry position |
protected void |
remove(IndexItem item)
|
Object |
remove(Object key)
remove an entry associated with the key |
void |
remove(StoreEntry entry)
Remove an Entry from ther Map |
boolean |
removeValue(Object o)
|
void |
setIndexBinSize(int indexBinSize)
Set the index bin size |
void |
setIndexKeySize(int indexKeySize)
Add the index key size |
void |
setIndexLoadFactor(int loadFactor)
|
void |
setIndexMaxBinSize(int maxBinSize)
set the meximum bin size |
void |
setIndexPageSize(int indexPageSize)
Set the index page size |
void |
setKeyMarshaller(Marshaller keyMarshaller)
For homogenous containers can set a custom marshaller for loading keys The default uses Object serialization |
void |
setValueMarshaller(Marshaller valueMarshaller)
For homogenous containers can set a custom marshaller for loading values The default uses Object serialization |
int |
size()
|
String |
toString()
|
void |
unload()
unload indexes from the container |
Collection |
values()
|
protected IndexItem |
write(Object key,
Object value)
|
| Methods inherited from class org.apache.activemq.kaha.impl.container.BaseContainerImpl |
|---|
checkClosed, close, delete, doClear, expressDataInterest, getContainerId, getDataManager, getId, getIndexManager, getInternalList, getList, isLoaded, isRoot, setList, storeIndex, updateIndexes |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.activemq.kaha.MapContainer |
|---|
getId, isLoaded |
| Methods inherited from interface java.util.Map |
|---|
equals, hashCode |
| Field Detail |
|---|
protected Index index
protected Marshaller keyMarshaller
protected Marshaller valueMarshaller
protected File directory
| Constructor Detail |
|---|
public MapContainerImpl(File directory,
ContainerId id,
IndexItem root,
IndexManager indexManager,
DataManager dataManager,
boolean persistentIndex)
| Method Detail |
|---|
public void init()
init in class BaseContainerImplpublic void load()
MapContainer
load in interface MapContainerload in class BaseContainerImplpublic void unload()
MapContainer
unload in interface MapContainerunload in class BaseContainerImplpublic void delete()
MapContainer
delete in interface MapContainerpublic void setKeyMarshaller(Marshaller keyMarshaller)
MapContainer
setKeyMarshaller in interface MapContainerpublic void setValueMarshaller(Marshaller valueMarshaller)
MapContainer
setValueMarshaller in interface MapContainerpublic int size()
size in interface Mapsize in interface MapContainersize in class BaseContainerImplpublic boolean isEmpty()
isEmpty in interface MapisEmpty in interface MapContainerpublic boolean containsKey(Object key)
containsKey in interface MapcontainsKey in interface MapContainerpublic Object get(Object key)
MapContainer
get in interface Mapget in interface MapContainerpublic StoreEntry getEntry(Object key)
getEntry in interface MapContainerkey -
public boolean containsValue(Object o)
containsValue in interface MapcontainsValue in interface MapContainerpublic void putAll(Map t)
MapContainer
putAll in interface MapputAll in interface MapContainerpublic Set keySet()
keySet in interface MapkeySet in interface MapContainerpublic Collection values()
values in interface Mapvalues in interface MapContainerpublic Set entrySet()
entrySet in interface MapentrySet in interface MapContainer
public Object put(Object key,
Object value)
MapContainer
put in interface Mapput in interface MapContainerpublic Object remove(Object key)
MapContainer
remove in interface Mapremove in interface MapContainerpublic boolean removeValue(Object o)
protected void remove(IndexItem item)
remove in class BaseContainerImplpublic void clear()
MapContainer
clear in interface Mapclear in interface MapContainerclear in class BaseContainerImpl
public StoreEntry place(Object key,
Object value)
place in interface MapContainerkey - value -
public void remove(StoreEntry entry)
remove in interface MapContainerentry -
IOExceptionpublic StoreEntry getFirst()
MapContainer
getFirst in interface MapContainerpublic StoreEntry getLast()
MapContainer
getLast in interface MapContainerpublic StoreEntry getNext(StoreEntry entry)
MapContainer
getNext in interface MapContainerpublic StoreEntry getPrevious(StoreEntry entry)
MapContainer
getPrevious in interface MapContainerpublic StoreEntry refresh(StoreEntry entry)
MapContainer
refresh in interface MapContainerentry - old entry
public Object getValue(StoreEntry item)
getValue in interface MapContainergetValue in class BaseContainerImplitem -
public Object getKey(StoreEntry item)
getKey in interface MapContaineritem -
protected IndexLinkedList getItemList()
protected IndexItem write(Object key,
Object value)
public int getIndexBinSize()
getIndexBinSize in interface MapContainerpublic void setIndexBinSize(int indexBinSize)
MapContainer
setIndexBinSize in interface MapContainerpublic int getIndexKeySize()
getIndexKeySize in interface MapContainerpublic void setIndexKeySize(int indexKeySize)
MapContainer
setIndexKeySize in interface MapContainerpublic int getIndexPageSize()
getIndexPageSize in interface MapContainerpublic void setIndexPageSize(int indexPageSize)
MapContainer
setIndexPageSize in interface MapContainerpublic int getIndexLoadFactor()
getIndexLoadFactor in interface MapContainerpublic void setIndexLoadFactor(int loadFactor)
setIndexLoadFactor in interface MapContainerloadFactor - the loadFactor to setpublic IndexMBean getIndexMBean()
getIndexMBean in interface MapContainerpublic int getIndexMaxBinSize()
getIndexMaxBinSize in interface MapContainerpublic void setIndexMaxBinSize(int maxBinSize)
MapContainer
setIndexMaxBinSize in interface MapContainerpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||