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

CdbBdbSPartitionsLayoutP Class Reference

A colllection ("Layout") of persistent partitions. More...

Inheritance diagram for CdbBdbSPartitionsLayoutP:

CdbBdbSPartitionListenerP BdbPersObj List of all members.

Public Member Functions

 CdbBdbSPartitionsLayoutP ()
 Default constructor.

virtual ~CdbBdbSPartitionsLayoutP ()
 Destructor.

d_ULong numPartitions () const
 Get the number of partitions in the layout.

CdbStatus insert (const BdbRef(CdbBdbSPartitionBaseP)&theRef)
 Insert a new partition.

CdbStatus update (const BdbRef(CdbBdbSPartitionBaseP)&theNewRef)
 Update P-Layout using specified partition.

CdbStatus find (d_UShort theId, BdbRef(CdbBdbSPartitionBaseP)&theRef) const
 Find a partition object by its identifier.

CdbStatus find (const BdbTime &theValidityTime, const BdbTime &theInsertionTime, BdbRef(CdbBdbSPartitionBaseP)&theRef) const
 Find a partition at a given point of the 2-dimension space.

CdbStatus find (const BdbTime &theValidityTime, BdbRef(CdbBdbSPartitionBaseP)&theRef) const
 Find an "open" partition at a given point of the VALIDITY dimension.

CdbStatus topmost (const BdbTime &theValidityTime, BdbRef(CdbBdbSPartitionBaseP)&theRef) const
 Find "topmost" partition at a given point of the VALIDITY dimension.

CdbStatus next (const BdbTime &theValidityTime, BdbRef(CdbBdbSPartitionBaseP)&theRef) const
 Find "next" partition at a given point of the VALIDITY dimension.

virtual CdbStatus close (d_UShort theId)
 Close a partition.

CdbItr< d_UShort > iterator () const
 Get an instance of an iterator for identifiers of known partitions.

CdbItr< CdbBdbSPartitionIntervaliterator (const BdbTime &theInsertionTime, const BdbTime &theBeginValidityTime=BdbTime::minusInfinity, const BdbTime &theEndValidityTime=BdbTime::plusInfinity) const
 Iterator of partition intervals.

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


Detailed Description

A colllection ("Layout") of persistent partitions.

This is not just a collection - this is 2-D "Layout" of partitions in the "validity" and "insertion" time dimensions.

Definition at line 120 of file CdbBdbSPartitionsLayoutP.ddl.


Constructor & Destructor Documentation

CdbBdbSPartitionsLayoutP::CdbBdbSPartitionsLayoutP  
 

Default constructor.

Initializes empty collection.

Definition at line 488 of file CdbBdbSPartitionsLayoutP.cc.

CdbBdbSPartitionsLayoutP::~CdbBdbSPartitionsLayoutP   [virtual]
 

Destructor.

Definition at line 515 of file CdbBdbSPartitionsLayoutP.cc.


Member Function Documentation

CdbStatus CdbBdbSPartitionsLayoutP::close d_UShort    theId [virtual]
 

Close a partition.

Implements a method defined in a base class.

See also:
CdbBdbSPartitionListenerP::close()
Parameters:
theId  the partition's identifier

Implements CdbBdbSPartitionListenerP.

Definition at line 947 of file CdbBdbSPartitionsLayoutP.cc.

References BdbRef(), CdbStatus::Error, find(), CdbBdbSPartitionCell::id, and CdbStatus::Success.

void CdbBdbSPartitionsLayoutP::dump std::ostream &    o const
 

Dump the contents of the layout.

Definition at line 1083 of file CdbBdbSPartitionsLayoutP.cc.

CdbStatus CdbBdbSPartitionsLayoutP::find const BdbTime   theValidityTime,
BdbRef(CdbBdbSPartitionBaseP)&    theRef
const
 

Find an "open" partition at a given point of the VALIDITY dimension.

NOTE: The "open" partition is the one whose topmost insertion time is +Infinity. The "open" partitions can be used to insert new data into them.

The method will return CdbStatus::NotFound if the partition was not found in the layout. Other possible completion statuses are as usual.

Parameters:
theValidityTime  the validity time of the point
theRef  the reference to be initialized upon successfull completion

Definition at line 806 of file CdbBdbSPartitionsLayoutP.cc.

References CdbBdbSPartitionCell::cell, CdbBdbSCell::endInsertion, CdbBdbSCell::inValidityRange(), CdbStatus::NotFound, BdbTime::plusInfinity, and CdbStatus::Success.

CdbStatus CdbBdbSPartitionsLayoutP::find const BdbTime   theValidityTime,
const BdbTime   theInsertionTime,
BdbRef(CdbBdbSPartitionBaseP)&    theRef
const
 

Find a partition at a given point of the 2-dimension space.

The method will return CdbStatus::NotFound if the partition was not found in the layout. Other possible completion statuses are as usual.

Parameters:
theValidityTime  the validity time of the point
theInsertionTime  the insertion time of the point
theRef  the reference to be initialized upon successfull completion

Definition at line 779 of file CdbBdbSPartitionsLayoutP.cc.

References CdbBdbSPartitionCell::cell, CdbBdbSCell::in(), CdbStatus::NotFound, and CdbStatus::Success.

