La classe MongoDB\Driver\Server

(mongodb >=1.0.0)

Introduction

Synopsis de la classe

final MongoDB\Driver\Server {
/* Constantes */
const integer TYPE_UNKNOWN = 0 ;
const integer TYPE_STANDALONE = 1 ;
const integer TYPE_MONGOS = 2 ;
const integer TYPE_POSSIBLE_PRIMARY = 3 ;
const integer TYPE_RS_PRIMARY = 4 ;
const integer TYPE_RS_SECONDARY = 5 ;
const integer TYPE_RS_ARBITER = 6 ;
const integer TYPE_RS_OTHER = 7 ;
const integer TYPE_RS_GHOST = 8 ;
/* Méthodes */
final private __construct ( void )
final public executeBulkWrite ( string $namespace , MongoDB\Driver\BulkWrite $bulk [, array $options = array() ] ) : MongoDB\Driver\WriteResult
final public executeCommand ( string $db , MongoDB\Driver\Command $command [, array $options = array() ] ) : MongoDB\Driver\Cursor
final public executeQuery ( string $namespace , MongoDB\Driver\Query $query [, array $options = array() ] ) : MongoDB\Driver\Cursor
final public executeReadCommand ( string $db , MongoDB\Driver\Command $command [, array $options = array() ] ) : MongoDB\Driver\Cursor
final public executeReadWriteCommand ( string $db , MongoDB\Driver\Command $command [, array $options = array() ] ) : MongoDB\Driver\Cursor
final public executeWriteCommand ( string $db , MongoDB\Driver\Command $command [, array $options = array() ] ) : MongoDB\Driver\Cursor
final public getHost ( void ) : string
final public getInfo ( void ) : array
final public getLatency ( void ) : string
final public getPort ( void ) : int
final public getTags ( void ) : array
final public getType ( void ) : int
final public isArbiter ( void ) : bool
final public isHidden ( void ) : bool
final public isPassive ( void ) : bool
final public isPrimary ( void ) : bool
final public isSecondary ( void ) : 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

Jeu de réplicas type de serveur principal possible, retourné par MongoDB\Driver\Server::getType().

Un serveur peut être identifié comme un possibile primaire s'il n'a pas encore été vérifié, mais une autre mémoire du jeu de réplicas pense qu'il est le principal.

MongoDB\Driver\Server::TYPE_RS_PRIMARY

Type de serveur principal du jeu de réplicas, retourné par MongoDB\Driver\Server::getType().

MongoDB\Driver\Server::TYPE_RS_SECONDARY

Réplica de type de serveur secondaire, retourné par MongoDB\Driver\Server::getType().

MongoDB\Driver\Server::TYPE_RS_ARBITER

Type de serveur arbitre de jeu de réplicas, retourné par MongoDB\Driver\Server::getType().

MongoDB\Driver\Server::TYPE_RS_OTHER

Type de serveur autre de jeu de réplicas, 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éplicas.

MongoDB\Driver\Server::TYPE_RS_GHOST

Type de serveur fantôme de jeu de réplicas, 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éplicas non initialisé; ou lorsque le serveur est évité (c'est à dire supprimé de la config du jeu de réplicas). 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éplicas; toutefois, le client peut surveiller ce serveur dans l'espoir qu'il change vers un état plus utile.

Sommaire