Tabnine Logo
NFACompiler$NFAFactoryCompiler.createState
Code IndexAdd Tabnine to your IDE (free)

How to use
createState
method
in
org.apache.flink.cep.nfa.compiler.NFACompiler$NFAFactoryCompiler

Best Java code snippets using org.apache.flink.cep.nfa.compiler.NFACompiler$NFAFactoryCompiler.createState (Showing top 20 results out of 315)

origin: apache/flink

private State<T> createStopState(final IterativeCondition<T> notCondition, final String name) {
  // We should not duplicate the notStates. All states from which we can stop should point to the same one.
  State<T> stopState = stopStates.get(name);
  if (stopState == null) {
    stopState = createState(name, State.StateType.Stop);
    stopState.addTake(notCondition);
    stopStates.put(name, stopState);
  }
  return stopState;
}
origin: apache/flink

final State<T> copyOfSink = createState(sinkState.getName(), sinkState.getStateType());
origin: apache/flink

final State<T> singletonState = createState(currentPattern.getName(), State.StateType.Normal);
  final State<T> ignoreState;
  if (isOptional) {
    ignoreState = createState(currentPattern.getName(), State.StateType.Normal);
    ignoreState.addTake(sink, takeCondition);
    ignoreState.addIgnore(ignoreCondition);
origin: org.apache.flink/flink-cep_2.11

/**
 * Create the states for the group pattern as a looping one.
 *
 * @param groupPattern the group pattern to create the states for
 * @param sinkState the state that the group pattern being converted should point to
 * @return the first state of the states of the group pattern
 */
private State<T> createLoopingGroupPatternState(
  final GroupPattern<T, ?> groupPattern,
  final State<T> sinkState) {
  final IterativeCondition<T> proceedCondition = getTrueFunction();
  Pattern<T, ?> oldCurrentPattern = currentPattern;
  Pattern<T, ?> oldFollowingPattern = followingPattern;
  GroupPattern<T, ?> oldGroupPattern = currentGroupPattern;
  final State<T> dummyState = createState(currentPattern.getName(), State.StateType.Normal);
  State<T> lastSink = dummyState;
  currentGroupPattern = groupPattern;
  currentPattern = groupPattern.getRawPattern();
  lastSink = createMiddleStates(lastSink);
  lastSink = convertPattern(lastSink);
  lastSink.addProceed(sinkState, proceedCondition);
  dummyState.addProceed(lastSink, proceedCondition);
  currentPattern = oldCurrentPattern;
  followingPattern = oldFollowingPattern;
  currentGroupPattern = oldGroupPattern;
  return lastSink;
}
origin: org.apache.flink/flink-cep

/**
 * Create the states for the group pattern as a looping one.
 *
 * @param groupPattern the group pattern to create the states for
 * @param sinkState the state that the group pattern being converted should point to
 * @return the first state of the states of the group pattern
 */
private State<T> createLoopingGroupPatternState(
  final GroupPattern<T, ?> groupPattern,
  final State<T> sinkState) {
  final IterativeCondition<T> proceedCondition = getTrueFunction();
  Pattern<T, ?> oldCurrentPattern = currentPattern;
  Pattern<T, ?> oldFollowingPattern = followingPattern;
  GroupPattern<T, ?> oldGroupPattern = currentGroupPattern;
  final State<T> dummyState = createState(currentPattern.getName(), State.StateType.Normal);
  State<T> lastSink = dummyState;
  currentGroupPattern = groupPattern;
  currentPattern = groupPattern.getRawPattern();
  lastSink = createMiddleStates(lastSink);
  lastSink = convertPattern(lastSink);
  lastSink.addProceed(sinkState, proceedCondition);
  dummyState.addProceed(lastSink, proceedCondition);
  currentPattern = oldCurrentPattern;
  followingPattern = oldFollowingPattern;
  currentGroupPattern = oldGroupPattern;
  return lastSink;
}
origin: org.apache.flink/flink-cep_2.10

/**
 * Creates a pair of states that enables relaxed strictness before a zeroOrMore looping state.
 *
 * @param loopingState the first state of zeroOrMore complex state
 * @param lastSink     the state that the looping one points to
 * @return the newly created state
 */
@SuppressWarnings("unchecked")
private State<T> createInitOptionalStateOfZeroOrMore(final State<T> loopingState, final State<T> lastSink) {
  final IterativeCondition<T> currentCondition = (IterativeCondition<T>) currentPattern.getCondition();
  final State<T> firstState = createState(currentPattern.getName(), State.StateType.Normal);
  firstState.addProceed(lastSink, BooleanConditions.<T>trueFunction());
  firstState.addTake(loopingState, currentCondition);
  final IterativeCondition<T> ignoreFunction = getIgnoreCondition(currentPattern);
  if (ignoreFunction != null) {
    final State<T> firstStateWithoutProceed = createState(currentPattern.getName(), State.StateType.Normal);
    firstState.addIgnore(firstStateWithoutProceed, ignoreFunction);
    firstStateWithoutProceed.addIgnore(ignoreFunction);
    firstStateWithoutProceed.addTake(loopingState, currentCondition);
    addStopStates(firstStateWithoutProceed);
  }
  return firstState;
}
origin: org.apache.flink/flink-cep_2.10

/**
 * Patterns with quantifiers AT_LEAST_ONE_* are created as a pair of states: a singleton state and
 * looping state. This method creates the first of the two.
 *
 * @param sinkState the state the newly created state should point to, it should be a looping state
 * @return the newly created state
 */
@SuppressWarnings("unchecked")
private State<T> createInitMandatoryStateOfOneOrMore(final State<T> sinkState) {
  final IterativeCondition<T> currentCondition = (IterativeCondition<T>) currentPattern.getCondition();
  final State<T> firstState = createState(currentPattern.getName(), State.StateType.Normal);
  firstState.addTake(sinkState, currentCondition);
  final IterativeCondition<T> ignoreCondition = getIgnoreCondition(currentPattern);
  if (ignoreCondition != null) {
    firstState.addIgnore(ignoreCondition);
  }
  return firstState;
}
origin: org.apache.flink/flink-cep

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;
}
origin: org.apache.flink/flink-cep_2.11

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;
}
origin: org.apache.flink/flink-cep_2.10

