/* * Internal method that does the real work */ void EventLogger::SendEvent(WORD category, DWORD eventId, LPCTSTR text) { EventSourceHolder eventSource(serviceName.c_str()); if (eventSource.get() != NULL) { LPCTSTR lpszStrings[2]; lpszStrings[0] = serviceName.c_str(); lpszStrings[1] = text; ReportEvent( eventSource.get(), category, 0, eventId, NULL, 2, 0, lpszStrings, NULL); } }
/*! @brief Constructor of CheckpointService */ CheckpointService::CheckpointService(const ConfigTable &config, EventEngine::Config eeConfig, EventEngine::Source source, const char8_t *name, ServiceThreadErrorHandler &serviceThreadErrorHandler) : serviceThreadErrorHandler_(serviceThreadErrorHandler), ee_(createEEConfig(config, eeConfig), source, name), clusterService_(NULL), clsEE_(NULL), transactionService_(NULL), transactionManager_(NULL), txnEE_(NULL), systemService_(NULL), logManager_(NULL), dataStore_(NULL), chunkManager_(NULL), partitionTable_(NULL), initailized_(false), fixedSizeAlloc_(NULL), requestedShutdownCheckpoint_(false), pgConfig_(config), cpInterval_(config.get<int32_t>( CONFIG_TABLE_CP_CHECKPOINT_INTERVAL)), logWriteMode_(config.get<int32_t>( CONFIG_TABLE_DS_LOG_WRITE_MODE)), chunkCopyIntervalMillis_(config.get<int32_t>( CONFIG_TABLE_CP_CHECKPOINT_COPY_INTERVAL)), delaySleepTime_(CP_SYNC_DELAY_INTERVAL), currentCpGrpId_(UINT32_MAX), currentCpPId_(UNDEF_PARTITIONID), parallelCheckpoint_(config.get<bool>( CONFIG_TABLE_CP_USE_PARALLEL_MODE)), errorOccured_(false), enableLsnInfoFile_(true), lastMode_(CP_UNDEF) { statUpdator_.service_ = this; try { Event::Source eventSource(source); ee_.setHandler(CP_REQUEST_CHECKPOINT, checkpointServiceMainHandler_); ee_.setHandler( CP_REQUEST_GROUP_CHECKPOINT, checkpointServiceGroupHandler_); ee_.setHandler(CP_TIMER_LOG_FLUSH, flushLogPeriodicallyHandler_); ee_.setThreadErrorHandler(serviceThreadErrorHandler_); groupCheckpointStatus_.resize( config.getUInt32(CONFIG_TABLE_DS_CONCURRENCY)); lsnInfo_.setConfigValue(this, config.getUInt32(CONFIG_TABLE_DS_PARTITION_NUM), config.getUInt32(CONFIG_TABLE_DS_CONCURRENCY), config.get<const char8_t *>(CONFIG_TABLE_DS_DB_PATH)); lastArchivedCpIdList_.assign(pgConfig_.getPartitionGroupCount(), 0); currentCheckpointIdList_.assign(pgConfig_.getPartitionCount(), 0); } catch (std::exception &e) { GS_RETHROW_SYSTEM_ERROR( e, "Initialize failed. (reason=" << GS_EXCEPTION_MESSAGE(e) << ")"); } }