Tabnine Logo
NFACompiler$NFAFactoryCompiler.getStates
Code IndexAdd Tabnine 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)

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

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

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.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

/**
 * 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.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);
  }
}
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

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • From CI to AI: The AI layer in your organization
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