net.sf.jaxme.sqls.db2
Class TableSpaceImpl

java.lang.Object
  extended bynet.sf.jaxme.sqls.db2.TableSpaceImpl
All Implemented Interfaces:
TableSpace

public class TableSpaceImpl
extends java.lang.Object
implements TableSpace

Default implementation of a DB2 tablespace.

Author:
Jochen Wiedmann

Nested Class Summary
static class TableSpaceImpl.DatabaseManagedContainerImpl
           
static class TableSpaceImpl.NameImpl
           
static class TableSpaceImpl.SystemManagedContainerImpl
           
 
Nested classes inherited from class net.sf.jaxme.sqls.db2.TableSpace
TableSpace.Container, TableSpace.DatabaseManagedContainer, TableSpace.Name, TableSpace.SystemManagedContainer, TableSpace.Type
 
Constructor Summary
protected TableSpaceImpl(DB2SQLFactory pFactory, TableSpace.Name pName, TableSpace.Type pType)
           
 
Method Summary
 BufferPool getBufferPool()
          Returns the BufferPool used by this TableSpace.
 java.util.Iterator getContainers()
          Returns an Iterator to the table spaces containers.
 java.lang.Long getExtentSize()
          Returns the number of pageSize pages that will be written to a container before skipping to the next container.
 TableSpace.Name getName()
          Returns the tablespace name.
 java.lang.Number getOverhead()
          Returns the I/O controller overhead and disk seek and latency time, in milliseconds.
 PageSize getPageSize()
          Returns the tablespaces page size.
 java.lang.Long getPrefetchSize()
          Returns the number of pageSize pages that will be read from the tablespace when data prefetching is being performed.
 DB2SQLFactory getSQLFactory()
          Returns the SQLFactory that created this TableSpace object.
 java.lang.Number getTransferRate()
          Returns the transfer rate, which is defined as the time to read one page into memory, in milliseconds.
 TableSpace.Type getType()
          Returns the tablespace type.
 java.lang.Boolean hasDroppedTableRecovery()
          Returns whether dropped tables in the specified tablespace may be recovered using the RECOVER TABLE ON option of the ROLLFORWARD command.
 boolean isPredefined()
          Returns whether this TableSpace is predefined by the system.
 TableSpace.Container newDatabaseManagedContainerInDevice(java.lang.String pDevice, long pNumPages)
          Creates a new database managed container with the given raw operating system device and the given number of pages.
 TableSpace.Container newDatabaseManagedContainerInFile(java.lang.String pFile, long pNumPages)
          Creates a new database managed container with the given file or device and the given number of pages.
 TableSpace.Container newSystemManagedContainer(java.lang.String pFile)
          Creates a new system managed container with the given file.
 void setBufferPool(BufferPool pBufferPool)
          Sets the BufferPool used by this TableSpace.
 void setDroppedTableRecovery(java.lang.Boolean pRecoverable)
          Sets whether dropped tables in the specified tablespace may be recovered using the RECOVER TABLE ON option of the ROLLFORWARD command.
 void setExtentSize(java.lang.Long pSize)
          Sets the number of pageSize pages that will be written to a container before skipping to the next container.
 void setOverhead(java.lang.Number pOverhead)
          Sets the I/O controller overhead and disk seek and latency time, in milliseconds.
 void setPageSize(PageSize pSize)
          Sets the tablespaces page size.
 void setPrefetchSize(java.lang.Long pSize)
          Sets the number of pageSize pages that will be read from the tablespace when data prefetching is being performed.
 void setTransferRate(java.lang.Number pTransferRate)
          Sets the transfer rate, which is defined as the time to read one page into memory, in milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableSpaceImpl

protected TableSpaceImpl(DB2SQLFactory pFactory,
                         TableSpace.Name pName,
                         TableSpace.Type pType)
Method Detail

getSQLFactory

public DB2SQLFactory getSQLFactory()
Description copied from interface: TableSpace

Returns the SQLFactory that created this TableSpace object.

Specified by:
getSQLFactory in interface TableSpace

getName

public TableSpace.Name getName()
Description copied from interface: TableSpace

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

