SMILA 1.0 API documentation

org.eclipse.smila.taskworker.output
Class AppendableOutput

java.lang.Object
  extended by org.eclipse.smila.taskworker.io.IODataObject
      extended by org.eclipse.smila.taskworker.output.Output
          extended by org.eclipse.smila.taskworker.output.AppendableOutput

public class AppendableOutput
extends Output

Similar to StreamOutput and RecordOutput but uses the Append API to create the result object. Works only if the output bulk info contains a valid Appendable ID.

Author:
cind01

Field Summary
 
Fields inherited from class org.eclipse.smila.taskworker.io.IODataObject
_objectStore
 
Constructor Summary
AppendableOutput(BulkInfo dataObject, ObjectStoreService objectStore)
           
 
Method Summary
 void abort()
          method for aborting the stream when not committing it.
 void append(byte[] data)
          append bytes.
 void append(byte[] data, java.lang.Integer numberOfRecords)
          append bytes.
 void appendAny(Any object)
          append an Any record converted to BON to the data object.
 void appendRecord(Record record)
          append a Record converted to BON to the data object.
 void commit()
          finalize the Appendable object.
 long getBytesWritten()
           
 java.util.Map<java.lang.String,java.lang.Number> getCounter()
          create basic counter map.
 long getRecordCount()
          number of Records (or Anys) appended.
 
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, toString, wait, wait, wait
 

Constructor Detail

AppendableOutput

public AppendableOutput(BulkInfo dataObject,
                        ObjectStoreService objectStore)
Parameters:
dataObject - The data object
objectStore - The reference to the object store service
Method Detail

append

public void append(byte[] data)
            throws ObjectStoreException
append bytes.

Throws:
ObjectStoreException

append

public void append(byte[] data,
                   java.lang.Integer numberOfRecords)
            throws ObjectStoreException
append bytes.

Throws:
ObjectStoreException

appendRecord

public void appendRecord(Record record)
                  throws ObjectStoreException,
                         java.io.IOException
append a Record converted to BON to the data object.

Throws:
ObjectStoreException
java.io.IOException

appendAny

public void appendAny(Any object)
               throws ObjectStoreException,
                      java.io.IOException
append an Any record converted to BON to the data object.

Throws:
ObjectStoreException
java.io.IOException

commit

public void commit()
            throws ObjectStoreException
finalize the Appendable object. Further appending will not be possible afterwards.

Specified by:
commit in class Output
Throws:
ObjectStoreException

abort

public void abort()
           throws ObjectStoreException
method for aborting the stream when not committing it.

Specified by:
abort in class Output
Throws:
ObjectStoreException

getBytesWritten

public long getBytesWritten()
Returns:
size of data written.

getRecordCount

public long getRecordCount()
number of Records (or Anys) appended.


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 records written to the stream.

SMILA 1.0 API documentation