Tabnine Logo
ComputationState.getVersion
Code IndexAdd Tabnine to your IDE (free)

How to use
getVersion
method
in
org.apache.flink.cep.nfa.ComputationState

Best Java code snippets using org.apache.flink.cep.nfa.ComputationState.getVersion (Showing top 19 results out of 315)

origin: apache/flink

/**
 * Extracts all the sequences of events from the start to the given computation state. An event
 * sequence is returned as a map which contains the events and the names of the states to which
 * the events were mapped.
 *
 * @param sharedBufferAccessor The accessor to {@link SharedBuffer} from which to extract the matches
 * @param computationState The end computation state of the extracted event sequences
 * @return Collection of event sequences which end in the given computation state
 * @throws Exception Thrown if the system cannot access the state.
 */
private Map<String, List<EventId>> extractCurrentMatches(
    final SharedBufferAccessor<T> sharedBufferAccessor,
    final ComputationState computationState) throws Exception {
  if (computationState.getPreviousBufferEntry() == null) {
    return new HashMap<>();
  }
  List<Map<String, List<EventId>>> paths = sharedBufferAccessor.extractPatterns(
      computationState.getPreviousBufferEntry(),
      computationState.getVersion());
  if (paths.isEmpty()) {
    return new HashMap<>();
  }
  // for a given computation state, we cannot have more than one matching patterns.
  Preconditions.checkState(paths.size() == 1);
  return paths.get(0);
}
origin: apache/flink

nfaState.getCompletedMatches().poll();
List<Map<String, List<EventId>>> matchedResult =
  sharedBufferAccessor.extractPatterns(earliestMatch.getPreviousBufferEntry(), earliestMatch.getVersion());
origin: apache/flink

  sharedBufferAccessor.extractPatterns(
    match.getPreviousBufferEntry(),
    match.getVersion()).get(0)
);
origin: apache/flink

private void serializeSingleComputationState(
    ComputationState computationState,
    DataOutputView target) throws IOException {
  StringValue.writeString(computationState.getCurrentStateName(), target);
  nodeIdSerializer.serialize(computationState.getPreviousBufferEntry(), target);
  versionSerializer.serialize(computationState.getVersion(), target);
  target.writeLong(computationState.getStartTimestamp());
  serializeStartEvent(computationState.getStartEventID(), target);
}
origin: apache/flink

          outgoingEdges.getTotalIgnoreBranches(),
          outgoingEdges.getTotalTakeBranches());
        version = computationState.getVersion().increase(toIncrease);
      } else {
        version = computationState.getVersion()
          .increase(totalTakeToSkip + ignoreBranchesToVisit)
          .addStage();
    final DeweyNumber currentVersion = computationState.getVersion().increase(takeBranchesToVisit);
    final DeweyNumber nextVersion = new DeweyNumber(currentVersion).addStage();
    takeBranchesToVisit--;
    outgoingEdges.getTotalTakeBranches());
DeweyNumber startVersion = computationState.getVersion().increase(totalBranches);
ComputationState startState = ComputationState.createStartState(computationState.getCurrentStateName(), startVersion);
resultingComputationStates.add(startState);
origin: org.apache.flink/flink-cep

/**
 * Extracts all the sequences of events from the start to the given computation state. An event
 * sequence is returned as a map which contains the events and the names of the states to which
 * the events were mapped.
 *
 * @param sharedBufferAccessor The accessor to {@link SharedBuffer} from which to extract the matches
 * @param computationState The end computation state of the extracted event sequences
 * @return Collection of event sequences which end in the given computation state
 * @throws Exception Thrown if the system cannot access the state.
 */
private Map<String, List<EventId>> extractCurrentMatches(
    final SharedBufferAccessor<T> sharedBufferAccessor,
    final ComputationState computationState) throws Exception {
  if (computationState.getPreviousBufferEntry() == null) {
    return new HashMap<>();
  }
  List<Map<String, List<EventId>>> paths = sharedBufferAccessor.extractPatterns(
      computationState.getPreviousBufferEntry(),
      computationState.getVersion());
  if (paths.isEmpty()) {
    return new HashMap<>();
  }
  // for a given computation state, we cannot have more than one matching patterns.
  Preconditions.checkState(paths.size() == 1);
  return paths.get(0);
}
origin: org.apache.flink/flink-cep_2.11

