io.deephaven.benchmark.controller.Controller Maven / Gradle / Ivy
The newest version!
/* Copyright (c) 2022-2023 Deephaven Data Labs and Patent Pending */
package io.deephaven.benchmark.controller;
/**
* Represents a mechanism that can manage the external service (e.g. Deephaven Engine) the benchmarks are running
* against. This includes; start, stop, logging, etc.
*
* Note: For now, this is not part of the Bench API but is used by runners that wrap the Bench API to provide normalized
* behavior or generated data reuse.
*/
public interface Controller {
/**
* Start the service according to the following contract:
*
* - If a service definition (e.g. docker-compose.yml) is not supplied, do nothing
* - If a service definition is supplied, stop the existing service and clear state (e.g. logs)
* - If a service definition is supplied, wait for the service to be in a usable state
*
*
* @return true if the service is running, otherwise false
*/
public boolean startService();
/**
* Stop the service according to the follow contract:
*
* - If a service definition (e.g. docker-compose.yml) is not supplied, do nothing
* - If a service definition is supplied, stop the service and clear state (e.g. logs)
*
*
* @return true if the service definition is specified, otherwise false
*/
public boolean stopService();
/**
* Stop the service, cleanup state, and start it. Implementors can simply call stopService
followed by
* startService
if desired.
*
* @return true if the service restarted, otherwise false
*/
public boolean restartService();
/**
* Get the available log from the service. Results will vary depending on when the log state was last cleared.
*
* @return the available log from the service
*/
public String getLog();
}