Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

CdbBdbSPartitionP Class Reference

Persistent partition class. More...

Inheritance diagram for CdbBdbSPartitionP:

CdbBdbSPartitionBaseP CdbBdbSCollectionElementP BdbPersObj List of all members.

Public Member Functions

 CdbBdbSPartitionP (d_UShort theId, const char *theDescription, const BdbTime &theCreationTime, const CdbBdbSCell &theCell, d_UShort theOriginId, const BdbRef(CdbBdbSPartitionListenerP)&theListenerRef)
 Normal constructor.

virtual ~CdbBdbSPartitionP ()
 Destructor.

d_UShort originId () const
 Get the owner of the partition.

bool isInstantiated () const
 Get the current status of the partition.

BdbTime modified () const
 Get the partition modification time.

CdbStatus update (const BdbTime &theModificationTime)
 Update the partition modification time.

CdbStatus close (const BdbTime &theTime)
 Close the partition at specified point of the INSERTION timeline.

CdbStatus instantiate (bool reinstantiateFlag=false)
 Instantiate supporting data structures.

d_UShort numIncrements () const
 Get the total number of "increments".

CdbStatus increment (d_UShort theNumber, CdbBdbSIncrement &theIncrement) const
 Get the specified "increment".

CdbStatus createIncrement (const BdbTime &theSplitTime)
 Create new "increment".

virtual void dump (std::ostream &o) const
 Dump the contents of the object.


Detailed Description

Persistent partition class.

This is an actual implementation of the partition class to be stored in the corresponding persistent "PartitionLayout" collection.

Definition at line 16 of file CdbBdbSPartitionP.ddl.


Constructor & Destructor Documentation

CdbBdbSPartitionP::CdbBdbSPartitionP d_UShort    theId,
const char *    theDescription,
const BdbTime   theCreationTime,
const CdbBdbSCell   theCell,
d_UShort    theOriginId,
const BdbRef(CdbBdbSPartitionListenerP)&    theListenerRef
 

Normal constructor.

The partition listener reference is an optional parameter, which is only passed when there is a listener.

Parameters:
theId  the identifier of the partition
theDescription  the description of the partition
theCreationTime  the time when the partition is supposed to be created
theCell  the cell (area) occupied by the partition in 2-dimension space
theOriginId  the owner of this partition
theListenerRef  this optional listener will be informed about any changes at partition's state

Definition at line 26 of file CdbBdbSPartitionP.cc.

CdbBdbSPartitionP::~CdbBdbSPartitionP   [virtual]
 

Destructor.

Definition at line 42 of file CdbBdbSPartitionP.cc.


Member Function Documentation

CdbStatus CdbBdbSPartitionP::close const BdbTime   theTime
 

Close the partition at specified point of the INSERTION timeline.

The specified time must be strictly greater than the "bottom" insertion time of the partition. It's also required that partition be instantiated before closing it.

See also:
CdbBdbSPartitionP::isInstantiated()

Definition at line 360 of file CdbBdbSPartitionP.cc.

References BdbRef(), CdbBdbSPartitionBaseP::closeCell(), CdbStatus::Error, CdbBdbSRegistryP::findMaster(), CdbBdbSUtils::findMetaData(), BdbTime::getGmtNsec(), BdbTime::getGmtSec(), CdbBdbSUtils::getLocalDbIdRange(), CdbBdbSCollectionElementP::id(), CdbBdbSPartitionBaseP::isClosed(), isInstantiated(), CdbItr< T >::next(), CdbItr< d_UShort >::next(), CdbBdbSIncrementCollection::numIncrements(), CdbStatus::Success, CdbItr< T >::value(), CdbItr< d_UShort >::value(), and CdbStatus::Warning.

CdbStatus CdbBdbSPartitionP::createIncrement const BdbTime   theSplitTime
 

Create new "increment".

The method if successfull will increase the number of increments by one.

Parameters:
theSplitTime  the split time for a new incrementhe increment

Definition at line 555 of file CdbBdbSPartitionP.cc.

References BdbRef(), CdbBdbSIncrementCollection::createIncrement(), CdbStatus::Error, CdbBdbSRegistryP::findMaster(), CdbBdbSUtils::findMetaData(), BdbTime::getGmtNsec(), BdbTime::getGmtSec(), CdbBdbSUtils::getLocalDbIdRange(), CdbBdbSCollectionElementP::id(), CdbBdbSPartitionBaseP::isClosed(), isInstantiated(), CdbItr< T >::next(), CdbItr< d_UShort >::next(), CdbBdbSIncrementCollection::numIncrements(), CdbStatus::Success, CdbItr< T >::value(), and CdbItr< d_UShort >::value().

