Tabnine Logo
State.addTake
Code IndexAdd Tabnine to your IDE (free)

How to use
addTake
method
in
org.apache.flink.cep.nfa.State

Best Java code snippets using org.apache.flink.cep.nfa.State.addTake (Showing top 18 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

private NFA<Event> createStartEndNFA() {
  State<Event> startState = new State<>("start", State.StateType.Start);
  State<Event> endState = new State<>("end", State.StateType.Normal);
  State<Event> endingState = new State<>("", State.StateType.Final);
  startState.addTake(
    endState,
    new SimpleCondition<Event>() {
      private static final long serialVersionUID = -4869589195918650396L;
      @Override
      public boolean filter(Event value) throws Exception {
        return value.getName().equals("start");
      }
    });
  endState.addTake(
    endingState,
    new SimpleCondition<Event>() {
      private static final long serialVersionUID = 2979804163709590673L;
      @Override
      public boolean filter(Event value) throws Exception {
        return value.getName().equals("end");
      }
    });
  endState.addIgnore(BooleanConditions.<Event>trueFunction());
  List<State<Event>> states = new ArrayList<>();
  states.add(startState);
  states.add(endState);
  states.add(endingState);
  return new NFA<>(states, 2L, false);
}
origin: apache/flink

State<Event> endingState = new State<>("", State.StateType.Final);
startState.addTake(
  endState,
  new SimpleCondition<Event>() {
endState.addTake(
  endingState,
  new SimpleCondition<Event>() {
origin: apache/flink

singletonState.addTake(sink, takeCondition);
  if (isOptional) {
    ignoreState = createState(currentPattern.getName(), State.StateType.Normal);
    ignoreState.addTake(sink, takeCondition);
    ignoreState.addIgnore(ignoreCondition);
    addStopStates(ignoreState);
origin: apache/flink

  loopingState.addProceed(sinkState, proceedCondition);
loopingState.addTake(takeCondition);
  ignoreState.addTake(loopingState, takeCondition);
  ignoreState.addIgnore(ignoreCondition);
  loopingState.addIgnore(ignoreState, ignoreCondition);
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: 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.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

/**
 * 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_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

singletonState.addTake(sink, currentCondition);
  if (isOptional) {
    ignoreState = createState(currentPattern.getName(), State.StateType.Normal);
    ignoreState.addTake(sink, currentCondition);
    ignoreState.addIgnore(ignoreCondition);
    addStopStates(ignoreState);
origin: org.apache.flink/flink-cep_2.10

/**
 * Creates the given state as a looping one. Looping state is one with TAKE edge to itself and
 * PROCEED edge to the sinkState. It also consists of a similar state without the PROCEED edge, so that
 * for each PROCEED transition branches in computation state graph  can be created only once.
 *
 * @param sinkState the state that the converted state should point to
 * @return the first state of the created complex state
 */
@SuppressWarnings("unchecked")
private State<T> createLooping(final State<T> sinkState) {
  final IterativeCondition<T> currentCondition = (IterativeCondition<T>) currentPattern.getCondition();
  final IterativeCondition<T> ignoreCondition = getInnerIgnoreCondition(currentPattern);
  final IterativeCondition<T> trueFunction = BooleanConditions.trueFunction();
  final State<T> loopingState = createState(currentPattern.getName(), State.StateType.Normal);
  loopingState.addProceed(sinkState, trueFunction);
  loopingState.addTake(currentCondition);
  addStopStateToLooping(loopingState);
  if (ignoreCondition != null) {
    final State<T> ignoreState = createState(currentPattern.getName(), State.StateType.Normal);
    ignoreState.addTake(loopingState, currentCondition);
    ignoreState.addIgnore(ignoreCondition);
    loopingState.addIgnore(ignoreState, ignoreCondition);
    addStopStateToLooping(ignoreState);
  }
  return loopingState;
}
origin: org.apache.flink/flink-cep_2.10

  newFirst.addTake(newSecond, oldFirstToSecondTake.getCondition());
newFirst.addTake(endingState, oldFirstToSecondTake.getCondition());
origin: org.apache.flink/flink-cep_2.10

singletonState.addTake(lastSink, currentCondition);
singletonState.addProceed(sinkState, BooleanConditions.<T>trueFunction());
  ignoreState.addTake(lastSink, currentCondition);
  ignoreState.addIgnore(ignoreCondition);
  singletonState.addIgnore(ignoreState, ignoreCondition);
origin: org.apache.flink/flink-cep

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

singletonState.addTake(sink, takeCondition);
  if (isOptional) {
    ignoreState = createState(currentPattern.getName(), State.StateType.Normal);
    ignoreState.addTake(sink, takeCondition);
    ignoreState.addIgnore(ignoreCondition);
    addStopStates(ignoreState);
origin: org.apache.flink/flink-cep

  loopingState.addProceed(sinkState, proceedCondition);
loopingState.addTake(takeCondition);
  ignoreState.addTake(loopingState, takeCondition);
  ignoreState.addIgnore(ignoreCondition);
  loopingState.addIgnore(ignoreState, ignoreCondition);
origin: org.apache.flink/flink-cep_2.11

  loopingState.addProceed(sinkState, proceedCondition);
loopingState.addTake(takeCondition);
  ignoreState.addTake(loopingState, takeCondition);
  ignoreState.addIgnore(ignoreCondition);
  loopingState.addIgnore(ignoreState, ignoreCondition);
org.apache.flink.cep.nfaStateaddTake

Popular methods of State

  • <init>
  • addIgnore
  • getName
  • getStateTransitions
  • isFinal
  • isStart
  • addProceed
  • addStateTransition
  • equals
  • getStateType
  • isStop
  • makeStart
  • isStop,
  • makeStart

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Top plugins for WebStorm
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