private State<T> createStopState(final IterativeCondition<T> notCondition, final String name) {
  // We should not duplicate the notStates. All states from which we can stop should point to the same one.
  State<T> stopState = stopStates.get(name);
  if (stopState == null) {
    stopState = createState(name, State.StateType.Stop);
    stopState.addTake(notCondition);
    stopStates.put(name, stopState);
  }
  return stopState;
}
origin: org.apache.flink/flink-cep_2.10

/**
 * Creates the dummy Final {@link State} of the NFA graph.
 * @return dummy Final state
 */
private State<T> createEndingState() {
  State<T> endState = createState(ENDING_STATE_NAME, State.StateType.Final);
  windowTime = currentPattern.getWindowTime() != null ? currentPattern.getWindowTime().toMilliseconds() : 0L;
  return endState;
}
origin: org.apache.flink/flink-cep_2.11

private State<T> createStopState(final IterativeCondition<T> notCondition, final String name) {
  // We should not duplicate the notStates. All states from which we can stop should point to the same one.
  State<T> stopState = stopStates.get(name);
  if (stopState == null) {
    stopState = createState(name, State.StateType.Stop);
    stopState.addTake(notCondition);
    stopStates.put(name, stopState);
  }
  return stopState;
}
origin: org.apache.flink/flink-cep_2.11

/**
 * Creates the dummy Final {@link State} of the NFA graph.
 * @return dummy Final state
 */
private State<T> createEndingState() {
  State<T> endState = createState(ENDING_STATE_NAME, State.StateType.Final);
  windowTime = currentPattern.getWindowTime() != null ? currentPattern.getWindowTime().toMilliseconds() : 0L;
  return endState;
}
origin: org.apache.flink/flink-cep

/**
 * Creates the dummy Final {@link State} of the NFA graph.
 * @return dummy Final state
 */
private State<T> createEndingState() {
  State<T> endState = createState(ENDING_STATE_NAME, State.StateType.Final);
  windowTime = currentPattern.getWindowTime() != null ? currentPattern.getWindowTime().toMilliseconds() : 0L;
  return endState;
}
origin: org.apache.flink/flink-cep

