La classe MongoDB\Driver\Server

(mongodb >=1.0.0)

Introduction

Synopsis de la classe

final class MongoDB\Driver\Server {
/* Constantes */
const int TYPE_UNKNOWN = 0;
const int TYPE_STANDALONE = 1;
const int TYPE_MONGOS = 2;
const int TYPE_RS_PRIMARY = 4;
const int TYPE_RS_ARBITER = 6;
const int TYPE_RS_OTHER = 7;
const int TYPE_RS_GHOST = 8;
/* Méthodes */
final private function __construct()
final public function executeBulkWrite(string $namespace, MongoDB\Driver\BulkWrite $bulk, ?array $options = null): MongoDB\Driver\WriteResult
final public function executeCommand(string $db, MongoDB\Driver\Command $command, ?array $options = null): MongoDB\Driver\Cursor
final public function executeQuery(string $namespace, MongoDB\Driver\Query $query, ?array $options = null): MongoDB\Driver\Cursor
final public function executeReadCommand(string $db, MongoDB\Driver\Command $command, ?array $options = null): MongoDB\Driver\Cursor
final public function executeReadWriteCommand(string $db, MongoDB\Driver\Command $command, ?array $options = null): MongoDB\Driver\Cursor
final public function executeWriteCommand(string $db, MongoDB\Driver\Command $command, ?array $options = null): MongoDB\Driver\Cursor
final public function getHost(): string
final public function getInfo(): array
final public function getLatency(): ?integer
final public function getPort(): int
final public function getTags(): array
final public function getType(): int
final public function isArbiter(): bool
final public function isHidden(): bool
final public function isPassive(): bool
final public function isPrimary(): bool
final public function isSecondary(): bool
}

Constantes pré-définies

MongoDB\Driver\Server::TYPE_UNKNOWN
Type de serveur inconnu, retourné par MongoDB\Driver\Server::getType().
MongoDB\Driver\Server::TYPE_STANDALONE
Type de serveur autonome, retourné par MongoDB\Driver\Server::getType().
MongoDB\Driver\Server::TYPE_MONGOS
Type de serveur Mongos, retourné par MongoDB\Driver\Server::getType().
MongoDB\Driver\Server::TYPE_POSSIBLE_PRIMARY
Type de serveur primaire possible du jeu de rĂ©plique, retournĂ© par MongoDB\Driver\Server::getType(). Un serveur peut ĂȘtre identifiĂ© comme un possible primaire s'il n'a pas encore Ă©tĂ© vĂ©rifiĂ©, mais un autre membre du jeu de rĂ©plique pense qu'il est le primaire.
MongoDB\Driver\Server::TYPE_RS_PRIMARY
Type de serveur primaire du jeu de réplique, retourné par MongoDB\Driver\Server::getType().
MongoDB\Driver\Server::TYPE_RS_SECONDARY
Type de serveur secondaire du jeu de réplique, retourné par MongoDB\Driver\Server::getType().
MongoDB\Driver\Server::TYPE_RS_ARBITER
Type de serveur arbitre de jeu de réplique, retourné par MongoDB\Driver\Server::getType().
MongoDB\Driver\Server::TYPE_RS_OTHER
Type de serveur autre de jeu de rĂ©plique, retournĂ© par MongoDB\Driver\Server::getType(). Ces serveurs peuvent ĂȘtre masquĂ©s, en cours de dĂ©marrage ou en cours de rĂ©cupĂ©ration. Ils ne peuvent pas ĂȘtre interrogĂ©s, mais leurs listes d'hĂŽtes sont utiles pour dĂ©couvrir la configuration actuelle du jeu de rĂ©plique.
MongoDB\Driver\Server::TYPE_RS_GHOST
Type de serveur fantĂŽme de jeu de rĂ©plique, retournĂ© par MongoDB\Driver\Server::getType(). Les serveurs peuvent ĂȘtre identifiĂ©s comme tels dans au moins trois situations : briĂšvement pendant le dĂ©marrage du serveur ; dans un jeu de rĂ©plique non initialisé ; ou lorsque le serveur est Ă©vitĂ© (c'est-Ă -dire supprimĂ© de la config du jeu de rĂ©plique). Ils ne peuvent pas ĂȘtre interrogĂ©s et leur liste d'hĂŽtes ne peut pas ĂȘtre utilisĂ©e pour dĂ©couvrir la configuration actuelle du jeu de rĂ©plique ; toutefois, le client peut surveiller ce serveur dans l'espoir qu'il change vers un Ă©tat plus utile.
MongoDB\Driver\Server::TYPE_LOAD_BALANCER
Type de serveur de Load balancer, retourné par MongoDB\Driver\Server::getType().

Historique

Version Description
PECL mongodb 1.11.0 Ajout de la constante MongoDB\Driver\Server::TYPE_LOAD_BALANCER.

Sommaire

add a note

User Contributed Notes

There are no user contributed notes for this page.