SMILA (incubation) API documentation

org.eclipse.smila.taskworker.io
Class IODataObjects

java.lang.Object
  extended by org.eclipse.smila.taskworker.io.IODataObjects
Direct Known Subclasses:
Inputs, Outputs

public class IODataObjects
extends java.lang.Object

base class for Inputs and Outputs. Provides simplified access to the BulkInfo objects in the task and manages the input/output data object wrappers created by the subclasses. Finally, calculates some basic IO durations for the task result counters.


Constructor Summary
IODataObjects(java.util.Map<java.lang.String,java.util.List<BulkInfo>> dataObjects, ObjectStoreService objectStore)
          create instance.
 
Method Summary
 void addCounters(java.util.Map<java.lang.String,java.lang.Number> counters, java.lang.String name)
          aggregate counters of input slots.
protected  boolean canCreate(java.lang.String slotName, int index)
          check if index is valid for slotname and no input object has yet been created for this object.
 BulkInfo getDataObject(java.lang.String slotName)
           
 BulkInfo getDataObject(java.lang.String slotName, int index)
           
 int getDataObjectCount(java.lang.String slotName)
           
protected  java.util.Map<java.lang.String,IODataObject[]> getIOData()
          get stored IODataObjects.
 ObjectStoreService getObjectStore()
           
protected  void putIOData(java.lang.String slotName, int index, IODataObject ioData)
          store IOData wrapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IODataObjects

public IODataObjects(java.util.Map<java.lang.String,java.util.List<BulkInfo>> dataObjects,
                     ObjectStoreService objectStore)
create instance. Each subclass must implement the same constructor so that it can be instantiated by the TaskContext.

Method Detail

getDataObjectCount

public int getDataObjectCount(java.lang.String slotName)
Returns:
number of data objects in the given slot. 0 if slot is not set.

getDataObject

public BulkInfo getDataObject(java.lang.String slotName)
Returns:
first data object in given slot. Null, if slot is not set.

getDataObject

public BulkInfo getDataObject(java.lang.String slotName,
                              int index)
Returns:
n-th data object in given slot. Null, if slot is not set or has less objects.

getObjectStore

public ObjectStoreService getObjectStore()
Returns:
reference to object store.

canCreate

protected boolean canCreate(java.lang.String slotName,
                            int index)
check if index is valid for slotname and no input object has yet been created for this object.


putIOData

protected void putIOData(java.lang.String slotName,
                         int index,
                         IODataObject ioData)
store IOData wrapper.


getIOData

protected java.util.Map<java.lang.String,IODataObject[]> getIOData()
get stored IODataObjects.


addCounters

public void addCounters(java.util.Map<java.lang.String,java.lang.Number> counters,
                        java.lang.String name)
aggregate counters of input slots.


SMILA (incubation) API documentation