grendel.storage.intertwingle
Class BGDB

java.lang.Object
  |
  +--grendel.storage.intertwingle.BaseDB
        |
        +--grendel.storage.intertwingle.BGDB

public final class BGDB
extends grendel.storage.intertwingle.BaseDB
implements java.lang.Runnable

This implements a RDF-ish database, where changes take very little time. It works by queueing up those changes, and having a low-priority background thread process that queue into real changes. The pending changes also get reflected into a disk file, so that if we crash, we'll recover unfinished stuff when the app next starts.

Queries on the database will search the queue for pending changes that could affect that query, and will commit those changes immediately.


Method Summary
 void assert(java.lang.String name, java.lang.String slot, java.lang.String value)
           
 java.util.Enumeration findAll(java.lang.String name, java.lang.String slot, boolean reverse)
           
 java.lang.String findFirst(java.lang.String name, java.lang.String slot, boolean reverse)
           
 void flushChanges()
           
 void run()
           
 void unassert(java.lang.String name, java.lang.String slot, java.lang.String value)
           
 
Methods inherited from class grendel.storage.intertwingle.BaseDB
isAsserted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

assert

public void assert(java.lang.String name,
                   java.lang.String slot,
                   java.lang.String value)
            throws java.io.IOException

unassert

public void unassert(java.lang.String name,
                     java.lang.String slot,
                     java.lang.String value)
              throws java.io.IOException

findFirst

public java.lang.String findFirst(java.lang.String name,
                                  java.lang.String slot,
                                  boolean reverse)
                           throws java.io.IOException

findAll

public java.util.Enumeration findAll(java.lang.String name,
                                     java.lang.String slot,
                                     boolean reverse)
                              throws java.io.IOException

flushChanges

public void flushChanges()
                  throws java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable