Codota Logo
NFACompiler$NFAFactoryCompiler.getStates
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
origin: apache/flink

NFAFactoryCompiler<?> compiler = new NFAFactoryCompiler<>(checkNotNull(pattern));
compiler.compileFactory();
State<?> startState = compiler.getStates().stream().filter(State::isStart).findFirst().orElseThrow(
  () -> new IllegalStateException("Compiler produced no start state. It is a bug. File a jira."));
origin: apache/flink

/**
 * Compiles the given pattern into a {@link NFAFactory}. The NFA factory can be used to create
 * multiple NFAs.
 *
 * @param pattern Definition of sequence pattern
 * @param timeoutHandling True if the NFA shall return timed out event patterns
 * @param <T> Type of the input events
 * @return Factory for NFAs corresponding to the given pattern
 */
@SuppressWarnings("unchecked")
public static <T> NFAFactory<T> compileFactory(
  final Pattern<T, ?> pattern,
  boolean timeoutHandling) {
  if (pattern == null) {
    // return a factory for empty NFAs
    return new NFAFactoryImpl<>(0, Collections.<State<T>>emptyList(), timeoutHandling);
  } else {
    final NFAFactoryCompiler<T> nfaFactoryCompiler = new NFAFactoryCompiler<>(pattern);
    nfaFactoryCompiler.compileFactory();
    return new NFAFactoryImpl<>(nfaFactoryCompiler.getWindowTime(), nfaFactoryCompiler.getStates(), timeoutHandling);
  }
}
origin: apache/flink

@Test
public void testNoUnnecessaryStateCopiesCreated() {
  final Pattern<Event, Event> pattern = Pattern.<Event>begin("start").where(startFilter)
    .notFollowedBy("not").where(startFilter)
    .followedBy("oneOrMore").where(startFilter).oneOrMore()
    .followedBy("end").where(endFilter);
  final NFACompiler.NFAFactoryCompiler<Event> nfaFactoryCompiler = new NFACompiler.NFAFactoryCompiler<>(pattern);
  nfaFactoryCompiler.compileFactory();
  int endStateCount = 0;
  for (State<Event> state : nfaFactoryCompiler.getStates()) {
    if (state.getName().equals("end")) {
      endStateCount++;
    }
  }
  assertEquals(1, endStateCount);
}
origin: org.apache.flink/flink-cep_2.11

/**
 * Compiles the given pattern into a {@link NFAFactory}. The NFA factory can be used to create
 * multiple NFAs.
 *
 * @param pattern Definition of sequence pattern
 * @param timeoutHandling True if the NFA shall return timed out event patterns
 * @param <T> Type of the input events
 * @return Factory for NFAs corresponding to the given pattern
 */
@SuppressWarnings("unchecked")
public static <T> NFAFactory<T> compileFactory(
  final Pattern<T, ?> pattern,
  boolean timeoutHandling) {
  if (pattern == null) {
    // return a factory for empty NFAs
    return new NFAFactoryImpl<>(0, Collections.<State<T>>emptyList(), timeoutHandling);
  } else {
    final NFAFactoryCompiler<T> nfaFactoryCompiler = new NFAFactoryCompiler<>(pattern);
    nfaFactoryCompiler.compileFactory();
    return new NFAFactoryImpl<>(nfaFactoryCompiler.getWindowTime(), nfaFactoryCompiler.getStates(), timeoutHandling);
  }
}
origin: org.apache.flink/flink-cep

/**
 * Compiles the given pattern into a {@link NFAFactory}. The NFA factory can be used to create
 * multiple NFAs.
 *
 * @param pattern Definition of sequence pattern
 * @param timeoutHandling True if the NFA shall return timed out event patterns
 * @param <T> Type of the input events
 * @return Factory for NFAs corresponding to the given pattern
 */
@SuppressWarnings("unchecked")
public static <T> NFAFactory<T> compileFactory(
  final Pattern<T, ?> pattern,
  boolean timeoutHandling) {
  if (pattern == null) {
    // return a factory for empty NFAs
    return new NFAFactoryImpl<>(0, Collections.<State<T>>emptyList(), timeoutHandling);
  } else {
    final NFAFactoryCompiler<T> nfaFactoryCompiler = new NFAFactoryCompiler<>(pattern);
    nfaFactoryCompiler.compileFactory();
    return new NFAFactoryImpl<>(nfaFactoryCompiler.getWindowTime(), nfaFactoryCompiler.getStates(), timeoutHandling);
  }
}
origin: org.apache.flink/flink-cep_2.10

/**
 * Compiles the given pattern into a {@link NFAFactory}. The NFA factory can be used to create
 * multiple NFAs.
 *
 * @param pattern Definition of sequence pattern
 * @param inputTypeSerializer Serializer for the input type
 * @param timeoutHandling True if the NFA shall return timed out event patterns
 * @param <T> Type of the input events
 * @return Factory for NFAs corresponding to the given pattern
 */
@SuppressWarnings("unchecked")
public static <T> NFAFactory<T> compileFactory(
  final Pattern<T, ?> pattern,
  final TypeSerializer<T> inputTypeSerializer,
  boolean timeoutHandling) {
  if (pattern == null) {
    // return a factory for empty NFAs
    return new NFAFactoryImpl<>(inputTypeSerializer, 0, Collections.<State<T>>emptyList(), timeoutHandling);
  } else {
    final NFAFactoryCompiler<T> nfaFactoryCompiler = new NFAFactoryCompiler<>(pattern);
    nfaFactoryCompiler.compileFactory();
    return new NFAFactoryImpl<>(inputTypeSerializer, nfaFactoryCompiler.getWindowTime(), nfaFactoryCompiler.getStates(), timeoutHandling);
  }
}
origin: org.apache.flink/flink-cep

NFAFactoryCompiler<?> compiler = new NFAFactoryCompiler<>(checkNotNull(pattern));
compiler.compileFactory();
State<?> startState = compiler.getStates().stream().filter(State::isStart).findFirst().orElseThrow(
  () -> new IllegalStateException("Compiler produced no start state. It is a bug. File a jira."));
origin: org.apache.flink/flink-cep_2.11

NFAFactoryCompiler<?> compiler = new NFAFactoryCompiler<>(checkNotNull(pattern));
compiler.compileFactory();
State<?> startState = compiler.getStates().stream().filter(State::isStart).findFirst().orElseThrow(
  () -> new IllegalStateException("Compiler produced no start state. It is a bug. File a jira."));
org.apache.flink.cep.nfa.compilerNFACompiler$NFAFactoryCompilergetStates

Popular methods of NFACompiler$NFAFactoryCompiler

  • <init>
  • compileFactory
    Compiles the given pattern into a NFAFactory. The NFA factory can be used to create multiple NFAs.
  • 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.
  • createState
    Creates a state with State.StateType#Normal and adds it to the collection of created states. Should
  • createStartState,
  • createState,
  • createStopState,
  • createTimesState,
  • getCurrentNotCondition,
  • getIgnoreCondition,
  • getInnerIgnoreCondition,
  • getWindowTime,
  • checkPatternNameUniqueness

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • notifyDataSetChanged (ArrayAdapter)
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • IOException (java.io)
    Signals that an I/O exception of some sort has occurred. This class is the general class of exceptio
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Runner (org.openjdk.jmh.runner)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now