many-sessions improvements, type fixes, more javadocs (#2094)

* some javadoc and type alignment improvements

* some javadoc and type alignment improvements

* example adapter

* alignment to previous changes

* improvements to many session testing

* add missing annotation
This commit is contained in:
Jonathan Shook
2024-11-20 17:25:30 -06:00
committed by GitHub
parent 2229f919a2
commit 130977fa34
123 changed files with 949 additions and 393 deletions

View File

@@ -27,7 +27,7 @@ public class TcpClientOpDispenser extends BaseOpDispenser<TcpClientOp, TcpClient
private final LongFunction<String> outFunction;
public TcpClientOpDispenser(TcpClientDriverAdapter adapter, ParsedOp cmd, LongFunction<TcpClientAdapterSpace> ctxfunc) {
super(adapter,cmd);
super(adapter,cmd, adapter.getSpaceFunc(cmd));
this.ctxFunction = ctxfunc;
LongFunction<Object> objectFunction = cmd.getAsRequiredFunction("stmt", Object.class);
LongFunction<String> stringFunction = l -> objectFunction.apply(l).toString();
@@ -35,9 +35,9 @@ public class TcpClientOpDispenser extends BaseOpDispenser<TcpClientOp, TcpClient
}
@Override
public TcpClientOp getOp(long value) {
TcpClientAdapterSpace ctx = ctxFunction.apply(value);
String output = outFunction.apply(value);
public TcpClientOp getOp(long cycle) {
TcpClientAdapterSpace ctx = ctxFunction.apply(cycle);
String output = outFunction.apply(cycle);
return new TcpClientOp(ctx,output);
}
}

View File

@@ -18,9 +18,8 @@ package io.nosqlbench.adapter.tcpclient;
import io.nosqlbench.adapters.api.activityimpl.OpDispenser;
import io.nosqlbench.adapters.api.activityimpl.OpMapper;
import io.nosqlbench.adapters.api.activityimpl.uniform.ConcurrentSpaceCache;
import io.nosqlbench.adapters.api.activityimpl.uniform.Space;
import io.nosqlbench.adapters.api.templating.ParsedOp;
import io.nosqlbench.nb.api.components.core.NBComponent;
import java.util.function.LongFunction;
@@ -34,7 +33,7 @@ public class TcpClientOpMapper implements OpMapper<TcpClientOp,TcpClientAdapterS
}
@Override
public OpDispenser<TcpClientOp> apply(ParsedOp op, LongFunction<TcpClientAdapterSpace> spaceInitF) {
public OpDispenser<TcpClientOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<TcpClientAdapterSpace> spaceInitF) {
LongFunction<String> spacefunc = op.getAsFunctionOr("space", "default");
LongFunction<TcpClientAdapterSpace> ctxfunc = adapter.getSpaceFunc(op);
return new TcpClientOpDispenser(adapter,op,ctxfunc);

View File

@@ -27,7 +27,7 @@ public class TcpServerOpDispenser extends BaseOpDispenser<TcpServerOp,TcpServerA
private final LongFunction<String> outFunction;
public TcpServerOpDispenser(TcpServerDriverAdapter adapter, ParsedOp cmd, LongFunction<TcpServerAdapterSpace> ctxfunc) {
super(adapter,cmd);
super(adapter,cmd, ctxfunc);
this.ctxFunction = ctxfunc;
LongFunction<Object> objectFunction = cmd.getAsRequiredFunction("stmt", Object.class);
LongFunction<String> stringFunction = l -> objectFunction.apply(l).toString();
@@ -35,9 +35,9 @@ public class TcpServerOpDispenser extends BaseOpDispenser<TcpServerOp,TcpServerA
}
@Override
public TcpServerOp getOp(long value) {
TcpServerAdapterSpace ctx = ctxFunction.apply(value);
String output = outFunction.apply(value);
public TcpServerOp getOp(long cycle) {
TcpServerAdapterSpace ctx = ctxFunction.apply(cycle);
String output = outFunction.apply(cycle);
return new TcpServerOp(ctx,output);
}
}

View File

@@ -18,9 +18,8 @@ package io.nosqlbench.adapter.tcpserver;
import io.nosqlbench.adapters.api.activityimpl.OpDispenser;
import io.nosqlbench.adapters.api.activityimpl.OpMapper;
import io.nosqlbench.adapters.api.activityimpl.uniform.ConcurrentSpaceCache;
import io.nosqlbench.adapters.api.activityimpl.uniform.Space;
import io.nosqlbench.adapters.api.templating.ParsedOp;
import io.nosqlbench.nb.api.components.core.NBComponent;
import java.util.function.LongFunction;
@@ -34,7 +33,7 @@ public class TcpServerOpMapper implements OpMapper<TcpServerOp,TcpServerAdapterS
}
@Override
public OpDispenser<TcpServerOp> apply(ParsedOp op, LongFunction<TcpServerAdapterSpace> spaceInitF) {
public OpDispenser<TcpServerOp> apply(NBComponent adapterC, ParsedOp op, LongFunction<TcpServerAdapterSpace> spaceInitF) {
LongFunction<String> spacefunc = op.getAsFunctionOr("space", "default");
LongFunction<TcpServerAdapterSpace> ctxfunc = adapter.getSpaceFunc(op);
return new TcpServerOpDispenser(adapter,op,ctxfunc);