Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes

AcsLogServiceImpl::LogRecordBatch Class Reference

#include <loggingAcsLogServiceImpl.h>

Collaboration diagram for AcsLogServiceImpl::LogRecordBatch:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LogRecordBatch ()
 ~LogRecordBatch ()
void sendRecords ()
void add (const ::Logging::XmlLogRecordSeq *reclist)
void set_logging_supplier (ACSStructuredPushSupplier *supplier)

Static Public Member Functions

static void * worker (void *)

Private Member Functions

void sendRecords (::Logging::XmlLogRecordSeq *reclist)
int svc ()

Private Attributes

::Logging::XmlLogRecordSeq * buffer_
::Logging::XmlLogRecordSeq buffer [3]
volatile unsigned int size_
ACSStructuredPushSupplierloggingSupplier_
ACE_SYNCH_MUTEX mutex_
ACE_SYNCH_MUTEX batchMutex_
ACE_SYNCH_CONDITION waitCond_
volatile bool shutdown_
int nBuff
::Logging::XmlLogRecordSeq * tmpBuffer
unsigned int tmpSize

Detailed Description

This class implements the functions necessary to send the log records in a batch through the logging Notification Channel. It implements the batch cache as triple buffer to improve the overall throughput of the service.

This class uses a worker thread to dispatch the log records through the Notification Channel when buffer is full or each 1 second


Constructor & Destructor Documentation

AcsLogServiceImpl::LogRecordBatch::LogRecordBatch (  ) 

Initializes the buffers and the worker thread

AcsLogServiceImpl::LogRecordBatch::~LogRecordBatch (  ) 

Stop the worker thread


Member Function Documentation

void AcsLogServiceImpl::LogRecordBatch::add ( const ::Logging::XmlLogRecordSeq *  reclist  ) 

Add log records to the buffer, if the buffer is full will dispatch to the worker thread to send the records through NC

void AcsLogServiceImpl::LogRecordBatch::sendRecords ( ::Logging::XmlLogRecordSeq *  reclist  )  [private]

Send the records through the Notification Channel

void AcsLogServiceImpl::LogRecordBatch::sendRecords (  ) 

Function used by the thread to send the log records to the NC

void AcsLogServiceImpl::LogRecordBatch::set_logging_supplier ( ACSStructuredPushSupplier supplier  ) 
int AcsLogServiceImpl::LogRecordBatch::svc (  )  [private]

Entry point for worker thread

static void* AcsLogServiceImpl::LogRecordBatch::worker ( void *   )  [static]

function to initilizate the thread


Member Data Documentation

mutex used to protect the batch

::Logging::XmlLogRecordSeq AcsLogServiceImpl::LogRecordBatch::buffer[3] [private]

triple buffer

::Logging::XmlLogRecordSeq* AcsLogServiceImpl::LogRecordBatch::buffer_ [private]

reference to the current buffer in use

ACE_SYNCH_MUTEX AcsLogServiceImpl::LogRecordBatch::mutex_ [private]

mutex used by the wait condition

number of the current buffer in use

volatile unsigned int AcsLogServiceImpl::LogRecordBatch::size_ [private]

current size of the batch

::Logging::XmlLogRecordSeq* AcsLogServiceImpl::LogRecordBatch::tmpBuffer [private]

Internal usage

Internal usage

ACE_SYNCH_CONDITION AcsLogServiceImpl::LogRecordBatch::waitCond_ [private]

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