Interface InProcessCluster

All Superinterfaces:
AutoCloseable, Closeable, ClusterManagerBase

public interface InProcessCluster extends ClusterManagerBase
Simulates a Rama cluster in a single process. Useful for unit testing modules or experimenting with Rama API. An InProcessCluster is used to manage modules and retrive depot, PState, and query topology clients.
See Also:
  • Method Details

    • launchModule

      void launchModule(RamaModule m, LaunchConfig config)
      Launch a module. Blocks until module is running.
      Parameters:
      m - Module to launch
      config - Parallelism config
    • updateModule

      void updateModule(RamaModule m)
      Update a module to a new version. Blocks until the update is complete.
      Parameters:
      m - Module to update. RamaModule.getModuleName() can be used in test contexts to define two different versions of the same module.
    • updateModule

      void updateModule(RamaModule m, UpdateOptions options)
      Update a module to a new version. Blocks until the update is complete.
      Parameters:
      m - Module to update. RamaModule.getModuleName() can be used in test contexts to define two different versions of the same module.
      options - Options for module update
    • destroyModule

      void destroyModule(String moduleName)
      Destroy a module
      Parameters:
      moduleName - Name of module to destroy
    • waitForMicrobatchProcessedCount

      void waitForMicrobatchProcessedCount(String moduleName, String topologyName, int count)
      Block until specified microbatch topology has finished processing at least the specified number of depot records since the topology started. If condition fails to be achieved within 1 minute, an exception is thrown.
      Parameters:
      moduleName - Name of module
      topologyName - Name of microbatch topology
      count - Number of records
    • waitForMicrobatchProcessedCount

      void waitForMicrobatchProcessedCount(String moduleName, String topologyName, int count, int timeoutMillis)
      Block until specified microbatch topology has finished processing at least the specified number of depot records since the topology started. If condition fails to be achieved within the passed timeout, an exception is thrown.
      Parameters:
      moduleName - Name of module
      topologyName - Name of microbatch topology
      count - Number of records
      timeoutMillis - Timeout in milliseconds
    • pauseMicrobatchTopology

      void pauseMicrobatchTopology(String moduleName, String topologyName)
      Pauses the specified microbatch topology so it stops processing. Blocks until the currently running microbatch finishes. No-op if topology is already paused.
      Parameters:
      moduleName - Name of module
      topologyName - Name of topology
    • resumeMicrobatchTopology

      void resumeMicrobatchTopology(String moduleName, String topologyName)
      Resumes a paused microbatch topology so it starts processing again. No-op if topology is already active.
      Parameters:
      moduleName - Name of module
      topologyName - Name of topology
    • create

      static InProcessCluster create()
      Creates an InProcessCluster
    • create

      static InProcessCluster create(List<Class> serializations)
      Creates an InProcessCluster with the specified RamaCustomSerialization implementations registered for all launched modules