org.eclipse.smila.taskworker.output
Class StreamOutput
java.lang.Object
org.eclipse.smila.taskworker.io.IODataObject
org.eclipse.smila.taskworker.output.Output
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.
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamOutput
public StreamOutput(BulkInfo dataObject,
ObjectStoreService objectStore)
- Parameters:
dataObject - The data objectobjectStore - The reference to the object store service
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