value) for all such constants * @since 1.31 */ public function getServerAttributes( $i ); /** * Get the current primary replication position * * @return DBPrimaryPos|false Returns false if not applicable * @throws DBError * @since 1.37 */ public function getPrimaryPos(); /** * Whether there are pending changes or callbacks in a transaction by this thread * @return bool * @since 1.37 */ public function hasPrimaryChanges(); /** * Determine whether an explicit transaction is active on any open primary * connection. * @return bool * @since 1.39 */ public function explicitTrxActive(); /** * Check if this load balancer object had any recent or still * pending writes issued against it by this PHP thread * * @param float|null $age How many seconds ago is "recent" [defaults to mWaitTimeout] * @return bool * @since 1.37 */ public function hasOrMadeRecentPrimaryChanges( $age = null ); /** * @note This method may trigger a DB connection if not yet done * @return string|false Reason the primary is read-only or false if it is not */ public function getReadOnlyReason(); /** * @return bool */ public function pingAll(); /** * Get the name and lag time of the most-lagged replica server * * This is useful for maintenance scripts that need to throttle their updates. * May attempt to open connections to replica DBs on the default DB. If there is * no lag, the maximum lag will be reported as -1. * * @return array{0:string,1:float|int|false,2:int} (host, max lag, index of max lagged host) */ public function getMaxLag(); /** * Get an estimate of replication lag (in seconds) for each server * * Results are cached for a short time in memcached/process cache * * Values may be "false" if replication is too broken to estimate * * @return float[]|int[]|false[] Map of (server index => lag) in order of server index */ public function getLagTimes(); /** * Wait for a replica DB to reach a specified primary position * * If $conn is not a replica server connection, then this will return true. * Otherwise, if $pos is not provided, this will connect to the primary server * to get an accurate position. * * @param IDatabase $conn Replica DB * @return bool Success * @since 1.37 */ public function waitForPrimaryPos( IDatabase $conn ); /** * Set a callback via IDatabase::setTransactionListener() on * all current and future primary connections of this load balancer * * @param string $name Callback name * @param callable|null $callback */ public function setTransactionListener( $name, ?callable $callback = null ); /** * Make certain table names use their own database, schema, and table prefix * when passed into SQL queries pre-escaped and without a qualified database name * * For example, "user" can be converted to "myschema.mydbname.user" for convenience. * Appearances like `user`, somedb.user, somedb.someschema.user will used literally. * * Calling this twice will completely clear any old table aliases. Also, note that * callers are responsible for making sure the schemas and databases actually exist. * * @param array[] $aliases Map of (table => (dbname, schema, prefix) map) */ public function setTableAliases( array $aliases ); /** * Convert certain database domains to alternative ones. * * This can be used for backwards compatibility logic. * * @param DatabaseDomain[]|string[] $aliases Map of (domain alias => domain) * @since 1.35 */ public function setDomainAliases( array $aliases ); }