class CAVERNdb_server_c

CAVERN database server

Public Methods

int init (char *defaultDBName = CAVERNDB_SERVER_DEFAULT_DB_NAME, int incomingPort = CAVERNdb_server_c::DEFAULT_TCP_REFLECTOR_PORT, int maxClients = CAVERNdb_server_c::DEFAULT_MAX_CLIENTS, int udpReflectorPort = CAVERNdb_server_c::DEFAULT_UDP_REFLECTOR_PORT)
Initialize server
int process ()
Handle connections and process incoming requests
void showStats (char* streamInfo, char* comment)
Displays the resultant statistics instantaneously in the netlogger format - this should be typically done after a read/write is done a network
int logStats (char* streamInfo, char* comment, FILE* filePtr)
This logs performance statistics in a file
int sendStats (char* streamInfo, char* comment)
Sends the performance statistics to a remote perfdaemon -for further analysis of the monitored data - the initSendStats API should be called first, before calling a sendStats (In order to connect to the perfdaemon initially)

int initSendStats (char* monitorClientIP, int port = PERF_DAEMON_DEFAULT_PORT)
Initialize sendStats - provide the IP of the perfDaemon and an optional port number to connect to
void exitSendStats ()
Properly delete the perfDaemonClient after sendStats is done

Public


static const int DEFAULT_TCP_REFLECTOR_PORT
Default listening port for the TCP Reflector of the DB Server(for reliable connections)
static const int DEFAULT_UDP_REFLECTOR_PORT
Default listening port for the UDP Reflector of the DB Server
static const int DEFAULT_MAX_CLIENTS
Default maximum number of clients that the server can manage.
static const int OK
Status ok.
static const int FAILED
Status failed.
static const int MEM_ALLOC_ERR
Memory allocation error.
static const int TOO_MANY_CLIENTS
Server cannot manage any more clients.
static const int KEY_DOES_NOT_EXIST
Key does not exist

Documentation

CAVERN database server. This server will listen for incoming connections and field database requests from CAVERNdb_client_c connections. This database is designed mainly to handle small datasets- primarily state information. To retrieve larger datasets consider using the CAVERNnet_remoteFileIO_c calls which are designed to move in excess of 2Gig data files.

int init(char *defaultDBName = CAVERNDB_SERVER_DEFAULT_DB_NAME, int incomingPort = CAVERNdb_server_c::DEFAULT_TCP_REFLECTOR_PORT, int maxClients = CAVERNdb_server_c::DEFAULT_MAX_CLIENTS, int udpReflectorPort = CAVERNdb_server_c::DEFAULT_UDP_REFLECTOR_PORT)
Initialize server
Returns:
MEM_ALLOC_ERR, FAILED or OK.
Parameters:
defaultDBName - database directory name. Default name is CAVERNdbserver.
incomingPort - db server's (tcp reflector's) listening port. Default port 9500.
maxClients - maximum number of clients that may connect to the server. Default is 64 clients.
udpReflectorPort - udp reflector listening port. Default port is 9550

int process()
Handle connections and process incoming requests. Do this in a while loop as frequently as possible to ensure that requests are processed rapidly.
Returns:
OK, FAILED, TOO_MANY_CLIENTS

void showStats(char* streamInfo, char* comment)
Displays the resultant statistics instantaneously in the netlogger format - this should be typically done after a read/write is done a network.

Also, it should be noted that a showStats call should be made at the end of atleast one send and receive for two-way information (the same applies for logStats and sendStats)

Parameters:
streamInfo - A label describing the stream that is being monitored.
comment - A comment on the event that marks the time at which the stream is being monitored

int logStats(char* streamInfo, char* comment, FILE* filePtr)
This logs performance statistics in a file. The user opens a file and passes the file pointer with this function and results of monitoring are written into the logfile.

Returns:
Either CAVERNnet_perfMonitor_c::OK or CAVERNnet_perfMonitor_c::FAILED
Parameters:
streamInfo - A label describing the stream that is being monitored.
comment - A comment on the event that marks the time at which the stream is being monitored
filePtr - File pointer to the file in which the results of monitoring are to be stored

int sendStats(char* streamInfo, char* comment)
Sends the performance statistics to a remote perfdaemon -for further analysis of the monitored data - the initSendStats API should be called first, before calling a sendStats (In order to connect to the perfdaemon initially)

Returns:
Either CAVERNnet_perfMonitor_c::OK or CAVERNnet_perfMonitor_c::FAILED
Parameters:
streamInfo - A label describing the stream that is being monitored.
comment - A comment on the event that marks the time at which the stream is being monitored

int initSendStats(char* monitorClientIP, int port = PERF_DAEMON_DEFAULT_PORT)
Initialize sendStats - provide the IP of the perfDaemon and an optional port number to connect to. This should be done initially before using the sendStats API.

Returns:
Either CAVERNnet_perfMonitor_c::OK or CAVERNnet_perfMonitor_c::FAILED
Parameters:
monitorClientIP - IP address of the perfDameon to connect to
port - Port number at which the perfDaemon is running -this is optional. The default port number for perfDaemon is 9500 -so a different port number has to be specified if the perfDaemon is running on a different port.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de