com.ibm.websphere.batch.devframework.datastreams.bdsadapter

Class AbstractBatchDataInputStreamRecordMetrics

  1. java.lang.Object
  2. extended bycom.ibm.websphere.batch.devframework.datastreams.bdsadapter.AbstractBatchDataStream
  3. extended bycom.ibm.websphere.batch.devframework.datastreams.bdsadapter.AbstractBatchDataInputStreamRecordMetrics
All implemented interfaces:
com.ibm.batch.api.BatchDataStream, AbstractBatchDataInputStream, AbstractBatchDataStreamRecordMetrics, RecordMetrics, java.io.Externalizable, java.io.Serializable

  1. public abstract class AbstractBatchDataInputStreamRecordMetrics
  2. extends AbstractBatchDataStream
  3. implements AbstractBatchDataInputStream, AbstractBatchDataStreamRecordMetrics, RecordMetrics, java.io.Externalizable
Base class provides skipped-record handling.
See Also:
Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface com.ibm.websphere.batch.RecordMetrics
RecordMetrics.MetricName

Field Summary

Fields inherited from class com.ibm.websphere.batch.devframework.datastreams.bdsadapter.AbstractBatchDataStream
jobStepKey

Constructor Summary

Constructor and Description
AbstractBatchDataInputStreamRecordMetrics()

Method Summary

Modifier and Type Method and Description
  1. abstract
  2. java.lang.String
_externalizeCheckpointInformation()
Abstract method implemented by sub class.
  1. protected abstract
  2. boolean
_hasNext()
Abstract method implemented by sub class.
  1. abstract
  2. void
_internalizeCheckpointInformation(java.lang.String token)
Abstract method implemented by sub class.
  1. abstract
  2. void
_positionAtCurrentCheckpoint()
Abstract method implemented by sub class.
  1. protected abstract
  2. java.lang.Object
_read()
Abstract method implemented by sub class.
  1. protected abstract
  2. java.lang.Object
_read(java.lang.Object parameters)
Abstract method implemented by sub class.
  1. void
addSkipListener(SkipListener skipListener)
Add a SkipListener callback to the BDS.
  1. protected
  2. void
endRPSMetric()
  1. java.lang.String
externalizeCheckpointInformation()
Encode record metric data at the beginning of the token, then call the sub class (via _externalizeCheckpointInformation) and append whatever it returns to the end of the token.
  1. abstract
  2. java.lang.Object
fetchHeader()
  1. long
getCumulativeTime()
  1. long
getMetric(RecordMetrics.MetricName metricName)
  1. long
getRecordCount()
  1. boolean
hasNext()
Return a boolean indicating if there is unread data in the Input Stream.
  1. void
initialize(java.lang.String name,java.lang.String jobstepId)
  1. void
internalizeCheckpointInformation(java.lang.String token)
Parse record metric data from the beginning of the token, then call the sub class (via _internalizeCheckpointInformation), passing the rest of the token.
  1. void
positionAtCurrentCheckpoint()
This method calls the sub class (via _positionAtCurrentCheckpoint) to allow the sub class to position the BDS properly, then it applies checkpoint-related record metric settings to the BDS.
  1. java.lang.Object
read()
Return the next record.
  1. java.lang.Object
read(java.lang.Object parameters)
Return the next record based on the input parameters.
  1. void
readExternal(java.io.ObjectInput in)
  1. protected
  2. void
setSkipMetric()
  1. protected
  2. void
startRPSMetric()
  1. void
writeExternal(java.io.ObjectOutput out)
Methods inherited from class com.ibm.websphere.batch.devframework.datastreams.bdsadapter.AbstractBatchDataStream
close, getJobstepId, getName, getProperties, getProperty, getRequiredProperty, getRequiredProperty, initialize, intermediateCheckpoint, isRestart, loadClass, open, positionAtInitialCheckpoint, setProperties, setRestart
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AbstractBatchDataInputStreamRecordMetrics

  1. public AbstractBatchDataInputStreamRecordMetrics( )

Method Detail

initialize

  1. public void initialize(java.lang.String name,
  2. java.lang.String jobstepId)
  3. throws BatchContainerDataStreamException
Description copied from class: AbstractBatchDataStream
Called during stream initialization.
Specified by:
initialize in interface com.ibm.batch.api.BatchDataStream
Overrides:
Parameters:
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.
Throws:

_hasNext

  1. protected abstract boolean _hasNext( )
  2. throws java.lang.Exception
