SYS.DataCheck.RangeListpersistent class SYS.DataCheck.RangeList
A list of global subscript ranges describing the entire key space of a single global.
Objects of this class are the list header with properties for the list metadata. The
The RangeList is used to store results of the check and also the include/exclude
subscript ranges to check (see
RangeList objects that store results are maintained by the DataCheck destination system and should not be modified.
To create/edit a global selection RangeList as part of configuring a DataCheck
destination system, the sequence is as follows. Note that the system must be
configured to use global selection RangeLists in order for this to have an effect:
1. To create a new RangeList object, passing the appropriate arguments to the %New() constructor (see
One of the following constants, defined for convenience in %syDataCheck.inc:
1 - $$$RangeStateMatched - the entire global, less any excluded ranges, was found to be matched 0 - $$$RangeStateUnknown - the entire global has not been checked yet, but no discrepancies found -1 - $$$RangeStateUnmatched - some ranges have discrepancies
Collation of global or -1 if unknown
Database referenced by this RangeList
Global name referenced by this RangeList
The set of RangeLists that this object is a member of. Integer values 1 and higher are the set of results generated by the DataCheck system and incremented each time the system starts a new set of results. The currently active set of results is returned by
GetActiveResultsListSet. A value of "%GS" ($$$RangeListSetGlobalSelection) indicates that this object is a member of the set of configured subscript ranges to include / exclude from the check.
DataCheck system name that this RangeList belongs to
Constructor for RangeList
systemname: name of the DataCheck destination system set: set that this rangelist is a member of; see ListSet database: The local database path for non-mirror DataCheck configurations; the mirror database name, in :mirror:mirrorname:mirrorDBname format, for mirrored DataCheck configurations. globalname: name of the global that this rangelist represents (leading ^ is optional)
IMPORTANT: The creator of a global selection RangeList is responsible for ensuring that the database is specified correctly, and for non-mirror DataCheck configurations, that it has a mapping specified in the DataCheck configuration.
Given a DataCheck system name, returns the ListSet of the currently active set of results
Given a DataCheck system name and a list set, returns the date and time in $horolog format when all pending DataCheck queries finished, with the specified list set was the active one. Returns null if there are queries pending and the specified list set is the active one, or if the specified list set does not exist. If the specified list set is the active one, the value may change from non-null back to null if new queries are run.
Given a DataCheck system name and a list set, returns the date and time in $horolog format when the check whose results are stored in that list set began. Returns null if the set does not exist.
Inserts a new range into the range list, merging and splitting with existing ranges as appropriate. Caller must call
gloref1: beginning of the range to insert (inclusive) gloref2: end of range to insert (exclusive) state: state of the range to insert cachetoken: (optional) A token returned from a previous call to Insert(). See below for more detail.Output Parameters: sc: %Status returned from this call. If an error occurs that is not simply the result of invalid input, the RangeList needs to be reloaded to return to a valid state; in this case subsequent calls to Insert or attempts to save the RangeList will result in $$$DCRangeListErrorStatus errors.
Returns: Returns a "cachetoken" that reserves some of the list elements in a cache to optimize the next insert. Caller must maintain this cachetoken as described below. If the status in 'sc' is not $$$OK, the cachetoken shall be null.
The cachetoken returned from a call to Insert() should be passed in to the next call to Insert() that is to act on a nearby part of the list. Each call to Insert() that is passed a token will: start a linear scan of the list from elements referenced in the passed cachetoken (assuming those elements are still cached and haven't be removed by intervening modifications to the list); release the cache reservation on the elements that the token references; and return a new cachetoken with an updated cache reservation. If an Insert() call is not known to be acting on a region of the list near to a cachetoken that the caller has from a previous Insert() call, the caller should instead pass a null cachetoken. When no cachetoken is passed, Insert() will evaluate all cached elements to determine an optimal starting location.
The caller is responsible for releasing the cache reservation for any cachetoken returned from Insert() that is not used in a later Insert() call. The cache reservation should be released by passing the unused cachetoken to
ReleaseCacheToken()or by closing the RangeList object.
Takes as argument a cachetoken returned from
Insertand releases the cache reservation of the cached elements.
Collationto the value of the 'col' parameter if specified. If no value is specified, obtains it from the local system by looking at the global referenced by this RangeList object, if it exists, or from the default for the database referenced by this RangeList object. Throws an exception if it was already set to a valid collation. Caller must call %Save()to save.
Selects From As
SYS.DataCheck.GlobalReference, To As SYS.DataCheck.GlobalReference, State As SYS.DataCheck.RangeState
The ListElements query fetches as rows each subscript range in the rangelist in collation order. Each subscript range is the global reference inclusive of the 'From' column up to but excluding the global reference in the 'To' column. If 'To' is null or "[end]" in display mode, the range extends to the end of the global.
systemname: name of the DataCheck system set: ListSet to query (see ListSetproperty) database: path of the database local to this system global: name of the global rl: (optional) If an object is passed in this parameter, it will be assumed to be the RangeList object for which elements should be returned and the other input parameters will be ignored. This parameter also serves as an output parameter to return the RangeList object opened if no object was passed in.
rl: (optional) If no object was passed in as an input parameter (see above), then the output of this parameter is the RangeList object that was opened, or null if no RangeList object exists (in this case no rows will be found). If an object was passed as an input parameter, it is not modified.