Package com.rpl.rama.test
Interface InProcessCluster
- All Superinterfaces:
AutoCloseable,Closeable,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 Summary
Modifier and TypeMethodDescriptionstatic InProcessClustercreate()Creates an InProcessClusterstatic InProcessClusterCreates an InProcessCluster with the specifiedRamaCustomSerializationimplementations registered for all launched modulesvoiddestroyModule(String moduleName) Destroy a modulevoidlaunchModule(RamaModule m, LaunchConfig config) Launch a module.voidpauseMicrobatchTopology(String moduleName, String topologyName) Pauses the specified microbatch topology so it stops processing.voidresumeMicrobatchTopology(String moduleName, String topologyName) Resumes a paused microbatch topology so it starts processing again.voidUpdate a module to a new version.voidupdateModule(RamaModule m, UpdateOptions options) Update a module to a new version.voidwaitForMicrobatchProcessedCount(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.voidwaitForMicrobatchProcessedCount(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.Methods inherited from interface com.rpl.rama.cluster.ClusterManagerBase
clusterDepot, clusterPState, clusterQuery, getDeployedModuleNames, getMicrobatchDepotInfo
-
Method Details
-
launchModule
Launch a module. Blocks until module is running.- Parameters:
m- Module to launchconfig- Parallelism config
-
updateModule
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
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
Destroy a module- Parameters:
moduleName- Name of module to destroy
-
waitForMicrobatchProcessedCount
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 moduletopologyName- Name of microbatch topologycount- 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 moduletopologyName- Name of microbatch topologycount- Number of recordstimeoutMillis- Timeout in milliseconds
-
pauseMicrobatchTopology
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 moduletopologyName- Name of topology
-
resumeMicrobatchTopology
Resumes a paused microbatch topology so it starts processing again. No-op if topology is already active.- Parameters:
moduleName- Name of moduletopologyName- Name of topology
-
create
Creates an InProcessCluster -
create
Creates an InProcessCluster with the specifiedRamaCustomSerializationimplementations registered for all launched modules
-