@AccessLevel(value=EXTERNAL)
public class BatchStreamHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
BatchStreamHelper.BatchProcessingSkippedRecordComparator
Comparator for BatchProcessingSkippedRecord struct, comparison based on
recordID
|
protected static class |
BatchStreamHelper.ChunkKeyTransaction
ChunkKey transaction is a hook that is required by the Curam
infrastructure.
|
Modifier and Type | Field and Description |
---|---|
protected static int |
kBatchProcessReadWait |
static java.lang.String |
kBatchStreamCategory
This constant is used to name the category into which the Batch Stream
related
trace output is placed.
|
protected static int |
kChunkKeyReadWait |
protected static int |
kScanForUnprocessedChunksWait |
protected static boolean |
kTraceProgress |
protected curam.util.type.DateTime |
startTime |
Constructor and Description |
---|
BatchStreamHelper() |
Modifier and Type | Method and Description |
---|---|
curam.core.struct.BatchProcessChunkDtlsList |
chunkList(curam.core.struct.BatchProcessingIDList batchProcessingIDList,
int chunkSize,
java.lang.String instanceID,
long initialKeyValue)
Converts the list of records into a list of chunk records.
|
curam.core.struct.BatchProcessingIDList |
convertStringIntoList(curam.util.type.Blob batchProcessChunkDetails)
Converts the string of records in the specified chunk into an array.
|
java.lang.Object |
decodeBatchParameters(curam.util.type.Blob parameters,
curam.core.struct.BatchProcessStreamKey batchProcessStreamKey)
Decodes the batch program parameters into a data object.
|
curam.util.type.Blob |
encodeBatchParameters(java.lang.Object parameter)
Encodes the batch program parameters into a string format.
|
boolean |
isRunning(java.lang.String instanceID)
Indicates whether the specified batch program is running.
|
curam.core.struct.BatchProcessingResult |
processChunk(curam.core.struct.BatchProcessStreamKey batchProcessStreamKey,
curam.core.struct.BatchProcessingIDList batchProcessingIDList,
curam.core.struct.BatchProcessingSkippedRecordList batchProcessingSkippedRecordList,
curam.util.type.Blob batchProcessParameters,
BatchStream chunkProcesser)
Facilitates the processing of an arbitrary number (aka "chunk")
of records for a specified batch job.
|
void |
runChunkMain(java.lang.String instanceID,
java.lang.Object parameter,
BatchMain batchMain,
curam.core.struct.BatchProcessingIDList batchProcessingIDList,
curam.core.struct.ChunkMainParameters chunkMainParameters,
BatchStream batchStream)
This method is used to run the main of a batch program.
|
void |
runStream(curam.core.struct.BatchProcessStreamKey batchProcessStreamKey,
BatchStream chunkProcesser)
Runs the batch process stream.
|
void |
runStreamForUnprocessedItems(curam.core.struct.BatchProcessStreamKey batchProcessStreamKey,
BatchStream chunkProcesser,
curam.core.struct.BatchProcessChunkDtlsList unprocessedBatchProcessChunkDtlsList,
curam.core.struct.BatchProcessDtls batchProcessDtls)
Runs the batch process stream for a specified list of unprocessed
chunks.
|
void |
setStartTime()
Sets the start time of the batch main.
|
public static final java.lang.String kBatchStreamCategory
protected static final int kBatchProcessReadWait
protected static final int kChunkKeyReadWait
protected static final int kScanForUnprocessedChunksWait
protected static final boolean kTraceProgress
protected curam.util.type.DateTime startTime
@AccessLevel(value=EXTERNAL) public void setStartTime()
@AccessLevel(value=EXTERNAL) public curam.core.struct.BatchProcessChunkDtlsList chunkList(curam.core.struct.BatchProcessingIDList batchProcessingIDList, int chunkSize, java.lang.String instanceID, long initialKeyValue)
batchProcessingIDList
- The string form of chunk.chunkSize
- The number of records to to be included in each chunk.instanceID
- The instance ID for this instance of the batch program.initialKeyValue
- The chunk ID for the batch processing.@AccessLevel(value=EXTERNAL) public curam.core.struct.BatchProcessingIDList convertStringIntoList(curam.util.type.Blob batchProcessChunkDetails)
batchProcessChunkDetails
- The string form of a specified chunk.@AccessLevel(value=EXTERNAL) public curam.util.type.Blob encodeBatchParameters(java.lang.Object parameter) throws curam.util.exception.AppException, curam.util.exception.InformationalException
parameter
- Batch parameters to be encoded.curam.util.exception.AppException
curam.util.exception.InformationalException
@AccessLevel(value=EXTERNAL) public java.lang.Object decodeBatchParameters(curam.util.type.Blob parameters, curam.core.struct.BatchProcessStreamKey batchProcessStreamKey) throws curam.util.exception.AppException, curam.util.exception.InformationalException
parameters
- The blob form of the batch parameters.batchProcessStreamKey
- Key for the batch process stream.curam.util.exception.AppException
curam.util.exception.InformationalException
@AccessLevel(value=EXTERNAL) public void runStreamForUnprocessedItems(curam.core.struct.BatchProcessStreamKey batchProcessStreamKey, BatchStream chunkProcesser, curam.core.struct.BatchProcessChunkDtlsList unprocessedBatchProcessChunkDtlsList, curam.core.struct.BatchProcessDtls batchProcessDtls) throws curam.util.exception.AppException, curam.util.exception.InformationalException
batchProcessStreamKey
- The key for this batch process stream.chunkProcesser
- An instance of the processor which implements the
processing for this stream.unprocessedBatchProcessChunkDtlsList
- A list of unprocessed chunks
to be processedbatchProcessDtls
- The details of the current batch process being run.curam.util.exception.AppException
curam.util.exception.InformationalException
@AccessLevel(value=EXTERNAL) public void runStream(curam.core.struct.BatchProcessStreamKey batchProcessStreamKey, BatchStream chunkProcesser) throws curam.util.exception.AppException, curam.util.exception.InformationalException
batchProcessStreamKey
- The key for this batch process stream.chunkProcesser
- An instance of the which implements the processing
for this stream.curam.util.exception.AppException
curam.util.exception.InformationalException
@AccessLevel(value=EXTERNAL) public curam.core.struct.BatchProcessingResult processChunk(curam.core.struct.BatchProcessStreamKey batchProcessStreamKey, curam.core.struct.BatchProcessingIDList batchProcessingIDList, curam.core.struct.BatchProcessingSkippedRecordList batchProcessingSkippedRecordList, curam.util.type.Blob batchProcessParameters, BatchStream chunkProcesser) throws curam.util.exception.AppException, curam.util.exception.InformationalException
batchProcessingIDList
- The details of the cases to be processed.batchProcessingSkippedRecordList
- The list of cases skipped by this
process.batchProcessParameters
- The parameters to this instance of the batch
program.chunkProcesser
- An instance of the which implements the processing
for this stream.curam.util.exception.AppException
curam.util.exception.InformationalException
@AccessLevel(value=EXTERNAL) public void runChunkMain(java.lang.String instanceID, java.lang.Object parameter, BatchMain batchMain, curam.core.struct.BatchProcessingIDList batchProcessingIDList, curam.core.struct.ChunkMainParameters chunkMainParameters, BatchStream batchStream) throws curam.util.exception.AppException, curam.util.exception.InformationalException
instanceID
- The key for this batch process streamparameter
- The struct used as a parameter to this batch programbatchMain
- The class implementing this batch programbatchProcessingIDList
- The details of the records to be processedchunkMainParameters
- The parameters which control the operation of
this processingcuram.util.exception.AppException
curam.util.exception.InformationalException
public boolean isRunning(java.lang.String instanceID) throws curam.util.exception.AppException, curam.util.exception.InformationalException
instanceID
- Identifier for a batch program.curam.util.exception.AppException
curam.util.exception.InformationalException