Class FBStatisticsManager
- java.lang.Object
- 
- org.firebirdsql.management.FBServiceManager
- 
- org.firebirdsql.management.FBStatisticsManager
 
 
- 
- All Implemented Interfaces:
- ServiceManager,- StatisticsManager
 
 public class FBStatisticsManager extends FBServiceManager implements StatisticsManager TheFBStatisticsManagerclass is 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/interfaces inherited from interface org.firebirdsql.management.StatisticsManagerStatisticsManager.DatabaseTransactionInfo
 
- 
 - 
Field Summary- 
Fields inherited from class org.firebirdsql.management.FBServiceManagerBUFFER_SIZE
 - 
Fields inherited from interface org.firebirdsql.management.StatisticsManagerDATA_TABLE_STATISTICS, INDEX_STATISTICS, RECORD_VERSION_STATISTICS, SYSTEM_TABLE_STATISTICS
 
- 
 - 
Constructor SummaryConstructors Constructor Description FBStatisticsManager()Create a new instance ofFBMaintenanceManagerbased on the default GDSType.FBStatisticsManager(java.lang.String gdsType)Create a new instance ofFBMaintenanceManagerbased on a given GDSType.FBStatisticsManager(GDSType gdsType)Create a new instance ofFBMaintenanceManagerbased on a given GDSType.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete 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.static StatisticsManager.DatabaseTransactionInfogetDatabaseTransactionInfo(java.sql.Connection connection)Get transaction information for an existing database connection.voidgetHeaderPage()Fetch the database statistics header page.voidgetTableStatistics(java.lang.String[] tableNames)Get the table statistics.- 
Methods inherited from class org.firebirdsql.management.FBServiceManagerattachDatabase, attachServiceManager, createRequestBuffer, executeServicesOperation, executeServicesOperation, getAuthPlugins, getCharSet, getDatabase, getDbCryptConfig, getHost, getLogger, getPassword, getPort, getServerVersion, getServiceName, getUser, getWireCrypt, isWireCompression, queueService, setAuthPlugins, setCharSet, setDatabase, setDbCryptConfig, setHost, setLogger, setPassword, setPort, setUser, setWireCompression, setWireCrypt
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.firebirdsql.management.ServiceManagergetAuthPlugins, getCharSet, getDatabase, getDbCryptConfig, getHost, getLogger, getPassword, getPort, getServerVersion, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setDatabase, setDbCryptConfig, setHost, setLogger, setPassword, setPort, setUser, setWireCompression, setWireCrypt
 
- 
 
- 
- 
- 
Constructor Detail- 
FBStatisticsManagerpublic FBStatisticsManager() Create a new instance ofFBMaintenanceManagerbased on the default GDSType.
 - 
FBStatisticsManagerpublic FBStatisticsManager(java.lang.String gdsType) Create a new instance ofFBMaintenanceManagerbased on a given GDSType.- Parameters:
- gdsType- type must be PURE_JAVA, EMBEDDED, or NATIVE
 
 - 
FBStatisticsManagerpublic FBStatisticsManager(GDSType gdsType) Create a new instance ofFBMaintenanceManagerbased on a given GDSType.- Parameters:
- gdsType- The GDS implementation type to use
 
 
- 
 - 
Method Detail- 
getHeaderPagepublic void getHeaderPage() throws java.sql.SQLExceptionDescription copied from interface:StatisticsManagerFetch the database statistics header page.The header information is written to this StatisticsManager's logger.- Specified by:
- getHeaderPagein interface- StatisticsManager
- Throws:
- java.sql.SQLException- if a database access error occurs
 
 - 
getDatabaseStatisticspublic void getDatabaseStatistics() throws java.sql.SQLExceptionDescription copied from interface:StatisticsManagerGet 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.- Specified by:
- getDatabaseStatisticsin interface- StatisticsManager
- Throws:
- java.sql.SQLException- if a database access error occurs
 
 - 
getDatabaseStatisticspublic void getDatabaseStatistics(int options) throws java.sql.SQLExceptionDescription copied from interface:StatisticsManagerGet 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_STATISTICS
- SYSTEM_TABLE_STATISTICS
- INDEX_STATISTICS
- RECORD_VERSION_STATISTICS
 If this method is invoked with 0as theoptionsvalue, only the header and log statistics will be output.- Specified by:
- getDatabaseStatisticsin interface- StatisticsManager
- Parameters:
- options- A bitmask combination of- DATA_TABLE_STATISTICS,- SYSTEM_TABLE_STATISTICS,- INDEX_STATISTICS, or- RECORD_VERSION_STATISTICS. Can also be- 0, which is equivalent to calling method- StatisticsManager.getDatabaseStatistics()
- Throws:
- java.sql.SQLException
 
 - 
getTableStatisticspublic void getTableStatistics(java.lang.String[] tableNames) throws java.sql.SQLExceptionDescription copied from interface:StatisticsManagerGet 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.- Specified by:
- getTableStatisticsin interface- StatisticsManager
- Parameters:
- tableNames- array of table names to analyze.
- Throws:
- java.sql.SQLException- if something went wrong.
 
 - 
getDatabaseTransactionInfopublic StatisticsManager.DatabaseTransactionInfo getDatabaseTransactionInfo() throws java.sql.SQLException Description copied from interface:StatisticsManagerGet transaction information of the database specified indatabase.- Specified by:
- getDatabaseTransactionInfoin interface- StatisticsManager
- Returns:
- Database transaction information
- Throws:
- java.sql.SQLException- If- databaseis not specified, or for failures to connect or retrieve information
 
 - 
getDatabaseTransactionInfopublic static StatisticsManager.DatabaseTransactionInfo getDatabaseTransactionInfo(java.sql.Connection connection) throws java.sql.SQLException Get transaction information for an existing database connection.- Parameters:
- connection- Database connection; must unwrap to- FirebirdConnection.
- Returns:
- Database transaction information
- Throws:
- java.sql.SQLException- If- connectiondoes not unwrap to- FirebirdConnection, or for failures to retrieve information
 
 
- 
 
-