return new SharedBuffer<>(valuesWithIds, entriesMap, mappingContext, starters);
@Override public void process(Object key, ValueState<MigratedNFA<IN>> state) throws Exception { MigratedNFA<IN> oldState = state.value(); computationStates.update(new NFAState(oldState.getComputationStates())); org.apache.flink.cep.nfa.SharedBuffer<IN> sharedBuffer = oldState.getSharedBuffer(); partialMatches.init(sharedBuffer.getEventsBuffer(), sharedBuffer.getPages()); state.clear(); } }
EventId startEventId; if (prevState != null) { nodeId = sharedBuffer.getNodeId(prevState, timestamp, counter, event); startEventId = sharedBuffer.getStartEventId(version.getRun()); } else { nodeId = null;
/** * Decreases the reference counter for the given value, key, timestamp entry so that it can be * removed once the reference counter reaches 0. * * @param key Key of the value to release * @param value Value to release * @param timestamp Timestamp of the value to release */ public void release(final K key, final V value, final long timestamp, int counter) { SharedBufferEntry<K, V> entry = get(key, value, timestamp, counter); if (entry != null) { internalRemove(entry); } }
@Override public int hashCode() { return Objects.hash(pages, getValueSerializer()); }
/** * Increases the reference counter for the given value, key, timestamp entry so that it is not * accidentally removed. * * @param key Key of the value to lock * @param value Value to lock * @param timestamp Timestamp of the value to lock */ public void lock(final K key, final V value, final long timestamp, int counter) { SharedBufferEntry<K, V> entry = get(key, value, timestamp, counter); if (entry != null) { entry.increaseReferenceCounter(); } }
@Override public boolean equals(Object obj) { if (obj instanceof NFA) { @SuppressWarnings("unchecked") NFA<T> other = (NFA<T>) obj; return nonDuplicatingTypeSerializer.equals(other.nonDuplicatingTypeSerializer) && eventSharedBuffer.equals(other.eventSharedBuffer) && states.equals(other.states) && windowTime == other.windowTime; } else { return false; } }
List<Map<String, List<T>>> paths = eventSharedBuffer.extractPatterns( NFAStateNameHandler.getOriginalNameFromInternal( computationState.getPreviousState().getName()),
@Override public boolean equals(Object obj) { if (obj instanceof SharedBuffer) { @SuppressWarnings("unchecked") SharedBuffer<K, V> other = (SharedBuffer<K, V>) obj; return pages.equals(other.pages) && getValueSerializer().equals(other.getValueSerializer()); } else { return false; } }
SharedBufferEntry<K, V> entry = get(key, value, timestamp, counter);
public NFA( final TypeSerializer<T> eventSerializer, final long windowTime, final boolean handleTimeout) { this.eventSerializer = eventSerializer; this.nonDuplicatingTypeSerializer = new NonDuplicatingTypeSerializer<>(eventSerializer); this.windowTime = windowTime; this.handleTimeout = handleTimeout; this.eventSharedBuffer = new SharedBuffer<>(nonDuplicatingTypeSerializer); this.computationStates = new LinkedList<>(); this.states = new HashSet<>(); }
@Override public void process(Object key, ValueState<MigratedNFA<IN>> state) throws Exception { MigratedNFA<IN> oldState = state.value(); computationStates.update(new NFAState(oldState.getComputationStates())); org.apache.flink.cep.nfa.SharedBuffer<IN> sharedBuffer = oldState.getSharedBuffer(); partialMatches.init(sharedBuffer.getEventsBuffer(), sharedBuffer.getPages()); state.clear(); } }
EventId startEventId; if (prevState != null) { nodeId = sharedBuffer.getNodeId(prevState, timestamp, counter, event); startEventId = sharedBuffer.getStartEventId(version.getRun()); } else { nodeId = null;
@Override public SharedBuffer<K, V> createInstance() { return new SharedBuffer<>(new NonDuplicatingTypeSerializer<V>(valueSerializer)); }
@Override public void process(Object key, ValueState<MigratedNFA<IN>> state) throws Exception { MigratedNFA<IN> oldState = state.value(); computationStates.update(new NFAState(oldState.getComputationStates())); org.apache.flink.cep.nfa.SharedBuffer<IN> sharedBuffer = oldState.getSharedBuffer(); partialMatches.init(sharedBuffer.getEventsBuffer(), sharedBuffer.getPages()); state.clear(); } }
EventId startEventId; if (prevState != null) { nodeId = sharedBuffer.getNodeId(prevState, timestamp, counter, event); startEventId = sharedBuffer.getStartEventId(version.getRun()); } else { nodeId = null;
return new SharedBuffer<>(buffer.valueSerializer, pageMap);
return new SharedBuffer<>(valuesWithIds, entriesMap, mappingContext, starters);
return new SharedBuffer<>(valuesWithIds, entriesMap, mappingContext, starters);