void CdbBdbSPartitionP::dump std::ostream &    o const [virtual]
 

Dump the contents of the object.

Reimplemented from CdbBdbSPartitionBaseP.

Definition at line 830 of file CdbBdbSPartitionP.cc.

References CdbBdbSIncrement::dump(), CdbBdbSPartitionBaseP::dump(), increment(), and numIncrements().

CdbStatus CdbBdbSPartitionP::increment d_UShort    theNumber,
CdbBdbSIncrement   theIncrement
const
 

Get the specified "increment".

The method will return CdbStatus::NotFound if the index is not in a valid range.

Parameters:
theNumber  the number of the increment in question
theIncrement  the value of the increment to be set up

Definition at line 547 of file CdbBdbSPartitionP.cc.

References CdbBdbSIncrementCollection::increment().

Referenced by dump().

CdbStatus CdbBdbSPartitionP::instantiate bool    reinstantiateFlag = false
 

Instantiate supporting data structures.

This method will only be able to do its job at the target database (the one (where the partition belongs to).

An optional "reinstantiateFlag" is only meant to be used in special cases to reset existing conditions for an existing and "open" partition as if this partition were being created from a scratch. The flag has no effect for non-existing partitions.

See also:
CdbBdbSPartitionP::isInstantiated()

Definition at line 108 of file CdbBdbSPartitionP.cc.

References BdbRef(), CdbBdbSCell::beginInsertion, CdbBdbSCell::beginValidity, CdbBdbSPartitionBaseP::cell(), CdbBdbSCell::endValidity, CdbStatus::Error, CdbBdbSRegistryP::findMaster(), CdbBdbSUtils::getLocalDbIdRange(), CdbBdbSCollectionElementP::id(), CdbBdbSPartitionBaseP::isClosed(), isInstantiated(), CdbItr< T >::next(), CdbItr< d_UShort >::next(), numIncrements(), CdbStatus::Success, CdbItr< T >::value(), CdbItr< d_UShort >::value(), and CdbStatus::Warning.

bool CdbBdbSPartitionP::isInstantiated   const
 

Get the current status of the partition.

One the partition gets created the corresponding database files and containers meant to store the actual condition objects and metadata are not created. In other words, the partition gets into "non-instantiated" state immediatelly upon its creation. At this point the partition is not usable for storinig new condition objects into it or fetching them from it. To get into "instantiated" state a separate method should be called.

The main reason to separate partition creation from its instantiation is that partition always get created at the MASTER database, but some of these partitions may be defined to belong to some SLAVE database. Therefore, the data structures supporting member conditions have to be created at the SLAVE rather than at the MASTER.

See also:
CdbBdbSPartitionP::instantiate()

Definition at line 52 of file CdbBdbSPartitionP.cc.

Referenced by close(), createIncrement(), and instantiate().

BdbTime CdbBdbSPartitionP::modified   const
 

Get the partition modification time.

Partition modification (INSERTION) time is meant to indicate when was the last time when any member condition of this partition was most recently updated.

Definition at line 58 of file CdbBdbSPartitionP.cc.

d_UShort CdbBdbSPartitionP::numIncrements   const
 

Get the total number of "increments".

Definition at line 541 of file CdbBdbSPartitionP.cc.

References CdbBdbSIncrementCollection::numIncrements().

Referenced by dump(), and instantiate().

d_UShort CdbBdbSPartitionP::originId   const
 

Get the owner of the partition.

Definition at line 46 of file CdbBdbSPartitionP.cc.

CdbStatus CdbBdbSPartitionP::update const BdbTime   theModificationTime
 

Update the partition modification time.

The current modification specified time must be the same or bigger (newer) than the one stored by the partition.

Definition at line 64 of file CdbBdbSPartitionP.cc.

References CdbStatus::Error, CdbBdbSPartitionBaseP::isClosed(), BdbTime::minusInfinity, BdbTime::plusInfinity, and CdbStatus::Success.


The documentation for this class was generated from the following files:
Generated on Mon Dec 5 18:22:19 2005 for CDB by doxygen1.3-rc3