CdbStatus CdbBdbSPartitionsLayoutP::find d_UShort    theId,
BdbRef(CdbBdbSPartitionBaseP)&    theRef
const
 

Find a partition object by its identifier.

The method will return CdbStatus::NotFound if the partition was not found in the layout. Other possible completion statuses are as usual.

Parameters:
theId  the object's identifier
theRef  the reference to be initialized upon successfull completion

Definition at line 771 of file CdbBdbSPartitionsLayoutP.cc.

Referenced by close().

CdbStatus CdbBdbSPartitionsLayoutP::insert const BdbRef(CdbBdbSPartitionBaseP)&    theRef
 

Insert a new partition.

This method will check the internal integrity of the passed object and will also look for a potential conflicts between the new partition and existing collection of ones.

Definition at line 552 of file CdbBdbSPartitionsLayoutP.cc.

References BdbRef(), CdbBdbSPartitionCell::cell, CdbBdbSPartitionBaseP::cell(), CdbStatus::Error, CdbBdbSCollectionElementP::id(), CdbBdbSCell::overlap(), and CdbStatus::Success.

CdbItr< CdbBdbSPartitionInterval > CdbBdbSPartitionsLayoutP::iterator const BdbTime   theInsertionTime,
const BdbTime   theBeginValidityTime = BdbTime::minusInfinity,
const BdbTime   theEndValidityTime = BdbTime::plusInfinity
const
 

Iterator of partition intervals.

The iterator will include intervals describing partitions satisfying both of the following criterias:

  • a partition should begin stricly earlier than specified insertion time
  • a partition should have non-zero cross-section with specified validity interval.
Parameters:
theInsertionTime  the insertion time of the projection
theBeginValidityTime  begin time of the validity window
theEndValidityTime  end time of the validity window

Definition at line 1014 of file CdbBdbSPartitionsLayoutP.cc.

References CdbBdbSPartitionCell::cell, CdbEnvironment::getDebugMode(), and CdbBdbSCell::overlap().

CdbItr< d_UShort > CdbBdbSPartitionsLayoutP::iterator   const
 

Get an instance of an iterator for identifiers of known partitions.

This kind of iterator provides "non-sorted" access to the keys.

Definition at line 1008 of file CdbBdbSPartitionsLayoutP.cc.

CdbStatus CdbBdbSPartitionsLayoutP::next const BdbTime   theValidityTime,
BdbRef(CdbBdbSPartitionBaseP)&    theRef
const
 

Find "next" partition at a given point of the VALIDITY dimension.

NOTE: The "next" partition is the one that is right below the one whose reference is passed as a procedure parameter.

IMPORTANT: The procedure uses the value of the passed reference to find the 'next' partition rather than its actual identifier.

The method will return CdbStatus::NotFound if the partition was not found in the layout. Other possible completion statuses are as usual.

Parameters:
theValidityTime  the validity time of the point
theRef  the reference to be initialized upon successfull completion

Definition at line 880 of file CdbBdbSPartitionsLayoutP.cc.

References CdbBdbSPartitionCell::cell, CdbBdbSCell::inValidityRange(), CdbStatus::NotFound, and CdbStatus::Success.

d_ULong CdbBdbSPartitionsLayoutP::numPartitions   const
 

Get the number of partitions in the layout.

Definition at line 546 of file CdbBdbSPartitionsLayoutP.cc.

CdbStatus CdbBdbSPartitionsLayoutP::topmost const BdbTime   theValidityTime,
BdbRef(CdbBdbSPartitionBaseP)&    theRef
const
 

Find "topmost" partition at a given point of the VALIDITY dimension.

NOTE: The "topmost" partition is the one that does not have any other partitions above it. A "topmost" partition is not necessarilly the "open" one.

The method will return CdbStatus::NotFound if the partition was not found in the layout. Other possible completion statuses are as usual.

Parameters:
theValidityTime  the validity time of the point
theRef  the reference to be initialized upon successfull completion

Definition at line 843 of file CdbBdbSPartitionsLayoutP.cc.

References CdbBdbSPartitionCell::cell, CdbBdbSCell::inValidityRange(), CdbStatus::NotFound, and CdbStatus::Success.

CdbStatus CdbBdbSPartitionsLayoutP::update const BdbRef(CdbBdbSPartitionBaseP)&    theNewRef
 

Update P-Layout using specified partition.

This method will check the internal integrity of the passed object first.

Then it will verify if there is a partition with specified ID, creation time and the cell (except the top level, which is allowed to be closed) in the current collection.

If the old partition object differs (does not have the same OID) as the new one the it (the old) will be destroyed and replaced with the new one. The corresponding P-Layout indexes will be also updated.

If passed partition object is already known to the Layout then indexes will only be updated.

The method will return CdbStatus::NotFound if it won't find a partition to be replaced. Other values are as usually.

Definition at line 647 of file CdbBdbSPartitionsLayoutP.cc.

References CdbBdbSCell::beginInsertion, CdbBdbSCell::beginValidity, CdbBdbSPartitionCell::cell, CdbBdbSPartitionBaseP::cell(), CdbBdbSCell::endValidity, CdbStatus::Error, CdbBdbSPartitionCell::id, CdbBdbSCollectionElementP::id(), CdbStatus::NotFound, and CdbStatus::Success.


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