Loading...
Searching...
No Matches
casacore::TSMOption Class Reference
tables package (libcasa_tables) » DataMan_module

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.
void | fillOption (Bool newFile)
| Fill the option in case Aipsrc or Default was given.
Option | option () const
| Get the option.
Int | bufferSize () const
| Get the buffer size.
Int | maxCacheSizeMB () const
| Get the maximum cache size (in MibiByte).

## 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

- TiledStMan

### 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.

- TSMOption::Cache Use unbuffered file IO with internal TSM caching. This is the old behaviour. The maximum cache size can be given as a constructor argument.
- TSMOption::MMap Use memory-mapped IO.
- TSMOption::Buffer Use buffered file IO without. The buffer size can be given as a constructor argument.
- TSMOption::Default Use default. This is MMap for existing files on 64-bit systems, otherwise Buffer.
- TSMOption::Aipsrc Use the option as defined in the aipsrc file.

The aipsrc variables are:

- table.tsm.option gives the option as the case-insensitive string value:
  - cache means TSMCache.
  - mmap (or map) means TSMMap.
  - mmapold (or mapold) means TSMMap for existing tables and TSMDefault for new tables.
  - buffer means TSMBuffer.
  - default means TSMDefault.
  It defaults to value default. Note that mmapold is almost the same as default. Only on 32-bit systems it is different.
- table.tsm.maxcachesizemb gives the maximum cache size in MibiByte for option TSMOption::Cache. A value -1 means that the system determines the maximum. A value 0 means unlimited. It defaults to -1. Note it can always be overridden using class ROTiledStManAccessor.
- table.tsm.buffersize gives the buffer size for option TSMOption::Buffer. A value <=0 means use the default 4096. It defaults to 0.

Definition at line 114 of file TSMOption.h.

## Member Enumeration Documentation

## Option

enum casacore::TSMOption::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 118 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).

References Aipsrc, bufferSize(), maxCacheSizeMB(), and option().

## Member Function Documentation

## bufferSize()

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

inline

Get the buffer size.

Definition at line 148 of file TSMOption.h.

References itsBufferSize.

Referenced by TSMOption().

## 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 152 of file TSMOption.h.

References itsMaxCacheSize.

Referenced by TSMOption().

## option()

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

inline

Get the option.

Definition at line 144 of file TSMOption.h.

References itsOption.

Referenced by TSMOption().

## Member Data Documentation

## itsBufferSize

Int casacore::TSMOption::itsBufferSize

private

Definition at line 157 of file TSMOption.h.

Referenced by bufferSize().

## itsMaxCacheSize

Int casacore::TSMOption::itsMaxCacheSize

private

Definition at line 158 of file TSMOption.h.

Referenced by maxCacheSizeMB().

## itsOption

Option casacore::TSMOption::itsOption

private

Definition at line 156 of file TSMOption.h.

Referenced by option().

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

- tables/DataMan/TSMOption.h