Getting Started With Objectivity

In order to get you started, I made a very simple and straightforward program so that you can test it out. It is meant to be the very first step in the Objectivity tutorial to come. Remember, you can use Objectivity only on RCF's IBM machines so far.


Note: I had a previous version of this tutorial which used a home-grown utility to create the database files in the federation. This one used to work fine with version 3.x of Objectivity, but with 4.x it changed its behavior. Specifically, it does not put a new database into the same directory where the federation boot file is, but that's where we want all the databases to go. So we use the standard oonewdb tool to create the new databases in the Makefiles instead. However, you can still look at the create.c utility, even if we don't use it anymore (and it's no longer part of the distribution). The tar files with all the examples is now called tutorial_0_1.tar. If you already used the old version, please get this new one, or change the Makefiles accordingly.


Setting Up a Small Database

In the long run each experiment will probably have The Centrally Maintained Big Objectivity Database somewhere, which all users access. For the purpose of this course, however, each user will set up a database system (referred to as a federated database in Objectivity lingo) for his or her own use, without interfering with any other user.

The idea is that this federated database created here and now will accomodate the little exercise projects which will come as this course evolves.

In order to create a federated database for your own use and pleasure, you will select a top directory where all this stuff will be located (I picked /phenix/u/purschke/Objectivity). Also, you will need to give your federated database an unique numerical identifier, so using number 1 is probably not a good idea. A good start to get something unique maybe your UID (I picked number 9866 in my examples).


Getting an AFS Token

Before we start, get an AFS token. By registering as a user, your username has been added to the list of people allowed to access the Objectivity distribution directories (which are in AFS).

Type

> klog
Password: your password


Unpacking the Tutorial Tar File

Rather than grabbing the files from the Web, just untar the file /phenix/u/purschke/Objectivity/tutorial_0_1.tar into your selected top directory. Since picking from the Web may convert tabs to spaces, Makefiles often do not work when copy-pasted from the Web.
> cd your_top_directory
> tar xvf /phenix/u/purschke/Objectivity/tutorial_0_1.tar 

You should find the following files:

drwxr-sr-x   2 purschke rhphenix    1024 Oct 13 11:53 Body
-rw-r--r--   1 purschke rhphenix     261 Oct 13 12:04 Makefile
-rw-r--r--   1 purschke rhphenix     971 Sep 08 23:20 config.sys
drwxr-sr-x   2 purschke rhphenix     512 Oct 13 12:04 db
-rw-r--r--   1 purschke rhphenix    1170 Sep 09 11:31 setup.com

Edit setup.com, and find and change the lines

setenv OBJY_TOP_DIR /phenix/u/purschke/Objectivity 
to point to your top directory, and change the number in
setenv OBJY_FDID 9866
to the unique number you picked. Then source the command (we assume that you are using tcsh, by the way):
> source setup.com

Building the Federated Database

You are now ready to build the federated database. We set things up in a way that all database files are in the db/ directory and out of the way.

In your top directory, type make now to create the federated database and the create utility. You should see something like

ribm01 % make 
oonewfd -fdlocalpath .FDB \
-pagesize 8192 -lockserverhost ribm01.rhic.bnl.gov \
        -fdnumber 9866  /phenix/u/purschke/Objectivity/db/TheDB

Objectivity/DB (TM) Create Federated Database Utility, Version 4.0.2
Copyright (c) Objectivity, Inc 1993, 1996. All rights reserved.

Federated Database "/phenix/u/purschke/Objectivity/db/TheDB" created.
ribm01 % 

If you want to clean up, you should use "make clean". As a rule, all Makefiles have a clean target. In particular for the projects to come you should always use "make clean" rather than just delete the databases in order to de-register them properly from the federation.


The First Project

It is now time to start the first project provided with the tutorial. It is called "Body", where we make a few persistent geometrical objects like cubes and cylinders.

O yes, take me there!


MLP Sept 07, 1997