org.progressmining.xeslite.external
Class XMapDBStore

java.lang.Object
  extended by org.progressmining.xeslite.external.XMapDBStore
All Implemented Interfaces:
XExternalAttributeStore
Direct Known Subclasses:
XMapDBStore.DirectMemoryStore, XMapDBStore.DiskStore

public abstract class XMapDBStore
extends java.lang.Object
implements XExternalAttributeStore

Implementation using MapDB (https://github.com/jankotek/mapdb) as back-end.

Author:
F. Mannhardt

Nested Class Summary
static class XMapDBStore.DirectMemoryStore
           
static class XMapDBStore.DiskStore
           
 
Field Summary
protected  int cacheSize
           
protected  boolean useAsyncWriter
           
protected  boolean useCache
           
 
Constructor Summary
protected XMapDBStore(boolean useAsyncWriter, boolean useCache, int cacheSize)
           
 
Method Summary
 void commit()
          Commits all pending changes to the underlying storage
protected abstract  org.mapdb.DB createDB()
           
protected  void finalize()
           
 org.deckfour.xes.model.XAttributeMap getAttributes(org.progressmining.xeslite.external.XExternalAttributable attributable)
           
 boolean hasAttributes(org.progressmining.xeslite.external.XExternalAttributable attributable)
           
 org.deckfour.xes.model.XAttributeMap removeAttributes(org.progressmining.xeslite.external.XExternalAttributable attributable)
           
 void setAttributes(org.progressmining.xeslite.external.XExternalAttributable attributable, org.deckfour.xes.model.XAttributeMap attributes)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useCache

protected final boolean useCache

cacheSize

protected final int cacheSize

useAsyncWriter

protected final boolean useAsyncWriter
Constructor Detail

XMapDBStore

protected XMapDBStore(boolean useAsyncWriter,
                      boolean useCache,
                      int cacheSize)
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

createDB

protected abstract org.mapdb.DB createDB()
                                  throws java.io.IOException
Throws:
java.io.IOException

getAttributes

public final org.deckfour.xes.model.XAttributeMap getAttributes(org.progressmining.xeslite.external.XExternalAttributable attributable)
Specified by:
getAttributes in interface XExternalAttributeStore
Returns:
the XAttributeMap associated with this id, possibly empty

hasAttributes

public final boolean hasAttributes(org.progressmining.xeslite.external.XExternalAttributable attributable)
Specified by:
hasAttributes in interface XExternalAttributeStore

setAttributes

public final void setAttributes(org.progressmining.xeslite.external.XExternalAttributable attributable,
                                org.deckfour.xes.model.XAttributeMap attributes)
Specified by:
setAttributes in interface XExternalAttributeStore
attributes - the XAttributeMap that replaces all existing attributes for this id

removeAttributes

public final org.deckfour.xes.model.XAttributeMap removeAttributes(org.progressmining.xeslite.external.XExternalAttributable attributable)
Specified by:
removeAttributes in interface XExternalAttributeStore
Returns:
a XAttributeMap with the previous values, possibly empty

commit

public final void commit()
Description copied from interface: XExternalAttributeStore
Commits all pending changes to the underlying storage

Specified by:
commit in interface XExternalAttributeStore