org.apache.ws.jaxme.sqls.db2

Interface TableSpace

public interface TableSpace

Interface of a DB2 TableSpace. An object of this kind is used to create a CREATE TABLESPACE ... statement.

A TableSpace can be associated to a BufferPool. If it is, it inherits certain settings from the BufferPool, in particular the pageSize.

A tablespace needs to know where data is stored physically. DB2 distinguishes between two possible data locations: System managed (Files handled by the operating system) and Database managed (Files handled by the database or Devices). In the latter case the database will preallocate space for the files or devices, giving a slightly faster operation. On the other hand, database managed files cannot grow automatically.

A tablespaces data location is called container. Any tablespace must have at least one container. Note, that one tablespace cannot have both system managed containers and database managed containers. If the first container is system managed, then all containers are, and vice versa.

Author: Jochen Wiedmann

Nested Class Summary
static interfaceTableSpace.Container

Interface of a TableSpace Container.

static interfaceTableSpace.DatabaseManagedContainer

Interface of a database managed container.

static interfaceTableSpace.Name
static interfaceTableSpace.SystemManagedContainer

Interface of a system managed container, aka operating system file.

static classTableSpace.Type

A DB2 TableSpace type.

Method Summary
BufferPoolgetBufferPool()

Returns the BufferPool used by this TableSpace.

IteratorgetContainers()

Returns an Iterator to the table spaces containers.

LonggetExtentSize()

Returns the number of pageSize pages that will be written to a container before skipping to the next container.

TableSpace.NamegetName()

Returns the tablespace name.

NumbergetOverhead()

Returns the I/O controller overhead and disk seek and latency time, in milliseconds.

PageSizegetPageSize()

Returns the tablespaces page size.

LonggetPrefetchSize()

Returns the number of pageSize pages that will be read from the tablespace when data prefetching is being performed.

DB2SQLFactorygetSQLFactory()

Returns the SQLFactory that created this TableSpace object.

NumbergetTransferRate()

Returns the transfer rate, which is defined as the time to read one page into memory, in milliseconds.

TableSpace.TypegetType()

Returns the tablespace type.

BooleanhasDroppedTableRecovery()

Returns whether dropped tables in the specified tablespace may be recovered using the RECOVER TABLE ON option of the ROLLFORWARD command.

booleanisPredefined()

Returns whether this TableSpace is predefined by the system.

TableSpace.ContainernewDatabaseManagedContainerInDevice(String pDevice, long pNumPages)

Creates a new database managed container with the given raw operating system device and the given number of pages.

TableSpace.ContainernewDatabaseManagedContainerInFile(String pFile, long pNumPages)

Creates a new database managed container with the given file or device and the given number of pages.

TableSpace.ContainernewSystemManagedContainer(String pFile)

Creates a new system managed container with the given file.

voidsetBufferPool(BufferPool pBufferPool)

Sets the BufferPool used by this TableSpace.

voidsetDroppedTableRecovery(Boolean pRecoverable)

Sets whether dropped tables in the specified tablespace may be recovered using the RECOVER TABLE ON option of the ROLLFORWARD command.

voidsetExtentSize(Long pSize)

Sets the number of pageSize pages that will be written to a container before skipping to the next container.

voidsetOverhead(Number pOverhead)

Sets the I/O controller overhead and disk seek and latency time, in milliseconds.

voidsetPageSize(PageSize pSize)

Sets the tablespaces page size.

voidsetPrefetchSize(Long pSize)

Sets the number of pageSize pages that will be read from the tablespace when data prefetching is being performed.

voidsetTransferRate(Number pNumber)

Sets the transfer rate, which is defined as the time to read one page into memory, in milliseconds.

Method Detail

getBufferPool

public BufferPool getBufferPool()

Returns the BufferPool used by this TableSpace.

getContainers

public Iterator getContainers()

Returns an Iterator to the table spaces containers. Any element in the java.util.Iterator is an instance of Container, which was created using newSystemManagedContainer, TableSpace, or TableSpace.

getExtentSize

public Long getExtentSize()

Returns the number of pageSize pages that will be written to a container before skipping to the next container. The database manager cycles repeatedly through the containers as data is stored. Defaults to null, in which case the DB2 configuration parameter DFT_EXTENT_SZ applies.

getName

public TableSpace.Name getName()

Returns the tablespace name. Tablespace names must be unique in the database.

