| java.lang.Object org.apache.derby.impl.sql.catalog.DataDictionaryImpl
DataDictionaryImpl | final public class DataDictionaryImpl implements DataDictionary,CacheableFactory,ModuleControl,ModuleSupportable,java.security.PrivilegedAction(Code) | | This abstract class contains the common code for the "regular" and
limited data dictionaries. The limited configuration puts an upper
limit on the number of tables a user is allowed to create.
This class provides the entire implementation of DataDictionary,
and ModuleControl, except for the stop()
method, which is to be provided by a non-abstract super-class.
The reason for putting the stop() method in the super-class is to
prevent someone from inadvertently changing this to a non-abstract
class. This class is shipped with both the limited and non-limited
configurations, and we don't want anyone to be able to cheat by
booting this class instead of booting the super-class.
|
Method Summary | |
public boolean | activeConstraint(ConstraintDescriptor constraint) Reports whether an individual constraint must be
enforced. | public void | addConstraintDescriptor(ConstraintDescriptor descriptor, TransactionController tc) Adds the given ConstraintDescriptor to the data dictionary,
associated with the given table and constraint type. | public void | addDescriptor(TupleDescriptor td, TupleDescriptor parent, int catalogNumber, boolean duplicatesAllowed, TransactionController tc) | public void | addDescriptor(TupleDescriptor td, TupleDescriptor parent, int catalogNumber, boolean duplicatesAllowed, TransactionController tc, boolean wait) | public void | addDescriptorArray(TupleDescriptor[] td, TupleDescriptor parent, int catalogNumber, boolean allowDuplicates, TransactionController tc) array version of addDescriptor. | public boolean | addRemovePermissionsDescriptor(boolean add, PermissionsDescriptor perm, String grantee, TransactionController tc) Add or remove a permission to/from the permission database. | public void | addSPSDescriptor(SPSDescriptor descriptor, TransactionController tc, boolean wait) Adds the given SPSDescriptor to the data dictionary,
associated with the given table and constraint type. | void | addSYSCOLUMNSIndex2Property(TransactionController tc, long index2ConglomerateNumber) | public void | addTableDescriptorToOtherCache(TableDescriptor td, Cacheable c) Add a table descriptor to the "other" cache. | public void | boot(boolean create, Properties startParams) Start-up method for this instance of the data dictionary. | public boolean | canSupport(Properties startParams) Currently, all this routine does is check to see if the Replication
property has been turned on for this database. | public boolean | checkVersion(int requiredMajorVersion, String feature) Check to see if a database has been upgraded to the required
level in order to use a language feature. | public void | clearCaches() Clear all of the DataDictionary caches. | void | clearSPSPlans() Mark all SPS plans in the data dictionary invalid. | public RowLocation[] | computeAutoincRowLocations(TransactionController tc, TableDescriptor td) | protected void | createDictionaryTables(Properties params, TransactionController tc, DataDescriptorGenerator ddg) Create all the required dictionary tables. | void | createRoutinePermPublicDescriptor(UUID routineUUID, TransactionController tc) Create RoutinePermDescriptor to grant access to PUBLIC for
this system routine. | void | createRoutinePermPublicDescriptor(UUID routineUUID, TransactionController tc, String authorizationID) Create RoutinePermDescriptor to grant access to PUBLIC for
this system routine using the grantor specified in authorizationID. | protected void | createSPSSet(TransactionController tc, boolean net, UUID schemaID) Create a set of stored prepared statements from a properties file. | void | createSystemSps(TransactionController tc) Create system built-in metadata stored prepared statements. | void | create_10_1_system_procedures(TransactionController tc, UUID sysUtilUUID) Create system procedures added in version 10.1. | void | create_10_2_system_procedures(TransactionController tc, UUID sysUtilUUID) Create system procedures added in version 10.2. | final protected void | create_SYSIBM_procedures(TransactionController tc) Create system procedures in SYSIBM
Used to add the system procedures to the database when
it is created. | public void | doneReading(int mode, LanguageConnectionContext lcc) | public void | dropAliasDescriptor(AliasDescriptor ad, TransactionController tc) | public void | dropAllColumnDescriptors(UUID tableID, TransactionController tc) Drops all column descriptors from the given table. | public void | dropAllConglomerateDescriptors(TableDescriptor td, TransactionController tc) Drops all conglomerates associated with a table. | public void | dropAllConstraintDescriptors(TableDescriptor table, TransactionController tc) | public void | dropAllRoutinePermDescriptors(UUID routineID, TransactionController tc) Drops all routine permission descriptors for the given routine. | public void | dropAllTableAndColPermDescriptors(UUID tableID, TransactionController tc) Drops all table and column permission descriptors for the given table. | public void | dropColumnDescriptor(UUID tableID, String columnName, TransactionController tc) Given a column name and a table ID, drops the column descriptor
from the table. | public void | dropConglomerateDescriptor(ConglomerateDescriptor conglomerate, TransactionController tc) | public void | dropConstraintDescriptor(TableDescriptor table, ConstraintDescriptor descriptor, TransactionController tc) Drops the given ConstraintDescriptor that is associated
with the given table and constraint type from the data dictionary. | public void | dropDependentsStoredDependencies(UUID dependentsUUID, TransactionController tc) Remove all of the stored dependencies for a given dependent's ID
from the data dictionary. | public void | dropDependentsStoredDependencies(UUID dependentsUUID, TransactionController tc, boolean wait) | public void | dropFileInfoDescriptor(FileInfoDescriptor fid) | public void | dropSPSDescriptor(SPSDescriptor descriptor, TransactionController tc) Drops the given SPSDescriptor. | public void | dropSPSDescriptor(UUID uuid, TransactionController tc) Drops the given SPSDescriptor. | public void | dropSchemaDescriptor(String schemaName, TransactionController tc) | public void | dropStatisticsDescriptors(UUID tableUUID, UUID referenceUUID, TransactionController tc) | public void | dropStoredDependency(DependencyDescriptor dd, TransactionController tc) Drop a single dependency from the data dictionary. | public void | dropTableDescriptor(TableDescriptor td, SchemaDescriptor schema, TransactionController tc) Drop the table descriptor.
Parameters: td - The table descriptor to drop Parameters: schema - A descriptor for the schema the tableis a part of. | public void | dropTriggerDescriptor(TriggerDescriptor descriptor, TransactionController tc) Drops the given TriggerDescriptor. | public void | dropViewDescriptor(ViewDescriptor vd, TransactionController tc) Drops the view descriptor from the data dictionary. | public void | faultInTabInfo(TabInfoImpl ti) Finishes building a TabInfoImpl if it hasn't already been faulted in. | public ConstraintDescriptorList | getActiveConstraintDescriptors(ConstraintDescriptorList cdl) Convert a constraint descriptor list into a list
of active constraints, that is, constraints which
must be enforced. | public AliasDescriptor | getAliasDescriptor(UUID uuid) Get a AliasDescriptor given its UUID. | public AliasDescriptor | getAliasDescriptor(String schemaId, String aliasName, char nameSpace) Get a AliasDescriptor by alias name and name space.
NOTE: caller responsible for handling no match.
Parameters: schemaId - schema identifier Parameters: aliasName - The alias name. Parameters: nameSpace - The alias type. | public List | getAllDependencyDescriptorsList() Build and return an List with DependencyDescriptors for
all of the stored dependencies. | public List | getAllSPSDescriptors() Get every statement in this database. | public String | getAuthorizationDatabaseOwner() | public int | getCacheMode() | public ColumnDescriptor | getColumnDescriptorByDefaultId(UUID uuid) Get a ColumnDescriptor given its Default ID. | public ColPermsDescriptor | getColumnPermissions(UUID colPermsUUID) | public ColPermsDescriptor | getColumnPermissions(UUID tableUUID, int privType, boolean forGrant, String authorizationId) Get one user's column privileges for a table.
Parameters: tableUUID - Parameters: privType - (as int) Authorizer.SELECT_PRIV, Authorizer.UPDATE_PRIV, or Authorizer.REFERENCES_PRIV Parameters: forGrant - Parameters: authorizationId - The user name a ColPermsDescriptor or null if the user has no separate columnpermissions of the specified type on the table. | public ColPermsDescriptor | getColumnPermissions(UUID tableUUID, String privTypeStr, boolean forGrant, String authorizationId) Get one user's column privileges for a table. | public ConglomerateDescriptor | getConglomerateDescriptor(UUID uuid) Get a ConglomerateDescriptor given its UUID. | public ConglomerateDescriptor | getConglomerateDescriptor(long conglomerateNumber) Get a ConglomerateDescriptor given its conglomerate number. | public ConglomerateDescriptor | getConglomerateDescriptor(String indexName, SchemaDescriptor sd, boolean forUpdate) Gets a conglomerate descriptor for the named index in the given schema,
getting an exclusive row lock on the matching row in
sys.sysconglomerates (for DDL concurrency) if requested.
Parameters: indexName - The name of the index we're looking for Parameters: sd - The schema descriptor Parameters: forUpdate - Whether or not to get an exclusive row lock on the row in sys.sysconglomerates. A ConglomerateDescriptor describing the requestedconglomerate. | public ConglomerateDescriptor[] | getConglomerateDescriptors(UUID uuid) Get an array of ConglomerateDescriptors given the UUID. | public ConglomerateDescriptor[] | getConglomerateDescriptors(long conglomerateNumber) Get an array of conglomerate descriptors for the given conglomerate
number. | public ConstraintDescriptor | getConstraintDescriptor(UUID uuid) Get a ConstraintDescriptor given its UUID. | public ConstraintDescriptor | getConstraintDescriptor(String constraintName, UUID schemaID) Get a ConstraintDescriptor given its name and schema ID. | public ConstraintDescriptor | getConstraintDescriptor(TableDescriptor td, UUID uuid) Get the constraint descriptor given a table and the UUID String
of the backing index.
Parameters: td - The table descriptor. Parameters: uuid - the UUID for the backing index. | public ConstraintDescriptor | getConstraintDescriptorById(TableDescriptor td, UUID uuid) | public ConstraintDescriptor | getConstraintDescriptorByName(TableDescriptor td, SchemaDescriptor sd, String constraintName, boolean forUpdate) Get the constraint descriptor given a TableDescriptor and the constraint name. | protected TupleDescriptor | getConstraintDescriptorViaHeap(ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, List list) Return a (single or list of) catalog row descriptor(s) from
SYSCONSTRAINTS through a heap scan
Parameters: scanQualifiers - qualifiers Parameters: ti - The TabInfoImpl to use Parameters: parentTupleDescriptor - The parentDescriptor, if applicable. Parameters: list - The list to build, if supplied. | protected ConstraintDescriptor | getConstraintDescriptorViaIndex(int indexId, ExecIndexRow keyRow, TabInfoImpl ti, TableDescriptor td, ConstraintDescriptorList dList, boolean forUpdate) Return a (single or list of) ConstraintDescriptor(s) from
SYSCONSTRAINTS where the access is from the index to the heap.
Parameters: indexId - The id of the index (0 to # of indexes on table) to use Parameters: keyRow - The supplied ExecIndexRow for search Parameters: ti - The TabInfoImpl to use Parameters: td - The TableDescriptor, if supplied. Parameters: dList - The list to build, if supplied. | public ConstraintDescriptorList | getConstraintDescriptors(TableDescriptor td) Load up the constraint descriptor list for this table
descriptor and return it. | public TableDescriptor | getConstraintTableDescriptor(UUID constraintId) Return a table descriptor corresponding to the TABLEID
field in SYSCONSTRAINTS where CONSTRAINTID matches
the constraintId passsed in. | public List | getConstraints(UUID uuid, int indexId, int columnNum) Return an List which of the relevant column matching
the indexed criteria. | public DataDescriptorGenerator | getDataDescriptorGenerator() Get a DataDescriptorGenerator, through which we can create
objects to be stored in the DataDictionary. | public DataValueFactory | getDataValueFactory() Get a DataValueFactory, through which we can create
data value objects. | public SchemaDescriptor | getDeclaredGlobalTemporaryTablesSchemaDescriptor() Get the descriptor for the declared global temporary table schema which
is always named "SESSION". | public DependencyManager | getDependencyManager() returns the dependencymanager associated with this datadictionary. | public List | getDependentsDescriptorList(String dependentID) Gets a list of the dependency descriptors for the given dependent's id.
Parameters: dependentID - The ID of the dependent we're interested in List Returns a list of DependencyDescriptors. | protected TupleDescriptor | getDescriptorViaHeap(ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, List list) Return a (single or list of) catalog row descriptor(s) from a
system table where the access a heap scan
Parameters: scanQualifiers - qualifiers Parameters: ti - The TabInfoImpl to use Parameters: parentTupleDescriptor - The parentDescriptor, if applicable. Parameters: list - The list to build, if supplied. | public int | getEngineType() | public ExecutionFactory | getExecutionFactory() Get ExecutionFactory associated with this database. | public FileInfoDescriptor | getFileInfoDescriptor(UUID id) | public FileInfoDescriptor | getFileInfoDescriptor(SchemaDescriptor sd, String name) | public ConstraintDescriptorList | getForeignKeys(UUID constraintId) Return a list of foreign keys constraints referencing
this constraint. | public static ExecIndexRow | getIndexRowFromHeapRow(IndexRowGenerator irg, RowLocation rl, ExecRow heapRow) Get an index row based on a row from the heap. | protected TabInfoImpl | getNonCoreTIByNumber(int catalogNumber) returns the tabinfo for a non core system catalog. | public List | getProvidersDescriptorList(String providerID) Gets a list of the dependency descriptors for the given provider's id.
Parameters: providerID - The ID of the provider we're interested in List Returns a list of DependencyDescriptors. | public java.util.List | getRoutineList(String schemaID, String routineName, char nameSpace) Get the list of routines matching the schema and routine name. | public RoutinePermsDescriptor | getRoutinePermissions(UUID routineUUID, String authorizationId) Get one user's permissions for a routine (function or procedure). | public RoutinePermsDescriptor | getRoutinePermissions(UUID routinePermsUUID) | public RowLocation | getRowLocationTemplate(LanguageConnectionContext lcc, TableDescriptor td) | public SPSDescriptor | getSPSDescriptor(UUID uuid) Get a SPSDescriptor given its UUID. | public SPSDescriptor | getSPSDescriptor(String stmtName, SchemaDescriptor sd) Get a SPSDescriptor given its name.
Currently no cacheing. | public DataTypeDescriptor[] | getSPSParams(SPSDescriptor spsd, Vector defaults) Get all the parameter descriptors for an SPS.
Look up the params in SYSCOLUMNS and turn them
into parameter descriptors. | public long | getSYSCOLUMNSHeapConglomerateNumber() Get the heap conglomerate number for SYS.SYSCOLUMNS. | public SchemaDescriptor | getSchemaDescriptor(String schemaName, TransactionController tc, boolean raiseError) Get the descriptor for the named schema.
Schema descriptors include authorization ids and schema ids.
SQL92 allows a schema to specify a default character set - we will
not support this. | public SchemaDescriptor | getSchemaDescriptor(UUID schemaId, TransactionController tc) Get the descriptor for the named schema. | public NumberDataValue | getSetAutoincrementValue(RowLocation rl, TransactionController tc, boolean doUpdate, NumberDataValue newValue, boolean wait) | public List | getStatisticsDescriptors(TableDescriptor td) get all the statistiscs descriptors for a given table. | public SubKeyConstraintDescriptor | getSubKeyConstraint(UUID constraintId, int type) Get a SubKeyConstraintDescriptor from syskeys or sysforeignkeys for
the specified constraint id. | public SchemaDescriptor | getSysIBMSchemaDescriptor() Get the descriptor for the SYSIBM schema. | public SchemaDescriptor | getSystemDiagSchemaDescriptor() Get the descriptor for the SYSCS_DIAG system schema. | public String | getSystemSQLName() Returns a unique system generated name of the form SQLyymmddhhmmssxxn
yy - year, mm - month, dd - day of month, hh - hour, mm - minute, ss - second,
xx - the first 2 digits of millisec because we don't have enough space to keep the exact millisec value,
n - number between 0-9
The number at the end is to handle more than one system generated name request came at the same time.
In that case, the timestamp will remain the same, we will just increment n at the end of the name.
Following is how we get around the problem of more than 10 system generated name requestes at the same time:
When the database boots up, we start a counter with value -1 for the last digit in the generated name.
We also keep the time in millisec to keep track of when the last system name was generated. | public SchemaDescriptor | getSystemSchemaDescriptor() Get the descriptor for the system schema. | public SchemaDescriptor | getSystemUtilSchemaDescriptor() Get the descriptor for the SYSCS_UTIL system schema. | public TableDescriptor | getTableDescriptor(String tableName, SchemaDescriptor schema) Get the descriptor for the named table within the given schema.
If the schema parameter is NULL, it looks for the table in the
current (default) schema. | public TableDescriptor | getTableDescriptor(UUID tableID) Get the descriptor for the table with the given UUID.
NOTE: I'm assuming that the object store will define an UUID for
persistent objects. | public TablePermsDescriptor | getTablePermissions(UUID tableUUID, String authorizationId) | public TablePermsDescriptor | getTablePermissions(UUID tablePermsUUID) | public TransactionController | getTransactionCompile() Get the TransactionController to use, when not
passed in as a parameter. | public TransactionController | getTransactionExecute() Get the TransactionController to use, when not
passed in as a parameter. | public TriggerDescriptor | getTriggerDescriptor(UUID uuid) Get a TriggerDescriptor given its UUID. | public TriggerDescriptor | getTriggerDescriptor(String name, SchemaDescriptor sd) Get the stored prepared statement descriptor given
a sps name.
Parameters: name - The sps name. Parameters: sd - The schema descriptor. | public GenericDescriptorList | getTriggerDescriptors(TableDescriptor td) Load up the trigger descriptor list for this table
descriptor and return it. | public UUIDFactory | getUUIDFactory() Get the UUID Factory. | ColPermsDescriptor | getUncachedColPermsDescriptor(ColPermsDescriptor key) Get a column permissions descriptor from the system tables, without going through the cache. | RoutinePermsDescriptor | getUncachedRoutinePermsDescriptor(RoutinePermsDescriptor key) Get a routine permissions descriptor from the system tables, without going through the cache. | public SPSDescriptor | getUncachedSPSDescriptor(TableKey stmtKey) This method can get called from the DataDictionary cache. | protected SPSDescriptor | getUncachedSPSDescriptor(UUID stmtId) This method can get called from the DataDictionary cache. | TableDescriptor | getUncachedTableDescriptor(TableKey tableKey) This method can get called from the DataDictionary cache. | protected TableDescriptor | getUncachedTableDescriptor(UUID tableID) This method can get called from the DataDictionary cache. | TablePermsDescriptor | getUncachedTablePermsDescriptor(TablePermsDescriptor key) Get a table permissions descriptor from the system tables, without going through the cache. | public String | getVTIClass(TableDescriptor td) | public DataValueDescriptor | getValueAsDVD(UUID uuid) Converts a UUID to an DataValueDescriptor. | public ViewDescriptor | getViewDescriptor(UUID uuid) Gets the viewDescriptor for the view with the given UUID. | public ViewDescriptor | getViewDescriptor(TableDescriptor td) Gets the viewDescriptor for the view given the TableDescriptor. | public void | grantPublicAccessToSystemRoutines(TransactionController tc, String authorizationID) Grant PUBLIC access to specific system routines. | public Hashtable | hashAllConglomerateDescriptorsByNumber(TransactionController tc) Get all of the ConglomerateDescriptors in the database and
hash them by conglomerate number. | public Hashtable | hashAllTableDescriptorsByTableId(TransactionController tc) Get all of the TableDescriptors in the database and hash them by TableId
This is useful as a performance optimization for the locking VTIs. | public void | initSystemIndexVariables(DataDescriptorGenerator ddg, TabInfoImpl ti, int indexNumber) | protected void | initSystemIndexVariables(TabInfoImpl ti) | public void | initializeCatalogInfo() Initialize catalog information. | public void | invalidateAllSPSPlans() | public boolean | isSchemaEmpty(SchemaDescriptor sd) Indicate whether there is anything in the
particular schema. | protected boolean | isSchemaReferenced(TransactionController tc, TabInfoImpl ti, int indexId, int indexCol, DataValueDescriptor schemaIdOrderable) Is the schema id referenced by the system table in question?
Currently assumes that the schema id is in an index. | public boolean | isSystemSchemaName(String name) Determine whether a string is the name of the system schema. | public void | loadCatalogs(DataDescriptorGenerator ddg, TabInfoImpl[] catalogArray) | protected void | loadDictionaryTables(TransactionController tc, DataDescriptorGenerator ddg, Properties startParams) Initialize system catalogs. | public void | makeCatalog(TabInfoImpl ti, SchemaDescriptor sd, TransactionController tc) The dirty work of creating a catalog. | public Cacheable | newCacheable(CacheManager cm) | protected void | populateSYSDUMMY1(TransactionController tc) Populate SYSDUMMY1 table with a single row. | public DataDictionaryContext | pushDataDictionaryContext(ContextManager contextManager) | final public Object | run() | public void | setAutoincrementValue(TransactionController tc, UUID tableUUID, String columnName, long aiValue, boolean incrementNeeded) sets a new value in SYSCOLUMNS for a particular
autoincrement column. | protected void | setDependencyManager() sets the dependencymanager associated with this dd. | void | spsCacheEntryAdded(SPSDescriptor spsd) Add an entry to the hashtables for lookup from the cache. | void | spsCacheEntryRemoved(SPSDescriptor spsd) | public int | startReading(LanguageConnectionContext lcc) | public void | startWriting(LanguageConnectionContext lcc) | public void | stop() Stop this module. | public void | transactionFinished() | public void | updateConglomerateDescriptor(ConglomerateDescriptor cd, long conglomerateNumber, TransactionController tc) Update the conglomerateNumber for a ConglomerateDescriptor. | public void | updateConglomerateDescriptor(ConglomerateDescriptor[] cds, long conglomerateNumber, TransactionController tc) Update the conglomerateNumber for an array of ConglomerateDescriptors.
In case of more than one ConglomerateDescriptor, each descriptor
should be updated separately, conglomerate id is not same for all
the descriptors. | public void | updateConstraintDescriptor(ConstraintDescriptor cd, UUID formerUUID, int[] colsToSet, TransactionController tc) Update the constraint descriptor in question. | public void | updateLockGranularity(TableDescriptor td, SchemaDescriptor schema, char lockGranularity, TransactionController tc) Update the lockGranularity for the specified table. | public void | updateSPS(SPSDescriptor spsd, TransactionController tc, boolean recompile, boolean updateParamDescriptors, boolean wait, boolean firstCompilation) Updates SYS.SYSSTATEMENTS with the info from the
SPSD. | public void | updateSYSCOLPERMSforAddColumnToUserTable(UUID tableID, TransactionController tc) Need to update SYSCOLPERMS for a given table because a new column has
been added to that table. | public void | updateSchemaAuth(String schemaName, String authorizationId, TransactionController tc) | public void | updateSystemSchemaAuthorization(String aid, TransactionController tc) Update all system schemas to have new authorizationId. | public void | updateTriggerDescriptor(TriggerDescriptor triggerd, UUID formerUUID, int[] colsToSet, TransactionController tc) Update the trigger descriptor in question. | protected void | upgradeMakeCatalog(TransactionController tc, int catalogNumber) called by the upgrade code (dd_xena etc) to add a new system catalog. | public void | upgrade_addColumns(CatalogRowFactory rowFactory, int[] newColumnIDs, TransactionController tc) Upgrade an existing catalog by adding columns. | public void | upgrade_addInvisibleColumns(CatalogRowFactory rowFactory, int[] newColumnIDs, TransactionController tc) | void | upgrade_initSystemTableCols(TransactionController tc, boolean isCoreTable, int tableNum, FormatableBitSet columnsToUpdateSet, DataValueDescriptor[] replaceRow) Initialize noncore columns to fixed values
Parameters: tc - The TransactionController for the transaction to do theupgrade in. Parameters: isCoreTable - true if it is a core table Parameters: tableNum - the noncore table number Parameters: columnsToUpdateSet - a bit set of columns to update. | public long | upgrade_makeOneIndex(TransactionController tc, TabInfoImpl ti, int indexNumber, long heapConglomerateNumber) Code to add an index to a catalog during upgrade. | public void | upgrade_setNullability(CatalogRowFactory rowFactory, int columnNumber, boolean nullability, TransactionController tc) | public boolean | usesSqlAuthorization() |
booting | protected boolean booting(Code) | | |
builtinSchemasAreFromLCC | boolean builtinSchemasAreFromLCC(Code) | | |
cacheMode | volatile int cacheMode(Code) | | |
convertIdToLower | protected boolean convertIdToLower(Code) | | |
ddlUsers | volatile int ddlUsers(Code) | | |
declaredGlobalTemporaryTablesSchemaDesc | protected SchemaDescriptor declaredGlobalTemporaryTablesSchemaDesc(Code) | | |
engineType | int engineType(Code) | | |
permissionsCacheSize | int permissionsCacheSize(Code) | | |
readOnlyUpgrade | public boolean readOnlyUpgrade(Code) | | True if the database is read only and requires
some form of upgrade, that makes the stored prepared
statements invalid.
With this case the engine is running at a different
version to the underlying stored database. This
can happen in 5.1 if the database is read only
and a different point release (later than 5.1.25?)
to the one that created it, has been booted. (Beetle 5170).
In 5.2 and newer this will be the case if the engine
booting the database is newer than the engine
that created it.
|
readersInDDLMode | volatile int readersInDDLMode(Code) | | |
stmtCacheSize | int stmtCacheSize(Code) | | |
tdCacheSize | int tdCacheSize(Code) | | |
DataDictionaryImpl | public DataDictionaryImpl()(Code) | | |
activeConstraint | public boolean activeConstraint(ConstraintDescriptor constraint) throws StandardException(Code) | | Reports whether an individual constraint must be
enforced. For the Core product, this routine always
returns true.
However, during REFRESH we may have deferred some
constraints until statement end. This method returns
false if the constraint deferred
Parameters: constraint - the constraint to check The corresponding Active ConstraintDescriptorList exception: StandardException - Thrown on failure |
addRemovePermissionsDescriptor | public boolean addRemovePermissionsDescriptor(boolean add, PermissionsDescriptor perm, String grantee, TransactionController tc) throws StandardException(Code) | | Add or remove a permission to/from the permission database.
Parameters: add - if true then the permission is added, if false the permission is removed Parameters: perm - Parameters: grantee - Parameters: tc - True means revoke has removed a privilege from systemtable and hence the caller of this method should send invalidation actions to PermssionDescriptor's dependents. |
addSPSDescriptor | public void addSPSDescriptor(SPSDescriptor descriptor, TransactionController tc, boolean wait) throws StandardException(Code) | | Adds the given SPSDescriptor to the data dictionary,
associated with the given table and constraint type.
Parameters: descriptor - The descriptor to add Parameters: tc - The transaction controller exception: StandardException - Thrown on error |
addTableDescriptorToOtherCache | public void addTableDescriptorToOtherCache(TableDescriptor td, Cacheable c) throws StandardException(Code) | | Add a table descriptor to the "other" cache. The other cache is
determined by the type of the object c.
Parameters: td - TableDescriptor to add to the other cache. Parameters: c - Cacheable Object which lets us figure out the other cache. exception: StandardException - |
boot | public void boot(boolean create, Properties startParams) throws StandardException(Code) | | Start-up method for this instance of the data dictionary.
Parameters: startParams - The start-up parameters exception: StandardException - Thrown if the module fails to start |
canSupport | public boolean canSupport(Properties startParams)(Code) | | Currently, all this routine does is check to see if the Replication
property has been turned on for this database. If so, then this is not
the NodeFactory that's wanted--so we return false. The NodeFactory that
is wanted is our child class "RepNodeFactory".
true if this database does not want Replicationfalse otherwise |
checkVersion | public boolean checkVersion(int requiredMajorVersion, String feature) throws StandardException(Code) | | Check to see if a database has been upgraded to the required
level in order to use a language feature.
Parameters: requiredMajorVersion - Data Dictionary major version Parameters: feature - Non-null to throw an error, null to return the state of the version match. True if the database has been upgraded to the required level, false otherwise. |
clearSPSPlans | void clearSPSPlans() throws StandardException(Code) | | Mark all SPS plans in the data dictionary invalid. This does
not invalidate cached plans. This function is for use by
the boot-up code.
exception: StandardException - Thrown on error |
createDictionaryTables | protected void createDictionaryTables(Properties params, TransactionController tc, DataDescriptorGenerator ddg) throws StandardException(Code) | | Create all the required dictionary tables. Any classes that extend this class
and need to create new tables shoudl override this method, and then
call this method as the first action in the new method, e.g.
protected Configuration createDictionaryTables(Configuration cfg, TransactionController tc,
DataDescriptorGenerator ddg)
throws StandardException
{
super.createDictionaryTables(params, tc, ddg);
...
}
exception: StandardException - Standard Cloudscape error policy |
createRoutinePermPublicDescriptor | void createRoutinePermPublicDescriptor(UUID routineUUID, TransactionController tc) throws StandardException(Code) | | Create RoutinePermDescriptor to grant access to PUBLIC for
this system routine. Currently only SYSUTIL routines need access
granted to execute them when a database is created/upgraded.
Parameters: routineUUID - uuid of the routine Parameters: tc - TransactionController to use exception: StandardException - Standard exception policy. |
createRoutinePermPublicDescriptor | void createRoutinePermPublicDescriptor(UUID routineUUID, TransactionController tc, String authorizationID) throws StandardException(Code) | | Create RoutinePermDescriptor to grant access to PUBLIC for
this system routine using the grantor specified in authorizationID.
Parameters: routineUUID - uuid of the routine Parameters: tc - TransactionController to use Parameters: authorizationID - authorization ID of the permission grantor throws: StandardException - Standard exception policy. |
createSPSSet | protected void createSPSSet(TransactionController tc, boolean net, UUID schemaID) throws StandardException(Code) | | Create a set of stored prepared statements from a properties file.
Key is the statement name, value is the SQL statement.
|
create_10_1_system_procedures | void create_10_1_system_procedures(TransactionController tc, UUID sysUtilUUID) throws StandardException(Code) | | Create system procedures added in version 10.1.
Create 10.1 system procedures, called by either code creating new
database, or code doing hard upgrade from previous version.
Parameters: sysUtilUUID - uuid of the SYSUTIL schema. exception: StandardException - Standard exception policy. |
create_10_2_system_procedures | void create_10_2_system_procedures(TransactionController tc, UUID sysUtilUUID) throws StandardException(Code) | | Create system procedures added in version 10.2.
Create 10.2 system procedures, called by either code creating new
database, or code doing hard upgrade from previous version.
Parameters: sysUtilUUID - uuid of the SYSUTIL schema. exception: StandardException - Standard exception policy. |
create_SYSIBM_procedures | final protected void create_SYSIBM_procedures(TransactionController tc) throws StandardException(Code) | | Create system procedures in SYSIBM
Used to add the system procedures to the database when
it is created. Full upgrade from version 5.1 or earlier also
calls this method.
Parameters: tc - transaction controller to use. Counts on caller tocommit. exception: StandardException - Standard exception policy. |
dropAllColumnDescriptors | public void dropAllColumnDescriptors(UUID tableID, TransactionController tc) throws StandardException(Code) | | Drops all column descriptors from the given table. Useful for
DROP TABLE.
Parameters: tableID - The UUID of the table from which to dropall the column descriptors Parameters: tc - TransactionController for the transaction exception: StandardException - Thrown on error |
dropAllConstraintDescriptors | public void dropAllConstraintDescriptors(TableDescriptor table, TransactionController tc) throws StandardException(Code) | | Drops all ConstraintDescriptors from the data dictionary
that are associated with the given table,
Parameters: table - The table from which to drop allconstraint descriptors Parameters: tc - The TransactionController exception: StandardException - Thrown on error |
dropAllRoutinePermDescriptors | public void dropAllRoutinePermDescriptors(UUID routineID, TransactionController tc) throws StandardException(Code) | | Drops all routine permission descriptors for the given routine.
Parameters: routineID - The UUID of the routine from which to dropall the permission descriptors Parameters: tc - TransactionController for the transaction exception: StandardException - Thrown on error |
dropAllTableAndColPermDescriptors | public void dropAllTableAndColPermDescriptors(UUID tableID, TransactionController tc) throws StandardException(Code) | | Drops all table and column permission descriptors for the given table.
Parameters: tableID - The UUID of the table from which to dropall the permission descriptors Parameters: tc - TransactionController for the transaction exception: StandardException - Thrown on error |
dropColumnDescriptor | public void dropColumnDescriptor(UUID tableID, String columnName, TransactionController tc) throws StandardException(Code) | | Given a column name and a table ID, drops the column descriptor
from the table.
Parameters: tableID - The UUID of the table to drop the column from Parameters: columnName - The name of the column to drop Parameters: tc - TransactionController for the transaction exception: StandardException - Thrown on error |
dropConstraintDescriptor | public void dropConstraintDescriptor(TableDescriptor table, ConstraintDescriptor descriptor, TransactionController tc) throws StandardException(Code) | | Drops the given ConstraintDescriptor that is associated
with the given table and constraint type from the data dictionary.
Parameters: table - The table from which to drop theconstraint descriptor Parameters: descriptor - The descriptor to drop Parameters: tc - The TransactionController exception: StandardException - Thrown on error |
dropDependentsStoredDependencies | public void dropDependentsStoredDependencies(UUID dependentsUUID, TransactionController tc) throws StandardException(Code) | | Remove all of the stored dependencies for a given dependent's ID
from the data dictionary.
Parameters: dependentsUUID - Dependent's uuid Parameters: tc - TransactionController for the transaction exception: StandardException - Thrown on failure |
dropSchemaDescriptor | public void dropSchemaDescriptor(String schemaName, TransactionController tc) throws StandardException(Code) | | Drop the descriptor for a schema, given the schema's name
Parameters: schemaName - The name of the schema to drop Parameters: tc - TransactionController for the transaction exception: StandardException - Thrown on error |
dropTableDescriptor | public void dropTableDescriptor(TableDescriptor td, SchemaDescriptor schema, TransactionController tc) throws StandardException(Code) | | Drop the table descriptor.
Parameters: td - The table descriptor to drop Parameters: schema - A descriptor for the schema the tableis a part of. If this parameter isNULL, then the table is part of thecurrent (default) schema Parameters: tc - TransactionController for the transaction exception: StandardException - Thrown on error |
faultInTabInfo | public void faultInTabInfo(TabInfoImpl ti) throws StandardException(Code) | | Finishes building a TabInfoImpl if it hasn't already been faulted in.
NOP if TabInfoImpl has already been faulted in.
Parameters: ti - TabInfoImpl to fault in. exception: StandardException - Thrown on error |
getActiveConstraintDescriptors | public ConstraintDescriptorList getActiveConstraintDescriptors(ConstraintDescriptorList cdl) throws StandardException(Code) | | Convert a constraint descriptor list into a list
of active constraints, that is, constraints which
must be enforced. For the Core product, these
are just the constraints on the original list.
However, during REFRESH we may have deferred some
constraints until statement end. This method returns
the corresponding list of constraints which AREN'T
deferred.
Parameters: cdl - The constraint descriptor list to wrap withan Active constraint descriptor list. The corresponding Active ConstraintDescriptorList exception: StandardException - Thrown on failure |
getAliasDescriptor | public AliasDescriptor getAliasDescriptor(String schemaId, String aliasName, char nameSpace) throws StandardException(Code) | | Get a AliasDescriptor by alias name and name space.
NOTE: caller responsible for handling no match.
Parameters: schemaId - schema identifier Parameters: aliasName - The alias name. Parameters: nameSpace - The alias type. AliasDescriptor AliasDescriptor for the alias name and name space exception: StandardException - Thrown on failure |
getAllDependencyDescriptorsList | public List getAllDependencyDescriptorsList() throws StandardException(Code) | | Build and return an List with DependencyDescriptors for
all of the stored dependencies.
This is useful for consistency checking.
List List of all DependencyDescriptors. exception: StandardException - Thrown on failure |
getAllSPSDescriptors | public List getAllSPSDescriptors() throws StandardException(Code) | | Get every statement in this database.
Return the SPSDescriptors in an list.
the list of descriptors exception: StandardException - Thrown on failure |
getAuthorizationDatabaseOwner | public String getAuthorizationDatabaseOwner()(Code) | | Get authorizationID of Database Owner
authorizationID |
getCacheMode | public int getCacheMode()(Code) | | |
getColumnPermissions | public ColPermsDescriptor getColumnPermissions(UUID tableUUID, int privType, boolean forGrant, String authorizationId) throws StandardException(Code) | | Get one user's column privileges for a table.
Parameters: tableUUID - Parameters: privType - (as int) Authorizer.SELECT_PRIV, Authorizer.UPDATE_PRIV, or Authorizer.REFERENCES_PRIV Parameters: forGrant - Parameters: authorizationId - The user name a ColPermsDescriptor or null if the user has no separate columnpermissions of the specified type on the table. Note that the user may have been grantedpermission on all the columns of the table (no column list), in which case this routinewill return null. You must also call getTablePermissions to see if the user has permissionon a set of columns. exception: StandardException - |
getColumnPermissions | public ColPermsDescriptor getColumnPermissions(UUID tableUUID, String privTypeStr, boolean forGrant, String authorizationId) throws StandardException(Code) | | Get one user's column privileges for a table. This routine gets called
during revoke privilege processing
Parameters: tableUUID - Parameters: privTypeStr - (as String) Authorizer.SELECT_PRIV, Authorizer.UPDATE_PRIV, or Authorizer.REFERENCES_PRIV Parameters: forGrant - Parameters: authorizationId - The user name a ColPermsDescriptor or null if the user has no separate columnpermissions of the specified type on the table. Note that the user may have been grantedpermission on all the columns of the table (no column list), in which case this routinewill return null. You must also call getTablePermissions to see if the user has permissionon a set of columns. exception: StandardException - |
getConglomerateDescriptor | public ConglomerateDescriptor getConglomerateDescriptor(UUID uuid) throws StandardException(Code) | | Get a ConglomerateDescriptor given its UUID. If it is an index
conglomerate shared by at least another duplicate index, this returns
one of the ConglomerateDescriptors for those indexes.
Parameters: uuid - The UUID A ConglomerateDescriptor for the conglomerate. exception: StandardException - Thrown on failure |
getConglomerateDescriptor | public ConglomerateDescriptor getConglomerateDescriptor(long conglomerateNumber) throws StandardException(Code) | | Get a ConglomerateDescriptor given its conglomerate number. If it is an
index conglomerate shared by at least another duplicate index, this
returns one of the ConglomerateDescriptors for those indexes.
Parameters: conglomerateNumber - The conglomerate number. A ConglomerateDescriptor for the conglomerate. Returns NULL ifno such conglomerate. exception: StandardException - Thrown on failure |
getConglomerateDescriptor | public ConglomerateDescriptor getConglomerateDescriptor(String indexName, SchemaDescriptor sd, boolean forUpdate) throws StandardException(Code) | | Gets a conglomerate descriptor for the named index in the given schema,
getting an exclusive row lock on the matching row in
sys.sysconglomerates (for DDL concurrency) if requested.
Parameters: indexName - The name of the index we're looking for Parameters: sd - The schema descriptor Parameters: forUpdate - Whether or not to get an exclusive row lock on the row in sys.sysconglomerates. A ConglomerateDescriptor describing the requestedconglomerate. Returns NULL if no such conglomerate. exception: StandardException - Thrown on failure |
getConglomerateDescriptors | public ConglomerateDescriptor[] getConglomerateDescriptors(UUID uuid) throws StandardException(Code) | | Get an array of ConglomerateDescriptors given the UUID. If it is a
heap conglomerate or an index conglomerate not shared by a duplicate
index, the size of the return array is 1.
Parameters: uuid - The UUID An array of ConglomerateDescriptors for the conglomerate.returns size 0 array if no such conglomerate. exception: StandardException - Thrown on failure |
getConglomerateDescriptors | public ConglomerateDescriptor[] getConglomerateDescriptors(long conglomerateNumber) throws StandardException(Code) | | Get an array of conglomerate descriptors for the given conglomerate
number. If it is a heap conglomerate or an index conglomerate not
shared by a duplicate index, the size of the return array is 1.
Parameters: conglomerateNumber - The number for the conglomeratewe're interested in An array of ConglomerateDescriptors that share the requestedconglomerate. Returns size 0 array if no such conglomerate. exception: StandardException - Thrown on failure |
getConstraintDescriptor | public ConstraintDescriptor getConstraintDescriptor(UUID uuid) throws StandardException(Code) | | Get a ConstraintDescriptor given its UUID. Please
use getConstraintDescriptorById() is you have the
constraints table descriptor, it is much faster.
Parameters: uuid - The UUID The ConstraintDescriptor for the constraint. exception: StandardException - Thrown on failure |
getConstraintDescriptor | public ConstraintDescriptor getConstraintDescriptor(String constraintName, UUID schemaID) throws StandardException(Code) | | Get a ConstraintDescriptor given its name and schema ID.
Please use getConstraintDescriptorByName() if you have the
constraint's table descriptor, it is much faster.
Parameters: constraintName - Constraint name. Parameters: schemaID - The schema UUID The ConstraintDescriptor for the constraint. exception: StandardException - Thrown on failure |
getConstraintDescriptor | public ConstraintDescriptor getConstraintDescriptor(TableDescriptor td, UUID uuid) throws StandardException(Code) | | Get the constraint descriptor given a table and the UUID String
of the backing index.
Parameters: td - The table descriptor. Parameters: uuid - the UUID for the backing index. The ConstraintDescriptor for the constraint. exception: StandardException - Thrown on failure |
getConstraintDescriptorById | public ConstraintDescriptor getConstraintDescriptorById(TableDescriptor td, UUID uuid) throws StandardException(Code) | | Get the constraint descriptor given a table and the UUID String
of the constraint
Parameters: td - The table descriptor. Parameters: uuid - The UUID for the constraint The ConstraintDescriptor for the constraint. exception: StandardException - Thrown on failure |
getConstraintDescriptorByName | public ConstraintDescriptor getConstraintDescriptorByName(TableDescriptor td, SchemaDescriptor sd, String constraintName, boolean forUpdate) throws StandardException(Code) | | Get the constraint descriptor given a TableDescriptor and the constraint name.
Parameters: td - The table descriptor. Parameters: sd - The schema descriptor for the constraint Parameters: constraintName - The constraint name. Parameters: forUpdate - Whether or not access is for update The ConstraintDescriptor for the constraint. exception: StandardException - Thrown on failure |
getConstraintDescriptorViaHeap | protected TupleDescriptor getConstraintDescriptorViaHeap(ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, List list) throws StandardException(Code) | | Return a (single or list of) catalog row descriptor(s) from
SYSCONSTRAINTS through a heap scan
Parameters: scanQualifiers - qualifiers Parameters: ti - The TabInfoImpl to use Parameters: parentTupleDescriptor - The parentDescriptor, if applicable. Parameters: list - The list to build, if supplied. If null, then caller expects a single descriptor The last matching descriptor exception: StandardException - Thrown on error |
getConstraintDescriptorViaIndex | protected ConstraintDescriptor getConstraintDescriptorViaIndex(int indexId, ExecIndexRow keyRow, TabInfoImpl ti, TableDescriptor td, ConstraintDescriptorList dList, boolean forUpdate) throws StandardException(Code) | | Return a (single or list of) ConstraintDescriptor(s) from
SYSCONSTRAINTS where the access is from the index to the heap.
Parameters: indexId - The id of the index (0 to # of indexes on table) to use Parameters: keyRow - The supplied ExecIndexRow for search Parameters: ti - The TabInfoImpl to use Parameters: td - The TableDescriptor, if supplied. Parameters: dList - The list to build, if supplied. If null, then caller expectsa single descriptor Parameters: forUpdate - Whether or not to open scan for update The last matching descriptor exception: StandardException - Thrown on error |
getConstraintDescriptors | public ConstraintDescriptorList getConstraintDescriptors(TableDescriptor td) throws StandardException(Code) | | Load up the constraint descriptor list for this table
descriptor and return it. If the descriptor list
is already loaded up, it is retuned without further
ado. If no table descriptor is passed in, then all
constraint descriptors are retrieved. Note that in
this case, the constraint descriptor objects may be
duplicates of constraint descriptors that are hung
off of the table descriptor cache.
Parameters: td - The table descriptor. If null,all constraint descriptors are returned. The ConstraintDescriptorList for the table exception: StandardException - Thrown on failure |
getConstraintTableDescriptor | public TableDescriptor getConstraintTableDescriptor(UUID constraintId) throws StandardException(Code) | | Return a table descriptor corresponding to the TABLEID
field in SYSCONSTRAINTS where CONSTRAINTID matches
the constraintId passsed in.
Parameters: constraintId - The id of the constraint the corresponding table descriptor exception: StandardException - Thrown on error |
getConstraints | public List getConstraints(UUID uuid, int indexId, int columnNum) throws StandardException(Code) | | Return an List which of the relevant column matching
the indexed criteria. If nothing matches, returns an
empty List (never returns null).
Parameters: uuid - The id of the constraint Parameters: indexId - The index id in SYS.SYSCONSTRAINTS Parameters: columnNum - The column to retrieve a list of UUIDs in an List. exception: StandardException - Thrown on error |
getDataDescriptorGenerator | public DataDescriptorGenerator getDataDescriptorGenerator()(Code) | | Get a DataDescriptorGenerator, through which we can create
objects to be stored in the DataDictionary.
A DataDescriptorGenerator |
getDataValueFactory | public DataValueFactory getDataValueFactory()(Code) | | Get a DataValueFactory, through which we can create
data value objects.
A DataValueFactory |
getDeclaredGlobalTemporaryTablesSchemaDescriptor | public SchemaDescriptor getDeclaredGlobalTemporaryTablesSchemaDescriptor() throws StandardException(Code) | | Get the descriptor for the declared global temporary table schema which
is always named "SESSION".
The descriptor for the schema. exception: StandardException - Thrown on failure |
getDependentsDescriptorList | public List getDependentsDescriptorList(String dependentID) throws StandardException(Code) | | Gets a list of the dependency descriptors for the given dependent's id.
Parameters: dependentID - The ID of the dependent we're interested in List Returns a list of DependencyDescriptors. Returns an empty List if no stored dependencies for thedependent's ID. exception: StandardException - Thrown on failure |
getDescriptorViaHeap | protected TupleDescriptor getDescriptorViaHeap(ScanQualifier[][] scanQualifiers, TabInfoImpl ti, TupleDescriptor parentTupleDescriptor, List list) throws StandardException(Code) | | Return a (single or list of) catalog row descriptor(s) from a
system table where the access a heap scan
Parameters: scanQualifiers - qualifiers Parameters: ti - The TabInfoImpl to use Parameters: parentTupleDescriptor - The parentDescriptor, if applicable. Parameters: list - The list to build, if supplied. If null, then caller expects a single descriptor The last matching descriptor exception: StandardException - Thrown on error |
getEngineType | public int getEngineType()(Code) | | |
getExecutionFactory | public ExecutionFactory getExecutionFactory()(Code) | | Get ExecutionFactory associated with this database.
The ExecutionFactory |
getForeignKeys | public ConstraintDescriptorList getForeignKeys(UUID constraintId) throws StandardException(Code) | | Return a list of foreign keys constraints referencing
this constraint. Returns both enabled and disabled
foreign keys.
Parameters: constraintId - The id of the referenced constraint list of constraints, empty of there are none exception: StandardException - Thrown on error |
getNonCoreTIByNumber | protected TabInfoImpl getNonCoreTIByNumber(int catalogNumber) throws StandardException(Code) | | returns the tabinfo for a non core system catalog. Input is a
catalogNumber (defined in DataDictionary).
|
getProvidersDescriptorList | public List getProvidersDescriptorList(String providerID) throws StandardException(Code) | | Gets a list of the dependency descriptors for the given provider's id.
Parameters: providerID - The ID of the provider we're interested in List Returns a list of DependencyDescriptors. Returns an empty List if no stored dependencies for theprovider's ID. exception: StandardException - Thrown on failure |
getRoutineList | public java.util.List getRoutineList(String schemaID, String routineName, char nameSpace) throws StandardException(Code) | | Get the list of routines matching the schema and routine name.
While we only support a single alias for a given name,namespace just
return a list of zero or one item.
If the schema is SYSFUN then do not use the system catalogs,
but instead look up the routines from the in-meomry table driven
by the contents of SYSFUN_FUNCTIONS.
|
getRoutinePermissions | public RoutinePermsDescriptor getRoutinePermissions(UUID routineUUID, String authorizationId) throws StandardException(Code) | | Get one user's permissions for a routine (function or procedure).
Parameters: routineUUID - Parameters: authorizationId - The user's name The descriptor of the users permissions for the routine. exception: StandardException - |
getSPSDescriptor | public SPSDescriptor getSPSDescriptor(String stmtName, SchemaDescriptor sd) throws StandardException(Code) | | Get a SPSDescriptor given its name.
Currently no cacheing. With caching
we need to be very careful about invalidation.
No caching means invalidations block on
existing SPSD instances (since they were read in
Parameters: stmtName - the statement name Parameters: sd - The SchemaDescriptor The SPSDescriptor for the constraint. exception: StandardException - Thrown on failure |
getSPSParams | public DataTypeDescriptor[] getSPSParams(SPSDescriptor spsd, Vector defaults) throws StandardException(Code) | | Get all the parameter descriptors for an SPS.
Look up the params in SYSCOLUMNS and turn them
into parameter descriptors.
Parameters: spsd - sps descriptor Parameters: defaults - vector for storing column defaults array of data type descriptors exception: StandardException - Thrown on error |
getSYSCOLUMNSHeapConglomerateNumber | public long getSYSCOLUMNSHeapConglomerateNumber()(Code) | | Get the heap conglomerate number for SYS.SYSCOLUMNS.
(Useful for adding new index to the table.)
The heap conglomerate number for SYS.SYSCOLUMNS. |
getSchemaDescriptor | public SchemaDescriptor getSchemaDescriptor(String schemaName, TransactionController tc, boolean raiseError) throws StandardException(Code) | | Get the descriptor for the named schema.
Schema descriptors include authorization ids and schema ids.
SQL92 allows a schema to specify a default character set - we will
not support this. Will check default schema for a match
before scanning a system table.
Parameters: schemaName - The name of the schema we're interested in. Must not be null. Parameters: tc - TransactionController Parameters: raiseError - whether an exception should be thrown if the schema does not exist. The descriptor for the schema. Can be null (not found) if raiseError is false. exception: StandardException - Thrown on error |
getSchemaDescriptor | public SchemaDescriptor getSchemaDescriptor(UUID schemaId, TransactionController tc) throws StandardException(Code) | | Get the descriptor for the named schema. If the schemaId
parameter is NULL, it gets the descriptor for the current (default)
schema. Schema descriptors include authorization ids and schema ids.
SQL92 allows a schema to specify a default character set - we will
not support this. Will check default schema for a match
before scanning a system table.
Parameters: schemaId - The id of the schema we're interested in.If the name is NULL, get the descriptor for thecurrent schema. Parameters: tc - TransactionController The descriptor for the schema. Warning: <\I> mayreturn NULL if schemaName is non-NULL and doesn't existin SYSSCHEMAS exception: StandardException - Thrown on error |
getStatisticsDescriptors | public List getStatisticsDescriptors(TableDescriptor td) throws StandardException(Code) | | get all the statistiscs descriptors for a given table.
Parameters: td - Table Descriptor for which I need statistics |
getSubKeyConstraint | public SubKeyConstraintDescriptor getSubKeyConstraint(UUID constraintId, int type) throws StandardException(Code) | | Get a SubKeyConstraintDescriptor from syskeys or sysforeignkeys for
the specified constraint id. For primary foreign and and unique
key constraints.
Parameters: constraintId - The UUID for the constraint. Parameters: type - The type of the constraint (e.g. DataDictionary.FOREIGNKEY_CONSTRAINT) SubKeyConstraintDescriptor The Sub descriptor for the constraint. exception: StandardException - Thrown on failure |
getSysIBMSchemaDescriptor | public SchemaDescriptor getSysIBMSchemaDescriptor() throws StandardException(Code) | | Get the descriptor for the SYSIBM schema. Schema descriptors include
authorization ids and schema ids.
SQL92 allows a schema to specify a default character set - we will
not support this.
The descriptor for the schema. exception: StandardException - Thrown on failure |
getSystemDiagSchemaDescriptor | public SchemaDescriptor getSystemDiagSchemaDescriptor() throws StandardException(Code) | | Get the descriptor for the SYSCS_DIAG system schema.
Schema descriptors include authorization ids and schema ids.
SQL92 allows a schema to specify a default character set - we will
not support this.
The descriptor for the schema. exception: StandardException - Thrown on failure |
getSystemSQLName | public String getSystemSQLName()(Code) | | Returns a unique system generated name of the form SQLyymmddhhmmssxxn
yy - year, mm - month, dd - day of month, hh - hour, mm - minute, ss - second,
xx - the first 2 digits of millisec because we don't have enough space to keep the exact millisec value,
n - number between 0-9
The number at the end is to handle more than one system generated name request came at the same time.
In that case, the timestamp will remain the same, we will just increment n at the end of the name.
Following is how we get around the problem of more than 10 system generated name requestes at the same time:
When the database boots up, we start a counter with value -1 for the last digit in the generated name.
We also keep the time in millisec to keep track of when the last system name was generated. At the
boot time, it will be default to 0L. In addition, we have a calendar object for the time in millisec
That calendar object is used to fetch yy, mm, dd, etc for the string SQLyymmddhhmmssxxn
When the first request for the system generated name comes, time of last system generated name will be less than
the current time. We initialize the counter to 0, set the time of last system generated name to the
current time truncated off to lower 10ms time. The first name request is the only time we know for sure the
time of last system generated name will be less than the current time. After this first request, the next request
could be at any time. We go through the following algorithm for every generated name request.
First check if the current time(truncated off to lower 10ms) is greater than the timestamp for last system generated name
If yes, then we change the timestamp for system generated name to the current timestamp and reset the counter to 0
and generate the name using the current timestamp and 0 as the number at the end of the generated name.
If no, then it means this request for generated name has come at the same time as last one.
Or it may come at a time less than the last generated name request. This could be because of seasonal time change
or somebody manually changing the time on the computer. In any case,
if the counter is less than 10(meaning this is not yet our 11th request for generated name at a given time),
we use that in the generated name. But if the counter has reached 10(which means, this is the 11th name request
at the same time), then we increment the system generated name timestamp by 10ms and reset the counter to 0
(notice, at this point, the timestamp for system generated names is not in sync with the real current time, but we
need to have this mechanism to get around the problem of more than 10 generated name requests at a same physical time).
system generated unique name |
getSystemSchemaDescriptor | public SchemaDescriptor getSystemSchemaDescriptor() throws StandardException(Code) | | Get the descriptor for the system schema. Schema descriptors include
authorization ids and schema ids.
SQL92 allows a schema to specify a default character set - we will
not support this.
The descriptor for the schema. exception: StandardException - Thrown on failure |
getSystemUtilSchemaDescriptor | public SchemaDescriptor getSystemUtilSchemaDescriptor() throws StandardException(Code) | | Get the descriptor for the SYSCS_UTIL system schema.
Schema descriptors include authorization ids and schema ids.
SQL92 allows a schema to specify a default character set - we will
not support this.
The descriptor for the schema. exception: StandardException - Thrown on failure |
getTableDescriptor | public TableDescriptor getTableDescriptor(String tableName, SchemaDescriptor schema) throws StandardException(Code) | | Get the descriptor for the named table within the given schema.
If the schema parameter is NULL, it looks for the table in the
current (default) schema. Table descriptors include object ids,
object types (table, view, etc.)
Parameters: tableName - The name of the table to get the descriptor for Parameters: schema - The descriptor for the schema the table lives in.If null, use the system schema. The descriptor for the table, null if table does notexist. exception: StandardException - Thrown on failure |
getTableDescriptor | public TableDescriptor getTableDescriptor(UUID tableID) throws StandardException(Code) | | Get the descriptor for the table with the given UUID.
NOTE: I'm assuming that the object store will define an UUID for
persistent objects. I'm also assuming that UUIDs are unique across
schemas, and that the object store will be able to do efficient
lookups across schemas (i.e. that no schema descriptor parameter
is needed).
Parameters: tableID - The UUID of the table to get the descriptor for The descriptor for the table, null if the table doesnot exist. exception: StandardException - Thrown on failure |
getTransactionCompile | public TransactionController getTransactionCompile() throws StandardException(Code) | | Get the TransactionController to use, when not
passed in as a parameter. (This hides logic about
whether or not we're at boot time in a single
place. NOTE: There's no LCC at boot time.)
NOTE: All methods in the DD should call this method.
TransactionController The TC to use. exception: StandardException - Thrown on error |
getTransactionExecute | public TransactionController getTransactionExecute() throws StandardException(Code) | | Get the TransactionController to use, when not
passed in as a parameter. (This hides logic about
whether or not we're at boot time in a single
place. NOTE: There's no LCC at boot time.)
NOTE: All methods in the DD should call this method.
TransactionController The TC to use. exception: StandardException - Thrown on error |
getTriggerDescriptors | public GenericDescriptorList getTriggerDescriptors(TableDescriptor td) throws StandardException(Code) | | Load up the trigger descriptor list for this table
descriptor and return it. If the descriptor list
is already loaded up, it is retuned without further
ado.
Parameters: td - The table descriptor. The ConstraintDescriptorList for the table exception: StandardException - Thrown on failure |
getUUIDFactory | public UUIDFactory getUUIDFactory()(Code) | | Get the UUID Factory. (No need to make the UUIDFactory a module.)
UUIDFactory The UUID Factory for this DataDictionary. |
getUncachedColPermsDescriptor | ColPermsDescriptor getUncachedColPermsDescriptor(ColPermsDescriptor key) throws StandardException(Code) | | Get a column permissions descriptor from the system tables, without going through the cache.
This method is called to fill the permissions cache.
a ColPermsDescriptor that describes the column permissions granted to the grantee, nullif no column permissions have been granted to him on the table. exception: StandardException - |
getUncachedRoutinePermsDescriptor | RoutinePermsDescriptor getUncachedRoutinePermsDescriptor(RoutinePermsDescriptor key) throws StandardException(Code) | | Get a routine permissions descriptor from the system tables, without going through the cache.
This method is called to fill the permissions cache.
a RoutinePermsDescriptor that describes the table permissions granted to the grantee, nullif no table-level permissions have been granted to him on the table. exception: StandardException - |
getUncachedSPSDescriptor | public SPSDescriptor getUncachedSPSDescriptor(TableKey stmtKey) throws StandardException(Code) | | This method can get called from the DataDictionary cache.
Parameters: stmtKey - The TableKey of the sps The descriptor for the sps, null if the sps doesnot exist. exception: StandardException - Thrown on failure |
getUncachedSPSDescriptor | protected SPSDescriptor getUncachedSPSDescriptor(UUID stmtId) throws StandardException(Code) | | This method can get called from the DataDictionary cache.
Parameters: stmtId - The UUID of the stmt to get the descriptor for The descriptor for the stmt, null if the table doesnot exist. exception: StandardException - Thrown on failure |
getUncachedTableDescriptor | TableDescriptor getUncachedTableDescriptor(TableKey tableKey) throws StandardException(Code) | | This method can get called from the DataDictionary cache.
Parameters: tableKey - The TableKey of the table The descriptor for the table, null if the table doesnot exist. exception: StandardException - Thrown on failure |
getUncachedTableDescriptor | protected TableDescriptor getUncachedTableDescriptor(UUID tableID) throws StandardException(Code) | | This method can get called from the DataDictionary cache.
Parameters: tableID - The UUID of the table to get the descriptor for The descriptor for the table, null if the table doesnot exist. exception: StandardException - Thrown on failure |
getUncachedTablePermsDescriptor | TablePermsDescriptor getUncachedTablePermsDescriptor(TablePermsDescriptor key) throws StandardException(Code) | | Get a table permissions descriptor from the system tables, without going through the cache.
This method is called to fill the permissions cache.
a TablePermsDescriptor that describes the table permissions granted to the grantee, nullif no table-level permissions have been granted to him on the table. exception: StandardException - |
grantPublicAccessToSystemRoutines | public void grantPublicAccessToSystemRoutines(TransactionController tc, String authorizationID) throws StandardException(Code) | | Grant PUBLIC access to specific system routines. Currently, this is
done for some routines in SYSCS_UTIL schema.
Parameters: tc - TransactionController to use Parameters: authorizationID - authorization ID of the permission grantor throws: StandardException - Standard exception policy. |
hashAllConglomerateDescriptorsByNumber | public Hashtable hashAllConglomerateDescriptorsByNumber(TransactionController tc) throws StandardException(Code) | | Get all of the ConglomerateDescriptors in the database and
hash them by conglomerate number.
This is useful as a performance optimization for the locking VTIs.
NOTE: This method will scan SYS.SYSCONGLOMERATES at READ UNCOMMITTED.
Parameters: tc - TransactionController for the transaction A Hashtable with all of the ConglomerateDescriptorsin the database hashed by conglomerate number. exception: StandardException - Thrown on failure |
hashAllTableDescriptorsByTableId | public Hashtable hashAllTableDescriptorsByTableId(TransactionController tc) throws StandardException(Code) | | Get all of the TableDescriptors in the database and hash them by TableId
This is useful as a performance optimization for the locking VTIs.
NOTE: This method will scan SYS.SYSTABLES at READ UNCOMMITTED.
Parameters: tc - TransactionController for the transaction A Hashtable with all of the Table descriptors in the databasehashed by TableId exception: StandardException - Thrown on failure |
initializeCatalogInfo | public void initializeCatalogInfo() throws StandardException(Code) | | Initialize catalog information. This method is overridden by children.
exception: StandardException - Thrown on error |
isSchemaEmpty | public boolean isSchemaEmpty(SchemaDescriptor sd) throws StandardException(Code) | | Indicate whether there is anything in the
particular schema. Checks for tables in the
the schema, on the assumption that there cannot
be any other objects in a schema w/o a table.
Parameters: sd - descriptor true/false exception: StandardException - on error |
isSchemaReferenced | protected boolean isSchemaReferenced(TransactionController tc, TabInfoImpl ti, int indexId, int indexCol, DataValueDescriptor schemaIdOrderable) throws StandardException(Code) | | Is the schema id referenced by the system table in question?
Currently assumes that the schema id is in an index.
NOTE: could be generalized a bit, and possibly used
elsewhere...
Parameters: tc - transaction controller Parameters: ti - table info for the system table Parameters: indexId - index id Parameters: indexCol - 1 based index column Parameters: schemaIdOrderable - the schemaid in a char orderable true if there is a reference to this schema exception: StandardException - on error |
isSystemSchemaName | public boolean isSystemSchemaName(String name) throws StandardException(Code) | | Determine whether a string is the name of the system schema.
Parameters: name - true or false exception: StandardException - Thrown on failure |
loadDictionaryTables | protected void loadDictionaryTables(TransactionController tc, DataDescriptorGenerator ddg, Properties startParams) throws StandardException(Code) | | Initialize system catalogs. This is where we perform upgrade. It is our
pious hope that we won't ever have to upgrade the core catalogs, other than
to add fields inside Formatable columns in these catalogs.
If we do have to upgrade the core catalogs, then we may need to move the
loadCatalog calls into the upgrade machinery. It's do-able, just not pretty.
Parameters: tc - TransactionController Parameters: ddg - DataDescriptorGenerator exception: StandardException - Thrown on error |
setAutoincrementValue | public void setAutoincrementValue(TransactionController tc, UUID tableUUID, String columnName, long aiValue, boolean incrementNeeded) throws StandardException(Code) | | sets a new value in SYSCOLUMNS for a particular
autoincrement column.
Parameters: tc - Transaction Controller to use. Parameters: columnName - Name of the column. Parameters: aiValue - Value to write to SYSCOLUMNS. Parameters: incrementNeeded - whether to increment the value passed in by theuser (aiValue) or not before writing it to SYSCOLUMNS. |
setDependencyManager | protected void setDependencyManager()(Code) | | sets the dependencymanager associated with this dd. subclasses can
override this to install their own funky dependency manager.
|
spsCacheEntryAdded | void spsCacheEntryAdded(SPSDescriptor spsd)(Code) | | Add an entry to the hashtables for lookup from the cache.
|
stop | public void stop()(Code) | | Stop this module. In this case, nothing needs to be done.
|
updateConglomerateDescriptor | public void updateConglomerateDescriptor(ConglomerateDescriptor cd, long conglomerateNumber, TransactionController tc) throws StandardException(Code) | | Update the conglomerateNumber for a ConglomerateDescriptor.
This is useful, in 1.3, when doing a bulkInsert into an
empty table where we insert into a new conglomerate.
(This will go away in 1.4.)
Parameters: cd - The ConglomerateDescriptor Parameters: conglomerateNumber - The new conglomerate number Parameters: tc - The TransactionController to use exception: StandardException - Thrown on failure |
updateConglomerateDescriptor | public void updateConglomerateDescriptor(ConglomerateDescriptor[] cds, long conglomerateNumber, TransactionController tc) throws StandardException(Code) | | Update the conglomerateNumber for an array of ConglomerateDescriptors.
In case of more than one ConglomerateDescriptor, each descriptor
should be updated separately, conglomerate id is not same for all
the descriptors. Even when indexes are sharing the same
conglomerate(conglomerate number), conglomerate ids are unique.
This is useful, in 1.3, when doing a bulkInsert into an
empty table where we insert into a new conglomerate.
(This will go away in 1.4.)
Parameters: cds - The array of ConglomerateDescriptors Parameters: conglomerateNumber - The new conglomerate number Parameters: tc - The TransactionController to use exception: StandardException - Thrown on failure |
updateConstraintDescriptor | public void updateConstraintDescriptor(ConstraintDescriptor cd, UUID formerUUID, int[] colsToSet, TransactionController tc) throws StandardException(Code) | | Update the constraint descriptor in question. Updates
every row in the base conglomerate.
Parameters: cd - The Constraintescriptor Parameters: formerUUID - The UUID for this column in SYSCONSTRAINTS,may differ from what is in cd if thisis the column that is being set. Parameters: colsToSet - Array of ints of columns to be modified,1 based. May be null (all cols). Parameters: tc - The TransactionController to use exception: StandardException - Thrown on failure |
updateLockGranularity | public void updateLockGranularity(TableDescriptor td, SchemaDescriptor schema, char lockGranularity, TransactionController tc) throws StandardException(Code) | | Update the lockGranularity for the specified table.
Parameters: td - The TableDescriptor for the table Parameters: schema - The SchemaDescriptor for the table Parameters: lockGranularity - The new lockGranularity Parameters: tc - The TransactionController to use. exception: StandardException - Thrown on error |
updateSPS | public void updateSPS(SPSDescriptor spsd, TransactionController tc, boolean recompile, boolean updateParamDescriptors, boolean wait, boolean firstCompilation) throws StandardException(Code) | | Updates SYS.SYSSTATEMENTS with the info from the
SPSD.
Parameters: spsd - The descriptor to add Parameters: tc - The transaction controller Parameters: updateParamDescriptors - If true, will update theparameter descriptors in SYS.SYSCOLUMNS. Parameters: wait - If true, then the caller wants to wait for locks. False will be Parameters: firstCompilation - true, if Statement is getting compiled for firsttime and SPS was created with NOCOMPILE option.when we using a nested user xaction - we want to timeout right away if the parentholds the lock. (bug 4821) exception: StandardException - Thrown on error |
updateSYSCOLPERMSforAddColumnToUserTable | public void updateSYSCOLPERMSforAddColumnToUserTable(UUID tableID, TransactionController tc) throws StandardException(Code) | | Need to update SYSCOLPERMS for a given table because a new column has
been added to that table. SYSCOLPERMS has a column called "COLUMNS"
which is a bit map for all the columns in a given user table. Since
ALTER TABLE .. ADD COLUMN .. has added one more column, we need to
expand "COLUMNS" for that new column
Currently, this code gets called during execution phase of
ALTER TABLE .. ADD COLUMN ..
Parameters: tableID - The UUID of the table to which a column has been added Parameters: tc - TransactionController for the transaction exception: StandardException - Thrown on error |
updateSchemaAuth | public void updateSchemaAuth(String schemaName, String authorizationId, TransactionController tc) throws StandardException(Code) | | Update authorizationId of specified schemaName
Parameters: schemaName - Schema Name of system schema Parameters: authorizationId - authorizationId of new schema owner Parameters: tc - The TransactionController to use exception: StandardException - Thrown on failure |
updateSystemSchemaAuthorization | public void updateSystemSchemaAuthorization(String aid, TransactionController tc) throws StandardException(Code) | | Update all system schemas to have new authorizationId. This is needed
while upgrading pre-10.2 databases to 10.2 or later versions. From 10.2,
all system schemas would be owned by database owner's authorizationId.
Parameters: aid - AuthorizationID of Database Owner Parameters: tc - TransactionController to use exception: StandardException - Thrown on failure |
updateTriggerDescriptor | public void updateTriggerDescriptor(TriggerDescriptor triggerd, UUID formerUUID, int[] colsToSet, TransactionController tc) throws StandardException(Code) | | Update the trigger descriptor in question. Updates
every row in the base conglomerate that matches the uuid.
Parameters: triggerd - The Trigger descriptor Parameters: formerUUID - The UUID for this column in SYSTRIGGERS,may differ from what is in triggerd if thisis the column that is being set. Parameters: colsToSet - Array of ints of columns to be modified,1 based. May be null (all cols). Parameters: tc - The TransactionController to use exception: StandardException - Thrown on failure |
upgradeMakeCatalog | protected void upgradeMakeCatalog(TransactionController tc, int catalogNumber) throws StandardException(Code) | | called by the upgrade code (dd_xena etc) to add a new system catalog.
Parameters: tc - TransactionController to use. Parameters: catalogNumber - catalogNumber |
upgrade_addColumns | public void upgrade_addColumns(CatalogRowFactory rowFactory, int[] newColumnIDs, TransactionController tc) throws StandardException(Code) | | Upgrade an existing catalog by adding columns.
Parameters: rowFactory - Associated with this catalog. Parameters: newColumnIDs - Array of 1-based column ids. Parameters: tc - Transaction controller exception: StandardException - Standard Cloudscape error policy |
upgrade_addInvisibleColumns | public void upgrade_addInvisibleColumns(CatalogRowFactory rowFactory, int[] newColumnIDs, TransactionController tc) throws StandardException(Code) | | Add invisible columns to an existing system catalog
Parameters: rowFactory - Associated with this catalog. Parameters: newColumnIDs - Array of 1-based column ids. Parameters: tc - Transaction controller exception: StandardException - Standard Cloudscape error policy |
upgrade_initSystemTableCols | void upgrade_initSystemTableCols(TransactionController tc, boolean isCoreTable, int tableNum, FormatableBitSet columnsToUpdateSet, DataValueDescriptor[] replaceRow) throws StandardException(Code) | | Initialize noncore columns to fixed values
Parameters: tc - The TransactionController for the transaction to do theupgrade in. Parameters: isCoreTable - true if it is a core table Parameters: tableNum - the noncore table number Parameters: columnsToUpdateSet - a bit set of columns to update. ZERO BASED Parameters: replaceRow - an object array of Orderables for the new values exception: StandardException - Thrown on error |
upgrade_makeOneIndex | public long upgrade_makeOneIndex(TransactionController tc, TabInfoImpl ti, int indexNumber, long heapConglomerateNumber) throws StandardException(Code) | | Code to add an index to a catalog during upgrade.
Parameters: tc - transaction controller Parameters: ti - information on the catalog that's having a new index added Parameters: indexNumber - 0-based index number Parameters: heapConglomerateNumber - what it is The conglomerate number of the new index. exception: StandardException - Thrown on failure |
upgrade_setNullability | public void upgrade_setNullability(CatalogRowFactory rowFactory, int columnNumber, boolean nullability, TransactionController tc) throws StandardException(Code) | | Upgrade an existing catalog by setting the nullability
Parameters: columnNumber - The column to change Parameters: nullability - true if nullable Parameters: tc - Transaction controller exception: StandardException - Standard Cloudscape error policy |
|
|