code cleanups for annotations

This commit is contained in:
Jonathan Shook 2024-01-02 13:37:11 -06:00
parent ec7482324f
commit 3a5e8f081a
3 changed files with 7 additions and 5 deletions

View File

@ -56,7 +56,7 @@ public interface Annotation extends NBLabeledElement {
* Annotations must be associated with a processing layer in NoSQLBench. * Annotations must be associated with a processing layer in NoSQLBench.
* For more details on layers, see {@link Layer} * For more details on layers, see {@link Layer}
* *
* @return * @return the {@link Layer} to which the annotations applies
*/ */
Layer getLayer(); Layer getLayer();

View File

@ -23,12 +23,14 @@ package io.nosqlbench.nb.api.annotations;
public interface Annotator { public interface Annotator {
/** /**
* Submit an annotation to some type of annotation store, logging or eventing mechanism. * <P>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 * 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 * 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. * and most obvious mapping should be used in each case.
*</P>
* *
* For details on constructing a useful annotation to submit to this service, see {@link Annotation#newBuilder()} * <P>For details on constructing a useful annotation to submit to this service, see {@link Annotation#newBuilder()}
* </P>
*/ */
void recordAnnotation(Annotation annotation); void recordAnnotation(Annotation annotation);

View File

@ -35,7 +35,7 @@ import java.util.function.Function;
public class MutableAnnotation implements Annotation { public class MutableAnnotation implements Annotation {
private final static Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create(); 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 ZoneId GMT = ZoneId.of("GMT");
private final LinkedList<Function<NBLabels,NBLabels>> labelfuncs = new LinkedList<>(); private final LinkedList<Function<NBLabels,NBLabels>> labelfuncs = new LinkedList<>();
@ -79,7 +79,7 @@ public class MutableAnnotation implements Annotation {
} }
public void setSession(String sessionName) { public void setSession(String sessionName) {
this.session = sessionName; session = sessionName;
} }
public void setStartMillis(long intervalStart) { public void setStartMillis(long intervalStart) {