Package com.tangosol.io
Class AsyncBinaryStoreManager
- java.lang.Object
-
- com.tangosol.io.AsyncBinaryStoreManager
-
- All Implemented Interfaces:
BinaryStoreManager
public class AsyncBinaryStoreManager extends Object implements BinaryStoreManager
An AsyncBinaryStoreManager is a wrapper BinaryStoreManager that creates wrapper AsyncBinaryStore objects. An AsyncBinaryStore is a BinaryStore wrapper that performs the "O" portion of its I/O asynchronously (on a daemon thread.) Since the "O" portion is passed along to the wrapped BinaryStore on a separate thread, only read operations are blocking, thus the BinaryStore operations on a whole appear much faster. (It is somewhat analogous to a write-behind cache.)In order for the AsyncBinaryStore objects to be used in situations that require a BinaryStoreManager, this class provides a manager for the AsyncBinaryStore objects, but to create the BinaryStore objects that will be wrapped by the AsyncBinaryStore objects, this AsyncBinaryStoreManager class has to be provided with an underlying BinaryStoreManager to wrap.
- Since:
- Coherence 2.5
- Author:
- cp 2004.06.18
-
-
Constructor Summary
Constructors Constructor Description AsyncBinaryStoreManager(BinaryStoreManager manager)
Construct an AsyncBinaryStoreManager.AsyncBinaryStoreManager(BinaryStoreManager manager, int cbMax)
Construct an AsyncBinaryStoreManager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BinaryStore
createBinaryStore()
Factory method: Returns a new BinaryStore.void
destroyBinaryStore(BinaryStore store)
Lifecycle method: Destroy a BinaryStore previously created by this manager.protected BinaryStoreManager
getBinaryStoreManager()
protected Map
getBinaryStoreMap()
protected int
getQueuedLimit()
protected AsyncBinaryStore
instantiateAsyncBinaryStore(BinaryStore store)
Factory method: Instantiate an AsyncBinaryStore.
-
-
-
Constructor Detail
-
AsyncBinaryStoreManager
public AsyncBinaryStoreManager(BinaryStoreManager manager)
Construct an AsyncBinaryStoreManager. An AsyncBinaryStoreManager creates and destroys AsyncBinaryStore objects, which wrap other BinaryStore objects to provide asynchronous write operations.- Parameters:
manager
- the BinaryStoreManager to wrap
-
AsyncBinaryStoreManager
public AsyncBinaryStoreManager(BinaryStoreManager manager, int cbMax)
Construct an AsyncBinaryStoreManager. An AsyncBinaryStoreManager creates and destroys AsyncBinaryStore objects, which wrap other BinaryStore objects to provide asynchronous write operations.- Parameters:
manager
- the BinaryStoreManager to wrapcbMax
- the maximum number of bytes to queue before blocking
-
-
Method Detail
-
createBinaryStore
public BinaryStore createBinaryStore()
Factory method: Returns a new BinaryStore.- Specified by:
createBinaryStore
in interfaceBinaryStoreManager
- Returns:
- a new BinaryStore object
-
destroyBinaryStore
public void destroyBinaryStore(BinaryStore store)
Lifecycle method: Destroy a BinaryStore previously created by this manager.- Specified by:
destroyBinaryStore
in interfaceBinaryStoreManager
- Parameters:
store
- a BinaryStore object previously created by this manager
-
getBinaryStoreManager
protected BinaryStoreManager getBinaryStoreManager()
- Returns:
- the wrapped BinaryStoreManager
-
getBinaryStoreMap
protected Map getBinaryStoreMap()
- Returns:
- the map of created AsyncBinaryStore objects and their corresponding wrapped BinaryStore objects
-
getQueuedLimit
protected int getQueuedLimit()
- Returns:
- the maximum number of pending bytes to allow to accumulate for async I/O in each of the AsyncBinaryStore objects created by this manager
-
instantiateAsyncBinaryStore
protected AsyncBinaryStore instantiateAsyncBinaryStore(BinaryStore store)
Factory method: Instantiate an AsyncBinaryStore.- Returns:
- a new AsyncBinaryStore
-
-