/**
 * Extracts all the sequences of events from the start to the given computation state. An event
 * sequence is returned as a map which contains the events and the names of the states to which
 * the events were mapped.
 *
 * @param sharedBufferAccessor The accessor to {@link SharedBuffer} from which to extract the matches
 * @param computationState The end computation state of the extracted event sequences
 * @return Collection of event sequences which end in the given computation state
 * @throws Exception Thrown if the system cannot access the state.
 */
private Map<String, List<EventId>> extractCurrentMatches(
    final SharedBufferAccessor<T> sharedBufferAccessor,
    final ComputationState computationState) throws Exception {
  if (computationState.getPreviousBufferEntry() == null) {
    return new HashMap<>();
  }
  List<Map<String, List<EventId>>> paths = sharedBufferAccessor.extractPatterns(
      computationState.getPreviousBufferEntry(),
      computationState.getVersion());
  if (paths.isEmpty()) {
    return new HashMap<>();
  }
  // for a given computation state, we cannot have more than one matching patterns.
  Preconditions.checkState(paths.size() == 1);
  return paths.get(0);
}
origin: org.apache.flink/flink-cep_2.10

computationState.getTimestamp(),
computationState.getCounter(),
computationState.getVersion());
origin: org.apache.flink/flink-cep_2.10

  0,
  readState.getTimestamp(),
  readState.getVersion(),
  readState.getStartTimestamp()
));
origin: org.apache.flink/flink-cep_2.11

nfaState.getCompletedMatches().poll();
List<Map<String, List<EventId>>> matchedResult =
  sharedBufferAccessor.extractPatterns(earliestMatch.getPreviousBufferEntry(), earliestMatch.getVersion());
origin: org.apache.flink/flink-cep

nfaState.getCompletedMatches().poll();
List<Map<String, List<EventId>>> matchedResult =
  sharedBufferAccessor.extractPatterns(earliestMatch.getPreviousBufferEntry(), earliestMatch.getVersion());
origin: org.apache.flink/flink-cep_2.11

  sharedBufferAccessor.extractPatterns(
    match.getPreviousBufferEntry(),
    match.getVersion()).get(0)
);
origin: org.apache.flink/flink-cep

  sharedBufferAccessor.extractPatterns(
    match.getPreviousBufferEntry(),
    match.getVersion()).get(0)
);
origin: org.apache.flink/flink-cep

private void serializeComputationStates(Queue<ComputationState> states, DataOutputView target) throws IOException {
  target.writeInt(states.size());
  for (ComputationState computationState : states) {
    STATE_NAME_SERIALIZER.serialize(computationState.getCurrentStateName(), target);
    NODE_ID_SERIALIZER.serialize(computationState.getPreviousBufferEntry(), target);
    VERSION_SERIALIZER.serialize(computationState.getVersion(), target);
    TIMESTAMP_SERIALIZER.serialize(computationState.getStartTimestamp(), target);
    if (computationState.getStartEventID() != null) {
      target.writeByte(1);
      EVENT_ID_SERIALIZER.serialize(computationState.getStartEventID(), target);
    } else {
      target.writeByte(0);
    }
  }
}
origin: org.apache.flink/flink-cep_2.11

private void serializeComputationStates(Queue<ComputationState> states, DataOutputView target) throws IOException {
  target.writeInt(states.size());
  for (ComputationState computationState : states) {
    STATE_NAME_SERIALIZER.serialize(computationState.getCurrentStateName(), target);
    NODE_ID_SERIALIZER.serialize(computationState.getPreviousBufferEntry(), target);
    VERSION_SERIALIZER.serialize(computationState.getVersion(), target);
    TIMESTAMP_SERIALIZER.serialize(computationState.getStartTimestamp(), target);
    if (computationState.getStartEventID() != null) {
      target.writeByte(1);
      EVENT_ID_SERIALIZER.serialize(computationState.getStartEventID(), target);
    } else {
      target.writeByte(0);
    }
  }
}
origin: org.apache.flink/flink-cep

          outgoingEdges.getTotalIgnoreBranches(),
          outgoingEdges.getTotalTakeBranches());
        version = computationState.getVersion().increase(toIncrease);
      } else {
        version = computationState.getVersion()
          .increase(totalTakeToSkip + ignoreBranchesToVisit)
          .addStage();
    final DeweyNumber currentVersion = computationState.getVersion().increase(takeBranchesToVisit);
    final DeweyNumber nextVersion = new DeweyNumber(currentVersion).addStage();
    takeBranchesToVisit--;
    outgoingEdges.getTotalTakeBranches());
