org.eclipse.smila.taskworker.input
Class RecordInput
java.lang.Object
org.eclipse.smila.taskworker.io.IODataObject
org.eclipse.smila.taskworker.input.Input
org.eclipse.smila.taskworker.input.RecordInput
public class RecordInput
- extends Input
Provides access to objects like record bulks that are sequences of BON Records. You can get single
Record from the objects, one at a time, by calling the getRecord() method. When end-of-stream is
reached, null is returned. You can also access the IpcStreamReader BON parser directly in case you do not
want to read complete records at once. However, you should not mix up getRecord() calls with calls to the
IpcStreamReader as your direct calls will probably confuse the record parsing.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RecordInput
public RecordInput(BulkInfo dataObject,
ObjectStoreService objectStore)
- create instance.
getRecord
public Record getRecord()
throws ObjectStoreException,
java.io.IOException
- Returns:
- next record on stream, or null, if end-of-stream is reached.
- Throws:
ObjectStoreException
java.io.IOException
getStreamReader
public IpcStreamReader getStreamReader()
throws ObjectStoreException,
java.io.IOException
- Returns:
- BON parser on data object stream. Records are not counted when this is used by worker immediately.
- Throws:
ObjectStoreException
java.io.IOException
getRecordCount
public long getRecordCount()
- Returns:
- number of records parsed so far using
getRecord()
getBytesRead
public long getBytesRead()
- See Also:
StreamInput.getBytesRead()
getCounter
public java.util.Map<java.lang.String,java.lang.Number> getCounter()
- Description copied from class:
IODataObject
- create basic counter map.
- Overrides:
getCounter in class IODataObject
- Returns:
- counter map of superclass extended by the number of bytes and number of records read from the stream.
close
public void close()
- close BON reader, if open.
- Specified by:
close in class Input
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object