uk.ac.gla.dcs.renaissance.mg4j.documents
Class CompactDocumentStorage

java.lang.Object
  extended by bpiwowar.db.BatchFileStorage<Integer,bpiwowar.db.BatchFileStorage.IntegerLocation,CompactDocument>
      extended by uk.ac.gla.dcs.renaissance.mg4j.documents.CompactDocumentStorage
All Implemented Interfaces:
Iterable<Map.Entry<Integer,CompactDocument>>

public class CompactDocumentStorage
extends bpiwowar.db.BatchFileStorage<Integer,bpiwowar.db.BatchFileStorage.IntegerLocation,CompactDocument>

This represents a set of cached documents - caches a set of tags

Author:
B. Piwowarski

Nested Class Summary
 
Nested classes/interfaces inherited from class bpiwowar.db.BatchFileStorage
bpiwowar.db.BatchFileStorage.IntegerLocation, bpiwowar.db.BatchFileStorage.Location<K>, bpiwowar.db.BatchFileStorage.StringLocation
 
Field Summary
 
Fields inherited from class bpiwowar.db.BatchFileStorage
locationStore
 
Constructor Summary
CompactDocumentStorage(com.sleepycat.je.Environment dbenv, String dbname, File home, boolean compress, boolean destroy)
          Initialise a new storage
 
Method Summary
 void close()
          Close the underlying resources
 Iterable<it.unimi.dsi.parser.Element> elements()
           
protected  CompactDocument readObject(InputStream inputStream)
           
protected  void writeObject(OutputStream outputStream, CompactDocument document)
           
 
Methods inherited from class bpiwowar.db.BatchFileStorage
cleanup, closeOpenedBatches, count, finalize, getCurrentBatchIndex, getHome, getLocation, getObjectSize, getStoredObject, getStoredObject, hasObject, isCompressed, iterator, keyIterator, keys, nextBatch, outputObject, storeObject, storeObject, storeObject, storeObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompactDocumentStorage

public CompactDocumentStorage(com.sleepycat.je.Environment dbenv,
                              String dbname,
                              File home,
                              boolean compress,
                              boolean destroy)
                       throws com.sleepycat.persist.evolve.IncompatibleClassException,
                              com.sleepycat.je.DatabaseException,
                              IOException
Initialise a new storage

Parameters:
dbenv - The database environment
dbname - The database name for storing documents
home - The directory where to store the files (null if using the same as the database environment)
compress - If the objects should be compressed
destroy - If the database should be destroyed when opened
Throws:
com.sleepycat.persist.evolve.IncompatibleClassException
com.sleepycat.je.DatabaseException
IOException
Method Detail

writeObject

protected void writeObject(OutputStream outputStream,
                           CompactDocument document)
                    throws IOException
Overrides:
writeObject in class bpiwowar.db.BatchFileStorage<Integer,bpiwowar.db.BatchFileStorage.IntegerLocation,CompactDocument>
Throws:
IOException

readObject

protected CompactDocument readObject(InputStream inputStream)
                              throws IOException
Overrides:
readObject in class bpiwowar.db.BatchFileStorage<Integer,bpiwowar.db.BatchFileStorage.IntegerLocation,CompactDocument>
Throws:
IOException

close

public void close()
           throws Throwable
Close the underlying resources

Overrides:
close in class bpiwowar.db.BatchFileStorage<Integer,bpiwowar.db.BatchFileStorage.IntegerLocation,CompactDocument>
Throws:
Throwable

elements

public Iterable<it.unimi.dsi.parser.Element> elements()


Copyright © 2011. All Rights Reserved.