|
Class Reference
%SYS.Journal.System
|
|
![]() |
|||
Private Storage |
Journaling related API
|
|
|
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
Return the path of the cluster journal log
Return the object reference to current journal file
Return the file count of current journal file
Return the path of current journal file
Returns the ending offset of the last journal record in current journal file; 0 if journaling is off
Return the free space available for journal files
Return the journal checkpoint information stored in the WIJ (aka Write Image Journal)
Return the journal file name prefix
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
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)
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.
TRUE if journaling is disabled system wide
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
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.
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:
Output:
- Reason: reason for the switch (0 = unspecified, 1 = user-initiated, etc.);
Return success or error status.
- NewFile: the path of the file to which journaling has switched (if successfully)
Caveat: Journal history global is NOT updated, a la journal daemon
Set the journal file prefix string. This string is prefixed to the mmddyyyy.nnn journal file name when a new journal file is created. Journal file prefixes can be used to distinguish journal files from different Cache instances if it is necessary to store journal files from several instances in the same directory. It is better practice to use separate directories, possibly separate subdirectories of a common directory, for each Cache instance. Changes to the journal file prefix require a Cache restart to become active.
Purpose: Start journalingOptional parameters for journaling:
shdwok: OK to share directory with shadow journal files despite potential file conflicts (DEFAULT = 0) Returns OK on success
- 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
Purpose: Stop journaling system wide
Purpose: Switch journal file (and optionally change one or more journaling parameters)Optional parameters for journaling:
Returns OK on success
- 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)
Purpose: Sync (commit) journal data to diskReturns 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.
Purpose: Report what portion of the journal has been committed to diskReturns a journal offset. It is guaranteed that journal data at or prior to the offset are on disk.
Caveat: see
Sync
|
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 }
Selects Main Status As%String , Cause As%String , Full Status As%String
Returns status of the journaling system.Example:
Here the journaling status of a remote system is retrieved and displayed every 10 seconds. Sees rs=##class(%RemoteResultSet).%New("%SYS.Journal.System:Status") s rs.UserName="_system" s rs.Password="sys" s rs.ConnectionString="hostname[port]:%SYS" s rc=rs.Execute() w rc while rs.Next() { w rs.Data("Main Status"),! h 10 }%RemoteResultSet for details on how to use it.
Selects Parameter As%String , Value As%String
Query returns a summary of the journaling system status.
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") }