Lambda Repository Functions

 

Overview

Fast Lambda oriented repository management is a corner stone of the Analytic Information Server database engine. The ability to store complex interrelated data structures with complex relationships fast, and to retrieve them fast, is essential to advanced, high volume data analysis. The Analytic Information Server object repository supports password protected data security, record compression and encryption, transaction rollback with no arbitrary limitation on the size of a transaction before rollback, automatic data recovery, multiple distributed volumes with a maximum of 2 gigabytes per volume and a maximum of 2 billion volumes supported. Each Analytic Information Server object repository supports automatic data recovery with the maximum possible data loss being limited to the object closures saved in the current transaction.

The best pocket introduction to the essential elements of AIS Object Repositories is the following table of essential flow of control functional elements.

(new ObjectRepository: fileName) Repository creation/reopen statement
(set repository symbolicKey anyObject) Indexed assignment statement
(set repository frame: frameID anyObject) Direct frame assignment statement
(setf repository.symbolicKey anyObject) Immediate indexed assignment statement
(ref repository symbolicKey) Indexed access statement
(ref repository frame: frameID) Direct frame access statement
(inspect repository) Repository inspection statement
(beginTransaction repository) Start an extended repository transaction
(checkPointTransaction repository) Check point an extended repository transaction
(abortTransaction repository) Abort an extended repository transaction
(commitTransaction repository) Complete/accept an extended repository transaction
(attachLibrarian repository Lambda) Attach an extended repository schema
(detachLibrarian repository) Detach an extended repository schema

new

Overview

The new function creates a new Object Repository, associates the Object Repository with a repository archive file, and allows for record encryption and other options. The styles of Object Repository creation are dependent upon the number and types of the arguments passed to the new function.

Type:              Function

When To Use

The new function is used to create an Object Repository and allows the user to specify creation options.

Syntax:           (new ObjectRepository: fileName)

                        (new ObjectRepository: fileName clear: key: code buffer: count)

Arguments


ObjectRepository: Mandatory argument specifying the type of object to create: ObjectRepository.
filename The name of the database archive file to be associated with the ObjectRepository. If no such file exists, a new database archive file will be created.
clear: (Optional) If the keyword clear: is present, the database archive file will be cleared immediately before any further processing. If no such file exists, a new database archive file will be created.
key: code (Optional) If the keyword key: is present and it is followed by a number, the number is treated as an encryption code to use in record encrypting the database archive file. This same encryption key code must be used in all future references to the ObjectRepository. If the keyword key: is followed by the Boolean value true, the database archive file will be compressed when saved. If the Boolean value false is present, the archive file will not be compressed. The same compression key code must be used in all future references to the ObjectRepository. WARNING: If the ObjectRepository is later opened with a different key value from was specified during file creation, as a security measure, the ObjectRepository will be made unrecoverable
buffer: count (Optional) If the key word buffer: is present, the numeric buffered object {count} must follow. The ObjectRepository will remember the last {count} objects retrieved to minimize disk access when required. As same objects are retrieved, the buffered object is returned and no disk access takes place. When a new object is retrieved, the oldest buffered object is thrown away to make room for the newly retrieved object.
Returns The newly created ObjectRepository.

Example 1

(setq _path "") ;;Reset the _path variable
(setq arcFile (new ObjectRepository: "myarchive.odb")) ;; Set database archive file to "myarchive.odb"

Example 2

   
(setq _path "d:\\test\\") ;; Set the _path variable to "d:\test"
(setq arcFile (new ObjectRepository: "myarchive.odb")) ;; Set database archive file to "d:\test\myarchive.odb"

Notes & Hints

[...under construction...]

set

Overview

The set function allows values to be stored in the specified ObjectRepository repository either by key or by direct frame id. Any value may be stored in the ObjectRepository and associated with a key. Both the key and the stored value may be of arbitrary complexity. An object may be removed from the ObjectRepository by setting the value #void in association with its previous key or frame id.

The set function also allows values to be stored in the specified ObjectRepository repository by direct frame id. Any value may be stored in the ObjectRepository and associated with a frame id. The stored value may be of arbitrary complexity. An object may be removed from the ObjectRepository by setting the value #void in association with its previous frame id.

Type:              Special Form

When To Use

The set function is used to store objects into an Object Repository for later retrieval.

Syntax:           (set repository key anyObject)

                        (setq frameID (set repository frame: frameID anyObject))

Arguments


repository Mandatory argument specifying the ObjectRepository into which the object is to be saved.
key Mandatory argument specifying the key associated with the object is to be saved in the ObjectRepository.
anyObject Mandatory argument specifying the object to be saved in the ObjectRepository. If the object to be saved is #void, then the specified key will be freed in the ObjectRepository.
Returns The ObjectRepository after the save has taken place.


