Class StreamingRunner.StreamingOperation

java.lang.Object
neqsim.mcp.runners.StreamingRunner.StreamingOperation
Enclosing class:
StreamingRunner

static class StreamingRunner.StreamingOperation extends Object
Internal state for a streaming operation.
Version:
1.0
Author:
Even Solbraa
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) boolean
    Whether cancellation was requested.
    (package private) int
    Number of completed steps.
    (package private) String
    Error message if failed.
    (package private) final String
    Operation ID.
    private final List<com.google.gson.JsonObject>
    Incremental results.
    (package private) String
    Current status: pending, running, completed, failed, cancelled.
    (package private) int
    Total expected steps.
    (package private) final String
    Operation type.
  • Constructor Summary

    Constructors
    Constructor
    Description
    StreamingOperation(String operationId, String type)
    Creates a new streaming operation.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    addResult(com.google.gson.JsonObject result)
    Adds a result point.
    (package private) int
    Gets the total result count.
    (package private) List<com.google.gson.JsonObject>
    getResultsSince(int fromIndex)
    Gets results added since the given index.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • operationId

      final String operationId
      Operation ID.
    • type

      final String type
      Operation type.
    • status

      volatile String status
      Current status: pending, running, completed, failed, cancelled.
    • completedSteps

      volatile int completedSteps
      Number of completed steps.
    • totalSteps

      volatile int totalSteps
      Total expected steps.
    • cancelled

      volatile boolean cancelled
      Whether cancellation was requested.
    • errorMessage

      volatile String errorMessage
      Error message if failed.
    • results

      private final List<com.google.gson.JsonObject> results
      Incremental results.
  • Constructor Details

    • StreamingOperation

      StreamingOperation(String operationId, String type)
      Creates a new streaming operation.
      Parameters:
      operationId - the operation ID
      type - the operation type
  • Method Details

    • addResult

      void addResult(com.google.gson.JsonObject result)
      Adds a result point.
      Parameters:
      result - the result
    • getResultsSince

      List<com.google.gson.JsonObject> getResultsSince(int fromIndex)
      Gets results added since the given index.
      Parameters:
      fromIndex - the start index
      Returns:
      new results
    • getResultCount

      int getResultCount()
      Gets the total result count.
      Returns:
      the count