%CSP.UI.System.BackgroundTask

class %CSP.UI.System.BackgroundTask extends %Library.RegisteredObject

This class is used internally by InterSystems IRIS. You should not make direct use of it within your applications. There is no guarantee made about either the behavior or future operation of this class.

This class supplies the ManagementPortal with a way to execute certain tasks as background jobs.
For example, you can rebuild indices for a class:

  Set tParms("ClassName") = "Sample.Person"
  Set tSC = ..RunTask("RebuildIndices","SAMPLES",.tParms,.tJob)
  

Method Inventory

Parameters

parameter DOMAIN = %Utility;
Default Localization Domain
parameter TASKS = ,AuditCopy,AuditExport,AuditPurge,Backup,CompactDBSpace,CopyNamespaceMappings,CreateDatabase,Compile,DatabaseIntegrityCheck,DataMigration,DefragmentDB,Delete,EnableEnsNamespace,Export,ExternalLangServers,FileMan,Import,SQLExport,SQLImport,SQLExportStatement,SQLImportStatement,QueryExport,JournalIntegrityCheck,LinkTable,LinkProcedure,MirrorActivateCatchupDB,MirrorRemoveDB,MirrorMountDB,MirrorAddDatabases,ModifyDatabaseSize,RebuildIndices,TuneTable,TuneTables,PurgeAllCachedQueries,JobShowPlan,JobSaveQuery,JobPossiblePlans,JobComparePlans,ShardActivate,ShardAssign,ShardVerify,ShardRebalance,Task1;
This defines the allowed tasks that this class can run

Methods

