mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-01-26 15:36:33 -06:00
implement bulk op
This commit is contained in:
parent
2e8a435f21
commit
27a02dfe28
@ -23,6 +23,8 @@ import io.nosqlbench.adapter.milvus.ops.MilvusBaseOp;
|
|||||||
import io.nosqlbench.adapter.milvus.ops.MilvusBulkInsertOp;
|
import io.nosqlbench.adapter.milvus.ops.MilvusBulkInsertOp;
|
||||||
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
import io.nosqlbench.adapters.api.templating.ParsedOp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.function.LongFunction;
|
import java.util.function.LongFunction;
|
||||||
|
|
||||||
public class MilvusBulkInsertOpDispenser extends MilvusBaseOpDispenser<BulkInsertParam> {
|
public class MilvusBulkInsertOpDispenser extends MilvusBaseOpDispenser<BulkInsertParam> {
|
||||||
@ -41,17 +43,20 @@ public class MilvusBulkInsertOpDispenser extends MilvusBaseOpDispenser<BulkInser
|
|||||||
) {
|
) {
|
||||||
LongFunction<BulkInsertParam.Builder> ebF =
|
LongFunction<BulkInsertParam.Builder> ebF =
|
||||||
l -> BulkInsertParam.newBuilder().withCollectionName(targetF.apply(l));
|
l -> BulkInsertParam.newBuilder().withCollectionName(targetF.apply(l));
|
||||||
// Add enhancement functions here
|
|
||||||
throw new RuntimeException("implement me");
|
|
||||||
|
|
||||||
|
ebF = op.enhanceFuncOptionally(ebF, "options", Map.class,
|
||||||
|
(BulkInsertParam.Builder builder, Map map) -> {
|
||||||
// And remove test function
|
map.forEach((k, v) -> {
|
||||||
// BulkInsertParam.Builder test = ebF.apply(0);
|
builder.withOption(k.toString(), v.toString());
|
||||||
|
});
|
||||||
// final LongFunction<BulkInsertParam.Builder> lastF = ebF;
|
return builder;
|
||||||
// final LongFunction<BulkInsertParam> collectionParamF = l -> lastF.apply(l).build();
|
}
|
||||||
// return null;
|
);
|
||||||
|
ebF = op.enhanceFuncOptionally(ebF, "files", List.class, BulkInsertParam.Builder::withFiles);
|
||||||
|
ebF = op.enhanceFuncOptionally(ebF, List.of("partition_name", "partition"), String.class,
|
||||||
|
BulkInsertParam.Builder::withPartitionName);
|
||||||
|
LongFunction<BulkInsertParam.Builder> finalEbF = ebF;
|
||||||
|
return l -> finalEbF.apply(l).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user