%SYS.Journal.System
abstract class %SYS.Journal.System extends %Library.RegisteredObject
Journaling related APIMethod Inventory
- ActivateEncryption()
- DeactivateEncryption()
- GetAlternateDirectory()
- GetClusterJournalLog()
- GetCurrentFile()
- GetCurrentFileCount()
- GetCurrentFileName()
- GetCurrentFileOffset()
- GetFreeSpace()
- GetImageJournalInfo()
- GetJournalFilePrefix()
- GetLastFileName()
- GetPrimaryDirectory()
- GetState()
- GetStateString()
- GetTheOtherDirectory()
- IsDisabled()
- IsEncKeyInUse()
- IsFrozen()
- IsGettingIOError()
- IsJournalEncryptionEnabled()
- IsPaused()
- OKNoDBEncKeyAtStartup()
- OKNoDBEncKeyNow()
- RollToNextFile()
- SetAlternateDirectory()
- SetPrimaryDirectory()
- Start()
- Stop()
- SwitchDirectory()
- SwitchFile()
- Sync()
- WhereCommitted()
Methods
Activate journal encryption such that new updates go to encrypted
journal files.
Deactivate journal encryption such that new updates go to unencrypted
journal files.
Return the path of the secondary journal directory
classmethod GetClusterJournalLog() as %String
Return the path of the cluster journal log
classmethod GetCurrentFile() as %SYS.Journal.File
Return the object reference to current journal file
classmethod GetCurrentFileCount() as %Integer
Return the file count of current journal file
classmethod GetCurrentFileName() as %String
Return the path of current journal file
classmethod GetCurrentFileOffset() as %Integer
Returns the ending offset of the last journal record in current journal file;
0 if journaling is off
classmethod GetFreeSpace() as %Integer
Return the free space available for journal files
classmethod GetImageJournalInfo(ByRef JournalFileName As %String, ByRef JournalFileOffset As %Integer, ByRef JournalFileCount As %Integer, ByRef OpenTransFileOffset As %Integer, ByRef OpenTransFileCount As %Integer) as %Status
Return the journal checkpoint information stored in the WIJ (aka Write Image Journal)
classmethod GetJournalFilePrefix() as %String
Return the journal file name prefix
classmethod GetLastFileName() as %String
Get the path of the last journal file on the system -- meaningful only if
current journal file name = "" (i.e., journaling hasn't started)
Return the path of the primary journal directory, which is not necessarily the current journal directory
classmethod GetState() as %Integer
Returns the state of the journaling system as an Integer
0 - Enabled
1 - Disabled (stopped)
2 - Suspended (due to I/O error)
3 - Frozen (due to I/O error)
4 - Paused (during journal file switch)
0 - Enabled
1 - Disabled (stopped)
2 - Suspended (due to I/O error)
3 - Frozen (due to I/O error)
4 - Paused (during journal file switch)
classmethod GetStateString() as %String
Returns the state of the journaling system as a string. Values are:
"Normal" (Enabled and running normally)
"Disabled" (stopped)
"Suspended" (due to I/O error)
"Frozen" (due to I/O error)
"Paused" (during journal file switch)
Frozen and Suspended are the same state (I/O error occurred), but they differ in the action processes take (freeze or discard journal data respectively) when they encounter this state.
"Normal" (Enabled and running normally)
"Disabled" (stopped)
"Suspended" (due to I/O error)
"Frozen" (due to I/O error)
"Paused" (during journal file switch)
Frozen and Suspended are the same state (I/O error occurred), but they differ in the action processes take (freeze or discard journal data respectively) when they encounter this state.
classmethod GetTheOtherDirectory(ByRef Directory As %String = "", ByRef Type As %Integer = 0) as %Integer
Get the path of the journal directory other than the current one.
Directory: The journal directory different from the current one or "" if none
Type: 1 if Directory is Primary or 2 if Directory is Secondary or 0 if Directory is "" (meaning no other directory)
Directory: The journal directory different from the current one or "" if none
Type: 1 if Directory is Primary or 2 if Directory is Secondary or 0 if Directory is "" (meaning no other directory)
TRUE if journaling is disabled system wide
TRUE if the given DBEncKeyID is used on journal files required for recovery
TRUE if journaling is frozen system wide (i.e., journal updates are blocked), typically
when there is a journaling error and the system is set up to freeze on such errors.
TRUE if there is a journaling error, from which the system may be trying to recover
Return current journal encryption status.
Type - 1: Run time journal encryption status (default).
2: Startup journal encryption status.
3: Run time or Startup encryption status.
Retrun 1 if journal encryption status is enabled, otherwise return 0.
Type - 1: Run time journal encryption status (default).
2: Startup journal encryption status.
3: Run time or Startup encryption status.
Retrun 1 if journal encryption status is enabled, otherwise return 0.
TRUE if journaling is paused system wide (when there is an ongoing journal switch)
Return OK if DBEncKey is not required at startup (i.e., OK to disable
DBEncKey activation at startup); otherwise, return an error indicating
why DBEncKey must be activated at startup.
classmethod OKNoDBEncKeyNow() as %Status
Return OK if DBEncKey is not required for individual jobs to roll back
their own open transactions (i.e., OK to deactivate DBEncKey); otherwise,
return an error indicating why DBEncKey must stay activated.
Purpose: Roll journaling to next file, without any journal property change (to activate)
Input:
- Reason: reason for the switch (0 = unspecified, 1 = user-initiated, etc.);
- NewFile: the path of the file to which journaling has switched (if successfully)
Caveat: Journal history global is NOT updated, a la journal daemon
classmethod Start(curdir As %String, altdir As %String, maxsiz As %Integer, expsiz As %Integer, prefix As %String, okshdw As %Boolean = 0) as %Status
Purpose: Start journaling
Optional parameters for journaling:
- curdir: primary journal directory
- altdir: alternate journal directory
- maxsiz: max size of journal file in bytes
- expsiz: [Windows & VMS only] unit increment of journal file size in bytes
- prefix: a string preceding the standard journal file name YYYYMMDD.NNN
classmethod Stop() as %Status
Purpose: Stop journaling system wide
Switch journaling to the other journal directory if specified
Return (by reference) the path of current journal file after a successful switch.
Return (by reference) the path of current journal file after a successful switch.
classmethod SwitchFile(curdir As %String, altdir As %String, maxsiz As %Integer, expsiz As %Integer, okshdw As %Boolean = 0, reason As %Integer) as %Status
Purpose: Switch journal file (and optionally change one or more journaling parameters)
Optional parameters for journaling:
- curdir: primary journal directory
- altdir: alternate journal directory
- maxsiz: max size of journal file in bytes
- expsiz: [Windows & VMS only] unit increment of journal file size in bytes
- shdwok: OK to share directory with shadow journal files despite potential file conflicts (DEFAULT = 0)
- reason: reason for journal switch (DEFAULT: by user)
classmethod Sync() as %Integer
Purpose: Sync (commit) journal data to disk
Returns a journal offset. It is guaranteed that journal data at or prior to the offset are on disk by the time Sync() returns.
Caveat: It is possible that journal file has been switched by the time Sync() returns. In that case, it is unpredictable which journal file the returned offset refers to and one might have to repeat Sync() until journal file remains the same before and after.
classmethod WhereCommitted() as %Integer
Purpose: Report what portion of the journal has been committed to disk
Returns a journal offset. It is guaranteed that journal data at or prior to the offset are on disk.
Caveat: see Sync()
Queries
query Progress()
Selects File Name As %String, File Count As %Integer, Offset As %Integer, Offset Committed As %Integer, TimeStamp As %String
Returns info on journaling progress
Example:
Here the current journal file name and offset are retrieved and displayed every 10 seconds.
s rs=##class(%ResultSet).%New("%SYS.Journal.System:Progress") s rc=rs.Execute() w rc while rs.Next() { w $zdt(rs.Data("TimeStamp"),8),": ",$j(rs.Data("Offset"),10)," ",rs.Data("File Name"),! h 10 }
query Status()
Returns status of the journaling system.
Here the journaling status of a remote system is retrieved and displayed every 10 seconds.
See %RemoteResultSet for details on how to use it.
Example:
s rs=##class(%ResultSet).%New("%SYS.Journal.System:Status") s rc=rs.Execute() w rc while rs.Next() { w rs.Data("Main Status"),! h 10 }
query Summary()
Query returns a summary of the journaling system status.
Example:
Example:
s rs=##class(%ResultSet).%New("%SYS.Journal.System:Summary") s rc=rs.Execute() w !,rs.GetColumnHeader(1),?40," ",rs.GetColumnHeader(2),! while rs.Next() { w !,rs.Data("Parameter"),?40," ",rs.Data("Value") }
Inherited Members
Inherited Methods
- %AddToSaveSet()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructClone()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %IsModified()
- %New()
- %NormalizeObject()
- %ObjectModified()
- %OriginalNamespace()
- %PackageName()
- %RemoveFromSaveSet()
- %SerializeObject()
- %SetModified()
- %ValidateObject()