Class Reference
IRIS for UNIX 2019.2
InterSystems: The power behind what matters   
Documentation  Search
  [ENSLIB] >  [EnsLib] >  [RecordMap] >  [Batcher]
Private  Storage   

abstract class EnsLib.RecordMap.Batcher extends Ens.BusinessOperation

Base class for creating RecordMap batches. Subclasses should implement more specific behaviour.

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
2 9 15


Summary

This is a Business Operation class.

Properties
%AlertStartTime %ConfigName %ConfigQueueName %LastActionTime
%LastHandledTime %LastReportedError %QuitTask %RequestHeader
%SessionId %SuperSession %WarnedLatest %isShadow
Adapter AlertGroups AlertOnError AlertRetryGracePeriod
ArchiveIO BusinessPartner DefaultBatchClass DeferResponse
FailureTimeout IOLogEntry InactivityTimeout NoFailWhileDisconnected
OpenMode QueueCountAlert QueueWaitAlert ReOpenMode
ReplyCodeActions Retry RetryCount RetryInterval
RolloverLimit RolloverSchedule SendSuperSession SuspendMessage
ThrottleDelay UnSwizzleRecords UseDefaultBatch WriteEmptyBatches

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OnClose %OnNew
%OriginalNamespace %PackageName %RemoveFromSaveSet %SerializeObject
%SetModified %SuperSessionSet %ValidateObject AdapterName
AssignOneSetting CheckRollover CloseIOLogEntry CreateDefaultBatch
DeferResponse EnumerateSettingsClose EnumerateSettingsExecute EnumerateSettingsFetch
GenerateSuperSession GetDefaultBatch GetDeferredResponseToken GetMessageList
GetProductionSettingValue GetProductionSettings GetPropertyConnections GetSettings
GetShadowInstance IncludeSuperSession NewIOLogEntry OnError
OnFailureTimeout OnGenerateSuperSession OnGetConnections OnGetReplyAction
OnInit OnKeepalive OnMessage OnMonitor
OnProcessBatch OnProductionStart OnProductionStop OnTearDown
ProcessBatch ProcessRecord ProcessRequestMessage ProcessTempFile
QueueName SaveIOLogEntry SendAlert SendDeferredResponse
SendRequestAsync SendRequestSync SwitchDefaultBatch TriggerRollover
UpdateRolloverTime


Parameters

• parameter RolloverKeepalive = 1;
Interval to use for checking schedule-based Rollover status. See the comments for RolloverSchedule for more detailed information.
• parameter SETTINGS = "UnSwizzleRecords,UseDefaultBatch,DefaultBatchClass,WriteEmptyBatches,OpenMode,ReOpenMode,RolloverSchedule,RolloverLimit";
List of properties can be set as settings in the configuration file format is a comma separated list of property names

Properties

• property DefaultBatchClass as Ens.DataType.Class;
The classname of the Batch class to be used for the Default Batch.
• property OpenMode as %String [ InitialExpression = "RWN" ];
Mode to open the temporary file with when creating a new file for a batch. See the documentation for %IO.FileStream and file devices for more information on the available options.
• property ReOpenMode as %String [ InitialExpression = "RW" ];
Mode to open the temporary file with when reopening an existing file for a batch. See the documentation for %IO.FileStream and file devices for more information on the available options.
• property RolloverLimit as %Integer(MINVAL=0) [ InitialExpression = 0 ];
Provide a limit to the number of messages which will be included in the current Default Batch. UseDefaultBatch must be enabled for this setting to take effect. If this number is 0, the application will be reponsible for enforcing batch rollovers by either sending BatchRolloverRequest messages from other components or by making use of the RolloverSchedule property. Note that this limit is evaluated after checking RolloverSchedule.
• property RolloverSchedule as %String(MAXLEN="");
A schedule string to control when the Default Batch ought to be rolled over. UseDefaultBatch must be enabled for this setting to take effect. The schedule string takes the same format as the standard schedule string for a component, with one exception: only START strings are permitted. At any time when a START is scheduled to occur, the current default Batch will be written out and replaced with a new default Batch. Note that the RolloverSchedule will be evaluated before checking RolloverLimit.
• property UnSwizzleRecords as %Boolean [ InitialExpression = 1 ];
UnSwizzle each record from memory after it has been written to the output stream. This option is used when processing an entire batch at once.
• property UseDefaultBatch as %Boolean [ InitialExpression = 0 ];
Flag to indicate whether incoming messages which are not assigned to a batch already should be added to a Default Batch. This Default Batch will be processed either when this configuration item receives a BatchRolloverRequest or the batch object itself. If RolloverSchedule is used to specify times when a Batch should be rolled over, then the current Default Batch will be processed based on the specified schedule.
• property WriteEmptyBatches as %Boolean [ InitialExpression = 0 ];
Control whether Batch objects which contain no records should be written out. Note that this applies to all batches, including the default Batch.

