Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

IdxRecordId Class Reference
[LWLogging Service]

#include <IdxRecordId.h>

List of all members.


Detailed Description

The master index controller.

Responsible for controlling access to the file indecies. Each Log instance has two indecies that are referenced to support queries from a LogConsumer. The primary index is the RecId index containing IdxRecord. The second is the Momento.idx that contains the current RecordIdx of the current Log. When the Log is shutdown it will reclaim the information in the Momento to start the Log from where it left off.

The IdxRecordId is also responsible for finding the location of specific LogRecords by time. LogRecords can exist in the Log archives that are written when a Log reaches its maximum size. The primary index is used to locate records by time and record id.

Author:
Author
knoxy
Version:
Revision
1.4
Date:
Date
2004/10/24 01:35:54


Public Member Functions

 IdxRecordId (std::string logname) throw (OrbInit::InitializationError)
virtual ~IdxRecordId ()
IdxRecord get_last_record ()
IdxRecord get_next_record_id (IdxRecord last)
IdxRecord find_by_time (const CosLwLog::LogTime &time)
IdxRecord find_by_recid (const CosLwLog::RecordId &recid)
const bool is_the_future (const CosLwLog::RecordId &recid) const
CosLwLog::RecordId future_id ()


Constructor & Destructor Documentation

IdxRecordId::IdxRecordId std::string  logname  )  throw (OrbInit::InitializationError)
 

ctor

Parameters:
logname - The base name of the log used in the file name
Exceptions:
OrbInit::InitializationError 

virtual IdxRecordId::~IdxRecordId  )  [virtual]
 

dtor

Ensures all files are closed


Member Function Documentation

IdxRecord IdxRecordId::find_by_recid const CosLwLog::RecordId recid  ) 
 

Find the IdxRecord that contains the specified RecordId

Given a RecordId, find the IdxRecord describing the Log that contains the specified RecordId

Parameters:
recid - The Record Id sought
Returns:
IdxRecord of the Log containing the specified Record Id

IdxRecord IdxRecordId::find_by_time const CosLwLog::LogTime time  ) 
 

Find the IdxRecord that contains the specified time

Given a LogTime find the IdxRecord describing the Log that contains the specified time

Parameters:
time - The LogTime sought
Returns:
IdxRecord of the Log containing the specified time

CosLwLog::RecordId IdxRecordId::future_id  ) 
 

Query the next RecordId

Determine the next RecordId. This is an unprotected operation.

Returns:
The next Record Id

IdxRecord IdxRecordId::get_last_record  ) 
 

Obtain the IdxRecord of the last Log

Reads the current Log's IdxRecord from the Momento index

Returns:
The IdxRecord of the current Log, or a IdxRecord initialized to 0 if the Momento index can't be read

IdxRecord IdxRecordId::get_next_record_id IdxRecord  last  ) 
 

Obtain the next valid Record Id

Responsible for determining the next RecordId. Reads the Momento index. If the start_seconds in the parameter last is greater than the start seconds in the Momento Index, an entry is made in the primary index and the Momento index is updated.

Parameters:
last - The last IdxRecord used
Returns:
The updated IdxRecord as it appears in the Momento index
Note:
This operation is mutexed and uses future_id

const bool IdxRecordId::is_the_future const CosLwLog::RecordId recid  )  const
 

Is the given RecordId in the future

Given a RecordId, determine if it exists in the future

Returns:
TRUE if the RecordId exists in the future, FALSE otherwise


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