public class SRBReader extends TypedAtomicActor
SRBReader/StreamGet is a Kepler Actor which has a functionality similar to the SRB command namely "Sget".However SRBReader actor downloads data from the SRB remote file with a streaming process as a byte of arrays instead of a parallel get. The following actor expects as input a reference to the SRB file system. This reference connection is obtained via the SRBConnect Actor in Kepler. See SRBConnect and its documentation.
The file reference system is created with a unique SRB user account and with this connection reference as input the SRBReader actor is able to gain access to the SRB file space. Once an alive SRB file connection system has been established the actor gets the remote SRB file path and creates a SRBRandomAccessFile stream. The contents of file are broadcasted as a sequence of bytes of arrays, after reading from the stream in a loop.
Actor Input: Accepts a reference to the SRB files system, an SRB remote file name as input.
Actor Output: The SRBStreamGet actor outputs the content of the SRB remote file a sequence of byte arrays. Also outputs a endofFile value once end of file has been reached and no more bytes are to be read.
The following actor accesses SRB file reference system and SRB file space with the SRB Jargon API provided. The JARGON is a pure API for developing programs with a data grid interface and I/O for SRB file systems.
Further information on SRBEntity.ContainedObjectsIterator| Modifier and Type | Field and Description |
|---|---|
TypedIOPort |
endOfFile
End of file when reached, outputs true
|
TypedIOPort |
output
Output.
|
TypedIOPort |
remoteFileName
The SRB file to be read.
|
TypedIOPort |
SRBFileSystem
Connection reference
|
_typesValid_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKSCOMPLETED, NOT_READY, STOP_ITERATING| Constructor and Description |
|---|
SRBReader(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fire()
Accepts an SRBFileSystem reference and a file name and outputs the file
content (Array of Bytes).
|
boolean |
postfire()
Post fire the actor.
|
void |
wrapup()
Disconnect from SRB.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, prefire, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortListisFireFunctional, isStrict, iterate, prefire, stop, stopFire, terminateaddInitializable, initialize, preinitialize, removeInitializabledescription, getContainer, getDisplayName, getFullName, getName, getName, setNamegetDerivedLevel, getDerivedList, propagateValuepublic TypedIOPort SRBFileSystem
public TypedIOPort output
public TypedIOPort remoteFileName
public TypedIOPort endOfFile
public SRBReader(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container - The container.name - The name of this actor.IllegalActionException - If the actor cannot be contained by the proposed
container.NameDuplicationException - If the container already has an actor with this name.public void fire() throws IllegalActionException
fire in interface Executablefire in class AtomicActor<TypedIOPort>IllegalActionException - Not thrown in this base class.public boolean postfire()
postfire in interface Executablepostfire in class AtomicActor<TypedIOPort>public void wrapup()
wrapup in interface Initializablewrapup in class AtomicActor<TypedIOPort>