Class D_DiagnosticUtil


  • public class D_DiagnosticUtil
    extends java.lang.Object
    This class provides some utility functions used to debug on disk structures of the store.
    • Constructor Summary

      Constructors 
      Constructor Description
      D_DiagnosticUtil()
      No arg Constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String diag_conglomid​(java.lang.String db_name, long conglomid)
      Given a Database name and conglomid, return diagnositic string.
      static java.lang.String diag_conglomid_print​(java.lang.String db_name, long conglomid)
      Given a Database name and conglomid print out diagnostic info.
      static long diag_conglomid_to_containerid​(java.lang.Object module, long conglomid)  
      static long diag_conglomid_to_containerid​(java.lang.String db_name, long conglomid)
      Given a Database name and containerid, return conglomerate id.
      static long diag_containerid_to_conglomid​(java.lang.Object module, long containerid)  
      static long diag_containerid_to_conglomid​(java.lang.String db_name, long containerid)
      Given a Database name and conglomid, return container id.
      static void diag_dump_page​(java.lang.String db_name, long segmentid, long containerid, long pagenumber)
      Dump raw contents of a page.
      private static java.lang.Object findService​(java.lang.String factoryInterface, java.lang.String serviceName)
      Privileged service lookup.
      private static java.lang.Object findServiceModule​(java.lang.Object serviceModule, java.lang.String factoryInterface)
      Privileged startup.
      private static java.lang.Object getModuleFromDbName​(java.lang.String db_name)
      Given a database name come up with a module.
      private static java.lang.Object getServiceModule​(java.lang.Object serviceModule, java.lang.String factoryInterface)
      Privileged module lookup.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • D_DiagnosticUtil

        public D_DiagnosticUtil()
        No arg Constructor.
    • Method Detail

      • getModuleFromDbName

        private static java.lang.Object getModuleFromDbName​(java.lang.String db_name)
                                                     throws StandardException
        Given a database name come up with a module.

        Parameters:
        db_name - name of the database.
        Returns:
        The store module associated with given database name.
        Throws:
        StandardException - Standard exception policy.
      • diag_conglomid_print

        public static java.lang.String diag_conglomid_print​(java.lang.String db_name,
                                                            long conglomid)
                                                     throws StandardException
        Given a Database name and conglomid print out diagnostic info.

        Print diagnostic information about a particular conglomerate, can be called for either a btree or heap conglomerate. This routine prints out the string to "System.out"; "ij", depending on it's configuration, will only print out a fixed length (default 128 bytes), so having ij print the string can be a problem.

        Can be called from ij to find out info about conglomid 19 in database 'msgdb' by using the following syntax: maximumdisplaywidth 9000; CREATE FUNCTION D_CONGLOMID_PRINT(DBNAME VARCHAR(128), CONGLOMID INT) RETURNS VARCHAR(32000) RETURNS NULL ON NULL INPUT EXTERNAL NAME 'org.apache.derby.impl.store.raw.data.D_DiagnosticUtil.diag_conglomid_print' LANGUAGE JAVA PARAMETER STYLE JAVA; values D_CONGLOMID_PRINT('msgdb', 19); com.ibm.db2j.protocol.BasicServices.Diagnostic.T_Diagnosticable:: diag_conglomid_print('msgdb', 19); RESOLVE - An interface that takes a table name would be nice.

        Parameters:
        db_name - name of the database
        conglomid - conglomerate id of the conglomerate to debug
        Throws:
        StandardException - Standard exception policy.
      • diag_conglomid

        public static java.lang.String diag_conglomid​(java.lang.String db_name,
                                                      long conglomid)
                                               throws StandardException
        Given a Database name and conglomid, return diagnositic string.

        Return a string with diagnostic information about a particular conglomerate, can be called for any type of conglomerate (some types may not return any info though).

        Can be called from ij to find out info about conglomid 19 in database 'msgdb' by using the following syntax: values com.ibm.db2j.protocol.BasicServices.Diagnostic.T_Diagnosticable:: diag_conglomid('msgdb', 19); maximumdisplaywidth 9000; CREATE FUNCTION DIAG_CONGLOMID(DBNAME VARCHAR(128), CONGLOMID INT) RETURNS VARCHAR(32000) RETURNS NULL ON NULL INPUT EXTERNAL NAME 'org.apache.derby.impl.store.raw.data.D_DiagnosticUtil.diag_conglomid' LANGUAGE JAVA PARAMETER STYLE JAVA; values DIAG_CONGLOMID('msgdb', 19); com.ibm.db2j.protocol.BasicServices.Diagnostic.T_Diagnosticable:: diag_conglomid_print('msgdb', 19); RESOLVE - An interface that takes a table name would be nice.

        Parameters:
        db_name - name of the database
        conglomid - conglomerate id of the conglomerate to debug
        Throws:
        StandardException - Standard exception policy.
      • diag_dump_page

        public static void diag_dump_page​(java.lang.String db_name,
                                          long segmentid,
                                          long containerid,
                                          long pagenumber)
        Dump raw contents of a page.

        A utility routine that can be called from an ij session that will dump the raw contents of a page, in the raw store dump format.

        Parameters:
        db_name - name of the database
        segmentid - segmentid of the table (usually 0)
        containerid - containerid of the table (not conglomid)
        pagenumber - pagenumber of page to dump.
      • diag_containerid_to_conglomid

        public static long diag_containerid_to_conglomid​(java.lang.String db_name,
                                                         long containerid)
                                                  throws StandardException
        Given a Database name and conglomid, return container id.

        Return the containerid of a given conglomerate id.

        Can be called from ij to find out info about conglomid 19 in database 'msgdb' by using the following syntax: values com.ibm.db2j.protocol.BasicServices.Diagnostic.T_Diagnosticable). diag_containerid_to_conglomid('msgdb', 924300359390); RESOLVE - An interface that takes a table name would be nice.

        Parameters:
        db_name - name of the database
        containerid - container id of the conglomerate to look up
        Throws:
        StandardException - Standard exception policy.
      • diag_containerid_to_conglomid

        public static long diag_containerid_to_conglomid​(java.lang.Object module,
                                                         long containerid)
      • diag_conglomid_to_containerid

        public static long diag_conglomid_to_containerid​(java.lang.String db_name,
                                                         long conglomid)
                                                  throws StandardException
        Given a Database name and containerid, return conglomerate id.

        Return the conglomerate id of a given conainer id.

        Can be called from ij to find out info about conglomid 19 in database 'msgdb' by using the following syntax: values com.ibm.db2j.protocol.BasicServices.Diagnostic.T_Diagnosticable). diag_conglomid_to_containerid('msgdb', 19); RESOLVE - An interface that takes a table name would be nice.

        Parameters:
        db_name - name of the database
        conglomid - conglomerate id of the conglomerate to debug
        Throws:
        StandardException - Standard exception policy.
      • diag_conglomid_to_containerid

        public static long diag_conglomid_to_containerid​(java.lang.Object module,
                                                         long conglomid)
      • findServiceModule

        private static java.lang.Object findServiceModule​(java.lang.Object serviceModule,
                                                          java.lang.String factoryInterface)
                                                   throws StandardException
        Privileged startup. Must be private so that user code can't call this entry point.
        Throws:
        StandardException
      • getServiceModule

        private static java.lang.Object getServiceModule​(java.lang.Object serviceModule,
                                                         java.lang.String factoryInterface)
        Privileged module lookup. Must be private so that user code can't call this entry point.
      • findService

        private static java.lang.Object findService​(java.lang.String factoryInterface,
                                                    java.lang.String serviceName)
        Privileged service lookup. Must be private so that user code can't call this entry point.