SequoiaDB
 All Classes Functions
Public Member Functions | List of all members
pysequoiadb.replicanode.replicanode Class Reference
Inheritance diagram for pysequoiadb.replicanode.replicanode:

Public Member Functions

def __init__
 
def __del__
 
def __repr__
 
def connect
 
def get_status
 
def get_hostname
 
def get_servicename
 
def get_nodename
 
def stop
 
def start
 

Detailed Description

Replica Node of SequoiaDB

All operation need deal with the error code returned first, if it has.
Every error code is not SDB_OK(or 0), it means something error has appeared,
and user should deal with it according the meaning of error code printed.

@version: execute to get version
          >>> import pysequoiadb
          >>> print pysequoiadb.get_version()

@notice : The dict of built-in Python is hashed and non-ordered. so the
          element in dict may not the order we make it. we make a dict and
          print it like this:
          ...
          >>> a = {"avg_age":24, "major":"computer science"}
          >>> a
          >>> {'major': 'computer science', 'avg_age': 24}
          ...
          the elements order it is not we make it!!
          therefore, we use bson.SON to make the order-sensitive dict if the
          order is important such as operations in "$sort", "$group",
          "split_by_condition", "aggregate","create_collection"...
          In every scene which the order is important, please make it using
          bson.SON and list. It is a subclass of built-in dict
          and order-sensitive

Constructor & Destructor Documentation

def pysequoiadb.replicanode.replicanode.__init__ (   self,
  client 
)
constructor of replica node

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.replicanode.replicanode.__del__ (   self)
release replica node

Exceptions:
   pysequoiadb.error.SDBBaseError

Member Function Documentation

def pysequoiadb.replicanode.replicanode.connect (   self)
Connect to the current node.

Return values:
   client of current node
Exceptions:
   pysequoiadb.error.SDBBaseError
Deprecated:
   This function is deprecated
def pysequoiadb.replicanode.replicanode.get_hostname (   self)
Get host name of the current node.

Return values:
   the name of host
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.replicanode.replicanode.get_nodename (   self)
Get node name of the current node.

Return values:
   the name of node
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.replicanode.replicanode.get_servicename (   self)
Get service name of the current node.

Return values:
   the name of service
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.replicanode.replicanode.get_status (   self)
Get status of the current node

Return values:
   the status of node
Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.replicanode.replicanode.start (   self)
Start the node.

Exceptions:
   pysequoiadb.error.SDBBaseError
def pysequoiadb.replicanode.replicanode.stop (   self)
Stop the node.

Exceptions:
   pysequoiadb.error.SDBBaseError

The documentation for this class was generated from the following file: