casacore
Public Types | Public Member Functions | Private Attributes | List of all members
casacore::TSMOption Class Reference

More...

#include <TSMOption.h>

Public Types

enum  Option {
  Cache ,
  Buffer ,
  MMap ,
  Default ,
  Aipsrc
}
 Define the possible options how the TiledStMan accesses its data. More...
 

Public Member Functions

 TSMOption (Option option=Aipsrc, Int bufferSize=-2, Int maxCacheSizeMB=-2)
 Create an option object. More...
 
void fillOption (Bool newFile)
 Fill the option in case Aipsrc or Default was given. More...
 
Option option () const
 Get the option. More...
 
Int bufferSize () const
 Get the buffer size. More...
 
Int maxCacheSizeMB () const
 Get the maximum cache size (in MibiByte). More...
 

Private Attributes

Option itsOption
 
Int itsBufferSize
 
Int itsMaxCacheSize
 

Detailed Description

Options for the Tiled Storage Manager Access

Intended use:

Public interface

Review Status

Reviewed By:
TPPR
Date Reviewed:
08.11.94
Test programs:
tTiledShapeStMan

Prerequisite

Synopsis

This class can be used to define how the Tiled Storage Manager accesses its data. There are three ways:

  1. Using a cache of its own. The cache size is derived using the hinted access pattern. The cache can be (too) large when using large tables with bad access patterns. A maximum cache size can be defined to overcome this problem, but that may result in poor caching behaviour. Until January 2010 this was the only way to access the data.
  2. Use memory-mapped IO (mmap); the operating system take care of caching. On 32-bit systems mmap cannot be used for larger tables due to the 4 GB address space limit. When creating or extending files, mmap can be disadvantageous because extending the file requires remapping it.
  3. Use buffered IO; the kernel's file cache should avoid unnecessary IO. Its performance is less than mmap, but it works well on 32-bit systems. The buffer size to be used can be defined.

The constructor of the class can be used to define the options or to read options from the aipsrc file.

The aipsrc variables are:

Definition at line 116 of file TSMOption.h.

Member Enumeration Documentation

◆ Option

Define the possible options how the TiledStMan accesses its data.

Enumerator
Cache 

Use unbuffered file IO with internal TSM caching.

Buffer 

Use buffered file IO without internal TSM caching.

MMap 

Use memory-mapped IO.

Default 

Use default.

Aipsrc 

Use as defined in the aipsrc file.

Definition at line 120 of file TSMOption.h.

Constructor & Destructor Documentation

◆ TSMOption()

casacore::TSMOption::TSMOption ( Option  option = Aipsrc,
Int  bufferSize = -2,
Int  maxCacheSizeMB = -2 
)

Create an option object.

The parameter values are described in the synopsis. A size value -2 means reading that size from the aipsrc file. The buffer size has to be given in bytes. The maximum cache size has to be given in MibiBytes (1024*1024 bytes).

Member Function Documentation

◆ bufferSize()

Int casacore::TSMOption::bufferSize ( ) const
inline

Get the buffer size.

Definition at line 150 of file TSMOption.h.

References itsBufferSize.

◆ fillOption()

void casacore::TSMOption::fillOption ( Bool  newFile)

Fill the option in case Aipsrc or Default was given.

It is done as explained in the synopsis.

◆ maxCacheSizeMB()

Int casacore::TSMOption::maxCacheSizeMB ( ) const
inline

Get the maximum cache size (in MibiByte).

-1 means undefined.

Definition at line 154 of file TSMOption.h.

References itsMaxCacheSize.

◆ option()

Option casacore::TSMOption::option ( ) const
inline

Get the option.

Definition at line 146 of file TSMOption.h.

References itsOption.

Member Data Documentation

◆ itsBufferSize

Int casacore::TSMOption::itsBufferSize
private

Definition at line 159 of file TSMOption.h.

Referenced by bufferSize().

◆ itsMaxCacheSize

Int casacore::TSMOption::itsMaxCacheSize
private

Definition at line 160 of file TSMOption.h.

Referenced by maxCacheSizeMB().

◆ itsOption

Option casacore::TSMOption::itsOption
private

Definition at line 158 of file TSMOption.h.

Referenced by option().


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