use of com.ms.silverking.cloud.dht.client.serialization.internal.SerializedKeyValueBuffers in project SilverKing by Morgan-Stanley.
the class KVSerializationTest method runTest.
public void runTest(int numKeys, BufferMode bufferMode) {
SerializedKeyValueBuffers skvBuffers;
Stopwatch sw;
ThreadLocalRandom random;
skvBuffers = new SerializedKeyValueBuffers();
random = ThreadLocalRandom.current();
sw = new SimpleStopwatch();
for (int i = 0; i < numKeys; i++) {
DHTKey key;
ByteBuffer value;
key = new SimpleKey(random.nextLong(), random.nextLong());
value = randomValue(random);
skvBuffers.addKeyValue(key, value, bufferMode);
}
sw.stop();
System.out.println(skvBuffers);
System.out.printf("Elapsed %f\n", sw.getElapsedSeconds());
skvBuffers.freeze();
display(skvBuffers);
}
Aggregations