PartitionDefs:
CEDAR
DEFINITIONS =
BEGIN
The partition package is used to temporarily store data onto a file.
Each data object is associated with a partition. When read, this
data is sorted by partition. The partition is specified by Layer
and Stripe. Layer is in the range [0..11], Stripe is in [0..255].
layerNumber: TYPE = [0..39];
stripeNumber: TYPE = [0..255];
InitPartitions: PROCEDURE [FileName: Rope.ROPE];
This initializes the partition package. The file is the
new disk file to be used.
DestroyPartitions: PROCEDURE RETURNS [fileLength: INT];
This cleans up the partition package when its use is finished. It
closes and deletes the temporary file and releases all storage used.
SendObjectToPartition:
PROCEDURE [
Stripe: stripeNumber, Layer: layerNumber, object: Basics.UnsafeBlock];
Stripe and Layer specify which partition is to be used.
ReadPartitionCreate:
PROCEDURE [Stripe: stripeNumber, Layer: layerNumber]
RETURNS [ s: IO.STREAM];
This resets the position of the partition to the beginning of the partition
so that it can be read. It re-obtains the partition in READ mode. If
the partition was never created, it returns FALSE.
ReadObject: PUBLIC PROCEDURE [ s: IO.STREAM, object: REF TEXT ];
Reads one object from a stream that was returned by ReadPartitionCreate. Finishes with ERROR IO.EndOfStream.
END.