📄 app.h
字号:
/******************************************************************* * * * params.h * * * * This file is a part of the eXtremeDB-HA Application Framework * * Copyright (c) 2001-2006 McObject LLC * * All Rights Reserved * * * *******************************************************************/#ifndef _PARAMS_H_ #define _PARAMS_H_#ifdef __cplusplus extern "C" { #endif#define INCLUDE_SOCKETS#include "interface.h"/* * ATTENTION! The definitions of HA endpoints and connection parameters were made separately * for each communication channel. You can find them in .H files included above. *//******************************************************************** HA definitions ********************************************************************//* hint address - you may need to find your own */#define MAP_ADDRESS 0x20000000#define COMMIT_WATCHDOG_TIME 4000 // ms/* size of the asynchronous replication data buffer */#define ASYNC_DATABUF_SIZE 1024*1024/********************************************************************** definitions of database **********************************************************************//* Database size and page size */#ifndef MCO_PLATFORM_X64#define DBSIZE ( 1024 * 1024 * 16 )#define DB_PAGESIZE 100#else#define DBSIZE ( 1024 * 1024 * 32 )#define DB_PAGESIZE 200#endif #define SHM_PAGESIZE 4096/* Initial number of objects /per class */#define S1_RECORDS 100/********************************************************************** definitions of the application **********************************************************************/#define HOST_MAX_NAMELENGTH 64 // max length of host name#define MAX_HA_INSTANCES 4 // max numer of HA instances#define MAX_REPLICAS 10 // max numer of replicas/* define to output a detailed report */#define PRINT_REPORTSint test_ExitCode;#ifndef _WIN32_WCE extern void Printf(char *str,...);#else #define Printf printf#endif#if defined (_VXWORKS) #define LOG_PATH "/tgtsvr/"#elif defined (_WIN32_WCE) #define LOG_PATH ""#else #define LOG_PATH ""#endiftypedef struct ThrParam_{ mco_db_h db; int finished;} ThrParam;/* counters */extern long ev_new_count;extern long ev_update_count;extern long ev_del_count;// REPORT_COUNTER number of transactions in report#define REPORT_COUNTER 1000/** Functions *//**\fn extern void async_events(ha_h ha); Description:\n Creation of asynchron events */extern void async_events(ha_h ha);/**\fn ha_h CreateDatabase( int instance); Description:\n Creation of the new database instance */ha_h CreateDatabase( int instance); /**\fn ha_h ConnectToDatabase( int instance); Description:\n connects to the existing database instance */ha_h ConnectToDatabase( int instance);/**\fn void CloseDatabases(int flag); Description:\n closes all database instances */void CloseDatabases(int flag);/**\fn ha_h CreateHAinstance(int instance); Description:\n creates HA instance */ha_h CreateHAinstance(int instance);/**\fn void InitHAinstance(ha_h ha, int instance); Description:\n initializes HA instance */void InitHAinstance(ha_h ha, int instance);/**\fn void InitHAthreads(ha_h ha); Description:\n creates threads for HA instance */void InitHAthreads(ha_h ha);/**\fn MCO_E_HA_REPLICA_STOP_REASON replication(ha_h ha); Description:\n performs replica's working loop */MCO_E_HA_REPLICA_STOP_REASON replication(ha_h ha);/**\fn void replica(ha_h ha); Description:\n performs replica's working loop */void replica(ha_h ha);/**\fn void master( int flag ); Description:\n performs master's working loop */void master( int flag, ha_h ha );/**\fn void errhandler( int n ); Description:\n error handler procedure */void errhandler( int n );/**\fn void ExitHandler(int flag); Description:\n provides emergency & normal exit from the program */void ExitHandler(int flag);/**\fn uint4 free_mem( mco_db_h db, int verbose); returns amount of database's free memory */uint4 free_mem( mco_db_h db, int verbose);/**\fn void make_strings( void ); Description:\n Makes dynamic text strings for database commit loop */void make_strings( void );/**\fn void replica_cancel(); cancels replica commit loop */void replica_cancel();/**\fn ReplicaReport(); reports replica results */void ReplicaReport();/**\fn void MasterReport(); reports master results */void MasterReport();#ifdef __cplusplus }#endif#endif //_PARAMS_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -