Class TableSerialExpirationBacklog

java.lang.Object
org.tentackle.dbms.TableSerialExpirationBacklog

public class TableSerialExpirationBacklog extends Object
Keeps a backlog of expiration sets.
Author:
harald
See Also:
  • Constructor Details

    • TableSerialExpirationBacklog

      public TableSerialExpirationBacklog(String name, int size)
      Creates a backlog.
      Parameters:
      name - the name of the backlog
      size - the size of the backlog
    • TableSerialExpirationBacklog

      public TableSerialExpirationBacklog(String name)
      Creates a backlog with a default size.
      Parameters:
      name - the name of the backlog
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addExpiration

      public void addExpiration(long minSerial, long maxSerial, Collection<IdSerialTuple> tuples, boolean mergeHistory)
      Adds an expiration set to the backlog.
      Parameters:
      minSerial - the lower serial bound of the query (minSerial < tableSerial)
      maxSerial - the upper serial bound of the query (tableSerial ≤ maxSerial)
      tuples - the expiration info as pairs of id/tableserial.
      mergeHistory - true to merge the TableSerialHistory
    • getExpiration

      public TreeSet<IdSerialTuple> getExpiration(long minSerial, long maxSerial)
      Gets the expiration backlog for a given range of table-serials.
      An id of 0 indicates a rolled back insert or update.
      A negative tableserial indicates a deletion.
      Parameters:
      minSerial - the lower serial bound of the query (minSerial < tableSerial)
      maxSerial - the upper serial bound of the query (tableSerial ≤ maxSerial)
      Returns:
      the expiration set as tuples of id/tableserial, ordered by abs(tableserial), null if the given range was not found in the backlog
    • enlargeSize

      protected int enlargeSize(int size)
      Computes the enlarged size.
      Invoked when there is an outdated query.
      Parameters:
      size - the current size
      Returns:
      the enlarged size, same if no more enlargement possible