public final class MapContainerImpl extends BaseContainerImpl implements MapContainer
Modifier and Type | Field and Description |
---|---|
protected File |
directory |
protected Index |
index |
protected Marshaller |
keyMarshaller |
protected Marshaller |
valueMarshaller |
closed, containerId, dataManager, indexList, indexManager, initialized, loaded, persistentIndex, root
Constructor and Description |
---|
MapContainerImpl(File directory,
ContainerId id,
IndexItem root,
IndexManager indexManager,
DataManager dataManager,
boolean persistentIndex) |
Modifier and Type | Method and Description |
---|---|
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) |
checkClosed, close, delete, doClear, expressDataInterest, getContainerId, getDataManager, getId, getIndexManager, getInternalList, getList, isLoaded, isRoot, setList, storeIndex, updateIndexes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, isLoaded
protected Marshaller keyMarshaller
protected Marshaller valueMarshaller
public MapContainerImpl(File directory, ContainerId id, IndexItem root, IndexManager indexManager, DataManager dataManager, boolean persistentIndex)
public void init()
init
in class BaseContainerImpl
public void load()
MapContainer
load
in interface MapContainer
load
in class BaseContainerImpl
public void unload()
MapContainer
unload
in interface MapContainer
unload
in class BaseContainerImpl
public void delete()
MapContainer
delete
in interface MapContainer
public void setKeyMarshaller(Marshaller keyMarshaller)
MapContainer
setKeyMarshaller
in interface MapContainer
public void setValueMarshaller(Marshaller valueMarshaller)
MapContainer
setValueMarshaller
in interface MapContainer
public int size()
size
in interface Map
size
in interface MapContainer
size
in class BaseContainerImpl
public boolean isEmpty()
isEmpty
in interface Map
isEmpty
in interface MapContainer
public boolean containsKey(Object key)
containsKey
in interface Map
containsKey
in interface MapContainer
public Object get(Object key)
MapContainer
get
in interface Map
get
in interface MapContainer
public StoreEntry getEntry(Object key)
getEntry
in interface MapContainer
key
- public boolean containsValue(Object o)
containsValue
in interface Map
containsValue
in interface MapContainer
public void putAll(Map t)
MapContainer
putAll
in interface Map
putAll
in interface MapContainer
public Set keySet()
keySet
in interface Map
keySet
in interface MapContainer
public Collection values()
values
in interface Map
values
in interface MapContainer
public Set entrySet()
entrySet
in interface Map
entrySet
in interface MapContainer
public Object put(Object key, Object value)
MapContainer
put
in interface Map
put
in interface MapContainer
public Object remove(Object key)
MapContainer
remove
in interface Map
remove
in interface MapContainer
public boolean removeValue(Object o)
protected void remove(IndexItem item)
remove
in class BaseContainerImpl
public void clear()
MapContainer
clear
in interface Map
clear
in interface MapContainer
clear
in class BaseContainerImpl
public StoreEntry place(Object key, Object value)
place
in interface MapContainer
key
- value
- public void remove(StoreEntry entry)
remove
in interface MapContainer
entry
- IOException
public StoreEntry getFirst()
MapContainer
getFirst
in interface MapContainer
public StoreEntry getLast()
MapContainer
getLast
in interface MapContainer
public StoreEntry getNext(StoreEntry entry)
MapContainer
getNext
in interface MapContainer
public StoreEntry getPrevious(StoreEntry entry)
MapContainer
getPrevious
in interface MapContainer
public StoreEntry refresh(StoreEntry entry)
MapContainer
refresh
in interface MapContainer
entry
- old entrypublic Object getValue(StoreEntry item)
getValue
in interface MapContainer
getValue
in class BaseContainerImpl
item
- public Object getKey(StoreEntry item)
getKey
in interface MapContainer
item
- protected IndexLinkedList getItemList()
public int getIndexBinSize()
getIndexBinSize
in interface MapContainer
public void setIndexBinSize(int indexBinSize)
MapContainer
setIndexBinSize
in interface MapContainer
public int getIndexKeySize()
getIndexKeySize
in interface MapContainer
public void setIndexKeySize(int indexKeySize)
MapContainer
setIndexKeySize
in interface MapContainer
public int getIndexPageSize()
getIndexPageSize
in interface MapContainer
public void setIndexPageSize(int indexPageSize)
MapContainer
setIndexPageSize
in interface MapContainer
public int getIndexLoadFactor()
getIndexLoadFactor
in interface MapContainer
public void setIndexLoadFactor(int loadFactor)
setIndexLoadFactor
in interface MapContainer
loadFactor
- the loadFactor to setpublic IndexMBean getIndexMBean()
getIndexMBean
in interface MapContainer
public int getIndexMaxBinSize()
getIndexMaxBinSize
in interface MapContainer
public void setIndexMaxBinSize(int maxBinSize)
MapContainer
setIndexMaxBinSize
in interface MapContainer
Copyright © 2005–2014. All rights reserved.