actually add new functions to build

This commit is contained in:
Jonathan Shook 2021-04-19 10:30:14 -05:00
parent 5b1ffee89a
commit a64ca6beee
4 changed files with 14 additions and 1 deletions

View File

@ -18,7 +18,7 @@ import java.util.function.LongToIntFunction;
* *
* As a 'Hashed' function, the input value is hashed again before being used as value. * As a 'Hashed' function, the input value is hashed again before being used as value.
*/ */
@Categories(Category.conversion) @Categories({Category.conversion,Category.general})
@ThreadSafeMapper @ThreadSafeMapper
public class ByteBufferSizedHashed implements LongFunction<ByteBuffer> { public class ByteBufferSizedHashed implements LongFunction<ByteBuffer> {

View File

@ -1,5 +1,7 @@
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_bytebuffer; package io.nosqlbench.virtdata.library.basics.shared.from_long.to_bytebuffer;
import io.nosqlbench.virtdata.api.annotations.Categories;
import io.nosqlbench.virtdata.api.annotations.Category;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper; import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import org.apache.commons.codec.binary.Hex; import org.apache.commons.codec.binary.Hex;
@ -10,6 +12,7 @@ import java.util.function.Function;
* Convert the contents of the input ByteBuffer to a String as hexadecimal. * Convert the contents of the input ByteBuffer to a String as hexadecimal.
*/ */
@ThreadSafeMapper @ThreadSafeMapper
@Categories(Category.conversion)
public class ByteBufferToHex implements Function<ByteBuffer,String> { public class ByteBufferToHex implements Function<ByteBuffer,String> {
@Override @Override
public String apply(ByteBuffer byteBuffer) { public String apply(ByteBuffer byteBuffer) {

View File

@ -1,5 +1,8 @@
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_bytebuffer; package io.nosqlbench.virtdata.library.basics.shared.from_long.to_bytebuffer;
import io.nosqlbench.virtdata.api.annotations.Categories;
import io.nosqlbench.virtdata.api.annotations.Category;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import io.nosqlbench.virtdata.api.bindings.VirtDataConversions; import io.nosqlbench.virtdata.api.bindings.VirtDataConversions;
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_int.Hash; import io.nosqlbench.virtdata.library.basics.shared.from_long.to_int.Hash;
@ -18,6 +21,8 @@ import java.util.function.LongToIntFunction;
* This function behaves slightly differently than most in that it creates and * This function behaves slightly differently than most in that it creates and
* caches as source byte buffer during initialization. * caches as source byte buffer during initialization.
*/ */
@ThreadSafeMapper
@Categories(Category.general)
public class HashedByteBufferExtract implements LongFunction<ByteBuffer> { public class HashedByteBufferExtract implements LongFunction<ByteBuffer> {
private final LongToIntFunction sizefunc; private final LongToIntFunction sizefunc;

View File

@ -1,5 +1,8 @@
package io.nosqlbench.virtdata.library.basics.shared.from_long.to_bytebuffer; package io.nosqlbench.virtdata.library.basics.shared.from_long.to_bytebuffer;
import io.nosqlbench.virtdata.api.annotations.Categories;
import io.nosqlbench.virtdata.api.annotations.Category;
import io.nosqlbench.virtdata.api.annotations.ThreadSafeMapper;
import io.nosqlbench.virtdata.api.bindings.VirtDataConversions; import io.nosqlbench.virtdata.api.bindings.VirtDataConversions;
import io.nosqlbench.virtdata.library.basics.shared.from_long.to_int.Hash; import io.nosqlbench.virtdata.library.basics.shared.from_long.to_int.Hash;
import org.apache.commons.codec.binary.Hex; import org.apache.commons.codec.binary.Hex;
@ -21,6 +24,8 @@ import java.util.function.LongToIntFunction;
* This function behaves slightly differently than most in that it creates and * This function behaves slightly differently than most in that it creates and
* caches as source byte buffer during initialization. * caches as source byte buffer during initialization.
*/ */
@ThreadSafeMapper
@Categories({Category.general})
public class HashedCharBufferExtract implements LongFunction<CharBuffer> { public class HashedCharBufferExtract implements LongFunction<CharBuffer> {
private final LongToIntFunction sizefunc; private final LongToIntFunction sizefunc;