fix annotators init bug

This commit is contained in:
Jonathan Shook 2021-12-22 23:22:17 -06:00
parent 11d1e948ae
commit 384df69744
2 changed files with 11 additions and 4 deletions

View File

@ -1,2 +1 @@
- 1eb1405ad (HEAD -> j17-preview, origin/j17-preview) update with docker at j17
- 13aff392b update docker to j17
- 4f310c122 (HEAD -> j17-preview) fix annotators init bug

View File

@ -5,10 +5,12 @@ import com.google.gson.GsonBuilder;
import io.nosqlbench.nb.annotations.Service;
import io.nosqlbench.nb.api.annotations.Annotation;
import io.nosqlbench.nb.api.annotations.Annotator;
import io.nosqlbench.nb.api.config.standard.NBMapConfigurable;
import io.nosqlbench.nb.api.config.standard.ConfigLoader;
import org.apache.logging.log4j.Logger;
import io.nosqlbench.nb.api.config.standard.NBConfigurable;
import io.nosqlbench.nb.api.config.standard.NBConfiguration;
import io.nosqlbench.nb.api.config.standard.NBMapConfigurable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.*;
@ -58,6 +60,12 @@ public class Annotators {
NBMapConfigurable.applyConfig(cmap);
}
if (annotator instanceof NBConfigurable) {
NBConfigurable nbConfigurable = (NBConfigurable) annotator;
NBConfiguration cfg = nbConfigurable.getConfigModel().apply(cmap);
nbConfigurable.applyConfig(cfg);
}
annotators.add(annotator);
}