MediaWiki  REL1_22
ChronologyProtector Class Reference

Class for ensuring a consistent ordering of events as seen by the user, despite replication. More...

Collaboration diagram for ChronologyProtector:

List of all members.

Public Member Functions

 initLB (LoadBalancer $lb)
 Initialise a LoadBalancer to give it appropriate chronology protection.
 shutdown ()
 Notify the ChronologyProtector that the LBFactory is done calling shutdownLB() for now.
 shutdownLB (LoadBalancer $lb)
 Notify the ChronologyProtector that the LoadBalancer is about to shut down.

Protected Attributes

 $initialized = false
Array $shutdownPositions = array()
 (DB master name => position) *
Array $startupPositions = array()
 (DB master name => position) *

Detailed Description

Class for ensuring a consistent ordering of events as seen by the user, despite replication.

Kind of like Hawking's [[Chronology Protection Agency]].

Definition at line 28 of file ChronologyProtector.php.


Member Function Documentation

Initialise a LoadBalancer to give it appropriate chronology protection.

If the session has a previous master position recorded, this will try to make sure that the next query to a slave of that master will see changes up to that position by delaying execution. The delay may timeout and allow stale data if no non-lagged slaves are available.

Parameters:
$lbLoadBalancer
Returns:
void

Definition at line 45 of file ChronologyProtector.php.

Notify the ChronologyProtector that the LBFactory is done calling shutdownLB() for now.

May commit chronology data to persistent storage.

Returns:
void

Definition at line 97 of file ChronologyProtector.php.

Notify the ChronologyProtector that the LoadBalancer is about to shut down.

Saves replication positions.

Parameters:
$lbLoadBalancer
Returns:
void

Definition at line 71 of file ChronologyProtector.php.


Member Data Documentation

ChronologyProtector::$initialized = false [protected]

Definition at line 32 of file ChronologyProtector.php.

Array ChronologyProtector::$shutdownPositions = array() [protected]

(DB master name => position) *

Definition at line 30 of file ChronologyProtector.php.

Array ChronologyProtector::$startupPositions = array() [protected]

(DB master name => position) *

Definition at line 29 of file ChronologyProtector.php.


The documentation for this class was generated from the following file: