Interface StatisticsManager
-
- All Superinterfaces:
AttachmentProperties,BaseProperties,ServiceConnectionProperties,ServiceManager
- All Known Implementing Classes:
FBStatisticsManager
public interface StatisticsManager extends ServiceManager
AStatisticsManageris responsible for replicating the functionality of thegstatcommand-line tool.This functionality includes:
- Retrieving data table statistics
- Retrieving the database header page
- Retrieving index statistics
- Retrieving database logging information
- Retrieving statistics for the data dictionary
- Author:
- Gabriel Reid
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classStatisticsManager.DatabaseTransactionInfo
-
Field Summary
Fields Modifier and Type Field Description static intDATA_TABLE_STATISTICSRequest statistics on data tables.static intINDEX_STATISTICSRequest statistics on indexes.static intRECORD_VERSION_STATISTICSRequest statistics on record versions.static intSYSTEM_TABLE_STATISTICSRequest statistics on system tables.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidgetDatabaseStatistics()Get the full database statistics information, excluding system table information.voidgetDatabaseStatistics(int options)Get specific database statistics.StatisticsManager.DatabaseTransactionInfogetDatabaseTransactionInfo()Get transaction information of the database specified indatabase.voidgetHeaderPage()Fetch the database statistics header page.voidgetTableStatistics(java.lang.String[] tableNames)Get the table statistics.-
Methods inherited from interface org.firebirdsql.jaybird.props.AttachmentProperties
getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEncoding, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEncoding, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSoTimeout, setType, setUser, setWireCompression, setWireCrypt
-
Methods inherited from interface org.firebirdsql.jaybird.props.BaseProperties
connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setProperty
-
Methods inherited from interface org.firebirdsql.jaybird.props.ServiceConnectionProperties
getExpectedDb, getServiceName, setExpectedDb, setServiceName
-
Methods inherited from interface org.firebirdsql.management.ServiceManager
getDatabase, getHost, getLogger, getPort, getServerVersion, getWireCryptAsEnum, setDatabase, setHost, setLogger, setPort, setWireCryptAsEnum
-
-
-
-
Field Detail
-
DATA_TABLE_STATISTICS
static final int DATA_TABLE_STATISTICS
Request statistics on data tables.- See Also:
- Constant Field Values
-
INDEX_STATISTICS
static final int INDEX_STATISTICS
Request statistics on indexes.- See Also:
- Constant Field Values
-
SYSTEM_TABLE_STATISTICS
static final int SYSTEM_TABLE_STATISTICS
Request statistics on system tables.- See Also:
- Constant Field Values
-
RECORD_VERSION_STATISTICS
static final int RECORD_VERSION_STATISTICS
Request statistics on record versions.- See Also:
- Constant Field Values
-
-
Method Detail
-
getHeaderPage
void getHeaderPage() throws java.sql.SQLExceptionFetch the database statistics header page.The header information is written to this
StatisticsManager's logger.- Throws:
java.sql.SQLException- if a database access error occurs
-
getDatabaseStatistics
void getDatabaseStatistics() throws java.sql.SQLExceptionGet the full database statistics information, excluding system table information.The statistics information is written to this
StatisticsManager's logger.The listed data includes:
- statistics header page
- log statistics
- index statistics
- data table statistics
Invoking this method is equivalent to the default behaviour of
gstaton the command-line.- Throws:
java.sql.SQLException- if a database access error occurs
-
getDatabaseStatistics
void getDatabaseStatistics(int options) throws java.sql.SQLExceptionGet specific database statistics.The statistics information is written to this
StatisticsManager's logger. All invocations of this method will result in the header page and log data being output.The following options can be supplied as a bitmask:
DATA_TABLE_STATISTICSSYSTEM_TABLE_STATISTICSINDEX_STATISTICSRECORD_VERSION_STATISTICS
If this method is invoked with
0as theoptionsvalue, only the header and log statistics will be output.- Parameters:
options- A bitmask combination ofDATA_TABLE_STATISTICS,SYSTEM_TABLE_STATISTICS,INDEX_STATISTICS, orRECORD_VERSION_STATISTICS. Can also be0, which is equivalent to calling methodgetDatabaseStatistics()- Throws:
java.sql.SQLException
-
getTableStatistics
void getTableStatistics(java.lang.String[] tableNames) throws java.sql.SQLExceptionGet the table statistics.The statistics information is written to this
StatisticsManager's logger.The listed data includes:
- the primary pointer and index root page numbers
- number of data pages and their average fill
- fill distribution
Invoking this method is equivalent to the behaviour of
gstat -t <table name>on the command-line.- Parameters:
tableNames- array of table names to analyze.- Throws:
java.sql.SQLException- if something went wrong.
-
getDatabaseTransactionInfo
StatisticsManager.DatabaseTransactionInfo getDatabaseTransactionInfo() throws java.sql.SQLException
Get transaction information of the database specified indatabase.- Returns:
- Database transaction information
- Throws:
java.sql.SQLException- Ifdatabaseis not specified, or for failures to connect or retrieve information
-
-