Logo Search packages:      
Sourcecode: maxdb-7.5.00 version File versions

Log_Writer Class Reference

#include <Log_Writer.hpp>

List of all members.


Detailed Description

Log writer manager class.

Log_Writer retrieves filled log pages from log queues and writes them out to the archive log devices. Log_Writer asks Log_Queue for filled log pages to be written out to log device.

Definition at line 65 of file Log_Writer.hpp.


Public Types

typedef Container_CircularList
< Log_Queue * > 
QueueRing
 ring of log queues

Public Member Functions

bool AddLogFillingEvent (const SAPDB_Int threshold, const tsp31_event_prio_Param priority)
 adds a new event for the log usage
Log_DeviceBlockCount CalculateReservedPages (SAPDB_UInt numPagesInQueues)
 returns the number of pages reserved for special purposes
void CheckForLogSaveAndSavepoint (tgg00_TransContext &trans)
 Triggers the log save component if enough pages for log save available. This is called by the TimeOut task.
void Delete ()
 Deletes writer structures.
bool DelLogFillingEvent (const SAPDB_Int threshold)
 deletes a event for the log usage
Log_IOSequenceNo GetIOSequenceNo () const
 Returns the current i/o sequence number used by the writer.
void GetLogFillingEvents (tsp31_short_event_desc &events)
 get defined events for log usage
const Log_RawDeviceIteratorGetPosition () const
 Returns the current write position as an iterator.
Log_RawDeviceOffset GetWriteOffset () const
 Returns the current write offset on the raw device This is the position where the next log page will be written.
SAPDB_Bool Initialize (Log_IOSequenceNo writerioseqno, Log_RawDeviceIterator writeiter, Log_Volume *archivelog, Log_InfoPage infopage, Log_RawDeviceOffset infopageoffs, SAPDB_UInt pagevecsize)
 Initializes writer structures.
 Log_Writer (SAPDBMem_IRawAllocator &alloc, QueueRing &logqueues, IOMan_ILogIO &pagewriter, Log_WriterTaskSynchronizer &writersync)
 Constructor.
bool LogIsFull () const
 returns true if no user can write more redo log
bool PagesAreFreeForWrite () const
void ResumeByUser ()
 The logwriter is resumed after suspended by SuspendAndGetLastWrittenIOSequence.
void Run ()
 Starts the log writer.
void SetDeviceEnd (Log_RawDeviceOffset offset)
 Sets log device end offset.
void SetState (tsp00_TaskId taskid, Log_IOSequenceNo writerioseqno, Log_RawDeviceOffset writeoffset, Log_RawDeviceOffset endoffset)
 Updates writer state.
void SetWritePositionAndIOSeq (Log_IOSequenceNo newIOSequence, Log_RawDeviceIterator newWritePosition)
 This must be used, if a log-recovery is started from init-config and not with a data-recovery.
void Stop ()
 Stops the log writer.
bool SuspendAndGetLastWrittenIOSequence (tsp00_TaskId taskid, Log_IOSequenceNo &iosequence)
 The logwriter is suspended until Resume() is called. The returned iosequence is the last used iosequence.
Log_DeviceBlockCount UsedPages () const
 Returns the number of pages which are needed for backup or restart.
Log_DeviceBlockCount UserLogSize () const
 Returns the number of pages which can be used for writing.

Private Types

typedef QueueRing::Iterator QueueIterator
 iterates from queue to queue
typedef Container_Vector
< QueueRequest
QueueRequests
 requests of several queues

Private Member Functions

void EnableAddedLogDevice ()
 The added device can now be accessed by the writer.
bool EnableAddedLogDeviceIsPossible () const
 Checks if the old cycle is still needed (by backup).
bool EnoughPagesFreeForUserTaskWrite (const Log_DeviceBlockCount pagesFreeOnDevice) const
 Checks if pagesFreeOnDevice are enough pages for allowing user-tasks the writing onto the log.
void FlushPages (IOMan_LogPages &pages)
 The pages are written with the iomanager to the log devspace.
Log_DeviceBlockCount FreePagesForLogWriter () const
 This returns the pagecount which can be used by the logwriter in online mode.
Log_RawDeviceOffset GetOldestRequiredOffset () const
 Returns the oldest offset on the log device that may not be overwritten by the log writer.
void PrepareAndFlushPageVector (SAPDB_Bool replacelastpage, Log_RawDeviceIterator &firstWrittenPosition)
 All pages get there writer iosequence and a timestamp A consistency check is done.
void SetLogFullQueueState (tsp00_TaskId taskId, bool allowOnlySavepointCommit)
 Sets the state of the Queue to LogFull, which causes user tasks to be suspended.
void WaitForUserResume ()
 If m_SuspendedByUser is true this method lets wait until m_SuspendedByUser is false.

Private Attributes

SAPDB_Bool m_Active
 indicates whether writer is active
SAPDB_Bool m_Allocated
 indicates whether writer structures have been allocated
Log_Volumem_ArchiveLog
 the arhive log handler for this writer.
SAPDB_UInt m_CheckOffsetCount
 for checking queue-pages before writing in quick kernel
Log_IOSequenceNo m_CheckQSequence
 for checking queue-pages before writing in quick kernel
Log_IOSequenceNo m_CheckWSequence
 for checking queue-pages before writing in quick kernel
SAPDB_UInt m_FrameCounter
 counts frames that have been flushed since info page was flushed
Log_IOSequenceNo m_IOSequenceNo
SAPDB_Int m_LastSavepointTriggerTime
 holds the last time a savepoint was triggered
Log_InfoPage m_LogInfoPage
 log infopage handler
Log_RawDeviceOffset m_LogInfoPageOffset
 offset of log info page on raw device
QueueRingm_LogQueues
 description: circular list of log queues that serve this writer
Kernel_EventSet m_LogUsageEvents
 event handler for log volume filling
Log_RawDeviceOffset m_NewDeviceEndOffset
 contains new device offset (if add log devspace has occurred)
Log_DeviceBlockCount m_PagesFreeOnDevice
Log_DeviceBlockCount m_PagesNotAvailableForUsers
 number of logpages reserved totally for special purposes
IOMan_ILogIOm_PageWriter
 writes log pages to raw log device
QueueRequests m_QueueRequests
 queues and pagecounts per queue
IOMan_LogPages m_RequestPages
 collection of page frames used for write i/o requests
IOMan_LogPages m_RequestPagesHelper
 another collection of page frames (required for split i/o)
bool m_SuspendedByUser
tsp00_TaskId m_UserWaitingForSuspend
Log_RawDeviceIterator m_WriteIterator
 iterator at actual write offset on raw device
Log_WriterTaskSynchronizerm_WriterTaskSync
 log writer task synchronization object

Classes

struct  QueueRequest
 one request of one queue: queueptr, pagecount, pages More...

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

Generated by  Doxygen 1.6.0   Back to index