From 3a5e8f081a372ee67ad14f96e9661e3934b25ecc Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Tue, 2 Jan 2024 13:37:11 -0600 Subject: [PATCH] code cleanups for annotations --- .../java/io/nosqlbench/nb/api/annotations/Annotation.java | 2 +- .../java/io/nosqlbench/nb/api/annotations/Annotator.java | 6 ++++-- .../io/nosqlbench/nb/api/annotations/MutableAnnotation.java | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/Annotation.java b/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/Annotation.java index 4c792d236..baeaefc5b 100644 --- a/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/Annotation.java +++ b/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/Annotation.java @@ -56,7 +56,7 @@ public interface Annotation extends NBLabeledElement { * Annotations must be associated with a processing layer in NoSQLBench. * For more details on layers, see {@link Layer} * - * @return + * @return the {@link Layer} to which the annotations applies */ Layer getLayer(); diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/Annotator.java b/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/Annotator.java index 1fb73615d..4c273b484 100644 --- a/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/Annotator.java +++ b/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/Annotator.java @@ -23,12 +23,14 @@ package io.nosqlbench.nb.api.annotations; public interface Annotator { /** - * Submit an annotation to some type of annotation store, logging or eventing mechanism. + *

Submit an annotation to some type of annotation store, logging or eventing mechanism. * Implementations of this service are responsible for mapping the scenario and labels * into appropriate key data, and the details in to a native payload. The least surprising * and most obvious mapping should be used in each case. + *

* - * For details on constructing a useful annotation to submit to this service, see {@link Annotation#newBuilder()} + *

For details on constructing a useful annotation to submit to this service, see {@link Annotation#newBuilder()} + *

*/ void recordAnnotation(Annotation annotation); diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/MutableAnnotation.java b/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/MutableAnnotation.java index 20ba99e72..517fed31d 100644 --- a/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/MutableAnnotation.java +++ b/nb-api/src/main/java/io/nosqlbench/nb/api/annotations/MutableAnnotation.java @@ -35,7 +35,7 @@ import java.util.function.Function; public class MutableAnnotation implements Annotation { private final static Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); - private String session = "SESSION_UNNAMED"; + public static String session = "SESSION_UNNAMED"; private final ZoneId GMT = ZoneId.of("GMT"); private final LinkedList> labelfuncs = new LinkedList<>(); @@ -79,7 +79,7 @@ public class MutableAnnotation implements Annotation { } public void setSession(String sessionName) { - this.session = sessionName; + session = sessionName; } public void setStartMillis(long intervalStart) {