DeweyNumber startVersion = computationState.getVersion().increase(totalBranches);
ComputationState startState = ComputationState.createStartState(computationState.getCurrentStateName(), startVersion);
resultingComputationStates.add(startState);
origin: org.apache.flink/flink-cep_2.11

          outgoingEdges.getTotalIgnoreBranches(),
          outgoingEdges.getTotalTakeBranches());
        version = computationState.getVersion().increase(toIncrease);
      } else {
        version = computationState.getVersion()
          .increase(totalTakeToSkip + ignoreBranchesToVisit)
          .addStage();
    final DeweyNumber currentVersion = computationState.getVersion().increase(takeBranchesToVisit);
    final DeweyNumber nextVersion = new DeweyNumber(currentVersion).addStage();
    takeBranchesToVisit--;
    outgoingEdges.getTotalTakeBranches());
DeweyNumber startVersion = computationState.getVersion().increase(totalBranches);
ComputationState startState = ComputationState.createStartState(computationState.getCurrentStateName(), startVersion);
resultingComputationStates.add(startState);
origin: org.apache.flink/flink-cep_2.10

@Override
public void serialize(NFA<T> record, DataOutputView target) throws IOException {
  serializeStates(record.states, target);
  target.writeLong(record.windowTime);
  target.writeBoolean(record.handleTimeout);
  sharedBufferSerializer.serialize(record.eventSharedBuffer, target);
  target.writeInt(record.computationStates.size());
  StringSerializer stateNameSerializer = StringSerializer.INSTANCE;
  LongSerializer timestampSerializer = LongSerializer.INSTANCE;
  DeweyNumber.DeweyNumberSerializer versionSerializer = new DeweyNumber.DeweyNumberSerializer();
  for (ComputationState<T> computationState: record.computationStates) {
    stateNameSerializer.serialize(computationState.getState().getName(), target);
    stateNameSerializer.serialize(computationState.getPreviousState() == null
        ? null : computationState.getPreviousState().getName(), target);
    timestampSerializer.serialize(computationState.getTimestamp(), target);
    versionSerializer.serialize(computationState.getVersion(), target);
    timestampSerializer.serialize(computationState.getStartTimestamp(), target);
    target.writeInt(computationState.getCounter());
    if (computationState.getEvent() == null) {
      target.writeBoolean(false);
    } else {
      target.writeBoolean(true);
      eventSerializer.serialize(computationState.getEvent(), target);
    }
  }
}
origin: org.apache.flink/flink-cep_2.10

          outgoingEdges.getTotalIgnoreBranches(),
          outgoingEdges.getTotalTakeBranches());
        version = computationState.getVersion().increase(toIncrease);
      } else {
        version = computationState.getVersion()
          .increase(totalTakeToSkip + ignoreBranchesToVisit)
          .addStage();
    final DeweyNumber currentVersion = computationState.getVersion().increase(takeBranchesToVisit);
    final DeweyNumber nextVersion = new DeweyNumber(currentVersion).addStage();
    takeBranchesToVisit--;
    outgoingEdges.getTotalTakeBranches());
DeweyNumber startVersion = computationState.getVersion().increase(totalBranches);
ComputationState<T> startState = ComputationState.createStartState(this, computationState.getState(), startVersion);
resultingComputationStates.add(startState);
org.apache.flink.cep.nfaComputationStategetVersion

Popular methods of ComputationState

  • <init>
  • createStartState
  • createState
  • getCurrentStateName
  • getStartTimestamp
  • equals
  • getPreviousBufferEntry
  • getStartEventID
  • getConditionContext
  • getCounter
  • getEvent
  • getPreviousState
  • getEvent,
  • getPreviousState,
  • getState,
  • getTimestamp,
  • isFinalState,
  • isStartState,
  • isStopState

Popular in Java

  • Updating database using SQL prepared statement
  • getApplicationContext (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • 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
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • JTextField (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top Vim plugins
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