Real Time Information Director User Documentation

RTID Metadata Language
Hewlett-Packard Company 64 529618-002
The block size is the number of keys that will be allocated at once. Only one key is
needed for each document, of course, but a PartitionedKeyDispenser class fetches a block
of keys at a time; any other instance of the Director would have to start with the next set
of that many keys.
{
public static final short STARTING_PARTITION = 0;
public static final short NO_OF_PARTITIONS = 4;
public static final long PARTITION_RANGE = 1000000;
public static final int KEYS_BLOCK_SIZE = 100;
Because the same parameters need to be passed to various classes, the parameters are
defined as an object. The first parameter is a default keyspace name, which is overridden
by any keyspace name specified when you create a PartitionedKeyDispenser class.
public static final PartitionParameters partitionParameters =
new
PartitionParameters("EHR",STARTING_PARTITION,NO_OF_PARTITIONS,PARTITION_
RANGE);
Here is the creation of the PartitionedKeyDispenser object called personIDDispenser,
which will allocate keys when the metadata later calls PartitionedSystemKey.
“PERSONID” is the namespace in the KEYS table. The value that you specify here
overrides the value specified as the default keyspace name in the PartitionParameters
object; if you omitted the parameter here, the default keyspace would apply.
public static final PartitionedKeyDispenser personIdDispenser =
new PartitionedKeyDispenser("PERSONID",partitionParameters,
KEYS_BLOCK_SIZE);
The next statement defines an EnrichedRecord object. The record to be stored in the
PERSON table (first parameter) is enriched with the addition of the partition ID:
public static final EnrichedRecord personRecord =
new EnrichedRecord("PERSON",
new PartitionedKey("PARTITIONID", partitionParameters,
new HashPartitionId("EXTERNALIDENTIFIER",
partitionParameters)));
In the EHR solution, the PERSON table has the crucial function of mapping the persons
external identifier, used in business documents, to the internal identifier assigned by the
Director. The following statement describes how the personRecord correlates these
identifiers; this statement would be required, even if the data were not being partitioned.
public static final Mapper personMapper = new Mapper(personRecord,
"UNIQUEIDENTIFIER", "EXTERNALIDENTIFIER IDENTIFIERTYPECODE");