|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
com.unister.semweb.drums.sync.SyncManager<Data>
Data
- an implementation of AbstractKVStorable
, e.g. GeneralStorable
public class SyncManager<Data extends AbstractKVStorable>
An instance of a SyncManager
is a thread, that handles the synchronization of Bucket
s with their
corresponding parts on disk. The policy for synchronizing is as following:
SyncManager
instantiates new SyncThread
s. Each SyncThread
uses a special
Synchronizer
to move data from cache to disk.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
BucketContainer<Data> |
bucketContainer
Contains the buckets. |
static double |
MINFILL_BEFORE_SYNC
at least this fill level of a bucket must been reached, before synchronizing for this bucket is started |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
SyncManager(BucketContainer<Data> bucketContainer,
ISynchronizerFactory<Data> synchronizerFactory,
DRUMSParameterSet<Data> gp)
Instantiates a new SyncManager with an already instantiated BucketContainer . |
Method Summary | |
---|---|
java.util.Set<Bucket<Data>> |
getActualProcessingBuckets()
|
BucketContainer<Data> |
getBucketContainer()
|
long |
getMaxBucketStorageTime()
|
int |
getNumberOfActiveThreads()
|
long |
getNumberOfElementsInserted()
|
long |
getNumberOfElementsUpdated()
|
int |
getNumberOfMaximalThreads()
|
java.lang.String |
getPathToDbFiles()
|
void |
run()
|
void |
setMaxBucketStorageTime(long maxBucketStorageTime)
Sets the maximal time that a bucket can linger within the BucketContainer without synchronization to hard drive. |
void |
setSynchronizer(ISynchronizerFactory<Data> factory)
overwrites the SynchronizerFactory. |
void |
shutdown()
Initiates the shutdown. |
void |
startForceMode()
Initiates the a synchronizing of all buckets. |
void |
stopForceMode()
Stops forcing the DRUMS to synchronize all Buckets |
void |
sumUpInserted(long toSumUp)
Sums the number of inserted elements. |
void |
sumUpUpdated(long toSumUp)
Sums the number of updated elements. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double MINFILL_BEFORE_SYNC
public final BucketContainer<Data extends AbstractKVStorable> bucketContainer
Constructor Detail |
---|
public SyncManager(BucketContainer<Data> bucketContainer, ISynchronizerFactory<Data> synchronizerFactory, DRUMSParameterSet<Data> gp)
SyncManager
with an already instantiated BucketContainer
. The defined number
of Threads in DRUMSParameterSet
will show the number of allowed SyncThread
s used to synchronize
the AbstractKVStorable
s from the Bucket
s in BucketContainer
to the HDD.
bucketContainer
- synchronizerFactory
- gp
- Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setSynchronizer(ISynchronizerFactory<Data> factory)
factory
- public void stopForceMode()
public void startForceMode()
public void shutdown()
public java.lang.String getPathToDbFiles()
public long getMaxBucketStorageTime()
public void setMaxBucketStorageTime(long maxBucketStorageTime)
maxBucketStorageTime
- public java.util.Set<Bucket<Data>> getActualProcessingBuckets()
public BucketContainer<Data> getBucketContainer()
BucketContainer
.public int getNumberOfActiveThreads()
public int getNumberOfMaximalThreads()
public void sumUpInserted(long toSumUp)
toSumUp
- public void sumUpUpdated(long toSumUp)
toSumUp
- public long getNumberOfElementsInserted()
public long getNumberOfElementsUpdated()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |