uk.ac.gla.dcs.renaissance.iqir
Class KeywordsSubspaceBuilder

java.lang.Object
  extended by bpiwowar.db.BatchFileStorage<Integer,bpiwowar.db.BatchFileStorage.IntegerLocation,DensityTracker>
      extended by uk.ac.gla.dcs.renaissance.iqir.IndexedSubspaceBuilder
          extended by uk.ac.gla.dcs.renaissance.iqir.KeywordsSubspaceBuilder
All Implemented Interfaces:
Iterable<Map.Entry<Integer,DensityTracker>>

public class KeywordsSubspaceBuilder
extends IndexedSubspaceBuilder

Utility class to get a representation for keywords

Author:
Benjamin Piwowarski

Nested Class Summary
static class KeywordsSubspaceBuilder.Sampler
           
 
Nested classes/interfaces inherited from class bpiwowar.db.BatchFileStorage
bpiwowar.db.BatchFileStorage.IntegerLocation, bpiwowar.db.BatchFileStorage.Location<K>, bpiwowar.db.BatchFileStorage.StringLocation
 
Field Summary
static int PERC_AVAILABLE_MEMORY_CHECK
          When available memory goes below this threshold, we try a compaction.
static int PERC_AVAILABLE_MEMORY_DUMP
          If after compaction there is less memory (in percentage) than this value, we will flush the current batch.
 
Fields inherited from class bpiwowar.db.BatchFileStorage
locationStore
 
Constructor Summary
KeywordsSubspaceBuilder(com.sleepycat.je.Environment dbenv, String dbname, boolean destroy, int nbThreads)
           
 
Method Summary
 void addInformationNeed(bpiwowar.log.TaskTimer timer, bpiwowar.maths.matrix.DoubleMatrix1D v)
          Add an Information Need vector
 void addRestriction(int id, KeywordsSubspaceBuilder.Sampler restriction)
           
 void setRandom(Random random)
          Set the random function
 
Methods inherited from class uk.ac.gla.dcs.renaissance.iqir.IndexedSubspaceBuilder
add, flush, setCompaction, setMaxSVDRank, setStoreVectorSum
 
Methods inherited from class bpiwowar.db.BatchFileStorage
cleanup, close, closeOpenedBatches, count, finalize, getCurrentBatchIndex, getHome, getLocation, getObjectSize, getStoredObject, getStoredObject, hasObject, isCompressed, iterator, keyIterator, keys, nextBatch, outputObject, readObject, storeObject, storeObject, storeObject, storeObject, toString, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PERC_AVAILABLE_MEMORY_CHECK

public static final int PERC_AVAILABLE_MEMORY_CHECK
When available memory goes below this threshold, we try a compaction.

See Also:
Constant Field Values

PERC_AVAILABLE_MEMORY_DUMP

public static final int PERC_AVAILABLE_MEMORY_DUMP
If after compaction there is less memory (in percentage) than this value, we will flush the current batch.

See Also:
Constant Field Values
Constructor Detail

KeywordsSubspaceBuilder

public KeywordsSubspaceBuilder(com.sleepycat.je.Environment dbenv,
                               String dbname,
                               boolean destroy,
                               int nbThreads)
                        throws com.sleepycat.persist.evolve.IncompatibleClassException,
                               com.sleepycat.je.DatabaseException
Parameters:
dbenv - The database environment
db -
dbname -
nbTerms - Number of terms
destroy - Destroy the old database
nbThreads -
Throws:
com.sleepycat.je.DatabaseException
com.sleepycat.persist.evolve.IncompatibleClassException
Method Detail

addRestriction

public void addRestriction(int id,
                           KeywordsSubspaceBuilder.Sampler restriction)

addInformationNeed

public void addInformationNeed(bpiwowar.log.TaskTimer timer,
                               bpiwowar.maths.matrix.DoubleMatrix1D v)
                        throws IOException,
                               com.sleepycat.je.DatabaseException
Add an Information Need vector

Parameters:
v - The vector to add
Throws:
com.sleepycat.je.DatabaseException
IOException

setRandom

public void setRandom(Random random)
Set the random function

Parameters:
random -


Copyright © 2011. All Rights Reserved.