casacore::BucketMapped Class Reference

Use file mapping for buckets in a part of a file. More...

#include <BucketMapped.h>

Inheritance diagram for casacore::BucketMapped:
casacore::BucketBase

List of all members.

Public Member Functions

 BucketMapped (BucketFile *file, Int64 startOffset, uInt bucketSize, uInt nrOfBuckets)
 Create the cache for (part of) a file.
 ~BucketMapped ()
 Unmap the file.
const char * getBucket (uInt bucketNr)
 Get a readonly pointer to the given bucket in memory.
char * getrwBucket (uInt bucketNr)
 Get a writable pointer to the given bucket in memory.

Private Member Functions

 BucketMapped (const BucketMapped &)
 Copy constructor is not possible.
BucketMappedoperator= (const BucketMapped &)
 Assignment is not possible.
virtual void doFlush ()
 Flush the file.
virtual void doResync ()
 Do the actual resync-ing.
virtual void doExtend (uInt nrBucket)
 Extend the file with the given number of buckets.
virtual void initializeBuckets (uInt bucketNr)
 Initialize the bucket buffer.

Detailed Description

Use file mapping for buckets in a part of a file.

Intended use:

Public interface

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Prerequisite

Etymology

BucketMapped uses memory-mapped files for bucket access.

Synopsis

BucketMapped is similar to class BucketCache and is meant to be used by the storage managers of the Table System.

It gives access to buckets in a file by means of memory-mapped files. However, its functionality is a subset of BucketCache and is only meant to be used by the Tiled Storage Managers. If The Standard and Incremental Storage Manager also want to use it, functions like extend needs to be added to this class. Also support for a free bucket list needs to be added.

Motivation

Use of BucketCache is sub-optimal when having large buckets and more or less random IO. Memory-mapping behaves much better.

Definition at line 76 of file BucketMapped.h.


Constructor & Destructor Documentation

casacore::BucketMapped::BucketMapped ( BucketFile file,
Int64  startOffset,
uInt  bucketSize,
uInt  nrOfBuckets 
)

Create the cache for (part of) a file.

The file part mapped into memory starts at startOffset. Its length is bucketSize*nrOfBuckets bytes. If the file is smaller, the remainder is indicated as an extension similarly to the behaviour of function extend.

casacore::BucketMapped::~BucketMapped (  ) 

Unmap the file.

casacore::BucketMapped::BucketMapped ( const BucketMapped  )  [private]

Copy constructor is not possible.


Member Function Documentation

virtual void casacore::BucketMapped::doExtend ( uInt  nrBucket  )  [private, virtual]

Extend the file with the given number of buckets.

Implements casacore::BucketBase.

virtual void casacore::BucketMapped::doFlush (  )  [private, virtual]

Flush the file.

Implements casacore::BucketBase.

virtual void casacore::BucketMapped::doResync (  )  [private, virtual]

Do the actual resync-ing.

Implements casacore::BucketBase.

const char* casacore::BucketMapped::getBucket ( uInt  bucketNr  ) 

Get a readonly pointer to the given bucket in memory.

Referenced by getrwBucket().

char* casacore::BucketMapped::getrwBucket ( uInt  bucketNr  )  [inline]

Get a writable pointer to the given bucket in memory.

It sets the hasWritten flag.

Definition at line 95 of file BucketMapped.h.

References getBucket(), casacore::BucketBase::itsHasWritten, and casacore::True.

virtual void casacore::BucketMapped::initializeBuckets ( uInt  bucketNr  )  [private, virtual]

Initialize the bucket buffer.

The uninitialized buckets before this bucket are also initialized.

Implements casacore::BucketBase.

BucketMapped& casacore::BucketMapped::operator= ( const BucketMapped  )  [private]

Assignment is not possible.

Reimplemented from casacore::BucketBase.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1