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> 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 { +public abstract class AzureAISearchBaseOp implements CycleOp { protected final static Logger logger = LogManager.getLogger(AzureAISearchBaseOp.class); protected final SearchIndexClient searchIndexClient; - protected final T request; - protected final LongFunction apiCall; + protected final REQUEST request; + protected final LongFunction apiCall; - public AzureAISearchBaseOp(SearchIndexClient searchIndexClient, T requestParam) { + public AzureAISearchBaseOp(SearchIndexClient searchIndexClient, REQUEST requestParam) { this.searchIndexClient = searchIndexClient; this.request = requestParam; this.apiCall = this::applyOp; } - public AzureAISearchBaseOp(SearchIndexClient searchIndexClient, T requestParam, LongFunction call) { + public AzureAISearchBaseOp(SearchIndexClient searchIndexClient, REQUEST requestParam, LongFunction call) { this.searchIndexClient = searchIndexClient; this.request = requestParam; this.apiCall = call; } @Override - public final Object apply(long value) { + public final RESULT apply(long value) { logger.trace(() -> "applying op: " + this); try { - Object result = applyOp(value); - + RESULT result = applyOp(value); return result; } catch (Exception e) { if (e instanceof RuntimeException rte) { @@ -63,7 +62,7 @@ public abstract class AzureAISearchBaseOp implements CycleOp { } }; - public abstract Object applyOp(long value); + public abstract RESULT applyOp(long value); @Override public String toString() { diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchClientBaseOp.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchClientBaseOp.java index 0f0be2c8d..11051b7d1 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchClientBaseOp.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchClientBaseOp.java @@ -17,12 +17,14 @@ package io.nosqlbench.adapter.azureaisearch.ops; import com.azure.search.documents.SearchClient; import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.util.AutocompletePagedIterable; +import com.azure.search.documents.util.SearchPagedIterable; -public abstract class AzureAISearchClientBaseOp extends AzureAISearchBaseOp { +public abstract class AzureAISearchClientBaseOp extends AzureAISearchBaseOp { protected final SearchClient searchClient; - public AzureAISearchClientBaseOp(SearchIndexClient searchIdxClient, SearchClient searchClnt, T requestParam) { + public AzureAISearchClientBaseOp(SearchIndexClient searchIdxClient, SearchClient searchClnt, REQUEST requestParam) { super(searchIdxClient, requestParam); this.searchClient = searchClnt; } -} \ No newline at end of file +} diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchCreateOrUpdateIndexOp.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchCreateOrUpdateIndexOp.java index cc1a2816a..99ece67bb 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchCreateOrUpdateIndexOp.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchCreateOrUpdateIndexOp.java @@ -18,14 +18,14 @@ package io.nosqlbench.adapter.azureaisearch.ops; import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.models.SearchIndex; -public class AzureAISearchCreateOrUpdateIndexOp extends AzureAISearchBaseOp { +public class AzureAISearchCreateOrUpdateIndexOp extends AzureAISearchBaseOp { public AzureAISearchCreateOrUpdateIndexOp(SearchIndexClient client, SearchIndex request) { super(client, request); } @Override - public Object applyOp(long value) { + public SearchIndex applyOp(long value) { SearchIndex createResponse = null; try { createResponse = searchIndexClient.createOrUpdateIndex(request); diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchDeleteIndexOp.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchDeleteIndexOp.java index c504a4014..a973a3949 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchDeleteIndexOp.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchDeleteIndexOp.java @@ -17,14 +17,14 @@ package io.nosqlbench.adapter.azureaisearch.ops; import com.azure.search.documents.indexes.SearchIndexClient; -public class AzureAISearchDeleteIndexOp extends AzureAISearchBaseOp { +public class AzureAISearchDeleteIndexOp extends AzureAISearchBaseOp { public AzureAISearchDeleteIndexOp(SearchIndexClient client, String request) { super(client, request); } @Override - public Object applyOp(long value) { + public String applyOp(long value) { try { searchIndexClient.deleteIndex(request); logger.debug("Successfully deleted the index: {}", request); @@ -34,4 +34,4 @@ public class AzureAISearchDeleteIndexOp extends AzureAISearchBaseOp { return "Deleted"; } -} \ No newline at end of file +} diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchListIndexesOp.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchListIndexesOp.java index 93f1449ed..98b56f363 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchListIndexesOp.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchListIndexesOp.java @@ -19,14 +19,14 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.indexes.models.SearchIndex; -public class AzureAISearchListIndexesOp extends AzureAISearchBaseOp { +public class AzureAISearchListIndexesOp extends AzureAISearchBaseOp { public AzureAISearchListIndexesOp(SearchIndexClient client, String request) { super(client, request); } @Override - public Object applyOp(long value) { + public String applyOp(long value) { try { PagedIterable response = searchIndexClient.listIndexes(); response.forEach((index) -> { diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchSearchDocumentsOp.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchSearchDocumentsOp.java index dda8bac62..499f5475f 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchSearchDocumentsOp.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/ops/AzureAISearchSearchDocumentsOp.java @@ -19,9 +19,10 @@ import com.azure.core.util.Context; import com.azure.search.documents.SearchClient; import com.azure.search.documents.indexes.SearchIndexClient; import com.azure.search.documents.models.SearchOptions; +import com.azure.search.documents.util.AutocompletePagedIterable; import com.azure.search.documents.util.SearchPagedIterable; -public class AzureAISearchSearchDocumentsOp extends AzureAISearchClientBaseOp { +public class AzureAISearchSearchDocumentsOp extends AzureAISearchClientBaseOp { public AzureAISearchSearchDocumentsOp(SearchIndexClient searchIndexClient, SearchClient searchClient, SearchOptions request) { @@ -29,7 +30,7 @@ public class AzureAISearchSearchDocumentsOp extends AzureAISearchClientBaseOp { +public class AzureAISearchUploadDocumentsOp extends AzureAISearchClientBaseOp { public AzureAISearchUploadDocumentsOp(SearchIndexClient searchIndexClient, SearchClient searchClient, SearchDocument request) { @@ -30,7 +30,7 @@ public class AzureAISearchUploadDocumentsOp extends AzureAISearchClientBaseOp - extends BaseOpDispenser, AzureAISearchSpace> { +public abstract class AzureAISearchBaseOpDispenser + extends BaseOpDispenser { protected final LongFunction azureAISearchSpaceFunction; protected final LongFunction clientFunction; - private final LongFunction> opF; - private final LongFunction paramF; + private final LongFunction> opF; + private final LongFunction paramF; @SuppressWarnings("rawtypes") protected AzureAISearchBaseOpDispenser(AzureAISearchDriverAdapter adapter, ParsedOp op, @@ -57,14 +57,14 @@ public abstract class AzureAISearchBaseOpDispenser return (AzureAISearchDriverAdapter) adapter; } - public abstract LongFunction getParamFunc(LongFunction clientF, ParsedOp op, + public abstract LongFunction getParamFunc(LongFunction clientF, ParsedOp op, LongFunction targetF); - public abstract LongFunction> createOpFunc(LongFunction paramF, + public abstract LongFunction> createOpFunc(LongFunction paramF, LongFunction clientF, ParsedOp op, LongFunction targetF); @Override - public AzureAISearchBaseOp getOp(long value) { + public AzureAISearchBaseOp getOp(long value) { return opF.apply(value); } diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchCreateOrUpdateIndexOpDispenser.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchCreateOrUpdateIndexOpDispenser.java index 54b88a8e2..3e567c44b 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchCreateOrUpdateIndexOpDispenser.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchCreateOrUpdateIndexOpDispenser.java @@ -53,7 +53,7 @@ import io.nosqlbench.nb.api.errors.OpConfigError; * "https://learn.microsoft.com/en-us/java/api/com.azure.search.documents?view=azure-java-stable">Index * docs */ -public class AzureAISearchCreateOrUpdateIndexOpDispenser extends AzureAISearchBaseOpDispenser { +public class AzureAISearchCreateOrUpdateIndexOpDispenser extends AzureAISearchBaseOpDispenser { private SearchField searchField; private VectorSearchProfile vsProfile; @@ -290,7 +290,7 @@ public class AzureAISearchCreateOrUpdateIndexOpDispenser extends AzureAISearchBa } @Override - public LongFunction> createOpFunc(LongFunction paramF, + public LongFunction> createOpFunc(LongFunction paramF, LongFunction clientF, ParsedOp op, LongFunction targetF) { return l -> new AzureAISearchCreateOrUpdateIndexOp(clientF.apply(l), paramF.apply(l)); } diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchDeleteIndexOpDispenser.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchDeleteIndexOpDispenser.java index d1bfda555..e656d2ce7 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchDeleteIndexOpDispenser.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchDeleteIndexOpDispenser.java @@ -26,7 +26,7 @@ import io.nosqlbench.adapters.api.templating.ParsedOp; /** * Delete an Azure AI Search index. - * + * * @see Delete * Index docs. @@ -34,7 +34,7 @@ import io.nosqlbench.adapters.api.templating.ParsedOp; * "https://learn.microsoft.com/en-us/rest/api/searchservice/">REST * API. */ -public class AzureAISearchDeleteIndexOpDispenser extends AzureAISearchBaseOpDispenser { +public class AzureAISearchDeleteIndexOpDispenser extends AzureAISearchBaseOpDispenser { public AzureAISearchDeleteIndexOpDispenser(AzureAISearchDriverAdapter adapter, ParsedOp op, LongFunction targetF) { @@ -48,7 +48,7 @@ public class AzureAISearchDeleteIndexOpDispenser extends AzureAISearchBaseOpDisp } @Override - public LongFunction> createOpFunc(LongFunction paramF, + public LongFunction> createOpFunc(LongFunction paramF, LongFunction clientF, ParsedOp op, LongFunction targetF) { return l -> new AzureAISearchDeleteIndexOp(clientF.apply(l), paramF.apply(l)); } diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchListIndexesOpDispenser.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchListIndexesOpDispenser.java index ced6d0a1c..849ea854e 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchListIndexesOpDispenser.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchListIndexesOpDispenser.java @@ -27,7 +27,7 @@ import io.nosqlbench.adapters.api.templating.ParsedOp; /** * Lists the indexes available. */ -public class AzureAISearchListIndexesOpDispenser extends AzureAISearchBaseOpDispenser { +public class AzureAISearchListIndexesOpDispenser extends AzureAISearchBaseOpDispenser { public AzureAISearchListIndexesOpDispenser(AzureAISearchDriverAdapter adapter, ParsedOp op, LongFunction targetF) { super(adapter, op, targetF); @@ -40,8 +40,8 @@ public class AzureAISearchListIndexesOpDispenser extends AzureAISearchBaseOpDisp } @Override - public LongFunction> createOpFunc(LongFunction paramF, + public LongFunction> createOpFunc(LongFunction paramF, LongFunction clientF, ParsedOp op, LongFunction targetF) { return l -> new AzureAISearchListIndexesOp(clientF.apply(l), paramF.apply(l)); } -} \ No newline at end of file +} diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchSearchDocumentsOpDispenser.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchSearchDocumentsOpDispenser.java index 8b9506230..437dd5a65 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchSearchDocumentsOpDispenser.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchSearchDocumentsOpDispenser.java @@ -26,6 +26,7 @@ import com.azure.search.documents.models.VectorQuery; import com.azure.search.documents.models.VectorSearchOptions; import com.azure.search.documents.models.VectorizedQuery; +import com.azure.search.documents.util.SearchPagedIterable; import io.nosqlbench.adapter.azureaisearch.AzureAISearchDriverAdapter; import io.nosqlbench.adapter.azureaisearch.ops.AzureAISearchBaseOp; import io.nosqlbench.adapter.azureaisearch.ops.AzureAISearchSearchDocumentsOp; @@ -40,7 +41,7 @@ import io.nosqlbench.nb.api.errors.OpConfigError; * "https://learn.microsoft.com/en-us/azure/search/vector-search-how-to-query?tabs=query-2024-07-01%2Cfilter-2024-07-01%2Cbuiltin-portal#vector-query-request">How * to query/vector search */ -public class AzureAISearchSearchDocumentsOpDispenser extends AzureAISearchBaseOpDispenser { +public class AzureAISearchSearchDocumentsOpDispenser extends AzureAISearchBaseOpDispenser { public AzureAISearchSearchDocumentsOpDispenser(AzureAISearchDriverAdapter adapter, ParsedOp op, LongFunction targetF) { super(adapter, op, targetF); @@ -70,7 +71,7 @@ public class AzureAISearchSearchDocumentsOpDispenser extends AzureAISearchBaseOp } @Override - public LongFunction> createOpFunc(LongFunction paramF, + public LongFunction> createOpFunc(LongFunction paramF, LongFunction clientF, ParsedOp op, LongFunction targetF) { return l -> new AzureAISearchSearchDocumentsOp(clientF.apply(l), clientF.apply(l).getSearchClient(targetF.apply(l)), paramF.apply(l)); diff --git a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchUploadDocumentsOpDispenser.java b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchUploadDocumentsOpDispenser.java index fa11d5fc8..60e5f0f36 100644 --- a/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchUploadDocumentsOpDispenser.java +++ b/nb-adapters/adapter-azure-aisearch/src/main/java/io/nosqlbench/adapter/azureaisearch/opsdispenser/AzureAISearchUploadDocumentsOpDispenser.java @@ -21,6 +21,7 @@ import java.util.function.LongFunction; import com.azure.search.documents.SearchDocument; import com.azure.search.documents.indexes.SearchIndexClient; +import com.azure.search.documents.models.IndexDocumentsResult; import io.nosqlbench.adapter.azureaisearch.AzureAISearchDriverAdapter; import io.nosqlbench.adapter.azureaisearch.ops.AzureAISearchBaseOp; import io.nosqlbench.adapter.azureaisearch.ops.AzureAISearchUploadDocumentsOp; @@ -34,7 +35,7 @@ import io.nosqlbench.adapters.api.templating.ParsedOp; * "https://learn.microsoft.com/en-us/java/api/com.azure.search.documents?view=azure-java-stable">Index * docs */ -public class AzureAISearchUploadDocumentsOpDispenser extends AzureAISearchBaseOpDispenser { +public class AzureAISearchUploadDocumentsOpDispenser extends AzureAISearchBaseOpDispenser { public AzureAISearchUploadDocumentsOpDispenser(AzureAISearchDriverAdapter adapter, ParsedOp op, LongFunction targetF) { super(adapter, op, targetF); @@ -55,7 +56,7 @@ public class AzureAISearchUploadDocumentsOpDispenser extends AzureAISearchBaseOp } @Override - public LongFunction> createOpFunc(LongFunction paramF, + public LongFunction> createOpFunc(LongFunction paramF, LongFunction clientF, ParsedOp op, LongFunction targetF) { return l -> new AzureAISearchUploadDocumentsOp(clientF.apply(l), clientF.apply(l).getSearchClient(targetF.apply(l)), paramF.apply(l));