diff --git a/nb-adapters/adapter-azure-aisearch/pom.xml b/nb-adapters/adapter-azure-aisearch/pom.xml
index da6a953ab..39602a30c 100644
--- a/nb-adapters/adapter-azure-aisearch/pom.xml
+++ b/nb-adapters/adapter-azure-aisearch/pom.xml
@@ -15,45 +15,50 @@
-->
- 4.0.0
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ 4.0.0
- adapter-azure-aisearch
- jar
+ adapter-azure-aisearch
+ jar
-
- mvn-defaults
- io.nosqlbench
- ${revision}
- ../../mvn-defaults
-
+
+ mvn-defaults
+ io.nosqlbench
+ ${revision}
+ ../../mvn-defaults
+
- ${project.artifactId}
-
- An nosqlbench adapter driver module for the Azure AI Search database.
-
+ ${project.artifactId}
+
+ An nosqlbench adapter driver module for the Azure AI Search database.
+
-
-
- io.nosqlbench
- nb-annotations
- ${revision}
- compile
-
-
- io.nosqlbench
- adapters-api
- ${revision}
- compile
-
-
- com.azure
- azure-search-documents
-
-
- com.azure
- azure-identity
-
-
-
\ No newline at end of file
+
+
+ io.nosqlbench
+ nb-annotations
+ ${revision}
+ compile
+
+
+ io.nosqlbench
+ adapters-api
+ ${revision}
+ compile
+
+
+
+ com.azure
+ azure-search-documents
+ 11.7.0
+
+
+
+ com.azure
+ azure-identity
+ 1.13.2
+
+
+
+
diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/AzureAISearchDriverAdapter.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/AzureAISearchDriverAdapter.java
index 0377bde16..62e39fd13 100644
--- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/AzureAISearchDriverAdapter.java
+++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/AzureAISearchDriverAdapter.java
@@ -17,6 +17,7 @@ package io.nosqlbench.adapter.azureaisearch;
import java.util.function.Function;
+import java.util.function.LongFunction;
import io.nosqlbench.adapter.azureaisearch.ops.AzureAISearchBaseOp;
import io.nosqlbench.adapters.api.activityimpl.OpMapper;
@@ -31,19 +32,19 @@ import io.nosqlbench.nb.api.labels.NBLabels;
import static io.nosqlbench.adapter.azureaisearch.AzureAISearchAdapterUtils.AZURE_AI_SEARCH;
@Service(value = DriverAdapter.class, selector = AZURE_AI_SEARCH)
-public class AzureAISearchDriverAdapter extends BaseDriverAdapter, AzureAISearchSpace> {
+public class AzureAISearchDriverAdapter extends BaseDriverAdapter {
public AzureAISearchDriverAdapter(NBComponent parentComponent, NBLabels labels) {
super(parentComponent, labels);
}
@Override
- public OpMapper> getOpMapper() {
+ public OpMapper getOpMapper() {
return new AzureAISearchOpMapper(this);
}
@Override
- public Function getSpaceInitializer(NBConfiguration cfg) {
+ public LongFunction getSpaceInitializer(NBConfiguration cfg) {
return (s) -> new AzureAISearchSpace(s, cfg);
}
@@ -52,4 +53,4 @@ public class AzureAISearchDriverAdapter extends BaseDriverAdapter> {
- private static final Logger logger = LogManager.getLogger(AzureAISearchOpMapper.class);
- private final AzureAISearchDriverAdapter adapter;
+import java.util.function.LongFunction;
- /**
- * Create a new {@code AzureAISearchOpMapper} implementing the {@link OpMapper}.
- * interface.
- *
- * @param adapter The associated {@link AzureAISearchDriverAdapter}
- */
- public AzureAISearchOpMapper(AzureAISearchDriverAdapter adapter) {
- this.adapter = adapter;
- }
+public class AzureAISearchOpMapper implements OpMapper {
+ private static final Logger logger = LogManager.getLogger(AzureAISearchOpMapper.class);
+ private final AzureAISearchDriverAdapter adapter;
- /**
- * Given an instance of a {@link ParsedOp} returns the appropriate
- * {@link AzureAISearchBaseOpDispenser} subclass.
- *
- * @param op The {@link ParsedOp} to be evaluated
- * @return The correct {@link AzureAISearchBaseOpDispenser} subclass based on
- * the op type
- */
- @Override
- public OpDispenser extends AzureAISearchBaseOp>> apply(ParsedOp op) {
- TypeAndTarget typeAndTarget = op.getTypeAndTarget(AzureAISearchOpType.class,
- String.class, "type", "target");
- logger.info(() -> "Using '" + typeAndTarget.enumId + "' op type for op template '" + op.getName() + "'");
+ /**
+ * Create a new {@code AzureAISearchOpMapper} implementing the {@link OpMapper}.
+ * interface.
+ *
+ * @param adapter
+ * The associated {@link AzureAISearchDriverAdapter}
+ */
+ public AzureAISearchOpMapper(AzureAISearchDriverAdapter adapter) {
+ this.adapter = adapter;
+ }
- return switch (typeAndTarget.enumId) {
- case delete_index -> new AzureAISearchDeleteIndexOpDispenser(adapter, op, typeAndTarget.targetFunction);
- case create_or_update_index ->
- new AzureAISearchCreateOrUpdateIndexOpDispenser(adapter, op, typeAndTarget.targetFunction);
- case list_indexes -> new AzureAISearchListIndexesOpDispenser(adapter, op, typeAndTarget.targetFunction);
- case upload_documents -> new AzureAISearchUploadDocumentsOpDispenser(adapter, op, typeAndTarget.targetFunction);
- case search_documents -> new AzureAISearchSearchDocumentsOpDispenser(adapter, op, typeAndTarget.targetFunction);
+ /**
+ * Given an instance of a {@link ParsedOp} returns the appropriate
+ * {@link AzureAISearchBaseOpDispenser} subclass.
+ *
+ * @param op
+ * The {@link ParsedOp} to be evaluated
+ * @param spaceInitF
+ * @return The correct {@link AzureAISearchBaseOpDispenser} subclass based on
+ * the op type
+ */
+ @Override
+ public OpDispenser apply(ParsedOp op, LongFunction spaceInitF) {
+
+ TypeAndTarget typeAndTarget = op.getTypeAndTarget(AzureAISearchOpType.class,
+ String.class, "type", "target");
+ logger.info(() -> "Using '" + typeAndTarget.enumId + "' op type for op template '" + op.getName() + "'");
+
+ return switch (typeAndTarget.enumId) {
+ case delete_index -> new AzureAISearchDeleteIndexOpDispenser(adapter, op, typeAndTarget.targetFunction);
+ case create_or_update_index ->
+ new AzureAISearchCreateOrUpdateIndexOpDispenser(adapter, op, typeAndTarget.targetFunction);
+ case list_indexes -> new AzureAISearchListIndexesOpDispenser(adapter, op, typeAndTarget.targetFunction);
+ case upload_documents ->
+ new AzureAISearchUploadDocumentsOpDispenser(adapter, op, typeAndTarget.targetFunction);
+ case search_documents ->
+ new AzureAISearchSearchDocumentsOpDispenser(adapter, op, typeAndTarget.targetFunction);
// default -> throw new RuntimeException(
// "Unrecognized op type '" + typeAndTarget.enumId.name() + "' while " + "mapping parsed op " + op);
- };
- }
+ };
+ }
+
}
diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/AzureAISearchSpace.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/AzureAISearchSpace.java
index c818d2e0a..70e721e39 100644
--- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/AzureAISearchSpace.java
+++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/AzureAISearchSpace.java
@@ -20,6 +20,7 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
+import io.nosqlbench.adapters.api.activityimpl.uniform.BaseSpace;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -50,9 +51,8 @@ import io.nosqlbench.nb.api.config.standard.Param;
* "https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/search/azure-search-documents/">Azure
* AI Search Java searchIndexClient
*/
-public class AzureAISearchSpace implements AutoCloseable {
+public class AzureAISearchSpace extends BaseSpace {
private final static Logger logger = LogManager.getLogger(AzureAISearchSpace.class);
- private final String name;
private final NBConfiguration cfg;
protected SearchIndexClient searchIndexClient;
@@ -62,11 +62,11 @@ public class AzureAISearchSpace implements AutoCloseable {
* contextual information needed to interact with the Azure AI Search
* database instance.
*
- * @param name The name of this space
+ * @param idx The name of this space
* @param cfg The configuration ({@link NBConfiguration}) for this nb run
*/
- public AzureAISearchSpace(String name, NBConfiguration cfg) {
- this.name = name;
+ public AzureAISearchSpace(long idx, NBConfiguration cfg) {
+ super(idx);
this.cfg = cfg;
}
diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchBaseOp.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchBaseOp.java
index 259501591..011ee2d3f 100644
--- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchBaseOp.java
+++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchBaseOp.java
@@ -26,33 +26,32 @@ import com.azure.search.documents.indexes.SearchIndexClient;
import io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes.CycleOp;
-public abstract class AzureAISearchBaseOp implements CycleOp