avnmp.java.lp
Class AvnmpRecQueue
java.lang.Object
|
+--java.util.AbstractCollection
|
+--java.util.AbstractSet
|
+--java.util.TreeSet
|
+--avnmp.java.lp.AvnmpQueue
|
+--avnmp.java.lp.AvnmpRecQueue
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Collection, java.util.Comparator, java.io.Serializable, java.util.Set, java.util.SortedSet
- public class AvnmpRecQueue
- extends AvnmpQueue
This class implements the AVNMP LP receive queue.
This research is funded by DARPA/ITO Contract Number:
F30602-98-C-0230 supported by the Air Force Research
Laboratory/IF.
- Version:
- $Revision: 1.1.1.1 $ $State: Exp $
- Author:
- Steve Bush
- See Also:
- Serialized Form
Field Summary |
java.lang.String |
AppOid
The Management Object ID of the actual value. |
long |
numCausalityRb
The number of causality based rollbacks. |
long |
numToleranceRb
The number of out of tolerance based rollbacks. |
Constructor Summary |
AvnmpRecQueue(java.lang.String oid)
Construct an empty receive queue. |
Method Summary |
long |
getLVT(AvnmpLP mylp,
AvnmpTime st)
This returns the smallest of any virtual message receive times
still in the receive queue. |
AvnmpPacket |
getNext(AvnmpTime lvt,
long lookahead,
AvnmpLP mylp)
Get the next packet to be processed from the this queue. |
AvnmpPacket |
lookNext(AvnmpTime lvt,
long lookahead,
AvnmpLP mylp)
Look at, but do not remove, the next packet. |
long |
recvm(AvnmpPacket ap,
AvnmpTime lvt,
AvnmpLP mylp,
AvnmpStateQueue sq,
AvnmpTime st,
AvnmpSndQueue vmoutq)
Receive and check the tolerance of an input message. |
Methods inherited from class avnmp.java.lp.AvnmpQueue |
add, addMessage, append, cancel, compare, deleteMessage, getClosestTime, getGreaterOrEqualRecTime, getGreaterOrEqualSndTime, getGreaterRecTime, getGreaterSndTime, getLessOrEqualRecTime, getLessOrEqualSndTime, getLessRecTime, getLessSndTime, getMessage, getReal, getVirtual, numReal, numVirtual, plotQueue, QtoString, queueSize, remove |
Methods inherited from class java.util.TreeSet |
addAll, clear, clone, comparator, contains, first, headSet, isEmpty, iterator, last, size, subSet, tailSet |
Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
containsAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
equals |
Methods inherited from interface java.util.Set |
containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
numCausalityRb
public long numCausalityRb
- The number of causality based rollbacks.
numToleranceRb
public long numToleranceRb
- The number of out of tolerance based rollbacks.
AppOid
public java.lang.String AppOid
- The Management Object ID of the actual value.
AvnmpRecQueue
public AvnmpRecQueue(java.lang.String oid)
- Construct an empty receive queue.
- Parameters:
oid
- This is the object identifier of the actual application
value that AVNMP is predicting.
recvm
public long recvm(AvnmpPacket ap,
AvnmpTime lvt,
AvnmpLP mylp,
AvnmpStateQueue sq,
AvnmpTime st,
AvnmpSndQueue vmoutq)
throws CausalityException,
ToleranceException
- Receive and check the tolerance of an input message. If the message
is virtual, check for anti-message cancellation and add to the receive
queue. If a cancellation occurs, the anti-message within the queue is
deleted, and the message is NOT added to the input queue.
If the message is real, check the tolerance and rollback if
necessary, throwing the appropriate exception.
The physical process's Compute() method is not called here. It is
called in inputvm() in AvnmpLP.
- Parameters:
ap
- Input packetlvt
- Local Virtual Timemylp
- The current logical processsq
- State Queuest
- (unused)vmoutq
- The Send Queue- Returns:
- 0 if ok, otherwise the time at which the rollback
occurred. Also throws Causality or Tolerance exceptions when the
packet is either about to be processed out-of-order or exceeds the
prediction tolerance.
- See Also:
ToleranceException
,
CausalityException
,
AvnmpLP.inputvm(avnmp.java.lp.AvnmpPacket)
,
AvnmpLP.getvm(avnmp.java.lp.AvnmpPacket)
getLVT
public long getLVT(AvnmpLP mylp,
AvnmpTime st)
- This returns the smallest of any virtual message receive times
still in the receive queue.
- Parameters:
mylp
- The current logical process.st
- (unused)- Returns:
- The local virtual time.
lookNext
public AvnmpPacket lookNext(AvnmpTime lvt,
long lookahead,
AvnmpLP mylp)
- Look at, but do not remove, the next packet.
- Parameters:
lvt
- The current local vitual time.lookahead
- Do not pick one that exceeds lookahead.mylp
- The current logical process.- Returns:
- The next packet that would be chosen from the receive queue.
getNext
public AvnmpPacket getNext(AvnmpTime lvt,
long lookahead,
AvnmpLP mylp)
- Get the next packet to be processed from the this queue. Note that
the message is deleted from the queue when it is returned. Thus, this
method cannot be called twice to return the same message.
- Parameters:
lvt
- The local virtual time.lookahead
- The maximum distance in time to predict.mylp
- The current LP.- Returns:
- The next packet for the physical process.