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

Class AbstractBatchDataOutputStreamRecordMetrics

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

  1. public abstract class AbstractBatchDataOutputStreamRecordMetrics
  2. extends AbstractBatchDataStream
  3. implements AbstractBatchDataOutputStream, AbstractBatchDataStreamRecordMetrics, RecordMetrics, java.io.Externalizable
Common class that all AbstractBatchDataOutputStreams inherit from. Allows us to insert common code into all the write paths.
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
AbstractBatchDataOutputStreamRecordMetrics()

Method Summary

Modifier and Type Method and Description
  1. abstract
  2. java.lang.String
_externalizeCheckpointInformation()
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. void
_write(java.lang.Object record)
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 _externalizeCheckpointInformation, implemented by the sub class, and append whatever it returns to the end of the token.
  1. abstract
  2. void
flush()
Flushes the output stream
  1. long
getCumulativeTime()
  1. long
getMetric(RecordMetrics.MetricName metricName)
  1. long
getRecordCount()
  1. protected
  2. com.ibm.ws.gridcontainer.batch.impl.SkipHandler
getSkipHandler()
  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 _internalizeCheckpointInformation, implemented by the sub class, passing the rest of the token.
  1. 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.
  1. void
readExternal(java.io.ObjectInput in)
  1. protected
  2. void
setExceptionRecord(java.lang.Object record)
  1. void
setMetric(RecordMetrics.MetricName metricName,long value)
  1. protected
  2. void
setSkipMetric()
  1. protected
  2. void
startRPSMetric()
  1. void
write(java.lang.Object record)
Writes the given record to the output stream.
  1. void
writeExternal(java.io.ObjectOutput out)
  1. abstract
  2. void
writeHeader(java.lang.Object record)
Writes header data
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

AbstractBatchDataOutputStreamRecordMetrics

  1. public AbstractBatchDataOutputStreamRecordMetrics( )

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:

_write

  1. protected abstract void _write( java.lang.Object record)
  2. throws java.lang.Exception
Abstract method implemented by sub class. This method is called by write(Object).
Throws:
java.lang.Exception

write

  1. public void write(java.lang.Object record)
  2. throws java.lang.Exception
Writes the given record to the output stream. Delegates to _write(Object), implemented by the sub class. Handle skip records, if applicable.
Specified by:
Parameters:
record -
Throws:
java.lang.Exception

flush

  1. public abstract void flush()
  2. throws java.lang.Exception
Flushes the output stream
Specified by:
Throws:
java.lang.Exception

writeHeader

  1. public abstract void writeHeader( java.lang.Object record)
  2. throws java.lang.Exception
Writes header data
Specified by:
Parameters:
record -
Throws:
java.lang.Exception

_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 _internalizeCheckpointInformation, implemented by the sub class, 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 _externalizeCheckpointInformation, implemented by the sub class, 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 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.
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()

setMetric

  1. public void setMetric(RecordMetrics.MetricName metricName,
  2. long value)

startRPSMetric

  1. protected void startRPSMetric()

endRPSMetric

  1. protected void endRPSMetric()

setExceptionRecord

  1. protected void setExceptionRecord( java.lang.Object record)

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

getSkipHandler

  1. protected com.ibm.ws.gridcontainer.batch.impl.SkipHandler getSkipHandler( )