public NodeId getNodeId(String prevState, long timestamp, int counter, V event) { return mappingContext.get(Tuple2.of(NFAStateNameHandler.getOriginalNameFromInternal(prevState), new ValueTimeWrapper<>(event, timestamp, counter))); }
/** * Stores given value (value + timestamp) under the given state. It assigns a preceding element * relation to the previous entry. * * @param stateName name of the state that the event should be assigned to * @param eventId unique id of event assigned by this SharedBuffer * @param previousNodeId id of previous entry (might be null if start of new run) * @param version Version of the previous relation * @return assigned id of this element */ public NodeId put( final String stateName, final EventId eventId, @Nullable final NodeId previousNodeId, final DeweyNumber version) { if (previousNodeId != null) { lockNode(previousNodeId); } NodeId currentNodeId = new NodeId(eventId, getOriginalNameFromInternal(stateName)); Lockable<SharedBufferNode> currentNode = sharedBuffer.getEntry(currentNodeId); if (currentNode == null) { currentNode = new Lockable<>(new SharedBufferNode(), 0); lockEvent(eventId); } currentNode.getElement().addEdge(new SharedBufferEdge( previousNodeId, version)); sharedBuffer.upsertEntry(currentNodeId, currentNode); return currentNodeId; }
private State<T> copy(final State<T> state) { final State<T> copyOfState = createState( NFAStateNameHandler.getOriginalNameFromInternal(state.getName()), state.getStateType()); for (StateTransition<T> tStateTransition : state.getStateTransitions()) { copyOfState.addStateTransition( tStateTransition.getAction(), tStateTransition.getTargetState().equals(tStateTransition.getSourceState()) ? copyOfState : tStateTransition.getTargetState(), tStateTransition.getCondition()); } return copyOfState; }
public NodeId getNodeId(String prevState, long timestamp, int counter, V event) { return mappingContext.get(Tuple2.of(NFAStateNameHandler.getOriginalNameFromInternal(prevState), new ValueTimeWrapper<>(event, timestamp, counter))); }
public NodeId getNodeId(String prevState, long timestamp, int counter, V event) { return mappingContext.get(Tuple2.of(NFAStateNameHandler.getOriginalNameFromInternal(prevState), new ValueTimeWrapper<>(event, timestamp, counter))); }
private void addComputationState( List<ComputationState<T>> computationStates, State<T> currentState, State<T> previousState, T event, int counter, long timestamp, DeweyNumber version, long startTimestamp) { ComputationState<T> computationState = ComputationState.createState( this, currentState, previousState, event, counter, timestamp, version, startTimestamp); computationStates.add(computationState); String originalStateName = NFAStateNameHandler.getOriginalNameFromInternal(previousState.getName()); eventSharedBuffer.lock(originalStateName, event, timestamp, counter); }
NFAStateNameHandler.getOriginalNameFromInternal( computationState.getPreviousState().getName()), computationState.getEvent(),
NFAStateNameHandler.getOriginalNameFromInternal(computationState.getPreviousState().getName()), computationState.getEvent(), computationState.getTimestamp(), NFAStateNameHandler.getOriginalNameFromInternal( newComputationState.getPreviousState().getName()), newComputationState.getEvent(), NFAStateNameHandler.getOriginalNameFromInternal( newComputationState.getPreviousState().getName()), newComputationState.getEvent(), NFAStateNameHandler.getOriginalNameFromInternal( state.getPreviousState().getName()), state.getEvent(),
private State<T> copy(final State<T> state) { final State<T> copyOfState = createState( NFAStateNameHandler.getOriginalNameFromInternal(state.getName()), state.getStateType()); for (StateTransition<T> tStateTransition : state.getStateTransitions()) { copyOfState.addStateTransition( tStateTransition.getAction(), tStateTransition.getTargetState().equals(tStateTransition.getSourceState()) ? copyOfState : tStateTransition.getTargetState(), tStateTransition.getCondition()); } return copyOfState; }
/** * Stores given value (value + timestamp) under the given state. It assigns a preceding element * relation to the previous entry. * * @param stateName name of the state that the event should be assigned to * @param eventId unique id of event assigned by this SharedBuffer * @param previousNodeId id of previous entry (might be null if start of new run) * @param version Version of the previous relation * @return assigned id of this element */ public NodeId put( final String stateName, final EventId eventId, @Nullable final NodeId previousNodeId, final DeweyNumber version) { if (previousNodeId != null) { lockNode(previousNodeId); } NodeId currentNodeId = new NodeId(eventId, getOriginalNameFromInternal(stateName)); Lockable<SharedBufferNode> currentNode = sharedBuffer.getEntry(currentNodeId); if (currentNode == null) { currentNode = new Lockable<>(new SharedBufferNode(), 0); lockEvent(eventId); } currentNode.getElement().addEdge(new SharedBufferEdge( previousNodeId, version)); sharedBuffer.upsertEntry(currentNodeId, currentNode); return currentNodeId; }
/** * Stores given value (value + timestamp) under the given state. It assigns a preceding element * relation to the previous entry. * * @param stateName name of the state that the event should be assigned to * @param eventId unique id of event assigned by this SharedBuffer * @param previousNodeId id of previous entry (might be null if start of new run) * @param version Version of the previous relation * @return assigned id of this element */ public NodeId put( final String stateName, final EventId eventId, @Nullable final NodeId previousNodeId, final DeweyNumber version) { if (previousNodeId != null) { lockNode(previousNodeId); } NodeId currentNodeId = new NodeId(eventId, getOriginalNameFromInternal(stateName)); Lockable<SharedBufferNode> currentNode = sharedBuffer.getEntry(currentNodeId); if (currentNode == null) { currentNode = new Lockable<>(new SharedBufferNode(), 0); lockEvent(eventId); } currentNode.getElement().addEdge(new SharedBufferEdge( previousNodeId, version)); sharedBuffer.upsertEntry(currentNodeId, currentNode); return currentNodeId; }
private State<T> copy(final State<T> state) { final State<T> copyOfState = createState( NFAStateNameHandler.getOriginalNameFromInternal(state.getName()), state.getStateType()); for (StateTransition<T> tStateTransition : state.getStateTransitions()) { copyOfState.addStateTransition( tStateTransition.getAction(), tStateTransition.getTargetState().equals(tStateTransition.getSourceState()) ? copyOfState : tStateTransition.getTargetState(), tStateTransition.getCondition()); } return copyOfState; }
startTimestamp = timestamp; counter = eventSharedBuffer.put( NFAStateNameHandler.getOriginalNameFromInternal( currentState.getName()), event, startTimestamp = computationState.getStartTimestamp(); counter = eventSharedBuffer.put( NFAStateNameHandler.getOriginalNameFromInternal( currentState.getName()), event, timestamp, NFAStateNameHandler.getOriginalNameFromInternal( previousState.getName()), previousEvent, NFAStateNameHandler.getOriginalNameFromInternal( computationState.getPreviousState().getName()), computationState.getEvent(),