classmethod ActivateShard(ByRef pParms) as %Status [ Language = objectscript ]
classmethod AssignShard(ByRef pParms) as %Status [ Language = objectscript ]
Assign new shard in the background
classmethod AuditCopy(ByRef pParms) as %Status [ Language = objectscript ]
Start Copy audit log to another namespace
classmethod AuditExport(ByRef pParms) as %Status [ Language = objectscript ]
Start Export audit log
classmethod AuditPurge(ByRef pParms) as %Status [ Language = objectscript ]
Start Purge audit log
classmethod CompactDBSpace(ByRef pParms) as %Status [ Language = objectscript ]
Return unused db space
classmethod Compile(ByRef pParms, ByRef tItems) as %Status [ Language = objectscript ]
Start Compile routines/classes
classmethod CopyNamespaceMappings(ByRef pParms) as %Status [ Language = objectscript ]
Copy Mappings from one Namespace to another
classmethod CreateDatabase(ByRef pParms) as %Status [ Language = objectscript ]
Create a database
classmethod DataMigration(ByRef pParms, ByRef tItems) as %Status [ Language = objectscript ]
Sart SQL Data Migration
classmethod DatabaseIntegrityCheck(ByRef pParms) as %Status [ Language = objectscript ]
Start database file integrity check. After finish, transform results to file.
classmethod DefragmentDB(ByRef pParms) as %Status [ Language = objectscript ]
classmethod Delete(ByRef pParms, ByRef tItems) as %Status [ Language = objectscript ]
Start Delete routines/classes
classmethod EnableEnsNamespace(ByRef pParms) as %Status [ Language = objectscript ]
Enable productions for a namespace
classmethod EnumerateTasksClose(ByRef qHandle As %Binary) as %Status [ Language = objectscript ]
classmethod EnumerateTasksExecute(ByRef qHandle As %Binary) as %Status [ Language = objectscript ]
classmethod EnumerateTasksFetch(ByRef qHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status [ Language = objectscript ]
classmethod ErrorLogClose(QHandle As %Binary) as %Status [ Language = objectscript ]
classmethod ErrorLogExecute(ByRef QHandle As %Binary, %pid As %Library.String) as %Status [ Language = objectscript ]
classmethod ErrorLogFetch(ByRef QHandle As %Binary, ByRef Row As %List, ByRef AtEnd As %Integer = 0) as %Status [ Language = objectscript ]
classmethod Export(ByRef pParms, ByRef tItems) as %Status [ Language = objectscript ]
Start Export globals/routines/classes
classmethod ExternalLangServers(ByRef pParms) as %Status [ Language = objectscript ]
Check status of external language servers
classmethod FileMan(ByRef pParms, ByRef pItems) as %Status [ Language = objectscript ]
Map FileMan files to InterSystems classes
classmethod Import(ByRef pParms, ByRef tItems) as %Status [ Language = objectscript ]
Start Import globals/routines/classes
classmethod JobComparePlans(ByRef pParms) as %Status [ Language = objectscript ]
Run Compare Show Plans process in the background
classmethod JobPossiblePlans(ByRef pParms) as %Status [ Language = objectscript ]
Run Possible Plans process in the background
classmethod JobSaveQuery(ByRef pParms) as %Status [ Language = objectscript ]
Run Save Query (for pTools) process in the background
classmethod JobShowPlan(ByRef pParms) as %Status [ Language = objectscript ]
Run Show Plan process in the background
classmethod JournalIntegrityCheck(ByRef pParms) as %Status [ Language = objectscript ]
Start journal file integrity check
classmethod LinkProcedure(ByRef pParms, ByRef tItems) as %Status [ Language = objectscript ]
Start SQL Link Procedure
classmethod LinkTable(ByRef pParms, ByRef tItems) as %Status [ Language = objectscript ]
Start SQL Link Table
classmethod MirrorActivateCatchupDB(ByRef pParms, ByRef pItems) as %Status [ Language = objectscript ]
Activate and/or catchup Mirror DBs
classmethod MirrorAddDatabases(ByRef pParms, ByRef pItems) as %Status [ Language = objectscript ]
Add databases to mirror
classmethod MirrorMountDB(ByRef pParms, ByRef pItems) as %Status [ Language = objectscript ]
Mount Mirror DBs
classmethod MirrorRemoveDB(ByRef pParms, ByRef pItems) as %Status [ Language = objectscript ]
Remove DBs from mirror
classmethod ModifyDatabaseSize(ByRef pParms) as %Status [ Language = objectscript ]
Modify database size
classmethod PurgeAllCachedQueries() as %Status [ Language = objectscript ]
Purge all cached queries from all namespaces
classmethod QueryExport(ByRef pParms) as %Status [ Language = objectscript ]
Start SQL Export Dynamic Query
classmethod RebalanceShard(ByRef pParms) as %Status [ Language = objectscript ]
Rebalance shards in the background
classmethod RebuildIndices(ByRef pParms) as %Status [ Language = objectscript ]
Rebuild indices for a class
classmethod RunBackgroundTask(pTask As %String, pNS As %String, pParmList As %List, pIdx As %Integer) [ Language = objectscript ]
This wrapper method is run in the background job. pParms is a list of parameters.
classmethod RunTask(pTask As %String, pNS As %String, ByRef pParms As %String, ByRef tItems As %String = "", ByRef pJob As %Integer) as %Status [ Language = objectscript ]
Use this method to request a background task pTask is name of task to run; it must one of the entries in the TASKS parameter.
pNS is namespace to run task in.
pParms is a array containing parameters for the task in the form pParms(parm)=value.
It returns a PID# if the task is started, or 0 if it fails to start.
classmethod SQLExport(ByRef pParms) as %Status [ Language = objectscript ]
Start SQL Export
classmethod SQLExportStatement(ByRef pParms) as %Status [ Language = objectscript ]
classmethod SQLImport(ByRef pParms) as %Status [ Language = objectscript ]
Start SQL Import
classmethod SQLImportStatement(ByRef pParms) as %Status [ Language = objectscript ]
classmethod Task1(ByRef pParms) as %Status [ Language = objectscript ]
Test task
classmethod TuneTables(ByRef pParms) as %Status [ Language = objectscript ]
Tune all tables in a schema
classmethod VerifyShard(ByRef pParms) as %Status [ Language = objectscript ]
Verify shards in the background
classmethod WriteDone() [ Language = objectscript ]
This method writes generic Status of "Done".
classmethod WriteError(ErrorMessage) [ Language = objectscript ]
This method writes generic Status of "ERROR" and error message to Details.

Queries

query EnumerateTasks()
Selects ID As %Integer, StartTime As %TimeStamp, Namespace As %String, Task As %String, Status As %String, Details As %String, ErrorCount As %String, SysBGTaskId
Return a list of currently excuting (or failed) background Management Portal tasks.
query ErrorLog(%pid As %Library.Integer)
Selects Type As %String, ErrorNo As %Integer, ErrorText As %String, Row As %Integer

Inherited Members

Inherited Methods

Feedback