public abstract class AbstractBatchDataOutputStreamRecordMetrics extends AbstractBatchDataStream implements AbstractBatchDataOutputStream, AbstractBatchDataStreamRecordMetrics, RecordMetrics, java.io.Externalizable
RecordMetrics.MetricName
jobStepKey
Constructor and Description |
---|
AbstractBatchDataOutputStreamRecordMetrics() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
_externalizeCheckpointInformation()
Abstract method implemented by sub class.
|
abstract void |
_internalizeCheckpointInformation(java.lang.String token)
Abstract method implemented by sub class.
|
abstract void |
_positionAtCurrentCheckpoint()
Abstract method implemented by sub class.
|
protected abstract void |
_write(java.lang.Object record)
Abstract method implemented by sub class.
|
void |
addSkipListener(SkipListener skipListener)
Add a SkipListener callback to the BDS.
|
protected void |
endRPSMetric() |
java.lang.String |
externalizeCheckpointInformation()
Encode record metric data at the beginning of the token, then call
_externalizeCheckpointInformation, implemented by the sub class, and
append whatever it returns to the end of the token.
|
abstract void |
flush()
Flushes the output stream
|
long |
getCumulativeTime() |
long |
getMetric(RecordMetrics.MetricName metricName)
Returns the value of the batch data stream metric specified
|
long |
getRecordCount() |
protected com.ibm.ws.gridcontainer.batch.impl.SkipHandler |
getSkipHandler() |
void |
initialize(java.lang.String name,
java.lang.String jobstepId)
Called during stream initialization.
|
void |
internalizeCheckpointInformation(java.lang.String token)
Parse record metric data from the beginning of the token, then call
_internalizeCheckpointInformation, implemented by the sub class,
passing the rest of the token.
|
void |
positionAtCurrentCheckpoint()
This metohd calls the sub class (via _positionAtCurrentCheckpoint)
to allow the sub class to position the BDS properly, then it sets its
own checkpoint-related record metric values.
|
void |
readExternal(java.io.ObjectInput in) |
protected void |
setExceptionRecord(java.lang.Object record) |
void |
setMetric(RecordMetrics.MetricName metricName,
long value) |
protected void |
setSkipMetric() |
protected void |
startRPSMetric() |
void |
write(java.lang.Object record)
Writes the given record to the output stream.
|
void |
writeExternal(java.io.ObjectOutput out) |
abstract void |
writeHeader(java.lang.Object record)
Writes header data
|
close, getJobstepId, getName, getProperties, getProperty, getRequiredProperty, getRequiredProperty, initialize, intermediateCheckpoint, isRestart, loadClass, open, positionAtInitialCheckpoint, setProperties, setRestart
public AbstractBatchDataOutputStreamRecordMetrics()
public void initialize(java.lang.String name, java.lang.String jobstepId) throws BatchContainerDataStreamException
AbstractBatchDataStream
initialize
in interface com.ibm.batch.api.BatchDataStream
initialize
in class AbstractBatchDataStream
name
- the logical name of the BDS, this name is used to
locate the resource in the job's xJCL.jobstepId
- an identifier that represents the step within the batch
job that is being run. This id is used to locate the resource in the job's
xJCL.BatchContainerDataStreamException
protected abstract void _write(java.lang.Object record) throws java.lang.Exception
java.lang.Exception
public void write(java.lang.Object record) throws java.lang.Exception
write
in interface AbstractBatchDataOutputStream
record
- java.lang.Exception
public abstract void flush() throws java.lang.Exception
flush
in interface AbstractBatchDataOutputStream
java.lang.Exception
public abstract void writeHeader(java.lang.Object record) throws java.lang.Exception
writeHeader
in interface AbstractBatchDataOutputStream
record
- java.lang.Exception
public abstract void _internalizeCheckpointInformation(java.lang.String token)
token
- the checkpoint tokenpublic final void internalizeCheckpointInformation(java.lang.String token)
internalizeCheckpointInformation
in interface com.ibm.batch.api.BatchDataStream
internalizeCheckpointInformation
in class AbstractBatchDataStream
token
- the checkpoint tokenpublic abstract java.lang.String _externalizeCheckpointInformation()
public final java.lang.String externalizeCheckpointInformation()
externalizeCheckpointInformation
in interface com.ibm.batch.api.BatchDataStream
externalizeCheckpointInformation
in class AbstractBatchDataStream
public abstract void _positionAtCurrentCheckpoint() throws BatchContainerDataStreamException
public void positionAtCurrentCheckpoint() throws BatchContainerDataStreamException
positionAtCurrentCheckpoint
in interface com.ibm.batch.api.BatchDataStream
BatchContainerDataStreamException
public void addSkipListener(SkipListener skipListener)
Add a SkipListener callback to the BDS. The SkipListener is called by the BDS whenever the BDS fails to read or write a record and is configured to skip the failed record.
addSkipListener
in interface AbstractBatchDataStreamRecordMetrics
skipListener
- The user-implemented SkipListener callback.public long getMetric(RecordMetrics.MetricName metricName)
RecordMetrics
getMetric
in interface RecordMetrics
metricName
- - skip or rpspublic long getRecordCount()
public long getCumulativeTime()
public void setMetric(RecordMetrics.MetricName metricName, long value)
protected void startRPSMetric()
protected void endRPSMetric()
protected void setExceptionRecord(java.lang.Object record)
protected void setSkipMetric()
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
protected com.ibm.ws.gridcontainer.batch.impl.SkipHandler getSkipHandler()