use of org.apache.cassandra.db.partitions.CachedBTreePartition in project cassandra by apache.
the class CacheProviderTest method assertDigests.
private void assertDigests(IRowCacheEntry one, CachedBTreePartition two) {
assertTrue(one instanceof CachedBTreePartition);
try {
MessageDigest d1 = MessageDigest.getInstance("MD5");
MessageDigest d2 = MessageDigest.getInstance("MD5");
UnfilteredRowIterators.digest(((CachedBTreePartition) one).unfilteredIterator(), d1, MessagingService.current_version);
UnfilteredRowIterators.digest(((CachedBTreePartition) two).unfilteredIterator(), d2, MessagingService.current_version);
assertTrue(MessageDigest.isEqual(d1.digest(), d2.digest()));
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
}
use of org.apache.cassandra.db.partitions.CachedBTreePartition in project cassandra by apache.
the class CacheProviderTest method testSerializingCache.
@Test
public void testSerializingCache() throws InterruptedException {
ICache<MeasureableString, IRowCacheEntry> cache = SerializingCache.create(CAPACITY, Weigher.singletonWeigher(), new SerializingCacheProvider.RowCacheSerializer());
CachedBTreePartition partition = createPartition();
simpleCase(partition, cache);
concurrentCase(partition, cache);
}
Aggregations