Specified by:
getName in interface TableSpace

getType

public TableSpace.Type getType()
Description copied from interface: TableSpace

Returns the tablespace type.

Specified by:
getType in interface TableSpace

getPageSize

public PageSize getPageSize()
Description copied from interface: TableSpace

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 TableSpace.setPageSize(PageSize).

Specified by:
getPageSize in interface TableSpace

setPageSize

public void setPageSize(PageSize pSize)
Description copied from interface: TableSpace

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

Specified by:
setPageSize in interface TableSpace

getExtentSize

public java.lang.Long getExtentSize()
Description copied from interface: TableSpace

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.

Specified by:
getExtentSize in interface TableSpace

setExtentSize

public void setExtentSize(java.lang.Long pSize)
Description copied from interface: TableSpace

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.

Specified by:
setExtentSize in interface TableSpace

getPrefetchSize

public java.lang.Long getPrefetchSize()
Description copied from interface: TableSpace

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.

Specified by:
getPrefetchSize in interface TableSpace

setPrefetchSize

public void setPrefetchSize(java.lang.Long pSize)
Description copied from interface: TableSpace

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.

Specified by:
setPrefetchSize in interface TableSpace

getOverhead

public java.lang.Number getOverhead()
Description copied from interface: TableSpace

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.

Specified by:
getOverhead in interface TableSpace

setOverhead

public void setOverhead(java.lang.Number pOverhead)
Description copied from interface: TableSpace

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.

Specified by:
setOverhead in interface TableSpace

getTransferRate

public java.lang.Number getTransferRate()
Description copied from interface: TableSpace

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.

Specified by:
getTransferRate in interface TableSpace

setTransferRate

public void setTransferRate(java.lang.Number pTransferRate)
Description copied from interface: TableSpace

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.

Specified by:
setTransferRate in interface TableSpace

hasDroppedTableRecovery

public java.lang.Boolean hasDroppedTableRecovery()
Description copied from interface: TableSpace

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 TableSpace.Type.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.

Specified by:
hasDroppedTableRecovery in interface TableSpace

setDroppedTableRecovery

public void setDroppedTableRecovery(java.lang.Boolean pRecoverable)
Description copied from interface: TableSpace

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 TableSpace.Type.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.

Specified by:
setDroppedTableRecovery in interface TableSpace

isPredefined

public boolean isPredefined()
Description copied from interface: TableSpace

Returns whether this TableSpace is predefined by the system.

Specified by:
isPredefined in interface TableSpace

newSystemManagedContainer

public TableSpace.Container newSystemManagedContainer(java.lang.String pFile)
Description copied from interface: TableSpace

Creates a new system managed container with the given file.

Specified by:
newSystemManagedContainer in interface TableSpace

newDatabaseManagedContainerInFile

public TableSpace.Container newDatabaseManagedContainerInFile(java.lang.String pFile,
                                                              long pNumPages)
Description copied from interface: TableSpace

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

Specified by:
newDatabaseManagedContainerInFile in interface TableSpace

newDatabaseManagedContainerInDevice

public TableSpace.Container newDatabaseManagedContainerInDevice(java.lang.String pDevice,
                                                                long pNumPages)
Description copied from interface: TableSpace

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

Specified by:
newDatabaseManagedContainerInDevice in interface TableSpace

getContainers

public java.util.Iterator getContainers()
Description copied from interface: TableSpace

Returns an Iterator to the table spaces containers. Any element in the Iterator is an instance of TableSpace.Container, which was created using TableSpace.newSystemManagedContainer(String), TableSpace.newDatabaseManagedContainerInFile(String, long), or TableSpace.newDatabaseManagedContainerInDevice(String, long).

Specified by:
getContainers in interface TableSpace

setBufferPool

public void setBufferPool(BufferPool pBufferPool)
Description copied from interface: TableSpace

Sets the BufferPool used by this TableSpace.

Specified by:
setBufferPool in interface TableSpace

getBufferPool

public BufferPool getBufferPool()
Description copied from interface: TableSpace

Returns the BufferPool used by this TableSpace.

Specified by:
getBufferPool in interface TableSpace