add missing workload and descriptions

This commit is contained in:
Jonathan Shook 2021-04-15 16:58:53 -05:00
parent a1a3d8b63c
commit 1dc9408073
11 changed files with 69 additions and 23 deletions

View File

@ -7,8 +7,8 @@ scenarios:
stdout: run driver===stdout format=readout bindings='set_.*'
lists:
stdout: run driver===stdout format=readout bindings='list_.*'
maps:
stdout: run driver===stdout format=readout bindings='map_.*'
# For collection building functions, there are 6 varieties:
# - "functions" - The main input is the same for the element functions
@ -21,13 +21,14 @@ scenarios:
bindings:
# This will always create a list like [5L, "five", "5-six"]
list_functions: ListFunctions(Identity(),NumberNameToString(), Template("{}-{}",Identity(),NumberNameToString()));
# The input to the element functions is incremented by 1 for
list_stepped: ListStepped(Identity(),NumberNameToString(),NumberNameToString())
list_hashed: ListHashed(Identity(),ToString())
list_sized: ListSized(HashRange(3,4),Identity(),NumberNameToString()))
list_sized_stepped: ListSizedStepped(HashRange(3,4),Identity(),NumberNameToString()))
list_sized_hashed: ListSizedHashed(HashRange(3,4),Identity(),ToString()))
list_of_sets: ListSizedStepped(HashRange(3,4),SetSized(HashRange(2,4),NumberNameToString())
list_of_sets: ListSizedStepped(HashRange(3,4),SetSized(HashRange(2,4),NumberNameToString()))
set_functions: SetFunctions(Identity(),NumberNameToString(), Template("{}-{}",Identity(),NumberNameToString()));
set_stepped: SetStepped(Identity(),NumberNameToString(),NumberNameToString())
@ -39,3 +40,13 @@ bindings:
set_of_hashed_lists: SetSizedStepped( HashRange(3,4), ListSizedHashed(HashRange(2,3),Combinations('A-Z;0-9;a-z')))
set_of_lists_withduplicates: SetSized( HashRange(3,4), ListSized(HashRange(2,3),Combinations('A-Z;0-9;a-z')))
map_functions: MapFunctions(NumbernameToString(), NumberNameToString(), ToString(), ToString())
map_hashed: MapHashed(NumberNameToString(), NumberNameToString(), ToString(), ToString())
map_sized: MapSized(1, NumberNameToString(), NumberNameToString(), ToString(), ToString())
map_stepped: MapStepped(NumberNameToString(), NumberNameToString(), ToString(), ToString())
map_sized_hashed: MapSizedHashed(1, NumberNameToString(), NumberNameToString(), ToString(), ToString())
map_sized_stepped: MapSizedStepped(1, NumberNameToString(), NumberNameToString())
map_of_maps: MapSized(2,NumberNameToString(),MapSized(2,NumberNameToString(),long->ToString()))
map_of_lists: MapSized(2,NumberNameToString(),ListSized(2,NumberNameToString())

View File

@ -8,10 +8,8 @@ import io.nosqlbench.virtdata.api.bindings.VirtDataConversions;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import java.util.function.LongFunction;
import java.util.function.LongToIntFunction;
import java.util.function.LongUnaryOperator;
/**
* Create a List from a long input based on a set of provided functions.
@ -37,7 +35,12 @@ public class ListSized implements LongFunction<List<Object>> {
"output: ['one','one','text','text','text']"
})
public ListSized(Object sizeFunc, Object... funcs) {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
if (sizeFunc instanceof Number) {
int size = ((Number)sizeFunc).intValue();
this.sizeFunc = s -> size;
} else {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
}
this.valueFuncs = VirtDataConversions.adaptFunctionList(funcs, LongFunction.class, Object.class);
}
public ListSized(int size, Object... funcs) {

View File

@ -8,12 +8,9 @@ import io.nosqlbench.virtdata.api.bindings.VirtDataConversions;
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_long.Hash;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.function.LongFunction;
import java.util.function.LongToIntFunction;
import java.util.function.LongUnaryOperator;
/**
* Create a List from a long input based on a set of provided functions.
@ -39,7 +36,12 @@ public class ListSizedHashed implements LongFunction<List<Object>> {
"ListSizedHashed output ['2945182322382062539', 'text', '37945690212757860', '287864597160630738', '3299224200079606887']"
})
public ListSizedHashed(Object sizeFunc, Object... funcs) {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
if (sizeFunc instanceof Number) {
int size = ((Number)sizeFunc).intValue();
this.sizeFunc = s -> size;
} else {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
}
this.valueFuncs = VirtDataConversions.adaptFunctionList(funcs, LongFunction.class, Object.class);
}

View File

@ -5,15 +5,11 @@ import io.nosqlbench.virtdata.api.annotations.Category;
import io.nosqlbench.virtdata.api.annotations.Example;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import io.nosqlbench.virtdata.api.bindings.VirtDataConversions;
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_long.Hash;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.function.LongFunction;
import java.util.function.LongToIntFunction;
import java.util.function.LongUnaryOperator;
/**
* Create a List from a long input based on a set of provided functions.
@ -36,7 +32,12 @@ public class ListSizedStepped implements LongFunction<List<Object>> {
"Create a list of ['one','one']"
})
public ListSizedStepped(Object sizeFunc, Object... funcs) {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc,LongToIntFunction.class);
if (sizeFunc instanceof Number) {
int size = ((Number)sizeFunc).intValue();
this.sizeFunc = s -> size;
} else {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
}
this.valueFuncs = VirtDataConversions.adaptFunctionList(funcs, LongFunction.class, Object.class);
}
public ListSizedStepped(int size, Object... funcs) {

View File

@ -36,7 +36,12 @@ public class MapSized implements LongFunction<java.util.Map<Object,Object>> {
"Create a map of object values. Produces values like {'one':'one'1:1}."
})
public MapSized(Object sizeFunc, Object... funcs) {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
if (sizeFunc instanceof Number) {
int size = ((Number) sizeFunc).intValue();
this.sizeFunc = s -> size;
} else {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
}
this.keyFuncs = VirtDataConversions.getFunctions(2, 0, LongFunction.class, funcs);
this.valueFuncs = VirtDataConversions.getFunctions(2,1,LongFunction.class, funcs);
}

View File

@ -42,7 +42,12 @@ public class MapSizedHashed implements LongFunction<java.util.Map<Object,Object>
"Create a map of object values. Produces values like {'one':'one'1:1}."
})
public MapSizedHashed(Object sizeFunc, Object... funcs) {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
if (sizeFunc instanceof Number) {
int size = ((Number)sizeFunc).intValue();
this.sizeFunc = s -> size;
} else {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
}
this.keyFuncs = VirtDataConversions.getFunctions(2, 0, LongFunction.class, funcs);
this.valueFuncs = VirtDataConversions.getFunctions(2,1, LongFunction.class, funcs);
}

View File

@ -35,7 +35,12 @@ public class MapSizedStepped implements LongFunction<java.util.Map<Object,Object
"Create a map of object values. Produces values like {'one':'one'1:1}."
})
public MapSizedStepped(Object sizeFunc, Object... funcs) {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
if (sizeFunc instanceof Number) {
int size = ((Number)sizeFunc).intValue();
this.sizeFunc = s -> size;
} else {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
}
this.keyFuncs = VirtDataConversions.getFunctions(2, 0, LongFunction.class, funcs);
this.valueFuncs = VirtDataConversions.getFunctions(2,1, LongFunction.class, funcs);
}

View File

@ -9,7 +9,6 @@ import io.nosqlbench.virtdata.api.bindings.VirtDataConversions;
import java.util.HashMap;
import java.util.List;
import java.util.function.LongFunction;
import java.util.function.LongToIntFunction;
/**
* Create a Map from a long input based on a set of provided key and value functions.
@ -30,7 +29,7 @@ public class MapStepped implements LongFunction<java.util.Map<Object,Object>> {
private final int size;
@Example({
"MapStepped(1, NumberNameToString(),NumberNameToString(),ToString(),ToString())",
"MapStepped(NumberNameToString(),NumberNameToString(),ToString(),ToString())",
"Create a map of object values. Produces values like {'one':'one'1:1}."
})
public MapStepped(Object... funcs) {

View File

@ -33,7 +33,12 @@ public class SetSized implements LongFunction<java.util.Set<Object>> {
"Create a sized set of object values, like ['one','text'], because 'text' is duplicated 4 times"
})
public SetSized(Object sizeFunc, Object... funcs) {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
if (sizeFunc instanceof Number) {
int size = ((Number)sizeFunc).intValue();
this.sizeFunc = s -> size;
} else {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
}
this.valueFuncs = VirtDataConversions.adaptFunctionList(funcs, LongFunction.class, Object.class);
}
public SetSized(int size, Object... funcs) {

View File

@ -34,7 +34,12 @@ public class SetSizedHashed implements LongFunction<java.util.Set<Object>> {
"Create a sized set of values like ['2945182322382062539', 'text', '37945690212757860', '287864597160630738', '3299224200079606887']"
})
public SetSizedHashed(Object sizeFunc, Object... funcs) {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
if (sizeFunc instanceof Number) {
int size = ((Number)sizeFunc).intValue();
this.sizeFunc = s -> size;
} else {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
}
this.valueFuncs = VirtDataConversions.adaptFunctionList(funcs, LongFunction.class, Object.class);
}
public SetSizedHashed(int size, Object... funcs) {

View File

@ -32,7 +32,12 @@ public class SetSizedStepped implements LongFunction<java.util.Set<Object>> {
"Create a set, like ['three','four']"
})
public SetSizedStepped(Object sizeFunc, Object... funcs) {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
if (sizeFunc instanceof Number) {
int size = ((Number)sizeFunc).intValue();
this.sizeFunc = s -> size;
} else {
this.sizeFunc = VirtDataConversions.adaptFunction(sizeFunc, LongToIntFunction.class);
}
this.valueFuncs = VirtDataConversions.adaptFunctionList(funcs, LongFunction.class, Object.class);
}