23 use Psr\Log\LoggerInterface;
41 private $trxReplicaLagStatus =
null;
54 if ( $this->topologyRole === IDatabase::ROLE_STREAMING_MASTER ) {
56 } elseif ( $this->topologyRole === IDatabase::ROLE_STATIC_CLONE ) {
88 if ( $this->topologyRole === IDatabase::ROLE_STREAMING_REPLICA ) {
91 $lag = $this->
getLag( $conn );
99 return [
'lag' => $lag,
'since' => microtime(
true ) ];
121 if ( $this->topologyRole === IDatabase::ROLE_STREAMING_REPLICA ) {
122 return [
'Server is configured as a read-only replica database.',
'role' ];
123 } elseif ( $this->topologyRole === IDatabase::ROLE_STATIC_CLONE ) {
124 return [
'Server is configured as a read-only static clone database.',
'role' ];
135 $this->trxReplicaLagStatus =
null;
155 return $conn->
trxLevel() ? $this->trxReplicaLagStatus :
null;
Class representing a cache/ephemeral data store.