org.firebirdsql.management
Class FBStatisticsManager

java.lang.Object
  extended by org.firebirdsql.management.FBServiceManager
      extended by org.firebirdsql.management.FBStatisticsManager
All Implemented Interfaces:
ServiceManager, StatisticsManager

public class FBStatisticsManager
extends FBServiceManager
implements StatisticsManager

The FBStatisticsManager class is responsible for replicating the functionality of the gstat command-line tool. This functionality includes:

Author:
Gabriel Reid

Field Summary
 
Fields inherited from class org.firebirdsql.management.FBServiceManager
BUFFER_SIZE
 
Fields inherited from interface org.firebirdsql.management.StatisticsManager
DATA_TABLE_STATISTICS, INDEX_STATISTICS, RECORD_VERSION_STATISTICS, SYSTEM_TABLE_STATISTICS
 
Constructor Summary
FBStatisticsManager()
          Create a new instance of FBMaintenanceManager based on the default GDSType.
FBStatisticsManager(org.firebirdsql.gds.impl.GDSType gdsType)
          Create a new instance of FBMaintenanceManager based on a given GDSType.
FBStatisticsManager(java.lang.String gdsType)
          Create a new instance of FBMaintenanceManager based on a given GDSType.
 
Method Summary
 void getDatabaseStatistics()
          Get the full database statistics information, excluding system table information.
 void getDatabaseStatistics(int options)
          Get specific database statistics.
 void getHeaderPage()
          Fetch the database statistics header page.
 void getTableStatistics(java.lang.String[] tableNames)
          Get the table statistics.
 
Methods inherited from class org.firebirdsql.management.FBServiceManager
attachServiceManager, createRequestBuffer, detachServiceManager, executeServicesOperation, getDatabase, getGds, getHost, getLogger, getPassword, getPort, getServiceName, getUser, queueService, setDatabase, setHost, setLogger, setPassword, setPort, setUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.firebirdsql.management.ServiceManager
getDatabase, getHost, getLogger, getPassword, getPort, getUser, setDatabase, setHost, setLogger, setPassword, setPort, setUser
 

Constructor Detail

FBStatisticsManager

public FBStatisticsManager()
Create a new instance of FBMaintenanceManager based on the default GDSType.


FBStatisticsManager

public FBStatisticsManager(java.lang.String gdsType)
Create a new instance of FBMaintenanceManager based on a given GDSType.

Parameters:
gdsType - type must be PURE_JAVA, EMBEDDED, or NATIVE

FBStatisticsManager

public FBStatisticsManager(org.firebirdsql.gds.impl.GDSType gdsType)
Create a new instance of FBMaintenanceManager based on a given GDSType.

Parameters:
gdsType - The GDS implementation type to use
Method Detail

getHeaderPage

public void getHeaderPage()
                   throws java.sql.SQLException
Description copied from interface: StatisticsManager
Fetch the database statistics header page. The header information is written to this StatisticsManager's logger.

Specified by:
getHeaderPage in interface StatisticsManager
Throws:
java.sql.SQLException - if a database access error occurs

getDatabaseStatistics

public void getDatabaseStatistics()
                           throws java.sql.SQLException
Description copied from interface: StatisticsManager
Get the full database statistics information, excluding system table information. The statistics information is written to this StatisticsManager's logger.

The listed data includes:

Invoking this method is equivalent to the default behaviour of gstat on the command-line.

Specified by:
getDatabaseStatistics in interface StatisticsManager
Throws:
java.sql.SQLException - if a database access error occurs

getDatabaseStatistics

public void getDatabaseStatistics(int options)
                           throws java.sql.SQLException
Description copied from interface: StatisticsManager
Get 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:

If this method is invoked with 0 as the options value, only the header and log statistics will be output.

Specified by:
getDatabaseStatistics in 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

getTableStatistics

public void getTableStatistics(java.lang.String[] tableNames)
                        throws java.sql.SQLException
Description copied from interface: StatisticsManager
Get the table statistics. The statistics information is written to this StatisticsManager's logger.

The listed data includes:

Invoking this method is equivalent to the behaviour of gstat -t

on the command-line.

Specified by:
getTableStatistics in interface StatisticsManager
Parameters:
tableNames - array of table names to analyze.
Throws:
java.sql.SQLException - if something went wrong.


Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.