com.continuent.tungsten.replicator.thl
Class EventsCache

java.lang.Object
  extended by com.continuent.tungsten.replicator.thl.EventsCache

public class EventsCache
extends java.lang.Object

Implements a simple hash map to hold events. If the cache is full we age out old items in FIFO order.

Version:
1.0
Author:
Stephane Giron

Constructor Summary
EventsCache(int cacheSize)
           
 
Method Summary
 THLEvent get(long seqno)
          Look up and return the cached item, if found.
 boolean isEmpty()
           
 void put(THLEvent thlEvent)
          Add an event to the cache, clearing space if necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventsCache

public EventsCache(int cacheSize)
Method Detail

isEmpty

public boolean isEmpty()

put

public void put(THLEvent thlEvent)
         throws java.lang.InterruptedException
Add an event to the cache, clearing space if necessary.

Throws:
java.lang.InterruptedException

get

public THLEvent get(long seqno)
Look up and return the cached item, if found.