getOverhead

public Number getOverhead()

Returns the I/O controller overhead and disk seek and latency time, in milliseconds. The number should be an average for all containers that belong to the tablespace, if not the same for all containers. This value is used to determine the cost of I/O during query optimization. Defaults to null, in which case the DB2 default (24.1) applies.

getPageSize

public PageSize getPageSize()

Returns the tablespaces page size. If the TableSpace has an associated BufferPool, returns the BufferPool's page size. Otherwise returns the page size configured via setPageSize.

getPrefetchSize

public Long getPrefetchSize()

Returns the number of pageSize pages that will be read from the tablespace when data prefetching is being performed. Prefetching reads in data needed by a query prior to it being referenced by the query, so that the query need not wait for I/O to be performed. Defaults to null, in which case the DB2 configuration parameter DFT_PREFETCH_SZ applies.

getSQLFactory

public DB2SQLFactory getSQLFactory()

Returns the SQLFactory that created this TableSpace object.

getTransferRate

public Number getTransferRate()

Returns the transfer rate, which is defined as the time to read one page into memory, in milliseconds. The number shouldbe an average for all containers that belong to the tablespace, if not the same for all containers. This value is used to determine the cost of I/O during query optimization. Defaults to null, in which case the DB2 default (0.9) applies.

getType

public TableSpace.Type getType()

Returns the tablespace type.

hasDroppedTableRecovery

public Boolean hasDroppedTableRecovery()

Returns whether dropped tables in the specified tablespace may be recovered using the RECOVER TABLE ON option of the ROLLFORWARD command. This clause can only be specified for a REGULAR tablespace (SQLSTATE 42613). For more information on recovering dropped tables, refer to the Administration Guide. Defaults to null, in which case the DB2 default applies.

isPredefined

public boolean isPredefined()

Returns whether this TableSpace is predefined by the system.

newDatabaseManagedContainerInDevice

public TableSpace.Container newDatabaseManagedContainerInDevice(String pDevice, long pNumPages)

Creates a new database managed container with the given raw operating system device and the given number of pages.

newDatabaseManagedContainerInFile

public TableSpace.Container newDatabaseManagedContainerInFile(String pFile, long pNumPages)

Creates a new database managed container with the given file or device and the given number of pages.

newSystemManagedContainer

public TableSpace.Container newSystemManagedContainer(String pFile)

Creates a new system managed container with the given file.

setBufferPool

public void setBufferPool(BufferPool pBufferPool)

Sets the BufferPool used by this TableSpace.

setDroppedTableRecovery

public void setDroppedTableRecovery(Boolean pRecoverable)

Sets whether dropped tables in the specified tablespace may be recovered using the RECOVER TABLE ON option of the ROLLFORWARD command. This clause can only be specified for a REGULAR tablespace (SQLSTATE 42613). For more information on recovering dropped tables, refer to the Administration Guide. Defaults to null, in which case the DB2 default applies.

setExtentSize

public void setExtentSize(Long pSize)

Sets the number of pageSize pages that will be written to a container before skipping to the next container. The database manager cycles repeatedly through the containers as data is stored. Defaults to null, in which case the DB2 configuration parameter DFT_EXTENT_SZ applies.

setOverhead

public void setOverhead(Number pOverhead)

Sets the I/O controller overhead and disk seek and latency time, in milliseconds. The number should be an average for all containers that belong to the tablespace, if not the same for all containers. This value is used to determine the cost of I/O during query optimization. Defaults to null, in which case the DB2 default (24.1) applies.

setPageSize

public void setPageSize(PageSize pSize)

Sets the tablespaces page size. This value will be ignored, if the TableSpace has an associated BufferPool.

setPrefetchSize

public void setPrefetchSize(Long pSize)

Sets the number of pageSize pages that will be read from the tablespace when data prefetching is being performed. Prefetching reads in data needed by a query prior to it being referenced by the query, so that the query need not wait for I/O to be performed. Defaults to null, in which case the DB2 configuration parameter DFT_PREFETCH_SZ applies.

setTransferRate

public void setTransferRate(Number pNumber)

Sets the transfer rate, which is defined as the time to read one page into memory, in milliseconds. The number shouldbe an average for all containers that belong to the tablespace, if not the same for all containers. This value is used to determine the cost of I/O during query optimization. Defaults to null, in which case the DB2 default (0.9) applies.