Skip to content
Snippets Groups Projects
Commit 1b1fd27e authored by Sören Henning's avatar Sören Henning
Browse files

Add JavaDoc

parent 78ebafaf
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,9 @@ import com.hazelcast.core.HazelcastInstance;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
/**
* A Theodolite load generator runner that establishes a cluster using Hazelcast.
*/
public class HazelcastRunner {
private final HazelcastInstance hzInstance;
......@@ -18,6 +21,9 @@ public class HazelcastRunner {
private final LoadGeneratorConfig loadConfig;
private final WorkloadDefinition totalLoadDefinition;
/**
* Create a new {@link HazelcastRunner} from the given configuration.
*/
public HazelcastRunner(
final ClusterConfig clusterConfig,
final LoadGeneratorConfig loadConfig,
......@@ -28,6 +34,9 @@ public class HazelcastRunner {
this.hzInstance.getCluster().addMembershipListener(new RunnerMembershipListener());
}
/**
* Start the workload generation and blocks until the workload generation is stopped again.
*/
public void runBlocking() {
while (!this.stopAction.isDone()) {
synchronized (this) {
......
......@@ -15,7 +15,10 @@ import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
// TODO Reconsider name -> Hazelcast Instance
/**
* An instance of a Hazelcast runner state, that is a load generator cluster with a given set of
* members.
*/
public class HazelcastRunnerStateInstance {
private static final Logger LOGGER = LoggerFactory.getLogger(HazelcastRunnerStateInstance.class);
......@@ -31,6 +34,9 @@ public class HazelcastRunnerStateInstance {
private final HazelcastInstance hzInstance;
private final Set<Member> members;
/**
* Create a new {@link HazelcastRunnerStateInstance}.
*/
public HazelcastRunnerStateInstance(
final LoadGeneratorConfig loadGeneratorConfig,
final WorkloadDefinition totalLoadDefinition,
......@@ -44,6 +50,9 @@ public class HazelcastRunnerStateInstance {
LOGGER.info("Created new Hazelcast runner instance for member set '{}'", this.members);
}
/**
* Start and block load generation for the configured member set.
*/
public void runBlocking() {
if (!this.stopAction.isDone()) {
this.tryPerformBeforeAction();
......@@ -175,8 +184,8 @@ public class HazelcastRunnerStateInstance {
}
private static final class LoadDefPerMember {
public final WorkloadDefinition loadDefinition;
public final Member member;
public final WorkloadDefinition loadDefinition; // NOCS used only internally
public final Member member; // NOCS used only internally
public LoadDefPerMember(final WorkloadDefinition loadDefinition, final Member member) {
this.loadDefinition = loadDefinition;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment