|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.catalog.DD_Version
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.
Field Summary | |
private DataDictionaryImpl |
bootingDictionary
|
(package private) int |
majorVersionNumber
|
private int |
minorVersionNumber
|
Constructor Summary | |
|
DD_Version()
Public niladic constructor needed for Formatable interface. |
(package private) |
DD_Version(DataDictionaryImpl bootingDictionary,
int majorVersionNumber)
Construct a Version for the currently booting data dictionary. |
Method Summary | |
private void |
applySafeChanges(TransactionController tc,
int fromMajorVersionNumber,
int lastSoftUpgradeVersion)
Apply changes that can safely be made in soft upgrade. |
(package private) boolean |
checkVersion(int requiredMajorVersion,
java.lang.String feature)
Check to see if a database has been upgraded to the required level in order to use a language feature. |
private void |
doFullUpgrade(TransactionController tc,
int fromMajorVersionNumber)
Do full upgrade. |
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. |
protected void |
fillIndex(TransactionController tc,
long heapConglomerateNumber,
TabInfo tabInfo,
int indexNumber)
Populates a new system index from the base system table. |
private int |
getJBMSMinorVersionNumber()
Get the minor version from the JBMS product minor version/maint version. |
int |
getTypeFormatId()
Get the formatID which corresponds to this class. |
private void |
handleMinorRevisionChange(TransactionController tc,
DD_Version fromVersion,
boolean softUpgradeRun)
Do any work needed for a minor revision change. |
private static java.lang.String |
majorToString(int majorVersionNumber)
|
protected void |
makeSystemCatalog(TransactionController tc,
TabInfo ti)
Make a catalog. |
private void |
modifySysTableNullability(TransactionController tc,
int catalogNum)
Modifies the nullability of the system table corresponding to the received catalog number. |
void |
readExternal(java.io.ObjectInput in)
Read this object from a stream of stored objects. |
java.lang.String |
toString()
Stringify this Version. |
(package private) void |
upgradeIfNeeded(DD_Version dictionaryVersion,
TransactionController tc,
java.util.Properties startParams)
Upgrade the data dictionary catalogs to the version represented by this DD_Version. |
void |
writeExternal(java.io.ObjectOutput out)
Write this object to a stream of stored objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private transient DataDictionaryImpl bootingDictionary
int majorVersionNumber
private int minorVersionNumber
Constructor Detail |
public DD_Version()
DD_Version(DataDictionaryImpl bootingDictionary, int majorVersionNumber)
bootingDictionary
- The booting dictionary that needs to be upgraded.Method Detail |
public java.lang.String toString()
private static java.lang.String majorToString(int majorVersionNumber)
void upgradeIfNeeded(DD_Version dictionaryVersion, TransactionController tc, java.util.Properties startParams) throws StandardException
dictionaryVersion
- the version of the data dictionary tables.
StandardException
- Ooopsprivate void applySafeChanges(TransactionController tc, int fromMajorVersionNumber, int lastSoftUpgradeVersion) throws StandardException
tc
- transaction controllerfromMajorVersionNumber
- version of the on-disk databaselastSoftUpgradeVersion
- last engine to perform a soft upgrade that made changes.
StandardException
- Standard Cloudscape error policy.private void doFullUpgrade(TransactionController tc, int fromMajorVersionNumber) throws StandardException
tc
- transaction controllerfromMajorVersionNumber
- version of the on-disk database
StandardException
- Standard Cloudscape error policy.private void handleMinorRevisionChange(TransactionController tc, DD_Version fromVersion, boolean softUpgradeRun) throws StandardException
tc
- the xact
StandardException
- Standard Cloudscape error policy.protected void dropJDBCMetadataSPSes(TransactionController tc, boolean removeSYSIBMonly) throws StandardException
tc
- the xact
StandardException
- Standard Cloudscape error policy.protected void makeSystemCatalog(TransactionController tc, TabInfo ti) throws StandardException
tc
- TransactionController
StandardException
- Standard Cloudscape error policy.protected void dropSystemCatalogDescription(TransactionController tc, TableDescriptor td) throws StandardException
tc
- TransactionControllertd
- Table descriptor for the catalog to drop.
StandardException
- Standard Cloudscape error policy.protected void dropSystemCatalog(TransactionController tc, CatalogRowFactory crf) throws StandardException
tc
- TransactionControllercrf
- CatalogRowFactory for the catalog to drop.
StandardException
- Standard Cloudscape error policy.protected void fillIndex(TransactionController tc, long heapConglomerateNumber, TabInfo tabInfo, int indexNumber) throws StandardException
tc
- transaction controllerheapConglomerateNumber
- identifies system table to StoretabInfo
- describes base system tableindexNumber
- index to populate
StandardException
- Thrown on failurepublic int getTypeFormatId()
getTypeFormatId
in interface TypedFormat
public final void readExternal(java.io.ObjectInput in) throws java.io.IOException
readExternal
in interface java.io.Externalizable
in
- read this.
java.io.IOException
- on errorpublic final void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- write bytes here.
java.io.IOException
- on errorprivate int getJBMSMinorVersionNumber()
private void modifySysTableNullability(TransactionController tc, int catalogNum) throws StandardException
tc
- TransactionController.catalogNum
- The catalog number corresponding
to the table for which we will modify the nullability.
If this corresponds to SYSALIASES, then the nullability of
the SYSALIASES.ALIASINFO column will be changed to true
(Beetle 4430). If this corresponds to SYSSTATEMENTS,
the nullability of the SYSSTATEMENTS.LASTCOMPILED
column will be changed to true.
StandardException
boolean checkVersion(int requiredMajorVersion, java.lang.String feature) throws StandardException
feature
- Non-null to throw an error, null to return the state of the version match.
StandardException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |