Class HashedByteBufferExtract
java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.from_long.to_bytebuffer.HashedByteBufferExtract
- All Implemented Interfaces:
java.util.function.LongFunction<java.nio.ByteBuffer>
public class HashedByteBufferExtract
extends java.lang.Object
implements java.util.function.LongFunction<java.nio.ByteBuffer>
Create a ByteBuffer from the first function, and then sample data from
that bytebuffer according to the size function. The initFunction can be
given as simply a size, in which case ByteBufferSizedHash is used.
If the size function yields a size larger than the available buffer size, then it is
lowered to that size automatically. If it is lower, then a random offset
is used within the buffer image.
This function behaves slightly differently than most in that it creates and
caches as source byte buffer during initialization.
-
Constructor Summary
Constructors Constructor Description HashedByteBufferExtract(java.lang.Object initFunc, java.lang.Object sizeFunc) -
Method Summary
Modifier and Type Method Description java.nio.ByteBufferapply(long value)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
HashedByteBufferExtract
public HashedByteBufferExtract(java.lang.Object initFunc, java.lang.Object sizeFunc)
-
-
Method Details
-
apply
public java.nio.ByteBuffer apply(long value)- Specified by:
applyin interfacejava.util.function.LongFunction<java.nio.ByteBuffer>
-