use of voldemort.store.serialized.SerializingStorageEngine in project voldemort by voldemort.
the class AbstractStorageEngineTest method testKeyIterationWithSerialization.
@Test
public void testKeyIterationWithSerialization() {
StorageEngine<ByteArray, byte[], byte[]> store = getStorageEngine();
StorageEngine<String, String, String> stringStore = new SerializingStorageEngine<String, String, String>(store, new StringSerializer(), new StringSerializer(), new StringSerializer());
Map<String, String> vals = ImmutableMap.of("a", "a", "b", "b", "c", "c", "d", "d", "e", "e");
for (Map.Entry<String, String> entry : vals.entrySet()) stringStore.put(entry.getKey(), new Versioned<String>(entry.getValue()), null);
ClosableIterator<String> iter = stringStore.keys();
int count = 0;
while (iter.hasNext()) {
String key = iter.next();
assertTrue(vals.containsKey(key));
count++;
}
assertEquals(count, vals.size());
iter.close();
}
Aggregations