| java.lang.Object org.apache.derby.impl.sql.catalog.DD_Version
DD_Version | public class DD_Version implements Formatable(Code) | | Generic code for upgrading data dictionaries.
Currently has all minor version upgrade logic.
A word about minor vs. major upgraded. Minor
upgrades must be backwards/forwards compatible.
So they cannot version classes or introduce new
classes. Major releases are only backwards compatible;
they will run against an old database, but not the
other way around. So they can introduce new classes,
etc.
author: Rick |
Constructor Summary | |
public | DD_Version() Public niladic constructor needed for Formatable interface. | | DD_Version(DataDictionaryImpl bootingDictionary, int majorVersionNumber) Construct a Version for the currently booting data dictionary. |
Method Summary | |
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.
Parameters: requiredMajorVersion - Data Dictionary major version Parameters: feature - Non-null to throw an error, null to return the state of the version match. | protected void | dropJDBCMetadataSPSes(TransactionController tc, boolean removeSYSIBMonly) Drop all jdbc metadata spses. | protected void | dropSystemCatalog(TransactionController tc, CatalogRowFactory crf) Drop a System catalog. | protected void | dropSystemCatalogDescription(TransactionController tc, TableDescriptor td) Remove the description of a System table from the data dictionary.
This does not delete the conglomerates that hold the catalog or
its indexes.
Parameters: tc - TransactionController Parameters: td - Table descriptor for the catalog to drop. | protected void | fillIndex(TransactionController tc, long heapConglomerateNumber, TabInfoImpl tabInfo, int indexNumber) Populates a new system index from the base system table. | public int | getTypeFormatId() Get the formatID which corresponds to this class. | protected void | makeSystemCatalog(TransactionController tc, TabInfoImpl ti) Make a catalog. | final public void | readExternal(ObjectInput in) Read this object from a stream of stored objects. | public String | toString() Stringify this Version. | void | upgradeIfNeeded(DD_Version dictionaryVersion, TransactionController tc, Properties startParams) Upgrade the data dictionary catalogs to the version represented by this
DD_Version. | final public void | writeExternal(ObjectOutput out) Write this object to a stream of stored objects. |
majorVersionNumber | int majorVersionNumber(Code) | | |
DD_Version | public DD_Version()(Code) | | Public niladic constructor needed for Formatable interface.
|
DD_Version | DD_Version(DataDictionaryImpl bootingDictionary, int majorVersionNumber)(Code) | | Construct a Version for the currently booting data dictionary.
The minor version is set by the subclass.
Parameters: bootingDictionary - The booting dictionary that needs to be upgraded. |
checkVersion | 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. |
dropJDBCMetadataSPSes | protected void dropJDBCMetadataSPSes(TransactionController tc, boolean removeSYSIBMonly) throws StandardException(Code) | | Drop all jdbc metadata spses. This
it to ensure that we don't have any problems
with old metadata queries that have outdated
query text (the plans are always cleared out
on upgrade time).
Parameters: tc - the xact Parameters: removeSYSIBMonly - if true , remove storedprepared statements in the SYSIBM schema only; otherwise,remove stored prepared statements in all system schemas(including SYSIBM) exception: StandardException - Standard Cloudscape error policy. |
dropSystemCatalogDescription | protected void dropSystemCatalogDescription(TransactionController tc, TableDescriptor td) throws StandardException(Code) | | Remove the description of a System table from the data dictionary.
This does not delete the conglomerates that hold the catalog or
its indexes.
Parameters: tc - TransactionController Parameters: td - Table descriptor for the catalog to drop. exception: StandardException - Standard Cloudscape error policy. |
fillIndex | protected void fillIndex(TransactionController tc, long heapConglomerateNumber, TabInfoImpl tabInfo, int indexNumber) throws StandardException(Code) | | Populates a new system index from the base system table.
Parameters: tc - transaction controller Parameters: heapConglomerateNumber - identifies system table to Store Parameters: tabInfo - describes base system table Parameters: indexNumber - index to populate exception: StandardException - Thrown on failure |
getTypeFormatId | public int getTypeFormatId()(Code) | | Get the formatID which corresponds to this class.
Map to the 5.0 version identifier so that 5.0 will understand
this object when we write it out in soft upgrade mode.
CS 5.0 will de-serialize it correctly.
When we are writing out a 5.1 version number we write out
the 5.1 version just to ensure no problems.
the formatID of this class |
readExternal | final public void readExternal(ObjectInput in) throws IOException(Code) | | Read this object from a stream of stored objects. Set
the minor version. Ignore the major version.
Parameters: in - read this. exception: IOException - on error |
toString | public String toString()(Code) | | Stringify this Version.
String representation of this Version. |
writeExternal | final public void writeExternal(ObjectOutput out) throws IOException(Code) | | Write this object to a stream of stored objects. Write
out the minor version which is bumped across minor release.
Just to be safe, write out the major version too. This
will allow us to do versioning of a specific Version impl
in the future.
Parameters: out - write bytes here. exception: IOException - on error |
|
|