| |
|
| java.lang.Object org.continuent.sequoia.controller.virtualdatabase.RequestResultFailoverCache
RequestResultFailoverCache | public class RequestResultFailoverCache implements Runnable(Code) | | This class defines a RequestResultFailoverCache.
It is used to implement the transparent failover feature. It temporarily
stores requests results so that they can be retrieved by the driver. Results
are stored/retrieved with a request ID.
An associated clean-up thread is started at instantiation time. It takes care
of removing cache entries which are too old.
author: Damian Arregui version: 1.0 |
Constructor Summary | |
public | RequestResultFailoverCache(Trace logger, long entryTimeout) Creates a new RequestResultFailoverCache object and starts
its associated clean-up thread. |
Method Summary | |
public synchronized Serializable | retrieve(long requestId) Retrieves from cache the result associated with a request ID. | public void | run() Takes care of removing cache entries which are too old. | public void | shutdown() Shutdown this thread so that it terminates asap. | public synchronized void | store(AbstractRequest request, Serializable result) Stores in cache a result associated with a given request. |
RequestResultFailoverCache | public RequestResultFailoverCache(Trace logger, long entryTimeout)(Code) | | Creates a new RequestResultFailoverCache object and starts
its associated clean-up thread.
Parameters: logger - logger to use to display messages Parameters: entryTimeout - time in ms after which an entry is removed from thecache |
retrieve | public synchronized Serializable retrieve(long requestId)(Code) | | Retrieves from cache the result associated with a request ID.
Parameters: requestId - id of the request to retrieve result or null if result not found |
shutdown | public void shutdown()(Code) | | Shutdown this thread so that it terminates asap. Note that if the thread
was waiting it will still proceed to the cleanup operations before
terminating.
|
store | public synchronized void store(AbstractRequest request, Serializable result)(Code) | | Stores in cache a result associated with a given request.
Parameters: request - request executed Parameters: result - result of the execution of the request |
|
|
|