Skip to main content

EnsLib.RecordMap.Batcher

abstract class EnsLib.RecordMap.Batcher extends Ens.BusinessOperation

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

Property Inventory

Method Inventory

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;
Inherited description: 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 methods: DefaultBatchClassDisplayToLogical(), DefaultBatchClassGet(), DefaultBatchClassIsValid(), DefaultBatchClassLogicalToDisplay(), DefaultBatchClassLogicalToOdbc(), DefaultBatchClassNormalize(), DefaultBatchClassSet()
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 methods: OpenModeDisplayToLogical(), OpenModeGet(), OpenModeIsValid(), OpenModeLogicalToDisplay(), OpenModeLogicalToOdbc(), OpenModeNormalize(), OpenModeSet()
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 methods: ReOpenModeDisplayToLogical(), ReOpenModeGet(), ReOpenModeIsValid(), ReOpenModeLogicalToDisplay(), ReOpenModeLogicalToOdbc(), ReOpenModeNormalize(), ReOpenModeSet()
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 methods: RolloverLimitDisplayToLogical(), RolloverLimitGet(), RolloverLimitIsValid(), RolloverLimitLogicalToDisplay(), RolloverLimitNormalize(), RolloverLimitSet()
property RolloverSchedule as %String);
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 methods: RolloverScheduleDisplayToLogical(), RolloverScheduleGet(), RolloverScheduleIsValid(), RolloverScheduleLogicalToDisplay(), RolloverScheduleLogicalToOdbc(), RolloverScheduleNormalize(), RolloverScheduleSet()
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 methods: UnSwizzleRecordsDisplayToLogical(), UnSwizzleRecordsGet(), UnSwizzleRecordsIsValid(), UnSwizzleRecordsLogicalToDisplay(), UnSwizzleRecordsNormalize(), UnSwizzleRecordsSet()
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 methods: UseDefaultBatchDisplayToLogical(), UseDefaultBatchGet(), UseDefaultBatchIsValid(), UseDefaultBatchLogicalToDisplay(), UseDefaultBatchNormalize(), UseDefaultBatchSet()
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.
Property methods: WriteEmptyBatchesDisplayToLogical(), WriteEmptyBatchesGet(), WriteEmptyBatchesIsValid(), WriteEmptyBatchesLogicalToDisplay(), WriteEmptyBatchesNormalize(), WriteEmptyBatchesSet()

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.

Inherited Members

Inherited Properties

Inherited Methods

FeedbackOpens in a new tab