%SYS.GlobalQuery
Class %SYS.GlobalQuery Extends %SYSTEM.Help [ Abstract, System = 3 ]
Parameters
DEFAULTCONCURRENCY
Parameter DEFAULTCONCURRENCY [ Internal ] = 0;
DOMAIN
Parameter DOMAIN = "%Utility";
Default Localization Domain
Methods
DecodeReplication
ClassMethod DecodeReplication(Index As %Integer) As %String [ Internal, Private ]
Lock
ClassMethod Lock(Global, Subscript, Name, Timeout = 0) As %Status [ Internal ]
UnLock
ClassMethod UnLock(Global, Subscript, IModeLock = 0) As %Status [ Internal ]
DisplayToLogical
ClassMethod DisplayToLogical(%val As %String) As %Library.Boolean [ Internal ]
Generate
ClassMethod Generate(Mask As %String, ByRef Begin As %String, ByRef End As %String, ByRef Pattern As %String, Flag As %Integer) [ Internal ]
Passed a pattern match this returns an COS style pattern and a start and stop point.
LogicalToDisplay
ClassMethod LogicalToDisplay(%val As %Library.Boolean) As %String [ Internal ]
Matches
ClassMethod Matches(Name As %String, ByRef Patterns As %String) As %Boolean [ Internal ]
Returns whether the passed name matches the Pattern array
Parse
ClassMethod Parse(Masks As %String, ByRef Patterns As %String) [ Internal ]
Parses a passed mask into a series of patterns in an array.
The resulting array can be passed to the $SYSTEM.Library.Pattern.Matches function along with a Name to determine if the name matches the mask.
The passed in mask may be a series of masks, each separated by a comma. Valid masks are as follows:
ABC* - All strings starting with ABC
A:D - All strings between A and D
A:D,Y* - All strings between A and D, and all strings starting with Y
A:D,'C* - All strings between A and D, except those starting with C
Wildcards
ClassMethod Wildcards(Mask As %String = "*") As %Boolean [ Internal ]
Check whether the input mask has wildcards specified. Return TRUE if there is wildcard otherwise return FALSE.
DirectoryListExecute
ClassMethod DirectoryListExecute(ByRef qHandle As %Binary, Directory As %String, System As %String = "", Mask As %String = "*", SystemGlobals As %Boolean = 0, Index As %Integer = 0, IgnoreHasData As %Boolean = 0) As %Status [ Internal ]
Returns a list of the Globals in a database
Parameters:
Directory - the directory file-spec for a database file.
System - ECP database server logical name, as defined in the Application Server list.
Mask - a mask, or comma-separated list of masks, to select globals. Default is "*" for all.
SystemGlobals - boolean flag to include system globals in the results. Default is "0".
Index - Internal use only.
IgnoreHasData - For faster list of Globals set this to 1 and the HasData column will always be FALSE.
Valid masks are as follows:
ABC* - All strings starting with ABC
A:D - All strings between A and D
A:D,Y* - All strings between A and D, and all strings starting with Y
A:D,'C* - All strings between A and D, except those starting with C
DirectoryListFetch
ClassMethod DirectoryListFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal ]
DirectoryListClose
ClassMethod DirectoryListClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = DirectoryListExecute ]
NameSpaceListExecute
ClassMethod NameSpaceListExecute(ByRef qHandle As %Binary, NameSpace As %String = {$namespace}, Mask As %String = "*", SystemGlobals As %Boolean = 0, ByRef UnavailableDatabases As %String, Index As %Integer = 0, IgnoreHasData As %Boolean = 0, Mapped As %Boolean = 1) As %Status [ Internal ]
Returns a list of the Globals in a namespace (used for GUI display)
Parameters:
NameSpace - a namespace. Default is current namespace.
Mask - a mask, or comma-separated list of masks, to select globals. Default is "*" for all.
SystemGlobals - boolean flag to include system globals in the results. Default is "0".
UnavailableDatabases - a returned local array of any databases not currently accessible, i.e. array(name)=status.
Index - Internal use only.
IgnoreHasData - For faster list of Globals set this to 1 and the HasData column will always be FALSE.
Mapped - Return all mapped global nodes when set to 1, the default value of this parameter is 1.
Valid masks are as follows:
ABC* - All strings starting with ABC
A:D - All strings between A and D
A:D,Y* - All strings between A and D, and all strings starting with Y
A:D,'C* - All strings between A and D, except those starting with C
NameSpaceListFetch
ClassMethod NameSpaceListFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal ]
NameSpaceListClose
ClassMethod NameSpaceListClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = NameSpaceListExecute ]
NameSpaceListChuiExecute
ClassMethod NameSpaceListChuiExecute(ByRef qHandle As %Binary, NameSpace As %String = {$namespace}, Mask As %String = "*", SystemGlobals As %Boolean = 0, ByRef UnavailableDatabases As %String, Index As %Integer = 0) As %Status [ Internal ]
Returns a list of Globals in a namespace (used for terminal display)
Parameters:
NameSpace - a namespace. Default is current namespace.
Mask - a mask, or comma-separated list of masks, to select globals. Default is "*" for all.
SystemGlobals - boolean flag to include system globals in the results. Default is "0".
UnavailableDatabases - a returned local array of any databases not currently accessible, i.e. array(name)=status.
Index - Internal use only.
Valid masks are as follows:
ABC* - All strings starting with ABC
A:D - All strings between A and D
A:D,Y* - All strings between A and D, and all strings starting with Y
A:D,'C* - All strings between A and D, except those starting with C
NameSpaceListChuiFetch
ClassMethod NameSpaceListChuiFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal ]
NameSpaceListChuiClose
ClassMethod NameSpaceListChuiClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = NameSpaceListExecute ]
SizeExecute
ClassMethod SizeExecute(ByRef qHandle As %Binary, Directory As %String, System As %String = "", Mask As %String = "*", SystemGlobals As %Boolean = 0, Index As %Integer = 0, FastFlag As %Integer = 0) As %Status [ Internal ]
Returns the size of Globals in a database
Parameters:
Directory - the directory file-spec for a database file.
System - Currently ignored, pass as a null string. Getting the size of a global in an ECP mounted database is not currently supported. You can get the size for these globals directly on the ECP server itself.
Mask - a mask, or comma-separated list of masks, to select globals. Default is "*" for all.
SystemGlobals - boolean flag to include system globals in the results. Default is "0".
Index - Internal use only.
FastFlag - If 1, don't return 'Used' count, only the precise 'Allocated' count. If 2, return estimates for 'Allocated' and 'Used' (fastest option for huge globals).
Valid masks are as follows:
ABC* - All strings starting with ABC
A:D - All strings between A and D
A:D,Y* - All strings between A and D, and all strings starting with Y
A:D,'C* - All strings between A and D, except those starting with C
SizeFetch
ClassMethod SizeFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal ]
SizeClose
ClassMethod SizeClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = SizeExecute ]
NameSpaceSizeExecute
ClassMethod NameSpaceSizeExecute(ByRef qHandle As %Binary, Global As %String, FastFlag As %Boolean = 0, SilentSkip As %Boolean = 0) As %Status [ Internal ]
Measures the size of a given global or subnode in the current namespace, iterating over the mappings and measuring data in each. Each row returns the subscript range that was measured, the corresponding database, and either allocated or estimated size in megabytes (MB).
For root globals, this query measures size by each subscript mapping. The sum will equal the total size (or estimate) of the global from the namespace's perspecive.
For subnodes, this query measures the entire subnode once in each mapped database. In typical scenarios, this will still sum to the subnode's overall size from the namespace's perspective.
Note that in certain configurations, a database may contain global data that the namespace doesn't see. This can happen if different namespaces map different parts of the same global to the same database. Subnode queries may measure unseen data and return inflated results in these cases.
Measurements in remote or dismounted databases are unsupported. They either return errors or are quietly skipped if SilentSkip=1.
Parameters:
Global - the name of the global or subnode to measure (for example, "testglobal" or "testglobal(1)"), with or without a prepended carat.
FastFlag - flag to run fast stochastic estimation. If set, fills Estimated column. Otherwise, fills Allocated column. Default is 0 (not set). 1 is recommended for huge globals.
SilentSkip - flag to silently skip unavailable databases and exclude them from results. If 0 (not set), stops and returns an error instead of skipping. Default is 0.
Executes all relevant subscript range measurements and assembles them in a temp global for Fetch.
NameSpaceSizeFetch
ClassMethod NameSpaceSizeFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) As %Status [ Internal ]
Iterates over results in the temp global assembled by NameSpaceSizeExecute. Results should already be in the $list format expected for rows.
NameSpaceSizeClose
ClassMethod NameSpaceSizeClose(ByRef qHandle As %Binary) As %Status [ Internal, PlaceAfter = NameSpaceSizeExecute ]
Cleans up the temp global data from NameSpaceSizeExecute.
GetGlobalMappings
ClassMethod GetGlobalMappings(Namespace As %String, Global As %String, ByRef mapArray, SilentSkip As %Boolean = 0) As %Status [ Internal ]
Internal helper for the NameSpaceSize class query. Amasses a validated array of subscript mappings and their corresponding databases for a given global (or subnode) in a given namespace. Takes as input a global name (no carat), the empty array to fill (passed by reference), and the SilentSkip flag. By default, returns status OK if all databases are local and available and an error status if a database is remote, dismounted, or missing. If SilentSkip is set, it skips over unavailable databases and assembles an array of the local, available ones without complaint.