Use buffered file IO for buckets in a part of a file. More...
#include <BucketBuffered.h>
Public Member Functions | |
BucketBuffered (BucketFile *file, Int64 startOffset, uInt bucketSize, uInt nrOfBuckets) | |
Create the object for (part of) a file. | |
virtual | ~BucketBuffered () |
char * | getBuffer () |
Get a pointer to the buffer. | |
void | read (uInt bucketNr, uInt bucketOffset, uInt nbytes, uInt bufferOffset=0) |
Read the given part into the internal buffer at the given offset. | |
void | write (uInt bucketNr, uInt bucketOffset, uInt nbytes) |
Write the given part from the internal buffer. | |
Private Member Functions | |
BucketBuffered (const BucketBuffered &) | |
Copy constructor is not possible. | |
BucketBuffered & | operator= (const BucketBuffered &) |
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. | |
Private Attributes | |
char * | itsBuffer |
Data buffer. |
Use buffered file IO for buckets in a part of a file.
Public interface
BucketBuffered 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-buffered 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.
Use of BucketCache is sub-optimal when having large buckets and more or less random IO. Memory-buffering behaves much better.
Definition at line 75 of file BucketBuffered.h.
casacore::BucketBuffered::BucketBuffered | ( | BucketFile * | file, | |
Int64 | startOffset, | |||
uInt | bucketSize, | |||
uInt | nrOfBuckets | |||
) |
virtual casacore::BucketBuffered::~BucketBuffered | ( | ) | [virtual] |
casacore::BucketBuffered::BucketBuffered | ( | const BucketBuffered & | ) | [private] |
Copy constructor is not possible.
virtual void casacore::BucketBuffered::doExtend | ( | uInt | nrBucket | ) | [private, virtual] |
Extend the file with the given number of buckets.
Implements casacore::BucketBase.
virtual void casacore::BucketBuffered::doFlush | ( | ) | [private, virtual] |
Flush the file.
Implements casacore::BucketBase.
virtual void casacore::BucketBuffered::doResync | ( | ) | [private, virtual] |
Do the actual resync-ing.
Implements casacore::BucketBase.
char* casacore::BucketBuffered::getBuffer | ( | ) | [inline] |
virtual void casacore::BucketBuffered::initializeBuckets | ( | uInt | bucketNr | ) | [private, virtual] |
Initialize the bucket buffer.
The uninitialized buckets before this bucket are also initialized.
Implements casacore::BucketBase.
BucketBuffered& casacore::BucketBuffered::operator= | ( | const BucketBuffered & | ) | [private] |
Assignment is not possible.
Reimplemented from casacore::BucketBase.
void casacore::BucketBuffered::read | ( | uInt | bucketNr, | |
uInt | bucketOffset, | |||
uInt | nbytes, | |||
uInt | bufferOffset = 0 | |||
) |
Read the given part into the internal buffer at the given offset.
Write the given part from the internal buffer.
char* casacore::BucketBuffered::itsBuffer [private] |