casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Private Attributes
casa::TSMOption Class Reference

Options for the Tiled Storage Manager Access. More...

#include <TSMOption.h>

List of all members.

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.

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

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

casa::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.


Member Function Documentation

Int casa::TSMOption::bufferSize ( ) const [inline]

Get the buffer size.

Definition at line 148 of file TSMOption.h.

References itsBufferSize.

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

Fill the option in case Aipsrc or Default was given.

It is done as explained in the synopsis.

Get the maximum cache size.

-1 means undefined.

Definition at line 152 of file TSMOption.h.

References itsMaxCacheSize.

Option casa::TSMOption::option ( ) const [inline]

Get the option.

Definition at line 144 of file TSMOption.h.

References itsOption.


Member Data Documentation

Definition at line 157 of file TSMOption.h.

Referenced by bufferSize().

Definition at line 158 of file TSMOption.h.

Referenced by maxCacheSizeMB().

Definition at line 156 of file TSMOption.h.

Referenced by option().


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