Methods

• method CheckRollover(pLocked As %Boolean = 0) as %Status
Check whether the current default Batch needs to be rolled over. This check is not run if UseDefaultBatch is false or if RolloverSchedule is not specified. Note that the check based on RolloverLimit is performed after the record has been processed in PutRecord().
• method CreateDefaultBatch(Output pDefaultBatch As EnsLib.RecordMap.Batch) as %Status
Callback to create a new default Batch. This method can be overridden in subclasses to further initialize the Batch object.
• method GetDefaultBatch(Output pDefaultBatch As EnsLib.RecordMap.Batch) as %Status
Get the current default Batch as an object
• method OnFailureTimeout(pRequest As %Library.Persistent, Output pResponse As %Library.Persistent, ByRef pSC As %Status) as %Boolean
Clean up temp file and AppData that might be left.
• method OnInit() as %Status
Verify the previous default Batch object if UseDefaultBatch is true, or create a new one if it didn't exist previously. Also validate that the contents of RolloverSchedule are valid.
• method OnKeepalive(pAdapterStatus As %Status) as %Status
Callback invoked to check whether a Rollover is required when RolloverSchedule is specified.
• method OnProcessBatch(pBatch As EnsLib.RecordMap.Batch, Output pResponse As EnsLib.RecordMap.BatchResponse, Output pBatchCount As %Integer = 0) as %Status
• method ProcessBatch(pBatch As EnsLib.RecordMap.Batch, Output pResponse As EnsLib.RecordMap.BatchResponse) as %Status
Handle processing of a Batch object, depending on context. See the documentation for the OnMessage method for more information on the processing order.
• method ProcessRecord(pRecord As EnsLib.RecordMap.Base, Output pResponse As EnsLib.RecordMap.BatchResponse) as %Status
Write out a Record object, depending on the context for the Batch to which the Record belongs.
• method ProcessRequestMessage(pRequest As %Persistent, Output pResponse As EnsLib.RecordMap.BatchResponse) as %Status
Handle incoming requests depending on their type. If a Batch message is received without being preceded by its contents, the entire batch will be processed immediately. If a message associated with a Batch is received before that Batch, the configuration item will note which messages are received for the Batch and will process the complete Batch when the Batch itself is received by the configuration item. If a BatchRolloverRequest is received and UseDefaultBatch is true, the current Default Batch will be rolled over and will be treated as if the default Batch was sent in a message.
• method ProcessTempFile(pTempFile As %IO.FileStream, pBatch As EnsLib.RecordMap.Batch) as %Status
Callback which subclasses should override. The completed temporary file will be passed to this method when the Batch has been processed.
• method SwitchDefaultBatch() as %Status
Create a new batch object if UseDefaultBatch is true. This method has no effect when UseDefaultBatch is false.
• method TriggerRollover() as %Status
• method UpdateRolloverTime(pLocked As %Boolean = 0) as %Status
Calculate the next rollover time based on the contents of RolloverSchedule.


Copyright (c) 2019 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.