SMILA (incubation) API documentation

org.eclipse.smila.taskworker.input
Class RecordInput

java.lang.Object
  extended by org.eclipse.smila.taskworker.io.IODataObject
      extended by org.eclipse.smila.taskworker.input.Input
          extended by 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.


Field Summary
 
Fields inherited from class org.eclipse.smila.taskworker.io.IODataObject
_objectStore
 
Constructor Summary
RecordInput(BulkInfo dataObject, ObjectStoreService objectStore)
          create instance.
 
Method Summary
 void close()
          close BON reader, if open.
 long getBytesRead()
           
 java.util.Map<java.lang.String,java.lang.Number> getCounter()
          create basic counter map.
 Record getRecord()
           
 long getRecordCount()
           
 IpcStreamReader getStreamReader()
           
 java.lang.String toString()
           
 
Methods inherited from class org.eclipse.smila.taskworker.io.IODataObject
ensureStore, getDataObject, getDurationOpen, getDurationPerform, getObjectName, getObjectStore, getStoreName, startTime, timeOpen, timePerform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RecordInput

public RecordInput(BulkInfo dataObject,
                   ObjectStoreService objectStore)
create instance.

Method Detail

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

SMILA (incubation) API documentation