Class TableSerialExpirationBacklog
java.lang.Object
org.tentackle.dbms.TableSerialExpirationBacklog
Keeps a backlog of expiration sets.
- Author:
- harald
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a backlog with a default size.TableSerialExpirationBacklog(String name, int size) Creates a backlog. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExpiration(long minSerial, long maxSerial, Collection<IdSerialTuple> tuples, boolean mergeHistory) Adds an expiration set to the backlog.protected intenlargeSize(int size) Computes the enlarged size.
Invoked when there is an outdated query.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.toString()
-
Constructor Details
-
TableSerialExpirationBacklog
Creates a backlog.- Parameters:
name- the name of the backlogsize- the size of the backlog
-
TableSerialExpirationBacklog
Creates a backlog with a default size.- Parameters:
name- the name of the backlog
-
-
Method Details
-
toString
-
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 theTableSerialHistory
-
getExpiration
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
-