diff --git a/nb-apis/adapters-api/src/main/java/io/nosqlbench/adapters/api/activityimpl/uniform/DriverAdapter.java b/nb-apis/adapters-api/src/main/java/io/nosqlbench/adapters/api/activityimpl/uniform/DriverAdapter.java index ba250b0f5..eeefce14a 100644 --- a/nb-apis/adapters-api/src/main/java/io/nosqlbench/adapters/api/activityimpl/uniform/DriverAdapter.java +++ b/nb-apis/adapters-api/src/main/java/io/nosqlbench/adapters/api/activityimpl/uniform/DriverAdapter.java @@ -36,7 +36,7 @@ import java.util.function.Function; import java.util.function.LongFunction; /** - *

The DriverAdapter interface is expected to be the replacement + *

The DriverAdapter interface is the replacement * for ActivityTypes. This interface takes a simpler * approach. Specifically, all of the core logic which was being pasted into each * driver type is centralized, and only the necessary interfaces diff --git a/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityapi/core/ActivityType.java b/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityapi/core/LegacyActivityType.java similarity index 95% rename from nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityapi/core/ActivityType.java rename to nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityapi/core/LegacyActivityType.java index a6fe93b6b..cfcbaa984 100644 --- a/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityapi/core/ActivityType.java +++ b/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityapi/core/LegacyActivityType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 nosqlbench + * Copyright (c) nosqlbench * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,15 +29,16 @@ import java.util.Map; import java.util.Optional; /** - *

An ActivityType is the central extension point in NB for new - * activity types drivers. It is responsible for naming the activity type, as well as providing + *

An ActivityType was the central extension point in NB for new + * activity types drivers. Please use DriverAdapter instead. + * It is responsible for naming the activity type, as well as providing * the input, activity, and motor instances that will be assembled into an activity.

*

At the very minimum, a useful implementation of an activity type should provide * an action dispenser. Default implementations of input and motor dispensers are provided, * and by extension, default inputs and motors.

*/ //@Deprecated(forRemoval = true,since = "5.0") -public interface ActivityType { +public interface LegacyActivityType { /** diff --git a/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/StandardActivityType.java b/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/StandardActivityType.java index a3e03db0d..f049fb7a4 100644 --- a/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/StandardActivityType.java +++ b/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/api/activityimpl/uniform/StandardActivityType.java @@ -20,14 +20,14 @@ import io.nosqlbench.adapters.api.activityimpl.uniform.DriverAdapter; import io.nosqlbench.nb.api.components.core.NBComponent; import io.nosqlbench.nb.api.engine.activityimpl.ActivityDef; import io.nosqlbench.engine.api.activityapi.core.ActionDispenser; -import io.nosqlbench.engine.api.activityapi.core.ActivityType; +import io.nosqlbench.engine.api.activityapi.core.LegacyActivityType; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.util.HashMap; import java.util.Map; -public class StandardActivityType> implements ActivityType { +public class StandardActivityType> implements LegacyActivityType { private static final Logger logger = LogManager.getLogger("ACTIVITY"); private final Map adapters = new HashMap<>(); diff --git a/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/activity/ActivityTypeLoader.java b/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/activity/ActivityTypeLoader.java index fc769df7a..6d0ea3721 100644 --- a/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/activity/ActivityTypeLoader.java +++ b/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/core/lifecycle/activity/ActivityTypeLoader.java @@ -25,7 +25,6 @@ import io.nosqlbench.nb.api.engine.activityimpl.ActivityDef; import io.nosqlbench.nb.api.errors.BasicError; import io.nosqlbench.nb.api.spi.SimpleServiceLoader; import io.nosqlbench.nb.api.system.NBEnvironment; -import io.nosqlbench.engine.api.activityapi.core.ActivityType; import io.nosqlbench.engine.api.activityimpl.uniform.StandardActivityType; import io.nosqlbench.nb.annotations.Maturity; import org.apache.logging.log4j.LogManager; @@ -42,13 +41,12 @@ import java.util.stream.Collectors; public class ActivityTypeLoader { private static final Logger logger = LogManager.getLogger(ActivityTypeLoader.class); - private final SimpleServiceLoader ACTIVITYTYPE_SPI_FINDER = new SimpleServiceLoader(ActivityType.class, Maturity.Any); private final SimpleServiceLoader DRIVERADAPTER_SPI_FINDER = new SimpleServiceLoader<>(DriverAdapter.class, Maturity.Any); private final SimpleServiceLoader DRIVERADAPTERLOADER_SPI_FINDER = new SimpleServiceLoader<>(DriverAdapterLoader.class, Maturity.Any); private final Set jarUrls = new HashSet<>(); public ActivityTypeLoader setMaturity(final Maturity maturity) { - this.ACTIVITYTYPE_SPI_FINDER.setMaturity(maturity); + this.DRIVERADAPTER_SPI_FINDER.setMaturity(maturity); return this; } @@ -120,7 +118,7 @@ public class ActivityTypeLoader { return urlsToAdd; } - public Optional load(final ActivityDef activityDef, final NBComponent parent) { + public Optional load(final ActivityDef activityDef, final NBComponent parent) { String driverName = activityDef.getParams() .getOptionalString("driver", "type") @@ -137,18 +135,17 @@ public class ActivityTypeLoader { }) .ifPresent(this::extendClassLoader); - return getDriverAdapter(driverName,activityDef,parent) - .or(() -> this.ACTIVITYTYPE_SPI_FINDER.getOptionally(driverName)); + return getDriverAdapter(driverName,activityDef,parent); } - private Optional getDriverAdapter(final String activityTypeName, final ActivityDef activityDef, final NBComponent parent) { + private Optional getDriverAdapter(final String activityTypeName, final ActivityDef activityDef, final NBComponent parent) { final Optional oda = this.DRIVERADAPTER_SPI_FINDER.getOptionally(activityTypeName); if (oda.isPresent()) { final DriverAdapter driverAdapter = oda.get(); - final ActivityType activityType = new StandardActivityType<>(driverAdapter, activityDef, parent); + final StandardActivityType activityType = new StandardActivityType<>(driverAdapter, activityDef, parent); return Optional.of(activityType); } return Optional.empty(); diff --git a/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/core/metadata/MarkdownFinder.java b/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/core/metadata/MarkdownFinder.java index 9a7aefd90..d82ebd36a 100644 --- a/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/core/metadata/MarkdownFinder.java +++ b/nb-engine/nb-engine-core/src/main/java/io/nosqlbench/engine/core/metadata/MarkdownFinder.java @@ -25,8 +25,6 @@ import io.nosqlbench.nb.api.nbio.Content; import io.nosqlbench.nb.api.nbio.NBIO; import io.nosqlbench.nb.api.engine.activityimpl.ActivityDef; import io.nosqlbench.nb.api.errors.BasicError; -import io.nosqlbench.engine.api.activityapi.core.ActivityType; -import io.nosqlbench.engine.core.lifecycle.activity.ActivityTypeLoader; import io.nosqlbench.nb.annotations.Service; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/nb-virtdata/virtdata-api/src/main/java/io/nosqlbench/virtdata/core/templates/ParsedTemplateString.java b/nb-virtdata/virtdata-api/src/main/java/io/nosqlbench/virtdata/core/templates/ParsedTemplateString.java index 9b35462d5..2436ca6e0 100644 --- a/nb-virtdata/virtdata-api/src/main/java/io/nosqlbench/virtdata/core/templates/ParsedTemplateString.java +++ b/nb-virtdata/virtdata-api/src/main/java/io/nosqlbench/virtdata/core/templates/ParsedTemplateString.java @@ -27,8 +27,6 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -// TODO: Consider using "Driver Adapter" or "Workload Adapter" instead of ActivityType - /** *

* A ParsedTemplate represents any string provided by a user which is meant to be