mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
Jshook/verification (#2107)
* docs update * typos * disable noisy prom exposition dump * fix refkey bug * move specs into non-test namespace * remove unimplemented rainbow ops * docs updates * give credit to maintainers * update milvus module to build clean on new APIs * remove var keyword * API remapping * enable new op behaviors
This commit is contained in:
parent
5fcc3b27fd
commit
ca38a710c3
@ -835,6 +835,22 @@
|
||||
<organization>nosqlbench.io</organization>
|
||||
<organizationUrl>https://nosqlbench.io/</organizationUrl>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Madhavan Sridharan</name>
|
||||
<organization>nosqlbench.io</organization>
|
||||
<organizationUrl>https://nosqlbench.io/</organizationUrl>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Dave Fisher</name>
|
||||
<organization>nosqlbench.io</organization>
|
||||
<organizationUrl>https://nosqlbench.io/</organizationUrl>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Mark Wolters</name>
|
||||
<organization>nosqlbench.io</organization>
|
||||
<organizationUrl>https://nosqlbench.io/</organizationUrl>
|
||||
</developer>
|
||||
|
||||
</developers>
|
||||
|
||||
<distributionManagement>
|
||||
|
@ -43,7 +43,7 @@ public class AmqpOpMapper implements OpMapper<AmqpTimeTrackOp,AmqpSpace> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<AmqpTimeTrackOp> apply(NBComponent adapterC, ParsedOp op, LongFunction spaceInitF) {
|
||||
public OpDispenser<AmqpTimeTrackOp> apply(NBComponent adapterC, ParsedOp op, LongFunction spaceF) {
|
||||
//public OpDispenser<AmqpTimeTrackOp> apply(ParsedOp op, LongFunction<AmqpTimeTrackOp> spaceInitF) {
|
||||
int spaceName = op.getStaticConfigOr("space", 0);
|
||||
|
||||
|
@ -57,12 +57,12 @@ public class AzureAISearchOpMapper implements OpMapper<AzureAISearchBaseOp<?,?>,
|
||||
* @param adapterC
|
||||
* @param op
|
||||
* The {@link ParsedOp} to be evaluated
|
||||
* @param spaceInitF
|
||||
* @param spaceF
|
||||
* @return The correct {@link AzureAISearchBaseOpDispenser} subclass based on
|
||||
* the op type
|
||||
*/
|
||||
@Override
|
||||
public OpDispenser<AzureAISearchBaseOp<?,?>> apply(NBComponent adapterC, ParsedOp op, LongFunction<AzureAISearchSpace> spaceInitF) {
|
||||
public OpDispenser<AzureAISearchBaseOp<?,?>> apply(NBComponent adapterC, ParsedOp op, LongFunction<AzureAISearchSpace> spaceF) {
|
||||
|
||||
TypeAndTarget<AzureAISearchOpType, String> typeAndTarget = op.getTypeAndTarget(AzureAISearchOpType.class,
|
||||
String.class, "type", "target");
|
||||
|
@ -79,21 +79,23 @@ public class AzureAISearchSpace extends BaseSpace<AzureAISearchSpace> {
|
||||
|
||||
private SearchIndexClient createSearchClients() {
|
||||
String uri = cfg.get("endpoint");
|
||||
var requiredToken = cfg.getOptional("token_file").map(Paths::get).map(tokenFilePath -> {
|
||||
try {
|
||||
return Files.readAllLines(tokenFilePath).getFirst();
|
||||
} catch (IOException e) {
|
||||
String error = "Error while reading token from file:" + tokenFilePath;
|
||||
logger.error(error, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).orElseGet(() -> cfg.getOptional("token").orElseThrow(() -> new RuntimeException(
|
||||
"You must provide either a 'token_file' or a 'token' to configure a Azure AI Search client")));
|
||||
String requiredToken = cfg.getOptional("token_file").map(Paths::get).map(tokenFilePath -> {
|
||||
try {
|
||||
return Files.readAllLines(tokenFilePath).getFirst();
|
||||
} catch (IOException e) {
|
||||
String error = "Error while reading token from file:" + tokenFilePath;
|
||||
logger.error(error, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}).orElseGet(() -> cfg.getOptional("token").orElse(null));
|
||||
// .orElseThrow(() -> new RuntimeException(
|
||||
// "You must provide either a 'token_file' or a 'token' to configure a Azure AI Search client")));
|
||||
|
||||
logger.info(() -> "Creating new Azure AI Search Client with (masked) token/key ["
|
||||
+ AzureAISearchAdapterUtils.maskDigits(requiredToken) + "], uri/endpoint [" + uri + "]");
|
||||
|
||||
var searchIndexClientBuilder = new SearchIndexClientBuilder().endpoint(uri);
|
||||
SearchIndexClientBuilder searchIndexClientBuilder = new SearchIndexClientBuilder().endpoint(
|
||||
uri);
|
||||
if (!requiredToken.isBlank()) {
|
||||
searchIndexClientBuilder = searchIndexClientBuilder.credential(new AzureKeyCredential(requiredToken));
|
||||
} else {
|
||||
|
@ -66,7 +66,7 @@ public class AzureAISearchUploadDocumentsOpDispenser extends AzureAISearchBaseOp
|
||||
private LongFunction<SearchDocument> buildFieldsStruct(LongFunction<Map> fieldsFunction) {
|
||||
return l -> {
|
||||
Map<String, Object> fields = fieldsFunction.apply(l);
|
||||
var doc = new SearchDocument();
|
||||
SearchDocument doc = new SearchDocument();
|
||||
fields.forEach((key, val) -> {
|
||||
doc.put(key, val);
|
||||
});
|
||||
|
@ -18,6 +18,9 @@ package io.nosqlbench.adapter.cqld4;
|
||||
|
||||
import io.nosqlbench.adapter.cqld4.opmappers.Cqld4CoreOpMapper;
|
||||
import io.nosqlbench.adapter.cqld4.optypes.Cqld4BaseOp;
|
||||
import io.nosqlbench.adapter.cqld4.validators.Cqld4SingleRowValidator;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.Validator;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
import io.nosqlbench.nb.api.config.standard.NBConfigModel;
|
||||
import io.nosqlbench.nb.api.config.standard.NBConfiguration;
|
||||
import io.nosqlbench.adapters.api.activityimpl.OpMapper;
|
||||
@ -29,10 +32,7 @@ import io.nosqlbench.nb.annotations.Service;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
|
@ -41,10 +41,10 @@ public class CqlD4BatchStmtMapper<RESULT extends List<? extends Row>> extends Cq
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<Cqld4CqlBatchStatement> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceInitF) {
|
||||
public OpDispenser<Cqld4CqlBatchStatement> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceF) {
|
||||
ParsedOp subop = op.getAsSubOp("op_template", ParsedOp.SubOpNaming.ParentAndSubKey);
|
||||
int repeat = op.getStaticValue("repeat");
|
||||
OpDispenser<Cqld4CqlOp> od = new Cqld4CqlOpMapper(adapter).apply(adapterC, op, spaceInitF);
|
||||
OpDispenser<Cqld4CqlOp> od = new Cqld4CqlOpMapper(adapter).apply(adapterC, op, spaceF);
|
||||
return new CqlD4BatchStmtDispenser(adapter, op, repeat, subop, od);
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class CqlD4CqlSimpleStmtMapper extends Cqld4CqlBaseOpMapper<Cqld4CqlSimpl
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<Cqld4CqlSimpleStatement> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceInitF) {
|
||||
public OpDispenser<Cqld4CqlSimpleStatement> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceF) {
|
||||
return new Cqld4SimpleCqlStmtDispenser(adapter, targetFunction, op);
|
||||
}
|
||||
|
||||
|
@ -18,65 +18,61 @@ package io.nosqlbench.adapter.cqld4.opmappers;
|
||||
|
||||
public enum CqlD4OpType {
|
||||
|
||||
/**
|
||||
* uses {@link com.datastax.oss.driver.api.core.cql.SimpleStatement}
|
||||
* <em>does not</em> parameterize values via the SimpleStatement API.
|
||||
* Pre-renderes the statement string with values included. This is not
|
||||
* efficient nor recommended for production use, although it is useful
|
||||
* for certain testing scenarios in which you need to create a lot
|
||||
* of DDL or other statements which require non-parameterizable fields
|
||||
* to be present in binding values.
|
||||
*/
|
||||
// uses [[com.datastax.oss.driver.api.core.cql.SimpleStatement]]
|
||||
// **does not** parameterize values via the SimpleStatement API.
|
||||
// Pre-renderes the statement string with values included. This is not
|
||||
// efficient nor recommended for production use, although it is useful
|
||||
// for certain testing scenarios in which you need to create a lot
|
||||
// of DDL or other statements which require non-parameterizable fields
|
||||
// to be present in binding values.
|
||||
raw,
|
||||
|
||||
/**
|
||||
* uses {@link com.datastax.oss.driver.api.core.cql.SimpleStatement}
|
||||
* This parameterizes values and applies them as positional fields,
|
||||
* where the binding points are aligned by binding name.
|
||||
*/
|
||||
// uses [[com.datastax.oss.driver.api.core.cql.SimpleStatement]]
|
||||
// This parameterizes values and applies them as positional fields,
|
||||
// where the binding points are aligned by binding name.
|
||||
//
|
||||
simple,
|
||||
|
||||
/**
|
||||
* uses {@link com.datastax.oss.driver.api.core.cql.SimpleStatement}
|
||||
* This type does everything that the {@link #simple} mode does, and
|
||||
* additionally uses prepared statements.
|
||||
*/
|
||||
// uses [[com.datastax.oss.driver.api.core.cql.PreparedStatement]]
|
||||
// This type does everything that the {@link #simple} mode does, and
|
||||
// additionally uses prepared statements.
|
||||
prepared,
|
||||
|
||||
/**
|
||||
* Allows for a statement template to be used to create a batch statement.
|
||||
* The fields 'op_template', and 'repeat' are required, and all fields below
|
||||
* the op_template field are a nested version of the other op types here, but
|
||||
* supports only the simple and prepared forms for historic compatibility reasons.
|
||||
*/
|
||||
// uses [[com.datastax.oss.driver.api.core.cql.BatchStatement]]
|
||||
// Allows for a statement template to be used to create a batch statement.
|
||||
// The fields 'op_template', and 'repeat' are required, and all fields below
|
||||
// the op_template field are a nested version of the other op types here, but
|
||||
// supports only the simple and prepared forms for historic compatibility reasons.
|
||||
batch,
|
||||
|
||||
/**
|
||||
* uses {@link com.datastax.dse.driver.api.core.graph.ScriptGraphStatement}
|
||||
* This is the "raw" mode of using gremlin. It is not as efficient, and thus
|
||||
* is only recommended for testing or legacy apps.
|
||||
*/
|
||||
// This reads rows of data and verifies data and structure according to what
|
||||
// would have been written according to the original bindings.
|
||||
verify,
|
||||
|
||||
// uses [[com.datastax.dse.driver.api.core.graph.ScriptGraphStatement]]
|
||||
// This is the "raw" mode of using gremlin. It is not as efficient, and thus
|
||||
// is only recommended for testing or legacy apps.
|
||||
gremlin,
|
||||
|
||||
/**
|
||||
* uses {@link com.datastax.dse.driver.api.core.graph.FluentGraphStatement}
|
||||
* uses [[com.datastax.dse.driver.api.core.graph.FluentGraphStatement]]
|
||||
* This mode is the recommended mode for gremlin execution. It uses the fluent
|
||||
* API on the client side. The fluent syntax is compiled and cached as bytecode
|
||||
* within a per-thread execution environment (for each op template). For each
|
||||
* cycle, the bindings are rendered, injected into that execution environment,
|
||||
* and then the bytecode is executed to render the current operation, which is
|
||||
* then sent to the server. Although this is arguably more involved, the result
|
||||
* is quite efficient and provides the closes idiomatic experience <em>AND</em>
|
||||
* is quite efficient and provides the closes idiomatic experience **AND**
|
||||
* the best performance.
|
||||
*
|
||||
* <p>This is the mode that is recommended for all graph usage.</p>
|
||||
* This is the mode that is recommended for all graph usage.
|
||||
*/
|
||||
fluent,
|
||||
|
||||
/**
|
||||
* reserved for future use
|
||||
*/
|
||||
rainbow,
|
||||
// /**
|
||||
// * reserved for future use
|
||||
// */
|
||||
// rainbow,
|
||||
// /**
|
||||
// * reserved for future use
|
||||
// */
|
||||
|
@ -47,7 +47,7 @@ public class CqlD4PreparedStmtMapper extends Cqld4CqlBaseOpMapper<Cqld4CqlPrepar
|
||||
public OpDispenser<Cqld4CqlPreparedStatement> apply(
|
||||
NBComponent adapterC,
|
||||
ParsedOp op,
|
||||
LongFunction<Cqld4Space> spaceInitF
|
||||
LongFunction<Cqld4Space> spaceF
|
||||
) {
|
||||
ParsedTemplateString stmtTpl = op.getAsTemplate(target.field).orElseThrow(() -> new BasicError(
|
||||
"No statement was found in the op template:" + op
|
||||
@ -68,7 +68,7 @@ public class CqlD4PreparedStmtMapper extends Cqld4CqlBaseOpMapper<Cqld4CqlPrepar
|
||||
});
|
||||
});
|
||||
|
||||
return new Cqld4PreparedStmtDispenser(adapter, op, stmtTpl, processors, spaceInitF);
|
||||
return new Cqld4PreparedStmtDispenser(adapter, op, stmtTpl, processors, spaceF);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ public class CqlD4RainbowTableMapper<CO extends Cqld4RainbowTableOp> extends Cql
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<Cqld4RainbowTableOp> apply(NBComponent adapterC, ParsedOp op, LongFunction spaceInitF) {
|
||||
public OpDispenser<Cqld4RainbowTableOp> apply(NBComponent adapterC, ParsedOp op, LongFunction spaceF) {
|
||||
return null;
|
||||
// return new CqlD4RainbowTableDispenser(adapter, sessionFunc,targetFunction, op);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public class CqlD4RawStmtMapper extends Cqld4CqlBaseOpMapper<Cqld4CqlSimpleState
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<Cqld4CqlSimpleStatement> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceInitF) {
|
||||
public OpDispenser<Cqld4CqlSimpleStatement> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceF) {
|
||||
return new Cqld4RawStmtDispenser(adapter, targetFunction,op);
|
||||
}
|
||||
|
||||
|
@ -38,5 +38,5 @@ public abstract class Cqld4BaseOpMapper<T extends Cqld4BaseOp<?>> implements OpM
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract OpDispenser<T> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceInitF);
|
||||
public abstract OpDispenser<T> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceF);
|
||||
}
|
||||
|
@ -61,8 +61,8 @@ public class Cqld4CoreOpMapper extends Cqld4BaseOpMapper<Cqld4BaseOp<?>> {
|
||||
case raw, simple, prepared, batch -> new Cqld4CqlOpMapper(adapter).apply(adapterC, op, spaceF);
|
||||
case gremlin -> new Cqld4GremlinOpMapper(adapter, target.targetFunction).apply(adapterC, op, spaceF);
|
||||
case fluent -> new Cqld4FluentGraphOpMapper(adapter, target).apply(adapterC, op, spaceF);
|
||||
case rainbow ->
|
||||
new CqlD4RainbowTableMapper(adapter, spaceF, target.targetFunction).apply(adapterC, op, spaceF);
|
||||
// case rainbow ->
|
||||
// new CqlD4RainbowTableMapper(adapter, spaceF, target.targetFunction).apply(adapterC, op, spaceF);
|
||||
default -> throw new OpConfigError("Unsupported op type " + opType);
|
||||
// case sst -> new Cqld4SsTableMapper(adapter, sessionFunc, target.targetFunction).apply(op);
|
||||
};
|
||||
|
@ -34,6 +34,6 @@ public abstract class Cqld4CqlBaseOpMapper<T extends Cqld4CqlOp> extends Cqld4Ba
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract OpDispenser<T> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceInitF);
|
||||
public abstract OpDispenser<T> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceF);
|
||||
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ public class Cqld4CqlOpMapper extends Cqld4CqlBaseOpMapper<Cqld4CqlOp> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<Cqld4CqlOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceInitF) {
|
||||
public OpDispenser<Cqld4CqlOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceF) {
|
||||
CqlD4OpType opType = CqlD4OpType.prepared;
|
||||
TypeAndTarget<CqlD4OpType, String> target = op.getTypeAndTarget(CqlD4OpType.class, String.class, "type", "stmt");
|
||||
logger.info(() -> "Using " + target.enumId + " statement form for '" + op.getName() + "'");
|
||||
@ -47,13 +47,13 @@ public class Cqld4CqlOpMapper extends Cqld4CqlBaseOpMapper<Cqld4CqlOp> {
|
||||
return (OpDispenser<Cqld4CqlOp>) switch (target.enumId) {
|
||||
case raw -> {
|
||||
CqlD4RawStmtMapper cqlD4RawStmtMapper = new CqlD4RawStmtMapper(adapter, target.targetFunction);
|
||||
OpDispenser<Cqld4CqlSimpleStatement> apply = cqlD4RawStmtMapper.apply(adapterC, op, spaceInitF);
|
||||
OpDispenser<Cqld4CqlSimpleStatement> apply = cqlD4RawStmtMapper.apply(adapterC, op, spaceF);
|
||||
yield apply;
|
||||
}
|
||||
case simple -> new CqlD4CqlSimpleStmtMapper(adapter, target.targetFunction).apply(adapterC, op, spaceInitF);
|
||||
case prepared -> new CqlD4PreparedStmtMapper(adapter, target).apply(adapterC, op, spaceInitF);
|
||||
case simple -> new CqlD4CqlSimpleStmtMapper(adapter, target.targetFunction).apply(adapterC, op, spaceF);
|
||||
case prepared -> new CqlD4PreparedStmtMapper(adapter, target).apply(adapterC, op, spaceF);
|
||||
|
||||
case batch -> new CqlD4BatchStmtMapper(adapter, target).apply(adapterC, op, spaceInitF);
|
||||
case batch -> new CqlD4BatchStmtMapper(adapter, target).apply(adapterC, op, spaceF);
|
||||
default ->
|
||||
throw new OpConfigError("Unsupported op type for CQL category of statement forms:" + target.enumId);
|
||||
};
|
||||
|
@ -59,7 +59,7 @@ public class Cqld4FluentGraphOpMapper extends Cqld4BaseOpMapper<Cqld4FluentGraph
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<Cqld4FluentGraphOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> cqld4SpaceLongFunction) {
|
||||
public OpDispenser<Cqld4FluentGraphOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<Cqld4Space> spaceF) {
|
||||
GraphTraversalSource g = DseGraph.g;
|
||||
|
||||
ParsedTemplateString fluent = op.getAsTemplate(target.field).orElseThrow();
|
||||
|
@ -33,7 +33,7 @@ public class Cqld4GremlinOpMapper<CO extends Cqld4ScriptGraphOp> extends Cqld4Ba
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cqld4GremlinOpDispenser apply(NBComponent adapterC, ParsedOp op, LongFunction spaceInitF) {
|
||||
public Cqld4GremlinOpDispenser apply(NBComponent adapterC, ParsedOp op, LongFunction spaceF) {
|
||||
return new Cqld4GremlinOpDispenser(
|
||||
adapter,
|
||||
l -> adapter.getSpaceFunc(op).apply(l).getSession(), targetFunction, op);
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
package io.nosqlbench.adapter.cqld4.optypes;
|
||||
|
||||
import com.datastax.oss.driver.api.core.CqlIdentifier;
|
||||
import com.datastax.oss.driver.api.core.CqlSession;
|
||||
import com.datastax.oss.driver.api.core.cql.*;
|
||||
import io.nosqlbench.adapter.cqld4.Cqld4CqlReboundStatement;
|
||||
@ -26,14 +27,16 @@ import io.nosqlbench.adapter.cqld4.exceptions.ExceededRetryReplaceException;
|
||||
import io.nosqlbench.adapter.cqld4.exceptions.UnexpectedPagingException;
|
||||
import io.nosqlbench.adapter.cqld4.instruments.CqlOpMetrics;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes.*;
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import io.nosqlbench.virtdata.core.templates.*;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
|
||||
// TODO: add statement filtering
|
||||
@ -47,7 +50,7 @@ import java.util.concurrent.*;
|
||||
|
||||
|
||||
public abstract class Cqld4CqlOp
|
||||
implements Cqld4BaseOp<List<Row>>, VariableCapture, OpGenerator, OpResultSize {
|
||||
implements Cqld4BaseOp<List<Row>>, UniformVariableCapture<List<Row>>, OpGenerator, OpResultSize {
|
||||
|
||||
private final static Logger logger = LogManager.getLogger(Cqld4CqlOp.class);
|
||||
|
||||
@ -165,8 +168,33 @@ public abstract class Cqld4CqlOp
|
||||
return next;
|
||||
}
|
||||
|
||||
public Map<String, ?> capture() {
|
||||
throw new NotImplementedException("Not implemented for Cqld4CqlOp");
|
||||
@Override
|
||||
public Function<List<Row>, Map<String, ?>> initCaptureF(CapturePoints<List<Row>> points) {
|
||||
Function<List<Row>,Map<String,?>> f = (List<Row> result) -> {
|
||||
if (result.size()!=1) {
|
||||
throw new CapturePointException("result contained " + result.size() + " rows, required exactly 1");
|
||||
}
|
||||
Row row = result.get(0);
|
||||
ColumnDefinitions coldefs = row.getColumnDefinitions();
|
||||
Map<String,Object> values = new HashMap<>(coldefs.size());
|
||||
|
||||
if (points.isGlob()) {
|
||||
for (ColumnDefinition coldef : coldefs) {
|
||||
String colname = coldef.getName().toString();
|
||||
values.put(colname,row.getObject(colname));
|
||||
}
|
||||
} else {
|
||||
for (CapturePoint<List<Row>> point : points) {
|
||||
String sourceName = point.getSourceName();
|
||||
Object value = row.getObject(point.getSourceName());
|
||||
Object recast = point.getAsCast().cast(value);
|
||||
values.put(point.getAsName(), recast);
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
};
|
||||
return f;
|
||||
}
|
||||
|
||||
public abstract Statement<?> getStmt();
|
||||
|
@ -19,11 +19,8 @@ package io.nosqlbench.adapter.cqld4.optypes;
|
||||
import com.datastax.oss.driver.api.core.cql.ResultSet;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
// Need to create RainbowTableStatement
|
||||
public class Cqld4RainbowTableOp
|
||||
implements Cqld4BaseOp<ResultSet>, VariableCapture, OpGenerator, OpResultSize {
|
||||
public class Cqld4RainbowTableOp implements Cqld4BaseOp<ResultSet>, OpGenerator, OpResultSize {
|
||||
// private final CqlSession session;
|
||||
// private final RainbowTableStatement stmt;
|
||||
|
||||
@ -39,9 +36,4 @@ public class Cqld4RainbowTableOp
|
||||
throw new RuntimeException("implement me");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, ?> capture() {
|
||||
throw new RuntimeException("implement me");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
package io.nosqlbench.adapter.cqld4.validators;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
import com.datastax.oss.driver.api.core.cql.Row;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.Validator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Cqld4SingleRowValidator implements Validator<List<Row>> {
|
||||
|
||||
public Cqld4SingleRowValidator() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(List<Row> rows) {
|
||||
System.out.println("validating rows...");
|
||||
}
|
||||
}
|
@ -536,7 +536,7 @@ public class CGWorkloadExporter implements BundledApp {
|
||||
pkeys.pop();
|
||||
}
|
||||
}
|
||||
var lastcount = keycount;
|
||||
int lastcount = keycount;
|
||||
keycount = Math.max(table.getPartitionKeys().size(), keycount);
|
||||
if (keycount != lastcount) {
|
||||
logger.debug("minimum keycount for " + table.getFullName() + " adjusted from " + lastcount + " to " + keycount);
|
||||
|
162
nb-adapters/adapter-cqld4/src/main/resources/cqlverify.md
Normal file
162
nb-adapters/adapter-cqld4/src/main/resources/cqlverify.md
Normal file
@ -0,0 +1,162 @@
|
||||
# CQL Verify
|
||||
|
||||
The cqld4 adapter has the capability to verify data in a database by reading each row and comparing
|
||||
it with reference data. The reference data is simply the same data which you might use to generate
|
||||
data for upsert, modeled with standard bindings. Thus, you can assert the correctness of any (whole
|
||||
or part of) data within a database for which you have data bindings. For the most common case --
|
||||
writing and then verifying data, the same bindings are used for both phases.
|
||||
|
||||
It allows you to read values from a database and compare them to the generated values that were
|
||||
expected to be written, row-by-row, producing a comparative result between the two.
|
||||
|
||||
If you specify `verify` as the op type with the cqld4 adapter, then it will do the following:
|
||||
|
||||
1. Presume that the op structure is effectively a read operation, meaning it will produce a result
|
||||
that can be used for comparison. The operation must have a single row in the result set. If there
|
||||
is no row, then the row fails validation. The same happens if there is more than one row.
|
||||
2. Using the provided bindings, re-generate the data separately which was expected to be in the
|
||||
database. This is called _reference data_ herein.
|
||||
3. Verify that the values returned from the database are the same as the reference data, and throw a
|
||||
ResultVerificationError for each mis-matching row.
|
||||
|
||||
Alternately, you can add the verify and compare options to any regular CQL statement (Simple, Raw,
|
||||
Prepared) in order to enable this verification logic.
|
||||
|
||||
## Verification Options
|
||||
|
||||
These options may be attached to an op template directly as op fields, or they may be passed as
|
||||
activity parameters. NOTE: passing them as activity parameters will only work if all of the active
|
||||
operations are compatible with the verify options.
|
||||
|
||||
- **verify** - an optional modifier of fields to verify for a statement. If this parameter is not
|
||||
provided, then it is presumed to be `*` by default. This is a string which consists of
|
||||
comma-separate values. This parameter is useful if you have a set of default bindings and want to
|
||||
specify which subset of them will be used just for this statement. Each form modifies the list of
|
||||
fields to verify incrementally, and multiple options are allowed:
|
||||
- `*` : If the value is `*`, then all the bindings that are visible for the statement will be used
|
||||
as expected values.
|
||||
- `-`, `-field2` : If it is a word that starts with `-`, like `-field2`, then the name after the
|
||||
dash is removed from the list of fields to verify.
|
||||
- `+`, `+field3` : If it is a word that starts with a `+`, like `+field3`, or a simple word, then
|
||||
the field is added to the list of fields to verify.
|
||||
- `f->b` : If any of the added fields is in the form `f->b`, then it is taken as a mapping from the
|
||||
field name `f` in the schema to a binding `b`.
|
||||
|
||||
For example,
|
||||
|
||||
```yaml
|
||||
# example op template
|
||||
ops:
|
||||
op1:
|
||||
readit: "select ....TBD"
|
||||
bindings:
|
||||
a: ..
|
||||
b: ..
|
||||
c: ..
|
||||
verify: "*,-b"
|
||||
```
|
||||
|
||||
means _verify all fields from the bindings except `b`_, using the default validation method.
|
||||
|
||||
- **compare** - what to verify, naming structure, values, etc. each of these is additive, and
|
||||
multiple can be specified.
|
||||
- all (the default) - A synonym for fields AND values
|
||||
- fields - A synonym for rowfields AND reffields (full set equivalence)
|
||||
- rowfields - Verify that the result field names include every reference field name.
|
||||
- reffields - Verify that the reference field names include every result field name.
|
||||
- values - Verify that all the pair-wise fields have equal values, according to the
|
||||
type-specific `.equals(...)` method for the data type identified in the row metadata by field
|
||||
name.
|
||||
|
||||
For example,
|
||||
|
||||
```yaml
|
||||
# example op template
|
||||
ops:
|
||||
op1:
|
||||
readit: "select ....TBD"
|
||||
bindings:
|
||||
a: ..
|
||||
b: ..
|
||||
c: ..
|
||||
verify: "*,-b"
|
||||
compare: reffields
|
||||
```
|
||||
|
||||
means _ensure reference fields are present in result fields by name but do not throw an error if
|
||||
there are more result fields present, and do not compare values of same-named fields_.
|
||||
|
||||
## Verification Results
|
||||
|
||||
### Errors
|
||||
|
||||
The data bindings are used to generate the expected values that would be used for an upsert. Each
|
||||
row is verified according to these values, and any discrepancy is treated as an error that can be
|
||||
counted, logged, etc. If you want to simply count the occurences instead of fast-failing an activity
|
||||
when a row is unverified, then you simply need to modify the error handler for that activity: '
|
||||
errors=unverified=count'.
|
||||
|
||||
The default error handling behavior will cause an exception to be thrown and NoSQLBench
|
||||
will exit by default. If you wish for something less dramatic, then
|
||||
wire the unverified category to something else:
|
||||
|
||||
errors=...,unverified->count
|
||||
|
||||
or
|
||||
|
||||
errors=...,unverified->warn
|
||||
|
||||
### Metrics
|
||||
|
||||
The cqlverify activity type adds some verification-specific metrics:
|
||||
|
||||
- alias.verified_results - A counter for how many results were verified
|
||||
- alias.unverified_results - A counter for how many results were not verified
|
||||
- alias.verified_values - A counter for how many field values were verified
|
||||
- alias.unverified_values - A counter for how many field values were unverified
|
||||
|
||||
## Advanced Usage
|
||||
|
||||
The verify capability does not retain logged data for verification. Still, it is able to compare
|
||||
data as if it had a separate physical data set to compare to. This is possible only because
|
||||
virtdata (the data generation layer of NoSQLBench) can provide realistic views of virtual datasets
|
||||
on the fly.
|
||||
|
||||
### Avoid Random data
|
||||
|
||||
That means, however, that you must avoid using the non-stable data mapping functions when writing
|
||||
data. The rule of thumb is to avoid using any data mapping functions containing the word "Random".
|
||||
Binding functions with `random` in their name behave differently from others in that they will not
|
||||
produce stable results. Their initialization vector is external to the function definition, such as
|
||||
when using the system _random_ functions.
|
||||
|
||||
> Some will bristle at this misuse of the terms, but connotatively they work well for most
|
||||
> other users. Actually, all of the algorithms used by
|
||||
> virtdata are __NOT__ truly random, and are deterministic in some way. However, some rely on
|
||||
> an initialization vector which is not self-contained within the function definition. As such,
|
||||
> these functions are not pure functions in practice and thus may not be relied upon to return the
|
||||
> same result from session to session. The word _random_ in virtdata binding functions indicates
|
||||
> that a function is non-determinstic in some cases. As long as you avoid these functions,
|
||||
> you can rely on stable generated data from session to session.
|
||||
|
||||
### Single vs Multiple Results
|
||||
|
||||
TBD
|
||||
|
||||
### Paging vs Non-Paging verification
|
||||
|
||||
TBD
|
||||
|
||||
### Example activity definitions
|
||||
|
||||
Write 100K cycles of telemetry data
|
||||
|
||||
> TBD ... run driver=cql alias=writesome workload=cql-iot tags=group:write cycles=100000 host=...
|
||||
|
||||
Verify the the same 100K cycles of telemetry data
|
||||
|
||||
> TBD ... run driver=cqlverify alias=verify workload=cql-iot tags=group:verify cycles=100000
|
||||
|
||||
To see how these examples work, TBD
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class CqlParserHarnessTest {
|
||||
CGWorkloadExporter exporter = new CGWorkloadExporter();
|
||||
exporter.applyAsInt(new String[]{"src/test/resources/testschemas/cql_alltypes.cql","_alltypes.yaml"});
|
||||
exporter.setNamingTemplate("[OPTYPE-][COLUMN-][TYPEDEF-][TABLE-]-[KEYSPACE]");
|
||||
var data = exporter.getWorkloadAsYaml();
|
||||
String data = exporter.getWorkloadAsYaml();
|
||||
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class DataApiOpMapper implements OpMapper<DataApiBaseOp,DataApiSpace> {
|
||||
|
||||
|
||||
@Override
|
||||
public OpDispenser<DataApiBaseOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<DataApiSpace> spaceInitF) {
|
||||
public OpDispenser<DataApiBaseOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<DataApiSpace> spaceF) {
|
||||
//public OpDispenser<DataApiBaseOp> apply(ParsedOp op, LongFunction<DataApiSpace> spaceInitF) {
|
||||
TypeAndTarget<DataApiOpType, String> typeAndTarget = op.getTypeAndTarget(
|
||||
DataApiOpType.class,
|
||||
|
@ -40,7 +40,7 @@ public class DynamoDBOpMapper implements OpMapper<DynamoDBOp,DynamoDBSpace> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<DynamoDBOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<DynamoDBSpace> spaceInitF) {
|
||||
public OpDispenser<DynamoDBOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<DynamoDBSpace> spaceF) {
|
||||
int space = op.getStaticConfigOr("space", 0);
|
||||
LongFunction<DynamoDBSpace> spaceFunc = adapter.getSpaceFunc(op);
|
||||
DynamoDB ddb = spaceFunc.apply(space).getDynamoDB();
|
||||
|
@ -2,13 +2,13 @@ package io.nosqlbench.adapter.prototype;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@ -35,13 +35,13 @@ public class ExampleOpMapper implements OpMapper<ExampleOpType1, ExampleSpace> {
|
||||
public OpDispenser<ExampleOpType1> apply(
|
||||
NBComponent adapterC,
|
||||
ParsedOp pop,
|
||||
LongFunction<ExampleSpace> spaceInitF
|
||||
LongFunction<ExampleSpace> spaceF
|
||||
) {
|
||||
TypeAndTarget<ExampleOpTypes, String> typeAndTarget = pop.getTypeAndTarget(ExampleOpTypes.class, String.class);
|
||||
|
||||
return switch (typeAndTarget.enumId) {
|
||||
case type1 -> new ExampleOpDispenserType1(adapterC, pop, spaceInitF);
|
||||
case type2 -> new ExampleOpDispenserType1(adapterC, pop, spaceInitF);
|
||||
case type1 -> new ExampleOpDispenserType1(adapterC, pop, spaceF);
|
||||
case type2 -> new ExampleOpDispenserType1(adapterC, pop, spaceF);
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ package io.nosqlbench.adapter.prototype;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@ -21,6 +21,9 @@ package io.nosqlbench.adapter.prototype;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.BaseSpace;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.DriverAdapter;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public class ExampleSpace extends BaseSpace<ExampleSpace> {
|
||||
|
||||
public ExampleSpace(DriverAdapter<?, ExampleSpace> adapter, long idx) {
|
||||
|
@ -51,12 +51,12 @@ public class GCPSpannerOpMapper implements OpMapper<GCPSpannerBaseOp<?,?>, GCPSp
|
||||
* @param adapterC
|
||||
* @param op
|
||||
* The {@link ParsedOp} to be evaluated
|
||||
* @param spaceInitF
|
||||
* @param spaceF
|
||||
* @return The correct {@link GCPSpannerBaseOpDispenser} subclass based on
|
||||
* the op type
|
||||
*/
|
||||
@Override
|
||||
public OpDispenser<GCPSpannerBaseOp<?,?>> apply(NBComponent adapterC, ParsedOp op, LongFunction<GCPSpannerSpace> spaceInitF) {
|
||||
public OpDispenser<GCPSpannerBaseOp<?,?>> apply(NBComponent adapterC, ParsedOp op, LongFunction<GCPSpannerSpace> spaceF) {
|
||||
TypeAndTarget<GCPSpannerOpType, String> typeAndTarget = op.getTypeAndTarget(GCPSpannerOpType.class,
|
||||
String.class, "type", "target");
|
||||
logger.info(() -> "Using '" + typeAndTarget.enumId + "' op type for op template '" + op.getName() + "'");
|
||||
|
@ -37,8 +37,8 @@ public class HttpOpMapper implements OpMapper<HttpOp,HttpSpace> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<HttpOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<HttpSpace> spaceInitF) {
|
||||
public OpDispenser<HttpOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<HttpSpace> spaceF) {
|
||||
LongFunction<String> spaceNameF = op.getAsFunctionOr("space", "default");
|
||||
return new HttpOpDispenser(adapter, spaceInitF, op);
|
||||
return new HttpOpDispenser(adapter, spaceF, op);
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ public class KafkaOpMapper implements OpMapper<KafkaOp,KafkaSpace> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<KafkaOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<KafkaSpace> spaceInitF) {
|
||||
public OpDispenser<KafkaOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<KafkaSpace> spaceF) {
|
||||
KafkaSpace kafkaSpace = adapter.getSpaceFunc(op).apply(op.getStaticConfigOr("space",0));
|
||||
|
||||
/*
|
||||
|
@ -27,6 +27,7 @@ import io.nosqlbench.nb.api.config.standard.NBConfiguration;
|
||||
import io.nosqlbench.nb.api.labels.NBLabels;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
import static io.nosqlbench.adapter.milvus.MilvusAdapterUtils.MILVUS;
|
||||
|
||||
@ -38,15 +39,20 @@ public class MilvusDriverAdapter extends BaseDriverAdapter<MilvusBaseOp<?>, Milv
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpMapper<MilvusBaseOp<?>> getOpMapper() {
|
||||
public OpMapper<MilvusBaseOp<?>,MilvusSpace> getOpMapper() {
|
||||
return new MilvusOpMapper(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Function<String, ? extends MilvusSpace> getSpaceInitializer(NBConfiguration cfg) {
|
||||
return (s) -> new MilvusSpace(s, cfg);
|
||||
public LongFunction<MilvusSpace> getSpaceInitializer(NBConfiguration cfg) {
|
||||
return (idx) -> new MilvusSpace(this, idx, cfg);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Function<String, ? extends MilvusSpace> getSpaceInitializer(NBConfiguration cfg) {
|
||||
// return (s) -> new MilvusSpace(s, cfg);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public NBConfigModel getConfigModel() {
|
||||
return super.getConfigModel().add(MilvusSpace.getConfigModel());
|
||||
|
@ -23,110 +23,157 @@ import io.nosqlbench.adapters.api.activityimpl.OpDispenser;
|
||||
import io.nosqlbench.adapters.api.activityimpl.OpMapper;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
import io.nosqlbench.engine.api.templating.TypeAndTarget;
|
||||
import io.nosqlbench.nb.api.components.core.NBComponent;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
public class MilvusOpMapper implements OpMapper<MilvusBaseOp<?>> {
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class MilvusOpMapper implements OpMapper<MilvusBaseOp<?>, MilvusSpace> {
|
||||
private static final Logger logger = LogManager.getLogger(MilvusOpMapper.class);
|
||||
private final MilvusDriverAdapter adapter;
|
||||
|
||||
/**
|
||||
* Create a new MilvusOpMapper implementing the {@link OpMapper} interface.
|
||||
*
|
||||
* @param adapter The associated {@link MilvusDriverAdapter}
|
||||
Create a new MilvusOpMapper implementing the {@link OpMapper} interface.
|
||||
@param adapter
|
||||
The associated {@link MilvusDriverAdapter}
|
||||
*/
|
||||
public MilvusOpMapper(MilvusDriverAdapter adapter) {
|
||||
this.adapter = adapter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Given an instance of a {@link ParsedOp} returns the appropriate {@link MilvusBaseOpDispenser} subclass
|
||||
*
|
||||
* @param op The {@link ParsedOp} to be evaluated
|
||||
* @return The correct {@link MilvusBaseOpDispenser} subclass based on the op type
|
||||
Given an instance of a {@link ParsedOp} returns the appropriate {@link MilvusBaseOpDispenser}
|
||||
subclass
|
||||
@param op
|
||||
The {@link ParsedOp} to be evaluated
|
||||
@return The correct {@link MilvusBaseOpDispenser} subclass based on the op type
|
||||
*/
|
||||
@Override
|
||||
public OpDispenser<? extends MilvusBaseOp<?>> apply(ParsedOp op) {
|
||||
public OpDispenser<? extends MilvusBaseOp<?>> apply(
|
||||
NBComponent adapterC, ParsedOp op,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
|
||||
TypeAndTarget<MilvusOpType, String> typeAndTarget = op.getTypeAndTarget(
|
||||
MilvusOpType.class,
|
||||
String.class,
|
||||
"type",
|
||||
"target"
|
||||
"type", "target"
|
||||
);
|
||||
logger.info(() -> "Using '" + typeAndTarget.enumId + "' op type for op template '" + op.getName() + "'");
|
||||
logger.info(
|
||||
() -> "Using '" + typeAndTarget.enumId + "' op type for op template '" + op.getName() + "'");
|
||||
|
||||
return switch (typeAndTarget.enumId) {
|
||||
case drop_collection -> new MilvusDropCollectionOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case create_collection -> new MilvusCreateCollectionOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case create_index -> new MilvusCreateIndexOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case drop_index -> new MilvusDropIndexOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case drop_collection -> new MilvusDropCollectionOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case create_collection -> new MilvusCreateCollectionOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case create_index -> new MilvusCreateIndexOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case drop_index -> new MilvusDropIndexOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
// Uses the Collection-specific fields (columnar) insert mode
|
||||
case insert_rows -> new MilvusInsertRowsOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case insert_rows -> new MilvusInsertRowsOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
// Uses the High-Level row-by-row JSONObject (tabular) insert mode
|
||||
case insert -> new MilvusInsertOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case delete -> new MilvusDeleteOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case search -> new MilvusSearchOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case alter_alias -> new MilvusAlterAliasOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case alter_collection -> new MilvusAlterCollectionOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case flush -> new MilvusFlushOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case bulk_insert -> new MilvusBulkInsertOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case create_alias -> new MilvusCreateAliasOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case get -> new MilvusGetOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case create_partition -> new MilvusCreatePartitionOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case create_credential -> new MilvusCreateCredentialOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case create_database -> new MilvusCreateDatabaseOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case query -> new MilvusQueryOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case delete_credential -> new MilvusDeleteCredentialOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case describe_collection ->
|
||||
new MilvusDescribeCollectionOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case describe_index -> new MilvusDescribeIndexOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case drop_alias -> new MilvusDropAliasOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case get_metrics -> new MilvusGetMetricsOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case drop_database -> new MilvusDropDatabaseOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case get_replicas -> new MilvusGetReplicasOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case load_balance -> new MilvusLoadBalanceOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case has_partition -> new MilvusHasPartitionOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case drop_partition -> new MilvusDropPartitionOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case get_load_state -> new MilvusGetLoadStateOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case list_databases -> new MilvusListDatabasesOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case manual_compact -> new MilvusManualCompactOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case get_index_state -> new MilvusGetIndexStateOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case list_cred_users -> new MilvusListCredUsersOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case load_collection -> new MilvusLoadCollectionOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case show_partitions -> new MilvusShowPartitionsOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case load_partitions -> new MilvusLoadPartitionsOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case list_collections -> new MilvusListCollectionsOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case show_collections -> new MilvusShowCollectionsOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case update_credential -> new MilvusUpdateCredentialOpDispenser(adapter, op, typeAndTarget.targetFunction);
|
||||
case release_collection -> new MilvusReleaseCollectionOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_bulk_insert_state -> new MilvusGetBulkInsertStateOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case release_partitions -> new MilvusReleasePartitionsOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_flush_all_state -> new MilvusGetFlushAllStateOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_compaction_state -> new MilvusGetCompactionStateOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_loading_progress -> new MilvusGetLoadingProgressOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_persistent_segment_info -> new MilvusGetPersistentSegmentInfoOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_query_segment_info -> new MilvusGetQuerySegmentInfoOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case list_bulk_insert_tasks -> new MilvusListBulkInsertTasksOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_index_build_progress -> new MilvusGetIndexBuildProgressOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_partition_statistics -> new MilvusGetPartitionStatisticsOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_collection_statistics -> new MilvusGetCollectionStatisticsOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case get_compaction_state_with_plans -> new MilvusGetCompactionStateWithPlansOpDispenser(adapter, op,
|
||||
typeAndTarget.targetFunction);
|
||||
case insert -> new MilvusInsertOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case delete -> new MilvusDeleteOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case search -> new MilvusSearchOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case alter_alias -> new MilvusAlterAliasOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case alter_collection -> new MilvusAlterCollectionOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case flush -> new MilvusFlushOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case bulk_insert -> new MilvusBulkInsertOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case create_alias -> new MilvusCreateAliasOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get -> new MilvusGetOpDispenser(adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case create_partition -> new MilvusCreatePartitionOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case create_credential -> new MilvusCreateCredentialOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case create_database -> new MilvusCreateDatabaseOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case query -> new MilvusQueryOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case delete_credential -> new MilvusDeleteCredentialOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case describe_collection -> new MilvusDescribeCollectionOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case describe_index -> new MilvusDescribeIndexOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case drop_alias -> new MilvusDropAliasOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_metrics -> new MilvusGetMetricsOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case drop_database -> new MilvusDropDatabaseOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_replicas -> new MilvusGetReplicasOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case load_balance -> new MilvusLoadBalanceOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case has_partition -> new MilvusHasPartitionOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case drop_partition -> new MilvusDropPartitionOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_load_state -> new MilvusGetLoadStateOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case list_databases -> new MilvusListDatabasesOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case manual_compact -> new MilvusManualCompactOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_index_state -> new MilvusGetIndexStateOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case list_cred_users -> new MilvusListCredUsersOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case load_collection -> new MilvusLoadCollectionOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case show_partitions -> new MilvusShowPartitionsOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case load_partitions -> new MilvusLoadPartitionsOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case list_collections -> new MilvusListCollectionsOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case show_collections -> new MilvusShowCollectionsOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case update_credential -> new MilvusUpdateCredentialOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case release_collection -> new MilvusReleaseCollectionOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_bulk_insert_state -> new MilvusGetBulkInsertStateOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case release_partitions -> new MilvusReleasePartitionsOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_flush_all_state -> new MilvusGetFlushAllStateOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_compaction_state -> new MilvusGetCompactionStateOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_loading_progress -> new MilvusGetLoadingProgressOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_persistent_segment_info -> new MilvusGetPersistentSegmentInfoOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_query_segment_info -> new MilvusGetQuerySegmentInfoOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case list_bulk_insert_tasks -> new MilvusListBulkInsertTasksOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_index_build_progress -> new MilvusGetIndexBuildProgressOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_partition_statistics -> new MilvusGetPartitionStatisticsOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_collection_statistics -> new MilvusGetCollectionStatisticsOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
case get_compaction_state_with_plans ->
|
||||
new MilvusGetCompactionStateWithPlansOpDispenser(
|
||||
adapter, op, typeAndTarget.targetFunction, spaceF);
|
||||
// default -> throw new RuntimeException("Unrecognized op type '" + typeAndTarget.enumId.name() + "' while " +
|
||||
// "mapping parsed op " + op);
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,8 @@ package io.nosqlbench.adapter.milvus;
|
||||
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.ConnectParam;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.BaseSpace;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.DriverAdapter;
|
||||
import io.nosqlbench.nb.api.config.standard.ConfigModel;
|
||||
import io.nosqlbench.nb.api.config.standard.NBConfigModel;
|
||||
import io.nosqlbench.nb.api.config.standard.NBConfiguration;
|
||||
@ -39,26 +41,16 @@ import java.util.Optional;
|
||||
* https://milvus.io/docs/install-java.md
|
||||
* https://docs.zilliz.com/docs/connect-to-cluster
|
||||
*/
|
||||
public class MilvusSpace implements AutoCloseable {
|
||||
public class MilvusSpace extends BaseSpace<MilvusSpace> {
|
||||
private final static Logger logger = LogManager.getLogger(MilvusSpace.class);
|
||||
private final String name;
|
||||
private final NBConfiguration cfg;
|
||||
|
||||
protected MilvusServiceClient client;
|
||||
|
||||
// private final Map<String, ConnectParam> connections = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Create a new MilvusSpace Object which stores all stateful contextual information needed to interact
|
||||
* with the Milvus/Zilliz database instance.
|
||||
*
|
||||
* @param name
|
||||
* The name of this space
|
||||
* @param cfg
|
||||
* The configuration ({@link NBConfiguration}) for this nb run
|
||||
*/
|
||||
public MilvusSpace(String name, NBConfiguration cfg) {
|
||||
this.name = name;
|
||||
public MilvusSpace(
|
||||
DriverAdapter<?, MilvusSpace> adapter, long idx, NBConfiguration cfg
|
||||
) {
|
||||
super(adapter, idx);
|
||||
this.cfg = cfg;
|
||||
}
|
||||
|
||||
@ -70,7 +62,7 @@ public class MilvusSpace implements AutoCloseable {
|
||||
}
|
||||
|
||||
private MilvusServiceClient createClient() {
|
||||
var builder = ConnectParam.newBuilder();
|
||||
ConnectParam.Builder builder = ConnectParam.newBuilder();
|
||||
builder = builder.withUri(cfg.get("uri"));
|
||||
cfg.getOptional("database_name").ifPresent(builder::withDatabaseName);
|
||||
cfg.getOptional("database").ifPresent(builder::withDatabaseName);
|
||||
@ -95,7 +87,7 @@ public class MilvusSpace implements AutoCloseable {
|
||||
String tokenSummary = Optional.ofNullable(builder.getToken())
|
||||
.map(MilvusAdapterUtils::maskDigits).orElse("[none]");
|
||||
logger.info("{}: Creating new Milvus/Zilliz Client with (masked) token [{}], uri/endpoint [{}]",
|
||||
this.name, tokenSummary, builder.getUri());
|
||||
this.getName(), tokenSummary, builder.getUri());
|
||||
return new MilvusServiceClient(connectParams);
|
||||
}
|
||||
|
||||
|
@ -17,20 +17,15 @@
|
||||
package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.common.clientenum.ConsistencyLevelEnum;
|
||||
import io.milvus.param.alias.AlterAliasParam;
|
||||
import io.milvus.param.collection.CreateCollectionParam;
|
||||
import io.milvus.param.collection.FieldType;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusAlterAliasOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusCreateCollectionOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class MilvusAlterAliasOpDispenser extends MilvusBaseOpDispenser<AlterAliasParam> {
|
||||
@ -38,8 +33,10 @@ public class MilvusAlterAliasOpDispenser extends MilvusBaseOpDispenser<AlterAlia
|
||||
|
||||
public MilvusAlterAliasOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,7 +50,7 @@ public class MilvusAlterAliasOpDispenser extends MilvusBaseOpDispenser<AlterAlia
|
||||
// Add enhancement functions here
|
||||
|
||||
ebF = op.enhanceFuncOptionally(
|
||||
ebF,List.of("collection_name","collection"),String.class,AlterAliasParam.Builder::withCollectionName);
|
||||
ebF,"collection",String.class,AlterAliasParam.Builder::withCollectionName);
|
||||
|
||||
final LongFunction<AlterAliasParam.Builder> lastF = ebF;
|
||||
final LongFunction<AlterAliasParam> collectionParamF = l -> lastF.apply(l).build();
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.AlterCollectionParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusAlterCollectionOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusAlterCollectionOpDispenser extends MilvusBaseOpDispenser<Alte
|
||||
|
||||
public MilvusAlterCollectionOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -33,16 +33,15 @@ public abstract class MilvusBaseOpDispenser<T> extends BaseOpDispenser<MilvusBas
|
||||
private final LongFunction<? extends MilvusBaseOp<T>> opF;
|
||||
private final LongFunction<T> paramF;
|
||||
|
||||
protected MilvusBaseOpDispenser(MilvusDriverAdapter adapter, ParsedOp op, LongFunction<String> targetF) {
|
||||
super((DriverAdapter)adapter, op);
|
||||
protected MilvusBaseOpDispenser(MilvusDriverAdapter adapter, ParsedOp op,
|
||||
LongFunction<String> targetF,
|
||||
LongFunction<MilvusSpace> spaceF) {
|
||||
super(adapter,op,spaceF);
|
||||
this.mzSpaceFunction = adapter.getSpaceFunc(op);
|
||||
this.clientFunction = (long l) -> this.mzSpaceFunction.apply(l).getClient();
|
||||
this.paramF = getParamFunc(this.clientFunction,op,targetF);
|
||||
this.opF = createOpFunc(paramF, this.clientFunction, op, targetF);
|
||||
}
|
||||
protected MilvusDriverAdapter getDriverAdapter() {
|
||||
return (MilvusDriverAdapter) adapter;
|
||||
}
|
||||
|
||||
public abstract LongFunction<T> getParamFunc(
|
||||
LongFunction<MilvusServiceClient> clientF,
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.bulkinsert.BulkInsertParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBulkInsertOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -31,8 +32,10 @@ public class MilvusBulkInsertOpDispenser extends MilvusBaseOpDispenser<BulkInser
|
||||
|
||||
public MilvusBulkInsertOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,7 +56,7 @@ public class MilvusBulkInsertOpDispenser extends MilvusBaseOpDispenser<BulkInser
|
||||
}
|
||||
);
|
||||
ebF = op.enhanceFuncOptionally(ebF, "files", List.class, BulkInsertParam.Builder::withFiles);
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("partition_name", "partition"), String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "partition", String.class,
|
||||
BulkInsertParam.Builder::withPartitionName);
|
||||
LongFunction<BulkInsertParam.Builder> finalEbF = ebF;
|
||||
return l -> finalEbF.apply(l).build();
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.alias.CreateAliasParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusCreateAliasOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,10 @@ public class MilvusCreateAliasOpDispenser extends MilvusBaseOpDispenser<CreateAl
|
||||
|
||||
public MilvusCreateAliasOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,7 +45,7 @@ public class MilvusCreateAliasOpDispenser extends MilvusBaseOpDispenser<CreateAl
|
||||
) {
|
||||
LongFunction<CreateAliasParam.Builder> ebF =
|
||||
l -> CreateAliasParam.newBuilder().withAlias(targetF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("collection_name","collection"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "collection",String.class,
|
||||
CreateAliasParam.Builder::withCollectionName);
|
||||
|
||||
|
||||
|
@ -23,6 +23,7 @@ import io.milvus.param.collection.CollectionSchemaParam;
|
||||
import io.milvus.param.collection.CreateCollectionParam;
|
||||
import io.milvus.param.collection.FieldType;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusCreateCollectionOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -38,16 +39,20 @@ public class MilvusCreateCollectionOpDispenser extends MilvusBaseOpDispenser<Cre
|
||||
private static final Logger logger = LogManager.getLogger(MilvusCreateCollectionOpDispenser.class);
|
||||
|
||||
/**
|
||||
* Create a new MilvusCreateCollectionOpDispenser subclassed from {@link MilvusBaseOpDispenser}.
|
||||
*
|
||||
* @param adapter The associated {@link MilvusDriverAdapter}
|
||||
* @param op The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
* @param targetFunction A LongFunction that returns the specified Milvus Index for this Op
|
||||
Create a new MilvusCreateCollectionOpDispenser subclassed from {@link MilvusBaseOpDispenser}.
|
||||
@param adapter
|
||||
The associated {@link MilvusDriverAdapter}
|
||||
@param op
|
||||
The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
@param targetFunction
|
||||
A LongFunction that returns the specified Milvus Index for this Op
|
||||
*/
|
||||
public MilvusCreateCollectionOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -111,7 +116,7 @@ public class MilvusCreateCollectionOpDispenser extends MilvusBaseOpDispenser<Cre
|
||||
.ifPresent((Number n) -> builder.withMaxLength(n.intValue()));
|
||||
fieldspec.getOptionalStaticConfig("max_capacity", Number.class)
|
||||
.ifPresent((Number n) -> builder.withMaxCapacity(n.intValue()));
|
||||
fieldspec.getOptionalStaticValue(List.of("partition_key", "partition"), Boolean.class)
|
||||
fieldspec.getOptionalStaticValue("partition", Boolean.class)
|
||||
.ifPresent(builder::withPartitionKey);
|
||||
fieldspec.getOptionalStaticValue("dimension", Number.class)
|
||||
.ifPresent((Number n) -> builder.withDimension(n.intValue()));
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.credential.CreateCredentialParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusCreateCredentialOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusCreateCredentialOpDispenser extends MilvusBaseOpDispenser<Cre
|
||||
|
||||
public MilvusCreateCredentialOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.CreateDatabaseParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusCreateDatabaseOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusCreateDatabaseOpDispenser extends MilvusBaseOpDispenser<Creat
|
||||
|
||||
public MilvusCreateDatabaseOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ import io.milvus.param.IndexType;
|
||||
import io.milvus.param.MetricType;
|
||||
import io.milvus.param.index.CreateIndexParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusCreateIndexOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -34,18 +35,20 @@ public class MilvusCreateIndexOpDispenser extends MilvusBaseOpDispenser<CreateIn
|
||||
private static final Logger logger = LogManager.getLogger(MilvusCreateIndexOpDispenser.class);
|
||||
|
||||
/**
|
||||
* Create a new MilvusCreateIndexOpDispenser subclassed from {@link MilvusBaseOpDispenser}.
|
||||
*
|
||||
* @param adapter The associated {@link MilvusDriverAdapter}
|
||||
* @param op The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
* @param targetFunction A LongFunction that returns the specified Milvus Index for this Op
|
||||
Create a new MilvusCreateIndexOpDispenser subclassed from {@link MilvusBaseOpDispenser}.
|
||||
@param adapter
|
||||
The associated {@link MilvusDriverAdapter}
|
||||
@param op
|
||||
The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
@param targetFunction
|
||||
A LongFunction that returns the specified Milvus Index for this Op
|
||||
*/
|
||||
public MilvusCreateIndexOpDispenser(
|
||||
MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction
|
||||
LongFunction<String> targetFunction, LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction);
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,7 +56,7 @@ public class MilvusCreateIndexOpDispenser extends MilvusBaseOpDispenser<CreateIn
|
||||
LongFunction<CreateIndexParam.Builder> bF =
|
||||
l -> CreateIndexParam.newBuilder().withIndexName(targetF.apply(l));
|
||||
|
||||
bF = op.enhanceFunc(bF, List.of("collection", "collection_name"), String.class,
|
||||
bF = op.enhanceFunc(bF, "collection", String.class,
|
||||
CreateIndexParam.Builder::withCollectionName);
|
||||
bF = op.enhanceFunc(bF, "field_name", String.class, CreateIndexParam.Builder::withFieldName);
|
||||
bF = op.enhanceEnumOptionally(bF, "index_type", IndexType.class, CreateIndexParam.Builder::withIndexType);
|
||||
@ -64,7 +67,7 @@ public class MilvusCreateIndexOpDispenser extends MilvusBaseOpDispenser<CreateIn
|
||||
(CreateIndexParam.Builder b, Number n) -> b.withSyncWaitingInterval(n.longValue()));
|
||||
bF = op.enhanceFuncOptionally(bF, "sync_waiting_timeout", Number.class,
|
||||
(CreateIndexParam.Builder b, Number n) -> b.withSyncWaitingTimeout(n.longValue()));
|
||||
bF = op.enhanceFuncOptionally(bF, List.of("database", "database_name"), String.class,
|
||||
bF = op.enhanceFuncOptionally(bF, "database", String.class,
|
||||
CreateIndexParam.Builder::withDatabaseName);
|
||||
LongFunction<CreateIndexParam.Builder> finalBF1 = bF;
|
||||
return l -> finalBF1.apply(l).build();
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.partition.CreatePartitionParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusCreatePartitionOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,10 @@ public class MilvusCreatePartitionOpDispenser extends MilvusBaseOpDispenser<Crea
|
||||
|
||||
public MilvusCreatePartitionOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,7 +46,7 @@ public class MilvusCreatePartitionOpDispenser extends MilvusBaseOpDispenser<Crea
|
||||
LongFunction<CreatePartitionParam.Builder> ebF =
|
||||
l -> CreatePartitionParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
// Add enhancement functions here
|
||||
ebF = op.enhanceFunc(ebF, List.of("collection","collection_name"),String.class,
|
||||
ebF = op.enhanceFunc(ebF, "collection",String.class,
|
||||
CreatePartitionParam.Builder::withCollectionName);
|
||||
|
||||
final LongFunction<CreatePartitionParam.Builder> lastF = ebF;
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.credential.DeleteCredentialParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusDeleteCredentialOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusDeleteCredentialOpDispenser extends MilvusBaseOpDispenser<Del
|
||||
|
||||
public MilvusDeleteCredentialOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.dml.DeleteParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusDeleteParamOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -32,15 +33,17 @@ import java.util.function.LongFunction;
|
||||
public class MilvusDeleteOpDispenser extends MilvusBaseOpDispenser<DeleteParam> {
|
||||
public MilvusDeleteOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LongFunction<DeleteParam> getParamFunc(LongFunction<MilvusServiceClient> clientF, ParsedOp op, LongFunction<String> targetF) {
|
||||
LongFunction<DeleteParam.Builder> f =
|
||||
l -> DeleteParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
f = op.enhanceFuncOptionally(f, List.of("partition_name","partition"), String.class,
|
||||
f = op.enhanceFuncOptionally(f, "partition", String.class,
|
||||
DeleteParam.Builder::withPartitionName);
|
||||
f = op.enhanceFuncOptionally(f, "expression", String.class, DeleteParam.Builder::withExpr);
|
||||
f = op.enhanceFuncOptionally(f, "expr", String.class, Builder::withExpr);
|
||||
|
@ -18,8 +18,8 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.DescribeCollectionParam;
|
||||
import io.milvus.param.partition.CreatePartitionParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusDescribeCollectionOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -31,8 +31,10 @@ public class MilvusDescribeCollectionOpDispenser extends MilvusBaseOpDispenser<D
|
||||
|
||||
public MilvusDescribeCollectionOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -44,7 +46,7 @@ public class MilvusDescribeCollectionOpDispenser extends MilvusBaseOpDispenser<D
|
||||
LongFunction<DescribeCollectionParam.Builder> ebF =
|
||||
l -> DescribeCollectionParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("database","database_name"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "database",String.class,
|
||||
DescribeCollectionParam.Builder::withDatabaseName);
|
||||
|
||||
final LongFunction<DescribeCollectionParam.Builder> lastF = ebF;
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.index.DescribeIndexParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusDescribeIndexOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -35,8 +36,10 @@ public class MilvusDescribeIndexOpDispenser extends MilvusBaseOpDispenser<Descri
|
||||
|
||||
public MilvusDescribeIndexOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
|
||||
op.getOptionalStaticValue("await_timeout", Number.class)
|
||||
.map(Number::doubleValue)
|
||||
@ -53,9 +56,9 @@ public class MilvusDescribeIndexOpDispenser extends MilvusBaseOpDispenser<Descri
|
||||
) {
|
||||
LongFunction<DescribeIndexParam.Builder> ebF =
|
||||
l -> DescribeIndexParam.newBuilder().withIndexName(targetF.apply(l));
|
||||
ebF = op.enhanceFunc(ebF, List.of("collection","collection_name"), String.class,
|
||||
ebF = op.enhanceFunc(ebF, "collection", String.class,
|
||||
DescribeIndexParam.Builder::withCollectionName);
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("database_name","database"), String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "database", String.class,
|
||||
DescribeIndexParam.Builder::withDatabaseName);
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.alias.DropAliasParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusDropAliasOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusDropAliasOpDispenser extends MilvusBaseOpDispenser<DropAliasP
|
||||
|
||||
public MilvusDropAliasOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.DropCollectionParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusDropCollectionOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -34,18 +35,23 @@ public class MilvusDropCollectionOpDispenser extends MilvusBaseOpDispenser<DropC
|
||||
private static final Logger logger = LogManager.getLogger(MilvusDropCollectionOpDispenser.class);
|
||||
|
||||
/**
|
||||
* <P>Create a new {@link MilvusDropCollectionOpDispenser} subclassed from {@link MilvusBaseOpDispenser}.</P>
|
||||
*
|
||||
* <P>{@see <A HREF="https://milvus.io/docs/drop_collection.md">Drop Collection</A>}</P>
|
||||
*
|
||||
* @param adapter The associated {@link MilvusDriverAdapter}
|
||||
* @param op The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
* @param targetFunction A LongFunction that returns the specified Milvus Index for this Op
|
||||
<P>Create a new {@link MilvusDropCollectionOpDispenser} subclassed from
|
||||
{@link MilvusBaseOpDispenser}.</P>
|
||||
|
||||
<P>{@see <A HREF="https://milvus.io/docs/drop_collection.md">Drop Collection</A>}</P>
|
||||
@param adapter
|
||||
The associated {@link MilvusDriverAdapter}
|
||||
@param op
|
||||
The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
@param targetFunction
|
||||
A LongFunction that returns the specified Milvus Index for this Op
|
||||
*/
|
||||
public MilvusDropCollectionOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -55,7 +61,7 @@ public class MilvusDropCollectionOpDispenser extends MilvusBaseOpDispenser<DropC
|
||||
LongFunction<String> targetF) {
|
||||
LongFunction<DropCollectionParam.Builder> f =
|
||||
l -> DropCollectionParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
f = op.enhanceFuncOptionally(f, List.of("database","database_name"),String.class,
|
||||
f = op.enhanceFuncOptionally(f, "database",String.class,
|
||||
DropCollectionParam.Builder::withDatabaseName);
|
||||
LongFunction<DropCollectionParam.Builder> finalF = f;
|
||||
return l -> finalF.apply(l).build();
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.DropDatabaseParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusDropDatabaseOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusDropDatabaseOpDispenser extends MilvusBaseOpDispenser<DropDat
|
||||
|
||||
public MilvusDropDatabaseOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,39 +21,38 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.index.DropIndexParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusDropIndexOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class MilvusDropIndexOpDispenser extends MilvusBaseOpDispenser<DropIndexParam> {
|
||||
/**
|
||||
* <P>Create a new MilvusDeleteOpDispenser subclassed from {@link MilvusBaseOpDispenser}.</P>
|
||||
* <P>{@see <a href="https://milvus.io/docs/drop_collection.md">Drop Index</a>}</P>
|
||||
*
|
||||
*
|
||||
* @param adapter
|
||||
* The associated {@link MilvusDriverAdapter}
|
||||
* @param op
|
||||
* The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
* @param targetFunction
|
||||
* A LongFunction that returns the specified Milvus Index for this Op
|
||||
<P>Create a new MilvusDeleteOpDispenser subclassed from {@link MilvusBaseOpDispenser}.</P>
|
||||
<P>{@see <a href="https://milvus.io/docs/drop_collection.md">Drop Index</a>}</P>
|
||||
@param adapter
|
||||
The associated {@link MilvusDriverAdapter}
|
||||
@param op
|
||||
The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
@param targetFunction
|
||||
A LongFunction that returns the specified Milvus Index for this Op
|
||||
*/
|
||||
public MilvusDropIndexOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LongFunction<DropIndexParam> getParamFunc(LongFunction<MilvusServiceClient> clientF, ParsedOp op, LongFunction<String> targetF) {
|
||||
LongFunction<DropIndexParam.Builder> f =
|
||||
l -> DropIndexParam.newBuilder().withIndexName(targetF.apply(l));
|
||||
f = op.enhanceFunc(f, List.of("collection_name","collection"),String.class,
|
||||
f = op.enhanceFunc(f, "collection",String.class,
|
||||
DropIndexParam.Builder::withCollectionName);
|
||||
LongFunction<DropIndexParam.Builder> finalF = f;
|
||||
return l -> finalF.apply(1).build();
|
||||
|
@ -17,9 +17,9 @@
|
||||
package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.partition.CreatePartitionParam;
|
||||
import io.milvus.param.partition.DropPartitionParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusDropPartitionOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -31,8 +31,10 @@ public class MilvusDropPartitionOpDispenser extends MilvusBaseOpDispenser<DropPa
|
||||
|
||||
public MilvusDropPartitionOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,7 +45,7 @@ public class MilvusDropPartitionOpDispenser extends MilvusBaseOpDispenser<DropPa
|
||||
) {
|
||||
LongFunction<DropPartitionParam.Builder> ebF =
|
||||
l -> DropPartitionParam.newBuilder().withPartitionName(targetF.apply(l));
|
||||
ebF = op.enhanceFunc(ebF, List.of("collection_name","collection"),String.class,
|
||||
ebF = op.enhanceFunc(ebF, "collection",String.class,
|
||||
DropPartitionParam.Builder::withCollectionName);
|
||||
|
||||
final LongFunction<DropPartitionParam.Builder> lastF = ebF;
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.FlushParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusFlushOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -31,8 +32,10 @@ public class MilvusFlushOpDispenser extends MilvusBaseOpDispenser<FlushParam> {
|
||||
|
||||
public MilvusFlushOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -51,7 +54,7 @@ public class MilvusFlushOpDispenser extends MilvusBaseOpDispenser<FlushParam> {
|
||||
};
|
||||
LongFunction<FlushParam.Builder> finalEbF = ebF;
|
||||
ebF = l -> finalEbF.apply(l).withCollectionNames(cnames.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("database_name", "database"), String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "database", String.class,
|
||||
FlushParam.Builder::withDatabaseName);
|
||||
ebF = op.enhanceFuncOptionally(ebF, "sync_flush_waiting_interval", Number.class,
|
||||
(FlushParam.Builder b, Number n) -> b.withSyncFlushWaitingInterval(n.longValue()));
|
||||
|
@ -19,9 +19,9 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.bulkinsert.GetBulkInsertStateParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetBulkInsertStateOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetCollectionStatisticsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
|
||||
import java.util.function.LongFunction;
|
||||
@ -30,8 +30,10 @@ public class MilvusGetBulkInsertStateOpDispenser extends MilvusBaseOpDispenser<G
|
||||
|
||||
public MilvusGetBulkInsertStateOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.GetCollectionStatisticsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetCollectionStatisticsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,10 @@ public class MilvusGetCollectionStatisticsOpDispenser extends MilvusBaseOpDispen
|
||||
|
||||
public MilvusGetCollectionStatisticsOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,7 +46,7 @@ public class MilvusGetCollectionStatisticsOpDispenser extends MilvusBaseOpDispen
|
||||
LongFunction<GetCollectionStatisticsParam.Builder> ebF =
|
||||
l -> GetCollectionStatisticsParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
// Add enhancement functions here
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("database_name","database"), String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "database", String.class,
|
||||
GetCollectionStatisticsParam.Builder::withDatabaseName);
|
||||
ebF = op.enhanceFuncOptionally(ebF,"flush",Boolean.class,GetCollectionStatisticsParam.Builder::withFlush);
|
||||
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.control.GetCompactionStateParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetCompactionStateOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusGetCompactionStateOpDispenser extends MilvusBaseOpDispenser<G
|
||||
|
||||
public MilvusGetCompactionStateOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,8 +18,8 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.control.GetCompactionPlansParam;
|
||||
import io.milvus.param.control.GetCompactionPlansParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetCompactionStateWithPlansOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +30,10 @@ public class MilvusGetCompactionStateWithPlansOpDispenser extends MilvusBaseOpDi
|
||||
|
||||
public MilvusGetCompactionStateWithPlansOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.control.GetFlushAllStateParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetFlushAllStateOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusGetFlushAllStateOpDispenser extends MilvusBaseOpDispenser<Get
|
||||
|
||||
public MilvusGetFlushAllStateOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.control.GetFlushStateParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetFlushStateOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -31,8 +32,9 @@ public class MilvusGetFlushStateOpDispenser extends MilvusBaseOpDispenser<GetFlu
|
||||
|
||||
public MilvusGetFlushStateOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -52,7 +54,7 @@ public class MilvusGetFlushStateOpDispenser extends MilvusBaseOpDispenser<GetFlu
|
||||
};
|
||||
LongFunction<GetFlushStateParam.Builder> finalEbF = ebF;
|
||||
ebF = l -> finalEbF.apply(l).withSegmentIDs(idsF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("collection", "collection_name"), String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "collection", String.class,
|
||||
GetFlushStateParam.Builder::withCollectionName);
|
||||
ebF = op.enhanceFuncOptionally(ebF, "flush_ts", Number.class,
|
||||
(GetFlushStateParam.Builder b, Number n) -> b.withFlushTs(n.longValue()));
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.index.GetIndexBuildProgressParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetIndexBuildProgressOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,10 @@ public class MilvusGetIndexBuildProgressOpDispenser extends MilvusBaseOpDispense
|
||||
|
||||
public MilvusGetIndexBuildProgressOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,7 +45,7 @@ public class MilvusGetIndexBuildProgressOpDispenser extends MilvusBaseOpDispense
|
||||
) {
|
||||
LongFunction<GetIndexBuildProgressParam.Builder> ebF =
|
||||
l -> GetIndexBuildProgressParam.newBuilder().withIndexName(targetF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("collection_name","collection"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "collection",String.class,
|
||||
GetIndexBuildProgressParam.Builder::withCollectionName);
|
||||
|
||||
final LongFunction<GetIndexBuildProgressParam.Builder> lastF = ebF;
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.index.GetIndexStateParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetIndexStateOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,10 @@ public class MilvusGetIndexStateOpDispenser extends MilvusBaseOpDispenser<GetInd
|
||||
|
||||
public MilvusGetIndexStateOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,7 +45,7 @@ public class MilvusGetIndexStateOpDispenser extends MilvusBaseOpDispenser<GetInd
|
||||
) {
|
||||
LongFunction<GetIndexStateParam.Builder> ebF =
|
||||
l -> GetIndexStateParam.newBuilder().withIndexName(targetF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("collection_name","collection"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "collection",String.class,
|
||||
GetIndexStateParam.Builder::withCollectionName);
|
||||
final LongFunction<GetIndexStateParam.Builder> lastF = ebF;
|
||||
final LongFunction<GetIndexStateParam> collectionParamF = l -> lastF.apply(l).build();
|
||||
|
@ -21,6 +21,7 @@ import io.milvus.grpc.LoadState;
|
||||
import io.milvus.param.collection.GetLoadStateParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusAdapterUtils;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetLoadStateOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -40,15 +41,17 @@ public class MilvusGetLoadStateOpDispenser extends MilvusBaseOpDispenser<GetLoad
|
||||
|
||||
public MilvusGetLoadStateOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
op.getOptionalStaticValue("await_timeout", Number.class)
|
||||
.map(Number::doubleValue)
|
||||
.ifPresent(v->this.awaitTimeout=Duration.of((long)(v*1000),ChronoUnit.MILLIS));
|
||||
op.getOptionalStaticValue("await_interval", Number.class)
|
||||
.map(Number::doubleValue).ifPresent(v->this.awaitInterval=Duration.of((long)(v*1000),ChronoUnit.MILLIS));
|
||||
op.getOptionalStaticValue("await_state", String.class).ifPresent(s -> {
|
||||
var spec = s.toLowerCase();
|
||||
String spec = s.toLowerCase();
|
||||
for (LoadState value : LoadState.values()) {
|
||||
if (value.name().toLowerCase().equals(spec) || value.name().toLowerCase().equals("loadstate" + spec)) {
|
||||
this.awaitState = value;
|
||||
@ -70,7 +73,7 @@ public class MilvusGetLoadStateOpDispenser extends MilvusBaseOpDispenser<GetLoad
|
||||
) {
|
||||
LongFunction<GetLoadStateParam.Builder> ebF =
|
||||
l -> GetLoadStateParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("database_name", "database"), String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "database", String.class,
|
||||
GetLoadStateParam.Builder::withDatabaseName);
|
||||
|
||||
Optional<LongFunction<String>> partitionsF = op.getAsOptionalFunction("partition_name", String.class);
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.GetLoadingProgressParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetLoadingProgressOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,10 @@ public class MilvusGetLoadingProgressOpDispenser extends MilvusBaseOpDispenser<G
|
||||
|
||||
public MilvusGetLoadingProgressOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,7 +45,7 @@ public class MilvusGetLoadingProgressOpDispenser extends MilvusBaseOpDispenser<G
|
||||
) {
|
||||
LongFunction<GetLoadingProgressParam.Builder> ebF =
|
||||
l -> GetLoadingProgressParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("partition_names","partitions"), List.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "partitions", List.class,
|
||||
GetLoadingProgressParam.Builder::withPartitionNames);
|
||||
final LongFunction<GetLoadingProgressParam.Builder> lastF = ebF;
|
||||
return l -> lastF.apply(l).build();
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.control.GetMetricsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetMetricsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusGetMetricsOpDispenser extends MilvusBaseOpDispenser<GetMetric
|
||||
|
||||
public MilvusGetMetricsOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ import io.milvus.common.clientenum.ConsistencyLevelEnum;
|
||||
import io.milvus.param.highlevel.dml.GetIdsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusAdapterUtils;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -46,8 +47,10 @@ public class MilvusGetOpDispenser extends MilvusBaseOpDispenser<GetIdsParam> {
|
||||
|
||||
public MilvusGetOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -75,7 +78,7 @@ public class MilvusGetOpDispenser extends MilvusBaseOpDispenser<GetIdsParam> {
|
||||
LongFunction<GetIdsParam.Builder> finalEbF2 = ebF;
|
||||
ebF = l -> finalEbF2.apply(l).withPrimaryIds(pidsF.apply(l));
|
||||
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("collection_name", "collection"), String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "collection", String.class,
|
||||
GetIdsParam.Builder::withCollectionName);
|
||||
ebF = op.enhanceEnumOptionally(ebF, "consistency_level", ConsistencyLevelEnum.class,
|
||||
GetIdsParam.Builder::withConsistencyLevel);
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.partition.GetPartitionStatisticsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetPartitionStatisticsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,10 @@ public class MilvusGetPartitionStatisticsOpDispenser extends MilvusBaseOpDispens
|
||||
|
||||
public MilvusGetPartitionStatisticsOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,7 +45,7 @@ public class MilvusGetPartitionStatisticsOpDispenser extends MilvusBaseOpDispens
|
||||
) {
|
||||
LongFunction<GetPartitionStatisticsParam.Builder> ebF =
|
||||
l -> GetPartitionStatisticsParam.newBuilder().withPartitionName(targetF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("collection_name","collection"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "collection",String.class,
|
||||
GetPartitionStatisticsParam.Builder::withCollectionName);
|
||||
ebF = op.enhanceFuncOptionally(ebF, "flush",Boolean.class, GetPartitionStatisticsParam.Builder::withFlush);
|
||||
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.partition.GetPartitionStatisticsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetPartitionStatisticsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,10 @@ public class MilvusGetPersistentSegmentInfoOpDispenser extends MilvusBaseOpDispe
|
||||
|
||||
public MilvusGetPersistentSegmentInfoOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -44,7 +47,7 @@ public class MilvusGetPersistentSegmentInfoOpDispenser extends MilvusBaseOpDispe
|
||||
l -> GetPartitionStatisticsParam.newBuilder().withPartitionName(targetF.apply(l));
|
||||
|
||||
ebF = op.enhanceFuncOptionally(ebF,"flush",Boolean.class,GetPartitionStatisticsParam.Builder::withFlush);
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("collection_name","collection"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "collection",String.class,
|
||||
GetPartitionStatisticsParam.Builder::withCollectionName);
|
||||
|
||||
final LongFunction<GetPartitionStatisticsParam.Builder> lastF = ebF;
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.control.GetQuerySegmentInfoParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetQuerySegmentInfoOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusGetQuerySegmentInfoOpDispenser extends MilvusBaseOpDispenser<
|
||||
|
||||
public MilvusGetQuerySegmentInfoOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.control.GetReplicasParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetReplicasOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusGetReplicasOpDispenser extends MilvusBaseOpDispenser<GetRepli
|
||||
|
||||
public MilvusGetReplicasOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.partition.HasPartitionParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusHasPartitionOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,9 @@ public class MilvusHasPartitionOpDispenser extends MilvusBaseOpDispenser<HasPart
|
||||
|
||||
public MilvusHasPartitionOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,7 +44,7 @@ public class MilvusHasPartitionOpDispenser extends MilvusBaseOpDispenser<HasPart
|
||||
) {
|
||||
LongFunction<HasPartitionParam.Builder> ebF =
|
||||
l -> HasPartitionParam.newBuilder().withPartitionName(targetF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("collection_name","collection"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "collection",String.class,
|
||||
HasPartitionParam.Builder::withCollectionName);
|
||||
|
||||
final LongFunction<HasPartitionParam.Builder> lastF = ebF;
|
||||
|
@ -22,6 +22,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.dml.InsertParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusInsertOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,9 +30,7 @@ import io.nosqlbench.nb.api.errors.OpConfigError;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
@ -39,16 +38,20 @@ public class MilvusInsertOpDispenser extends MilvusBaseOpDispenser<InsertParam>
|
||||
private static final Logger logger = LogManager.getLogger(MilvusInsertOpDispenser.class);
|
||||
|
||||
/**
|
||||
* Create a new MilvusDeleteOpDispenser subclassed from {@link MilvusBaseOpDispenser}.
|
||||
*
|
||||
* @param adapter The associated {@link MilvusDriverAdapter}
|
||||
* @param op The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
* @param targetFunction A LongFunction that returns the specified Milvus Index for this Op
|
||||
Create a new MilvusDeleteOpDispenser subclassed from {@link MilvusBaseOpDispenser}.
|
||||
@param adapter
|
||||
The associated {@link MilvusDriverAdapter}
|
||||
@param op
|
||||
The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
@param targetFunction
|
||||
A LongFunction that returns the specified Milvus Index for this Op
|
||||
*/
|
||||
public MilvusInsertOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -57,11 +60,11 @@ public class MilvusInsertOpDispenser extends MilvusBaseOpDispenser<InsertParam>
|
||||
l -> InsertParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
|
||||
f = op.enhanceFuncOptionally(
|
||||
f, List.of("partition_name","partition"), String.class,
|
||||
f, "partition", String.class,
|
||||
InsertParam.Builder::withPartitionName
|
||||
);
|
||||
f = op.enhanceFuncOptionally(
|
||||
f, List.of("database_name","database"), String.class,
|
||||
f, "database", String.class,
|
||||
InsertParam.Builder::withDatabaseName
|
||||
);
|
||||
|
||||
@ -76,13 +79,13 @@ public class MilvusInsertOpDispenser extends MilvusBaseOpDispenser<InsertParam>
|
||||
}
|
||||
|
||||
if (optionalRowsF.isPresent()) {
|
||||
var rf = optionalRowsF.get();
|
||||
LongFunction<List<JSONObject>> rf = optionalRowsF.get();
|
||||
LongFunction<InsertParam.Builder> finalF2 = f;
|
||||
f = l -> finalF2.apply(l).withRows(rf.apply(l));
|
||||
}
|
||||
|
||||
if (optionalFieldsF.isPresent()) {
|
||||
var ff = optionalFieldsF.get();
|
||||
LongFunction<List<InsertParam.Field>> ff = optionalFieldsF.get();
|
||||
LongFunction<InsertParam.Builder> finalF3 = f;
|
||||
f = l -> finalF3.apply(l).withFields(ff.apply(l));
|
||||
}
|
||||
|
@ -18,43 +18,38 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
*/
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.dml.InsertParam;
|
||||
import io.milvus.param.highlevel.dml.InsertRowsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusInsertOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusInsertRowsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
import io.nosqlbench.nb.api.errors.OpConfigError;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.LongFunction;
|
||||
|
||||
public class MilvusInsertRowsOpDispenser extends MilvusBaseOpDispenser<InsertRowsParam> {
|
||||
private static final Logger logger = LogManager.getLogger(MilvusInsertRowsOpDispenser.class);
|
||||
|
||||
/**
|
||||
* Create a new MilvusDeleteOpDispenser subclassed from {@link MilvusBaseOpDispenser}.
|
||||
*
|
||||
* @param adapter
|
||||
* The associated {@link MilvusDriverAdapter}
|
||||
* @param op
|
||||
* The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
* @param targetFunction
|
||||
* A LongFunction that returns the specified Milvus Index for this Op
|
||||
Create a new MilvusDeleteOpDispenser subclassed from {@link MilvusBaseOpDispenser}.
|
||||
@param adapter
|
||||
The associated {@link MilvusDriverAdapter}
|
||||
@param op
|
||||
The {@link ParsedOp} encapsulating the activity for this cycle
|
||||
@param targetFunction
|
||||
A LongFunction that returns the specified Milvus Index for this Op
|
||||
*/
|
||||
public MilvusInsertRowsOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction,spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.bulkinsert.ListBulkInsertTasksParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusListBulkInsertTasksOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusListBulkInsertTasksOpDispenser extends MilvusBaseOpDispenser<
|
||||
|
||||
public MilvusListBulkInsertTasksOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.highlevel.collection.ListCollectionsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusListCollectionsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusListCollectionsOpDispenser extends MilvusBaseOpDispenser<List
|
||||
|
||||
public MilvusListCollectionsOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.credential.ListCredUsersParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusListCredUsersOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusListCredUsersOpDispenser extends MilvusBaseOpDispenser<ListCr
|
||||
|
||||
public MilvusListCredUsersOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -18,6 +18,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusListDatabasesOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -28,8 +29,10 @@ public class MilvusListDatabasesOpDispenser extends MilvusBaseOpDispenser<Object
|
||||
|
||||
public MilvusListDatabasesOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.control.LoadBalanceParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusLoadBalanceOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusLoadBalanceOpDispenser extends MilvusBaseOpDispenser<LoadBala
|
||||
|
||||
public MilvusLoadBalanceOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.LoadCollectionParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusLoadCollectionOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -30,8 +31,10 @@ public class MilvusLoadCollectionOpDispenser extends MilvusBaseOpDispenser<LoadC
|
||||
|
||||
public MilvusLoadCollectionOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,7 +46,7 @@ public class MilvusLoadCollectionOpDispenser extends MilvusBaseOpDispenser<LoadC
|
||||
LongFunction<LoadCollectionParam.Builder> ebF =
|
||||
l -> LoadCollectionParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("database_name", "database"), String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "database", String.class,
|
||||
LoadCollectionParam.Builder::withDatabaseName);
|
||||
|
||||
ebF = op.enhanceFuncOptionally(ebF, "refresh", Boolean.class, LoadCollectionParam.Builder::withRefresh);
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.partition.LoadPartitionsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusLoadPartitionsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,16 +30,15 @@ import java.util.function.LongFunction;
|
||||
public class MilvusLoadPartitionsOpDispenser extends MilvusBaseOpDispenser<LoadPartitionsParam> {
|
||||
|
||||
/**
|
||||
* TODO: Refactor this class after API refinements for more type and target variation
|
||||
*
|
||||
* @param adapter
|
||||
* @param op
|
||||
* @param targetFunction
|
||||
TODO: Refactor this class after API refinements for more type and target variation
|
||||
@param adapter
|
||||
*/
|
||||
public MilvusLoadPartitionsOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -50,14 +50,14 @@ public class MilvusLoadPartitionsOpDispenser extends MilvusBaseOpDispenser<LoadP
|
||||
LongFunction<LoadPartitionsParam.Builder> ebF =
|
||||
l -> LoadPartitionsParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
|
||||
ebF = op.enhanceFunc(ebF, List.of("partition_names", "partitions"), List.class,
|
||||
ebF = op.enhanceFunc(ebF, "partitions", List.class,
|
||||
LoadPartitionsParam.Builder::withPartitionNames);
|
||||
ebF = op.enhanceFuncOptionally(
|
||||
ebF, "resource_groups", List.class,
|
||||
LoadPartitionsParam.Builder::withResourceGroups
|
||||
);
|
||||
ebF = op.enhanceFuncOptionally(
|
||||
ebF, List.of("database_name", "database"), String.class,
|
||||
ebF, "database", String.class,
|
||||
LoadPartitionsParam.Builder::withDatabaseName
|
||||
);
|
||||
ebF = op.enhanceFuncOptionally(ebF, "refresh", Boolean.class, LoadPartitionsParam.Builder::withRefresh);
|
||||
|
@ -19,8 +19,10 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.GetLoadingProgressParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusGetLoadingProgressOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusSearchOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
|
||||
import java.util.List;
|
||||
@ -30,8 +32,9 @@ public class MilvusLoadingProgressOpDispenser extends MilvusBaseOpDispenser<GetL
|
||||
|
||||
public MilvusLoadingProgressOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,7 +45,7 @@ public class MilvusLoadingProgressOpDispenser extends MilvusBaseOpDispenser<GetL
|
||||
) {
|
||||
LongFunction<GetLoadingProgressParam.Builder> ebF =
|
||||
l -> GetLoadingProgressParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF,List.of("partition_names","partitions"), List.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF,"partitions", List.class,
|
||||
GetLoadingProgressParam.Builder::withPartitionNames);
|
||||
|
||||
final LongFunction<GetLoadingProgressParam.Builder> lastF = ebF;
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.control.ManualCompactParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusManualCompactOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusManualCompactOpDispenser extends MilvusBaseOpDispenser<Manual
|
||||
|
||||
public MilvusManualCompactOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.common.clientenum.ConsistencyLevelEnum;
|
||||
import io.milvus.param.dml.QueryParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusQueryOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -31,8 +32,10 @@ public class MilvusQueryOpDispenser extends MilvusBaseOpDispenser<QueryParam> {
|
||||
|
||||
public MilvusQueryOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -44,7 +47,7 @@ public class MilvusQueryOpDispenser extends MilvusBaseOpDispenser<QueryParam> {
|
||||
LongFunction<QueryParam.Builder> ebF =
|
||||
l -> QueryParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("partition_names", "partitions"), List.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF, "partitions", List.class,
|
||||
QueryParam.Builder::withPartitionNames);
|
||||
ebF = op.enhanceEnumOptionally(ebF, "consistency_level", ConsistencyLevelEnum.class, QueryParam.Builder::withConsistencyLevel);
|
||||
ebF = op.enhanceFuncOptionally(ebF, "expr", String.class, QueryParam.Builder::withExpr);
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.collection.ReleaseCollectionParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusReleaseCollectionOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusReleaseCollectionOpDispenser extends MilvusBaseOpDispenser<Re
|
||||
|
||||
public MilvusReleaseCollectionOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.partition.ReleasePartitionsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusAdapterUtils;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusReleasePartitionsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -31,8 +32,10 @@ public class MilvusReleasePartitionsOpDispenser extends MilvusBaseOpDispenser<Re
|
||||
|
||||
public MilvusReleasePartitionsOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,7 +50,7 @@ public class MilvusReleasePartitionsOpDispenser extends MilvusBaseOpDispenser<Re
|
||||
|
||||
LongFunction<ReleasePartitionsParam.Builder> finalEbF = ebF;
|
||||
ebF = l -> finalEbF.apply(l).withPartitionNames(partNamesF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF,List.of("collection_name","collection"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF,"collection",String.class,
|
||||
ReleasePartitionsParam.Builder::withCollectionName);
|
||||
|
||||
final LongFunction<ReleasePartitionsParam.Builder> lastF = ebF;
|
||||
|
@ -21,6 +21,7 @@ import io.milvus.common.clientenum.ConsistencyLevelEnum;
|
||||
import io.milvus.param.MetricType;
|
||||
import io.milvus.param.dml.SearchParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusSearchOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -32,8 +33,9 @@ public class MilvusSearchOpDispenser extends MilvusBaseOpDispenser<SearchParam>
|
||||
public MilvusSearchOpDispenser(
|
||||
MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction, LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -43,7 +45,7 @@ public class MilvusSearchOpDispenser extends MilvusBaseOpDispenser<SearchParam>
|
||||
LongFunction<SearchParam.Builder> ebF =
|
||||
l -> SearchParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||
|
||||
ebF = op.enhanceFuncOptionally(ebF, List.of("partition_names", "partitions"), List.class, SearchParam.Builder::withPartitionNames);
|
||||
ebF = op.enhanceFuncOptionally(ebF, "partitions", List.class, SearchParam.Builder::withPartitionNames);
|
||||
ebF = op.enhanceFuncOptionally(ebF, "out_fields", List.class, SearchParam.Builder::withOutFields);
|
||||
|
||||
|
||||
@ -56,7 +58,7 @@ public class MilvusSearchOpDispenser extends MilvusBaseOpDispenser<SearchParam>
|
||||
(SearchParam.Builder b, Number n) -> b.withRoundDecimal(n.intValue()));
|
||||
ebF = op.enhanceFuncOptionally(ebF, "ignore_growing", Boolean.class, SearchParam.Builder::withIgnoreGrowing);
|
||||
ebF = op.enhanceFuncOptionally(ebF, "params", String.class, SearchParam.Builder::withParams);
|
||||
ebF = op.enhanceFunc(ebF, List.of("vector_field_name", "vector_field"), String.class,
|
||||
ebF = op.enhanceFunc(ebF, "vector_field", String.class,
|
||||
SearchParam.Builder::withVectorFieldName);
|
||||
// TODO: sanity check List of Floats vs List of List of Floats at func construction time.
|
||||
ebF = op.enhanceFuncOptionally(ebF, "vectors", List.class, SearchParam.Builder::withVectors);
|
||||
|
@ -21,6 +21,7 @@ import io.milvus.grpc.ShowType;
|
||||
import io.milvus.param.collection.ShowCollectionsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusAdapterUtils;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusShowCollectionsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -32,8 +33,10 @@ public class MilvusShowCollectionsOpDispenser extends MilvusBaseOpDispenser<Show
|
||||
|
||||
public MilvusShowCollectionsOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,7 +50,7 @@ public class MilvusShowCollectionsOpDispenser extends MilvusBaseOpDispenser<Show
|
||||
LongFunction<List<String>> collectionsF = l -> MilvusAdapterUtils.splitNames(targetF.apply(l));
|
||||
LongFunction<ShowCollectionsParam.Builder> finalEbF = ebF;
|
||||
ebF = l -> finalEbF.apply(l).withCollectionNames(collectionsF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF,List.of("database_name","database"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF,"database",String.class,
|
||||
ShowCollectionsParam.Builder::withDatabaseName);
|
||||
ebF = op.enhanceEnumOptionally(ebF,"show_type", ShowType.class,ShowCollectionsParam.Builder::withShowType);
|
||||
logger.warn(this.getClass().getSimpleName() + " is deprecated, use get_loading_progress instead");
|
||||
|
@ -20,6 +20,7 @@ import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.partition.ShowPartitionsParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusAdapterUtils;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusShowPartitionsOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -31,8 +32,10 @@ public class MilvusShowPartitionsOpDispenser extends MilvusBaseOpDispenser<ShowP
|
||||
|
||||
public MilvusShowPartitionsOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -47,7 +50,7 @@ public class MilvusShowPartitionsOpDispenser extends MilvusBaseOpDispenser<ShowP
|
||||
LongFunction<List<String>> partitionsF = l -> MilvusAdapterUtils.splitNames(targetF.apply(l));
|
||||
LongFunction<ShowPartitionsParam.Builder> finalEbF = ebF;
|
||||
ebF = l -> finalEbF.apply(l).withPartitionNames(partitionsF.apply(l));
|
||||
ebF = op.enhanceFuncOptionally(ebF,List.of("collection_name","collection"),String.class,
|
||||
ebF = op.enhanceFuncOptionally(ebF,"collection",String.class,
|
||||
ShowPartitionsParam.Builder::withCollectionName);
|
||||
final LongFunction<ShowPartitionsParam.Builder> lastF = ebF;
|
||||
final LongFunction<ShowPartitionsParam> collectionParamF = l -> lastF.apply(l).build();
|
||||
|
@ -19,6 +19,7 @@ package io.nosqlbench.adapter.milvus.opdispensers;
|
||||
import io.milvus.client.MilvusServiceClient;
|
||||
import io.milvus.param.credential.UpdateCredentialParam;
|
||||
import io.nosqlbench.adapter.milvus.MilvusDriverAdapter;
|
||||
import io.nosqlbench.adapter.milvus.MilvusSpace;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
||||
import io.nosqlbench.adapter.milvus.ops.MilvusUpdateCredentialOp;
|
||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||
@ -29,8 +30,10 @@ public class MilvusUpdateCredentialOpDispenser extends MilvusBaseOpDispenser<Upd
|
||||
|
||||
public MilvusUpdateCredentialOpDispenser(MilvusDriverAdapter adapter,
|
||||
ParsedOp op,
|
||||
LongFunction<String> targetFunction) {
|
||||
super(adapter, op, targetFunction);
|
||||
LongFunction<String> targetFunction,
|
||||
LongFunction<MilvusSpace> spaceF
|
||||
) {
|
||||
super(adapter, op, targetFunction, spaceF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,7 +52,7 @@ public abstract class MilvusBaseOp<T> implements CycleOp<Object> {
|
||||
try {
|
||||
Object result = applyOp(value);
|
||||
if (result instanceof R<?> r) {
|
||||
var error = r.getException();
|
||||
Exception error = r.getException();
|
||||
if (error!=null) {
|
||||
throw error;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ import io.milvus.grpc.DescribeIndexResponse;
|
||||
import io.milvus.grpc.IndexDescription;
|
||||
import io.milvus.param.R;
|
||||
import io.milvus.param.index.DescribeIndexParam;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes.Op;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes.CycleOp;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes.OpGenerator;
|
||||
import io.nosqlbench.adapters.api.scheduling.TimeoutPredicate;
|
||||
|
||||
@ -98,7 +98,7 @@ public class MilvusDescribeIndexOp extends MilvusBaseOp<DescribeIndexParam> impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public Op getNextOp() {
|
||||
public CycleOp<Object> getNextOp() {
|
||||
return nextOp;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import io.milvus.grpc.LoadState;
|
||||
import io.milvus.param.R;
|
||||
import io.milvus.param.collection.GetLoadStateParam;
|
||||
import io.nosqlbench.adapter.milvus.exceptions.MilvusAwaitStateIncompleteError;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes.Op;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes.CycleOp;
|
||||
import io.nosqlbench.adapters.api.activityimpl.uniform.flowtypes.OpGenerator;
|
||||
import io.nosqlbench.adapters.api.scheduling.TimeoutPredicate;
|
||||
|
||||
@ -65,7 +65,7 @@ public class MilvusGetLoadStateOp extends MilvusBaseOp<GetLoadStateParam> implem
|
||||
}
|
||||
|
||||
@Override
|
||||
public Op getNextOp() {
|
||||
public CycleOp<Object> getNextOp() {
|
||||
return this.nextOp;
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class MongoOpMapper<MC extends MongoDirectCommandOp> implements OpMapper<
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<MongoDirectCommandOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<MongoSpace> spaceInitF) {
|
||||
public OpDispenser<MongoDirectCommandOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<MongoSpace> spaceF) {
|
||||
|
||||
LongFunction<String> ctxNamer = op.getAsFunctionOr("space", "default");
|
||||
|
||||
@ -65,12 +65,12 @@ public class MongoOpMapper<MC extends MongoDirectCommandOp> implements OpMapper<
|
||||
if (target.isPresent()) {
|
||||
TypeAndTarget<MongoDBOpTypes, String> targetData = target.get();
|
||||
return switch (targetData.enumId) {
|
||||
case command -> new MongoCommandOpDispenser(adapter, spaceInitF, op);
|
||||
case command -> new MongoCommandOpDispenser(adapter, spaceF, op);
|
||||
};
|
||||
}
|
||||
// For everything else use the command API
|
||||
else {
|
||||
return new MongoCommandOpDispenser(adapter, spaceInitF, op);
|
||||
return new MongoCommandOpDispenser(adapter, spaceF, op);
|
||||
}
|
||||
|
||||
|
||||
|
@ -36,7 +36,7 @@ public class Neo4JOpMapper implements OpMapper<Neo4JBaseOp,Neo4JSpace> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<Neo4JBaseOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<Neo4JSpace> spaceInitF) {
|
||||
public OpDispenser<Neo4JBaseOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<Neo4JSpace> spaceF) {
|
||||
TypeAndTarget<Neo4JOpType, String> typeAndTarget = op.getTypeAndTarget(Neo4JOpType.class, String.class);
|
||||
LongFunction<Neo4JSpace> spaceFunc = adapter.getSpaceFunc(op);
|
||||
return switch (typeAndTarget.enumId) {
|
||||
|
@ -18,6 +18,7 @@ package io.nosqlbench.adapter.neo4j.ops;
|
||||
|
||||
import org.neo4j.driver.Query;
|
||||
import org.neo4j.driver.Record;
|
||||
import org.neo4j.driver.Result;
|
||||
import org.neo4j.driver.Session;
|
||||
|
||||
import java.util.List;
|
||||
@ -35,7 +36,7 @@ public class Neo4JSyncReadTxnOp extends Neo4JBaseOp{
|
||||
public final Record[] apply(long value) {
|
||||
List<Record> recordList = session.executeRead(
|
||||
txn -> {
|
||||
var result = txn.run(query);
|
||||
Result result = txn.run(query);
|
||||
return result.list();
|
||||
}
|
||||
);
|
||||
|
@ -18,6 +18,7 @@ package io.nosqlbench.adapter.neo4j.ops;
|
||||
|
||||
import org.neo4j.driver.Query;
|
||||
import org.neo4j.driver.Record;
|
||||
import org.neo4j.driver.Result;
|
||||
import org.neo4j.driver.Session;
|
||||
|
||||
import java.util.List;
|
||||
@ -35,7 +36,7 @@ public class Neo4JSyncWriteTxnOp extends Neo4JBaseOp{
|
||||
public final Record[] apply(long value) {
|
||||
List<Record> recordList = session.executeWrite(
|
||||
txn -> {
|
||||
var result = txn.run(query);
|
||||
Result result = txn.run(query);
|
||||
return result.list();
|
||||
}
|
||||
);
|
||||
|
@ -42,7 +42,7 @@ public class PulsarOpMapper implements OpMapper<PulsarOp,PulsarSpace> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<PulsarOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<PulsarSpace> spaceInitF) {
|
||||
public OpDispenser<PulsarOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<PulsarSpace> spaceF) {
|
||||
int spaceName = op.getStaticConfigOr("space", 0);
|
||||
// PulsarSpace pulsarSpace = spaceCache.get(spaceName);
|
||||
PulsarSpace pulsarSpace = adapter.getSpaceFunc(op).apply(spaceName);
|
||||
|
@ -48,11 +48,11 @@ public class QdrantOpMapper implements OpMapper<QdrantBaseOp<?,?>,QdrantSpace> {
|
||||
* @param adapterC
|
||||
* @param op
|
||||
* The {@link ParsedOp} to be evaluated
|
||||
* @param spaceInitF
|
||||
* @param spaceF
|
||||
* @return The correct {@link QdrantBaseOpDispenser} subclass based on the op type
|
||||
*/
|
||||
@Override
|
||||
public OpDispenser<QdrantBaseOp<?,?>> apply(NBComponent adapterC, ParsedOp op, LongFunction<QdrantSpace> spaceInitF) {
|
||||
public OpDispenser<QdrantBaseOp<?,?>> apply(NBComponent adapterC, ParsedOp op, LongFunction<QdrantSpace> spaceF) {
|
||||
TypeAndTarget<QdrantOpType, String> typeAndTarget = op.getTypeAndTarget(
|
||||
QdrantOpType.class,
|
||||
String.class,
|
||||
|
@ -40,7 +40,7 @@ public class S4JOpMapper implements OpMapper<S4JOp,S4JSpace> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public OpDispenser<S4JOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<S4JSpace> spaceInitF) {
|
||||
public OpDispenser<S4JOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<S4JSpace> spaceF) {
|
||||
|
||||
/*
|
||||
* If the user provides a body element, then they want to provide the JSON or
|
||||
|
@ -95,7 +95,7 @@ public class StdoutDriverAdapter extends BaseDriverAdapter<StdoutOp, StdoutSpace
|
||||
}
|
||||
|
||||
OpData op = new OpData("synthetic", "synthetic", Map.of(), opsDocList.getDocBindings(), cfg,
|
||||
Map.of("stmt", genStatementTemplate(filteredBindingNames, cfg)));
|
||||
Map.of("stmt", genStatementTemplate(filteredBindingNames, cfg)),200);
|
||||
|
||||
return List.of(op);
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user