public class MemoryBackgroundLoadSave
extends java.lang.Object
Utility class that can be used by FileLoader or DBInterface implementations to provide a worker thread pool to load/save the file data using a queue of file load/save requests.
Modifier and Type | Class and Description |
---|---|
protected class |
MemoryBackgroundLoadSave.ThreadWorker
Thread Worker Inner Class
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DBFileSegmentInfo |
static long |
DefaultTransactionTimeout |
static int |
DefaultWorkerThreads |
static long |
MaximumTransactionTimeout |
static int |
MaximumWorkerThreads |
static long |
MinimumTransactionTimeout |
static int |
MinimumWorkerThreads |
static long |
RequestProcessedExpire |
static int |
RequestQueueDefaultSize |
static long |
RequestQueuedExpire |
static int |
RequestQueueLowWaterMark |
static int |
RequestQueueMaxSize |
static int |
RequestQueueMinSize |
static int |
RequeueMinSize |
static long |
RequeueWaitTime |
static long |
SequentialFileExpire |
static int |
StsError |
static int |
StsRequeue |
static int |
StsSuccess |
Constructor and Description |
---|
MemoryBackgroundLoadSave(FileStateCache stateCache,
BackgroundFileLoader bgLoader)
Class constructor
|
MemoryBackgroundLoadSave(java.lang.String name,
FileStateCache stateCache,
BackgroundFileLoader bgLoader)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
BackgroundFileLoader |
getFileLoader()
Return the file loader interface
|
long |
getFileStateTimeout()
Return the default file state timeout
|
int |
getLowQueueSize()
Return the in-memory file request queue low water mark level
|
int |
getMaximumQueueSize()
Return the maximum in-memory file request queue size
|
java.lang.String |
getName()
Return the worker thread prefix
|
protected FileRequestQueue |
getReadQueue()
Return the read request queue
|
int |
getReadWorkers()
Return the number of read worker threads
|
protected FileStateCache |
getStateCache()
Return the file state cache
|
protected FileRequestQueue |
getWriteQueue()
Return the write request queue
|
int |
getWriteWorkers()
Return the number of write worker threads
|
boolean |
hasDebug()
Check if debug output is enabled
|
void |
queueFileRequest(FileRequest req)
Request file data to be loaded/saved
|
void |
setDebug(boolean dbg)
Enable/disable debug output
|
void |
setLowQueueSize(int lowqSize)
Set the in-memory file request queue low water mark level
|
void |
setMaximumQueueSize(int qsize)
Set the maximum in-memory file request queue size
|
void |
setName(java.lang.String name)
Set the worker thread name prefix
|
void |
setReadWorkers(int rdWorkers)
Set the number of read worker threads
|
void |
setWriteWorkers(int wrWorkers)
Set the number of write worker threads
|
void |
shutdownThreads()
Shutdown the background load/save thread pool
|
void |
startThreads()
Start the background load/save thread pool
|
public static final int StsSuccess
public static final int StsRequeue
public static final int StsError
public static final int DefaultWorkerThreads
public static final int MinimumWorkerThreads
public static final int MaximumWorkerThreads
public static final int RequestQueueMaxSize
public static final int RequestQueueMinSize
public static final int RequestQueueDefaultSize
public static final int RequestQueueLowWaterMark
public static final int RequeueMinSize
public static final long RequeueWaitTime
public static final java.lang.String DBFileSegmentInfo
public static final long SequentialFileExpire
public static final long RequestProcessedExpire
public static final long RequestQueuedExpire
public static final long DefaultTransactionTimeout
public static final long MinimumTransactionTimeout
public static final long MaximumTransactionTimeout
public MemoryBackgroundLoadSave(FileStateCache stateCache, BackgroundFileLoader bgLoader)
stateCache
- FileStateCachebgLoader
- BackgroundFileLoaderpublic MemoryBackgroundLoadSave(java.lang.String name, FileStateCache stateCache, BackgroundFileLoader bgLoader)
name
- StringstateCache
- FileStateCachebgLoader
- BackgroundFileLoaderpublic final void startThreads()
public final void shutdownThreads()
public void queueFileRequest(FileRequest req)
req
- FileRequestpublic final boolean hasDebug()
public final BackgroundFileLoader getFileLoader()
public final long getFileStateTimeout()
public final int getMaximumQueueSize()
public final int getLowQueueSize()
public final java.lang.String getName()
protected final FileRequestQueue getReadQueue()
protected final FileRequestQueue getWriteQueue()
public final int getReadWorkers()
public final int getWriteWorkers()
protected final FileStateCache getStateCache()
public final void setName(java.lang.String name)
name
- Stringpublic final void setDebug(boolean dbg)
dbg
- booleanpublic final void setMaximumQueueSize(int qsize)
qsize
- intpublic final void setLowQueueSize(int lowqSize)
lowqSize
- public final void setReadWorkers(int rdWorkers)
rdWorkers
- intpublic final void setWriteWorkers(int wrWorkers)
wrWorkers
- intCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.