Top Description Constructors Methods
org.apache.derby.impl.store.raw.data

public Class D_DiagnosticUtil

extends Object
Class Inheritance
Imports
org.apache.derby.iapi.services.context.ContextService, org.apache.derby.iapi.services.diag.Diagnosticable, .DiagnosticUtil, org.apache.derby.iapi.services.monitor.Monitor, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.AccessFactory, .ConglomerateController, .TransactionController, org.apache.derby.iapi.store.raw.ContainerHandle, .ContainerKey, .Page, .Transaction, .RawStoreFactory, org.apache.derby.shared.common.reference.Property

This class provides some utility functions used to debug on disk structures of the store.

Constructor Summary

AccessConstructor and Description
public
D_DiagnosticUtil()

No arg Constructor.

Method Summary

Modifier and TypeMethod and Description
public static String
diag_conglomid(String
name of the database
db_name
,
long
conglomerate id of the conglomerate to debug
conglomid
)

Given a Database name and conglomid, return diagnositic string.

public static String
diag_conglomid_print(String
name of the database
db_name
,
long
conglomerate id of the conglomerate to debug
conglomid
)

Given a Database name and conglomid print out diagnostic info.

public static long
diag_conglomid_to_containerid(String
name of the database
db_name
,
long
conglomerate id of the conglomerate to debug
conglomid
)

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).

public static long
diag_conglomid_to_containerid(Object module, long conglomid)

public static long
diag_containerid_to_conglomid(String
name of the database
db_name
,
long
container id of the conglomerate to look up
containerid
)

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).

public static long
diag_containerid_to_conglomid(Object module, long containerid)

public static void
diag_dump_page(String
name of the database
db_name
,
long
segmentid of the table (usually 0)
segmentid
,
long
containerid of the table (not conglomid)
containerid
,
long
pagenumber of page to dump.
pagenumber
)

Dump raw contents of a page.

private static Object
findService(final String factoryInterface, final String serviceName)

Must be private so that user code can't call this entry point.

private static Object
findServiceModule(final Object serviceModule, final String factoryInterface)

Must be private so that user code can't call this entry point.

private static Object

Returns:

The store module associated with given database name.
getModuleFromDbName
(String
name of the database.
db_name
)

Given a database name come up with a module.

private static Object
getServiceModule(final Object serviceModule, final String factoryInterface)

Must be private so that user code can't call this entry point.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

D_DiagnosticUtilback to summary
public D_DiagnosticUtil()

No arg Constructor.

Method Detail

diag_conglomidback to summary
public static String diag_conglomid(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:String

name of the database

conglomid:long

conglomerate id of the conglomerate to debug

Exceptions
StandardException:
Standard exception policy.
diag_conglomid_printback to summary
public static String diag_conglomid_print(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:String

name of the database

conglomid:long

conglomerate id of the conglomerate to debug

Exceptions
StandardException:
Standard exception policy.
diag_conglomid_to_containeridback to summary
public static long diag_conglomid_to_containerid(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:String

name of the database

conglomid:long

conglomerate id of the conglomerate to debug

Exceptions
StandardException:
Standard exception policy.
diag_conglomid_to_containeridback to summary
public static long diag_conglomid_to_containerid(Object module, long conglomid)
diag_containerid_to_conglomidback to summary
public static long diag_containerid_to_conglomid(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:String

name of the database

containerid:long

container id of the conglomerate to look up

Exceptions
StandardException:
Standard exception policy.
diag_containerid_to_conglomidback to summary
public static long diag_containerid_to_conglomid(Object module, long containerid)
diag_dump_pageback to summary
public static void diag_dump_page(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:String

name of the database

segmentid:long

segmentid of the table (usually 0)

containerid:long

containerid of the table (not conglomid)

pagenumber:long

pagenumber of page to dump.

findServiceback to summary
private static Object findService(final String factoryInterface, final String serviceName)

Must be private so that user code can't call this entry point.

findServiceModuleback to summary
private static Object findServiceModule(final Object serviceModule, final String factoryInterface) throws StandardException

Must be private so that user code can't call this entry point.

getModuleFromDbNameback to summary
private static Object getModuleFromDbName(String db_name) throws StandardException

Given a database name come up with a module.

Parameters
db_name:String

name of the database.

Returns:Object

The store module associated with given database name.

Exceptions
StandardException:
Standard exception policy.
getServiceModuleback to summary
private static Object getServiceModule(final Object serviceModule, final String factoryInterface)

Must be private so that user code can't call this entry point.