Abstract method implemented by sub class. This method is called by hasNext.
Throws:
java.lang.Exception

hasNext

  1. public final boolean hasNext()
  2. throws java.lang.Exception
Return a boolean indicating if there is unread data in the Input Stream. Delegates to _hasNext, implemented by sub class. Handle skip records, if applicable.
Specified by:
Returns:
boolean indicating if there is more data to be read
Throws:
java.lang.Exception

_read

  1. protected abstract java.lang.Object _read( )
  2. throws java.lang.Exception
Abstract method implemented by sub class. This method is called by read().
Throws:
java.lang.Exception

read

  1. public final java.lang.Object read( )
  2. throws java.lang.Exception
Return the next record. Delegates to _read, implemented by the sub class. Handle skip records, if applicable.
Specified by:
Returns:
an object representing the next record in the inputstream
Throws:
java.lang.Exception

_read

  1. protected abstract java.lang.Object _read( java.lang.Object parameters)
  2. throws java.lang.Exception
Abstract method implemented by sub class. This method is called by read(Object).
Throws:
java.lang.Exception

read

  1. public final java.lang.Object read( java.lang.Object parameters)
  2. throws java.lang.Exception
Return the next record based on the input parameters. Delegates to _read(Object), implemented by the sub class. Handle skip records, if applicable.
Specified by:
Parameters:
parameters -
Returns:
Throws:
java.lang.Exception

fetchHeader

  1. public abstract java.lang.Object fetchHeader( )
Description copied from interface: AbstractBatchDataInputStream
Returns the header data if any
Specified by:
Returns:

_internalizeCheckpointInformation

  1. public abstract void _internalizeCheckpointInformation( java.lang.String token)
Abstract method implemented by sub class. This method is called by internalizeCheckpointInformation.
Parameters:
token - the checkpoint token

internalizeCheckpointInformation

  1. public final void internalizeCheckpointInformation( java.lang.String token)
Parse record metric data from the beginning of the token, then call the sub class (via _internalizeCheckpointInformation), passing the rest of the token.
Specified by:
internalizeCheckpointInformation in interface com.ibm.batch.api.BatchDataStream
Specified by:
Parameters:
token - the checkpoint token

_externalizeCheckpointInformation

  1. public abstract java.lang.String _externalizeCheckpointInformation( )
Abstract method implemented by sub class. This method is called by externalizeCheckpointInformation.

externalizeCheckpointInformation

  1. public final java.lang.String externalizeCheckpointInformation( )
Encode record metric data at the beginning of the token, then call the sub class (via _externalizeCheckpointInformation) and append whatever it returns to the end of the token.
Specified by:
externalizeCheckpointInformation in interface com.ibm.batch.api.BatchDataStream
Specified by:
Returns:
- This is a string that is created to record the BDS's position in the stream being processed. This String is opaque to anyone but the BDS, so only the BDS can interpret its content.

_positionAtCurrentCheckpoint

  1. public abstract void _positionAtCurrentCheckpoint( )
  2. throws BatchContainerDataStreamException
Abstract method implemented by sub class. This method is called by positionAtCurrentCheckpoint.
Throws:

positionAtCurrentCheckpoint

  1. public void positionAtCurrentCheckpoint( )
  2. throws BatchContainerDataStreamException
This method calls the sub class (via _positionAtCurrentCheckpoint) to allow the sub class to position the BDS properly, then it applies checkpoint-related record metric settings to the BDS.
Specified by:
positionAtCurrentCheckpoint in interface com.ibm.batch.api.BatchDataStream
Throws:

addSkipListener

  1. 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.

Specified by:
Parameters:
skipListener - The user-implemented SkipListener callback.

getMetric

  1. public long getMetric(RecordMetrics.MetricName metricName)
Description copied from interface: RecordMetrics
Returns the value of the batch data stream metric specified
Specified by:
getMetric in interface RecordMetrics
Parameters:
metricName - - skip or rps
Returns:
metricValue

getRecordCount

  1. public long getRecordCount()

getCumulativeTime

  1. public long getCumulativeTime()

startRPSMetric

  1. protected void startRPSMetric()

endRPSMetric

  1. protected void endRPSMetric()

setSkipMetric

  1. protected void setSkipMetric()

readExternal

  1. public void readExternal(java.io.ObjectInput in)
  2. throws java.io.IOException
  3. java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

  1. public void writeExternal(java.io.ObjectOutput out)
  2. throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException