SMILA (incubation) API documentation

org.eclipse.smila.taskworker.output
Class StreamOutput

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

public class StreamOutput
extends Output

Provides direct access to the OutputStream of a data object for writing to objectstore.


Field Summary
 
Fields inherited from class org.eclipse.smila.taskworker.io.IODataObject
_objectStore
 
Constructor Summary
StreamOutput(BulkInfo dataObject, ObjectStoreService objectStore)
           
 
Method Summary
 void abort()
          method for aborting the stream when not committing it.
 void commit()
          Commit the data object to objectstore.
 long getBytesWritten()
           
 java.util.Map<java.lang.String,java.lang.Number> getCounter()
          create basic counter map.
 java.io.OutputStream getStream()
           
 
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

StreamOutput

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

getStream

public java.io.OutputStream getStream()
                               throws ObjectStoreException
Returns:
OutputStream to the objectstore object.
Throws:
ObjectStoreException

commit

public void commit()
            throws java.io.IOException
Commit the data object to objectstore. Called by the WorkerManager after the task was finished.

Specified by:
commit in class Output
Throws:
java.io.IOException

getBytesWritten

public long getBytesWritten()
Returns:
size of data written to the stream. Valid only after committing the input.

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

abort

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

Specified by:
abort in class Output
Throws:
java.io.IOException

SMILA (incubation) API documentation