private State<T> createStopState(final IterativeCondition<T> notCondition, final String name) {
  // We should not duplicate the notStates. All states from which we can stop should point to the same one.
  State<T> stopState = stopStates.get(name);
  if (stopState == null) {
    stopState = createState(name, State.StateType.Stop);
    stopState.addTake(notCondition);
    stopStates.put(name, stopState);
  }
  return stopState;
}
origin: apache/flink

final State<T> notNext = createState(currentPattern.getName(), State.StateType.Normal);
final IterativeCondition<T> notCondition = getTakeCondition(currentPattern);
final State<T> stopState = createStopState(notCondition, currentPattern.getName());
origin: apache/flink

final State<T> loopingState = createState(currentPattern.getName(), State.StateType.Normal);
  final State<T> ignoreState = createState(currentPattern.getName(), State.StateType.Normal);
  ignoreState.addTake(loopingState, takeCondition);
  ignoreState.addIgnore(ignoreCondition);
origin: apache/flink

/**
 * Create the states for the group pattern as a looping one.
 *
 * @param groupPattern the group pattern to create the states for
 * @param sinkState the state that the group pattern being converted should point to
 * @return the first state of the states of the group pattern
 */
private State<T> createLoopingGroupPatternState(
  final GroupPattern<T, ?> groupPattern,
  final State<T> sinkState) {
  final IterativeCondition<T> proceedCondition = getTrueFunction();
  Pattern<T, ?> oldCurrentPattern = currentPattern;
  Pattern<T, ?> oldFollowingPattern = followingPattern;
  GroupPattern<T, ?> oldGroupPattern = currentGroupPattern;
  final State<T> dummyState = createState(currentPattern.getName(), State.StateType.Normal);
  State<T> lastSink = dummyState;
  currentGroupPattern = groupPattern;
  currentPattern = groupPattern.getRawPattern();
  lastSink = createMiddleStates(lastSink);
  lastSink = convertPattern(lastSink);
  lastSink.addProceed(sinkState, proceedCondition);
  dummyState.addProceed(lastSink, proceedCondition);
  currentPattern = oldCurrentPattern;
  followingPattern = oldFollowingPattern;
  currentGroupPattern = oldGroupPattern;
  return lastSink;
}
origin: apache/flink

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;
}
origin: apache/flink

/**
 * Creates the dummy Final {@link State} of the NFA graph.
 * @return dummy Final state
 */
private State<T> createEndingState() {
  State<T> endState = createState(ENDING_STATE_NAME, State.StateType.Final);
  windowTime = currentPattern.getWindowTime() != null ? currentPattern.getWindowTime().toMilliseconds() : 0L;
  return endState;
}
org.apache.flink.cep.nfa.compilerNFACompiler$NFAFactoryCompilercreateState

Javadoc

Creates a state with State.StateType#Normal and adds it to the collection of created states. Should be used instead of instantiating with new operator.

Popular methods of NFACompiler$NFAFactoryCompiler

  • <init>
  • compileFactory
    Compiles the given pattern into a NFAFactory. The NFA factory can be used to create multiple NFAs.
  • getStates
  • addStopStateToLooping
  • addStopStates
  • convertPattern
  • copyWithoutTransitiveNots
    This method creates an alternative state that is target for TAKE transition from an optional State.
  • createEndingState
    Creates the dummy Final State of the NFA graph.
  • createLooping
    Creates the given state as a looping one. Looping state is one with TAKE edge to itself and PROCEED
  • createMiddleStates
    Creates all the states between Start and Final state.
  • createSingletonState
    Creates a simple single state. For an OPTIONAL state it also consists of a similar state without the
  • createStartState
    Creates the Start State of the resulting NFA graph.
  • createSingletonState,
  • createStartState,
  • createStopState,
  • createTimesState,
  • getCurrentNotCondition,
  • getIgnoreCondition,
  • getInnerIgnoreCondition,
  • getWindowTime,
  • checkPatternNameUniqueness

Popular in Java

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • compareTo (BigDecimal)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JTable (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now