Friday, March 31, 2006

Log Device and File-Group Device Installation

It would appear that log devices and file-group devices have more than a few things in common - not quite enough in common to justify deriving log devices from file-group devices but it's certainly close. The installers for both these classes also share a certain amount of commonality but this thankfully is limited to ensuring each installer has a primary physical device among its children (and only one at that) so no great problem!

I probably shouldn't have said that - I might yet need to modify the searching code to look through the child tree rather than limiting the search to immediate children as I may want to wrap physical devices within a transaction installer wrapper for example.

I will leave the wrapping of installers in transactional installers to cover installing the log device and each database file-group as these are autonomonous operations (perhaps even wrapping log device and primary file-group under one transaction and everything else under another)

As you can see - I've not quite decided on the right way to go at this time!

Before finishing work on the installers I need to finish the implementation of performance counters and satisfy myself that I have enough support for event-logging within the current logging object - then the project installer located in the DB class library can be moved into the Installer library!

No rest for the very very very wicked eh?

Sunday, March 26, 2006

Installer Work

More work on the installation/initialisation aspects of the DB engine and the database physical device installer now correctly writes the distribution pages to disk following successful installation of the underlying physical file.

The Device installer base class has been tweaked so that fits into the .NET framework installer system better and so far it looks good.

With physical data device installers approaching completion - only the writing of the actual root page needs to be done there - I'll move on to the file-group device installer. This installer class needs to update the root page of each device so as to identify the other members of the filegroup. This will make attaching a filegroup easier for users as they will not have to find the primary file.

Next up will be the log device installer and finally I can look at the final part of the puzzle - the databse installer itself!

Saturday, March 25, 2006

Refactoring Revisited & Installer Heaven

Well I have been a busy bee indeed as programming operations have moved from the United Kingdom to Thailand - the weather is warmer, the cost of living cheaper and since the sun shines more often - I tend to feel more inclined to write code and good code at that!

Reorganised the class library in what should be the last time - now it follows a similar convention to .NET itself so all generic classes are in a root namespace and base device and page classes are grouped together in a componentmodel namespace.

This has helped no end in reducing the number of namespace entries within each code file significantly.

The component libraries are now signed with a strong name and I have also created a reference class which is shared via source control to each of the DB assemblies - this assembly reference contains strings which simplify the task of referencing other assemblies in type names and so on.

I have also started work on installer classes to facilitate the installation/uninstallation of database device components (rather handy they are components eh?) This work has changed the focus to how these devices are installed and where the responsibilities lie in dealing with scope of work and in definition of pages.

A few things have fallen out of the installer work - I have a base DeviceInstaller class (derived from ComponentInstaller) from which a hierarchy of installer classes are derived from.
Installing a device involves execution of the following;

  • Creation of installation-time device component

  • Attaching to parent device (as necessary)

  • Pre-mounting tasks

  • Create/mount of device

  • Post-mounting tasks



The logic controlling the sequencing of these operations is encapsulated within the DeviceInstaller base class.

Pre-mounting tasks involve setting up the static device settings. The ID and Name are handled by the base class with everything else being handled by the appropriate derived class.

Post-mounting tasks involve the setting up of device pages as determined by the installer. DatabasePhysicalDeviceInstaller will create distribution pages here and update the root page information (as created by the PhysicalDeviceInstaller)

Certain installer classes will need to record state information to facilitate rollback or uninstall operations.