mongo::Shard Class Reference

#include <shard.h>

List of all members.

Public Member Functions

bool containsNode (const string &node) const
ConnectionString getAddress () const
string getConnString () const
long long getMaxSize () const
string getName () const
ShardStatus getStatus () const
bool isDraining () const
bool ok () const
bool operator!= (const string &s) const
bool operator!= (const Shard &s) const
bool operator< (const Shard &o) const
bool operator== (const string &s) const
bool operator== (const Shard &s) const
void reset (const string &ident)
BSONObj runCommand (const string &db, const BSONObj &cmd) const
BSONObj runCommand (const string &db, const string &simple) const
void setAddress (const ConnectionString &cs)
 Shard (const Shard *other)
 Shard (const Shard &other)
 Shard (const string &ident)
 Shard (const string &name, const string &addr, long long maxSize=0, bool isDraining=false)
 Shard ()
string toString () const

Static Public Member Functions

static void getAllShards (vector< Shard > &all)
static bool isAShardNode (const string &ident)
static Shard make (const string &ident)
static Shard pick (const Shard &current=EMPTY)
static void printShardInfo (ostream &out)
static void reloadShardInfo ()
static void removeShard (const string &name)

Static Public Attributes

static Shard EMPTY

Private Member Functions

void _rsInit ()
void _setAddr (const string &addr)

Private Attributes

string _addr
ConnectionString _cs
bool _isDraining
long long _maxSize
string _name
ReplicaSetMonitorPtr _rs

Friends

ostream & operator<< (ostream &out, const Shard &s)

Detailed Description

Definition at line 34 of file shard.h.


Constructor & Destructor Documentation

mongo::Shard::Shard (  )  [inline]

Definition at line 36 of file shard.h.

mongo::Shard::Shard ( const string &  name,
const string &  addr,
long long  maxSize = 0,
bool  isDraining = false 
) [inline]

Definition at line 40 of file shard.h.

mongo::Shard::Shard ( const string &  ident  )  [inline]

Definition at line 45 of file shard.h.

mongo::Shard::Shard ( const Shard other  )  [inline]

Definition at line 49 of file shard.h.

mongo::Shard::Shard ( const Shard other  )  [inline]

Definition at line 54 of file shard.h.


Member Function Documentation

void mongo::Shard::_rsInit (  )  [private]
void mongo::Shard::_setAddr ( const string &  addr  )  [private]
bool mongo::Shard::containsNode ( const string &  node  )  const

mostly for replica set retursn true if node is the shard of if the replica set contains node

ConnectionString mongo::Shard::getAddress (  )  const [inline]

Definition at line 72 of file shard.h.

static void mongo::Shard::getAllShards ( vector< Shard > &  all  )  [static]
string mongo::Shard::getConnString (  )  const [inline]

Definition at line 79 of file shard.h.

long long mongo::Shard::getMaxSize (  )  const [inline]

Definition at line 84 of file shard.h.

string mongo::Shard::getName (  )  const [inline]

Definition at line 74 of file shard.h.

ShardStatus mongo::Shard::getStatus (  )  const
static bool mongo::Shard::isAShardNode ( const string &  ident  )  [static]
bool mongo::Shard::isDraining (  )  const [inline]

Definition at line 88 of file shard.h.

static Shard mongo::Shard::make ( const string &  ident  )  [inline, static]

Definition at line 59 of file shard.h.

bool mongo::Shard::ok (  )  const [inline]

Definition at line 127 of file shard.h.

bool mongo::Shard::operator!= ( const string &  s  )  const [inline]

Definition at line 119 of file shard.h.

bool mongo::Shard::operator!= ( const Shard s  )  const [inline]

Definition at line 108 of file shard.h.

bool mongo::Shard::operator< ( const Shard o  )  const [inline]

Definition at line 123 of file shard.h.

bool mongo::Shard::operator== ( const string &  s  )  const [inline]

Definition at line 115 of file shard.h.

bool mongo::Shard::operator== ( const Shard s  )  const [inline]

Definition at line 100 of file shard.h.

static Shard mongo::Shard::pick ( const Shard current = EMPTY  )  [static]

current - shard where the chunk/database currently lives in

Returns:
the currently emptiest shard, if best then current, or EMPTY
static void mongo::Shard::printShardInfo ( ostream &  out  )  [static]
static void mongo::Shard::reloadShardInfo (  )  [static]
static void mongo::Shard::removeShard ( const string &  name  )  [static]
void mongo::Shard::reset ( const string &  ident  ) 
Parameters:
ident either name or address
BSONObj mongo::Shard::runCommand ( const string &  db,
const BSONObj cmd 
) const
BSONObj mongo::Shard::runCommand ( const string &  db,
const string &  simple 
) const [inline]

Definition at line 131 of file shard.h.

void mongo::Shard::setAddress ( const ConnectionString cs  ) 
string mongo::Shard::toString (  )  const [inline]

Definition at line 92 of file shard.h.


Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const Shard s 
) [friend]

Definition at line 96 of file shard.h.


Member Data Documentation

string mongo::Shard::_addr [private]

Definition at line 168 of file shard.h.

Definition at line 169 of file shard.h.

bool mongo::Shard::_isDraining [private]

Definition at line 171 of file shard.h.

long long mongo::Shard::_maxSize [private]

Definition at line 170 of file shard.h.

string mongo::Shard::_name [private]

Definition at line 167 of file shard.h.

Definition at line 172 of file shard.h.

Definition at line 160 of file shard.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


mongodb
Author(s): Nate Koenig
autogenerated on Fri Jan 11 12:15:58 2013