repository Mandatory argument specifying the ObjectRepository into which the object is to be saved.
frame: Mandatory keyword specifying that direct frame access is to be used with the object is to be saved in the ObjectRepository.
frameID Mandatory argument specifying the frame id associated with the object is to be saved in the ObjectRepository. If the frameID is to small to hold the specified object, then a new frame id will be assigned. If the frameID is #void, then a new frame id will be assigned.
anyObject Mandatory argument specifying the object to be saved in the ObjectRepository. If the object to be saved is #void, then the specified frame id will be freed in the ObjectRepository.
Returns The frame id associated with the object saved in the repository.

Example 1

Creating and initializing a new object repository.

     (setq repo (new ObjectRepository: "test.db"))

     (setq repo.Key1 "Hello World")

     repo.Key1    Returns    "Hello World"

     (setq frameID (setq repo[frame: frameID] "Hello World"))

     frameID    Returns    1.0

     repo[frame: frameID]    Returns    "Hello World"

     (setq repo.Key1 #void)

     repo.Key1    Returns    #void

     (setq frameID (setq repo[frame: frameID] #void))

     repo[frame: frameID]    Returns    #void

Note: The set function saves object values into the object repository. These object values can be of any size and complexity.

Notes & Hints

[...under construction...]

ref

Overview

The ref function allows values to be retreived from the specified ObjectRepository repository either by key or by direct frame id. Any previously stored value, associated with a key or a frame id, may be retrieved the ObjectRepository. Both the key and the stored value may be of arbitrary complexity. An object may be removed from the ObjectRepository by setting the value #void in association with its previous key or frame id.

The ref function also allows values to be retrieved from the specified ObjectRepository repository by direct frame id. Any previously stored value, associated with a frame id, may be retrieved the ObjectRepository. The retrieved value may be of arbitrary complexity. An object may be removed from the ObjectRepository by setting the value #void in association with its previous frame id.

Type:              Special Form

When To Use

The ref function is used to retrieve previously saved objects from an Object Repository.

Syntax:           (ref repository key)

                        (ref repository frame: frameID)

Arguments


repository Mandatory argument specifying the ObjectRepository from which the object is to be retrieved.
key Mandatory argument specifying the key associated with which the object is to be retrieved from the ObjectRepository.
Returns The previously saved object value retrieved from the ObjectRepository.


repository Mandatory argument specifying the ObjectRepository from which the object is to be retrieved.
frame: Mandatory keyword specifying that direct frame access is to be used with the object to be retrieved from the ObjectRepository.
frameID Mandatory argument specifying the frame id associated with the object is to be retrieved from the ObjectRepository.
Returns The previously saved object value retrieved from the ObjectRepository.

Example 1

Creating and initializing a new object repository.

     (setq repo (new ObjectRepository: "test.db"))

     (setq repo.Key1 "Hello World")

     repo.Key1    Returns    "Hello World"

     (setq frameID (setq repo[frame: frameID] "Hello World"))

     frameID    Returns    1.0

     repo[frame: frameID]    Returns    "Hello World"

     (setq repo.Key1 #void)

     repo.Key1    Returns    #void

     (setq frameID (setq repo[frame: frameID] #void))

     repo[frame: frameID]    Returns    #void

Note: The set function saves object values into the object repository. These object values can be of any size and complexity.

Notes & Hints

[...under construction...]

_path

Overview

The global variable, _path, is reserved by the system to hold the directory and path name of the current working directory. The _path variable is set to the empty string "" at system startup. It is the programmer??s responsibility to initialize the _path variable. When the _path variable is referenced, the text contents of the _path variable are automatically attached to the beginning of database archive file named in the new function.

Type:              Global Variable

When To Use

The _path is a global variable use to hold a path name string assigned by the programmer. If the _path variable is something other than a null string, the _path variable string will be prepended to the filename specified in the new function

Example 1

(setq _path "") ;;Reset the _path variable
(setq arcFile (new ObjectRepository: "myarchive.odb")) ;; Set database archive file to "myarchive.odb"

Example 2

   
(setq _path "d:\\test\\") ;; Set the _path variable to "d:\test"
(setq arcFile (new ObjectRepository: "myarchive.odb")) ;; Set database archive file to "d:\test\myarchive.odb"

Notes & Hints

[...under construction...]

Repository Functions

Here is a list of Repository Functions that operate on stored Lambdas, Lambda opinions, Lambda knowledge, and Lambda data.