Add ChronicleHashBuilder.averageKey() and ChronicleMapBuilder.averageValue() methods

This commit is contained in:
leventov
2015-07-29 01:21:21 +03:00
parent a3c9ed688c
commit e39dfc394c
7 changed files with 154 additions and 17 deletions
@@ -33,8 +33,13 @@ public class NestedContextsTest {
@Test
public void nestedContextsTest() throws ExecutionException, InterruptedException {
HashSet<Integer> averageValue = new HashSet<>();
for (int i = 0; i < 5; i++) {
averageValue.add(i);
}
ChronicleMap<Integer, Set<Integer>> graph = ChronicleMapBuilder
.of(Integer.class, (Class<Set<Integer>>) (Class) Set.class)
.averageValue(averageValue)
.actualSegments(2)
.create();
@@ -100,10 +100,14 @@ public class TcpReplicationSoakCrdtTest {
public void setup() throws IOException {
final InetSocketAddress endpoint = new InetSocketAddress("localhost", s_port + 1);
HashSet<Integer> averageValue = new HashSet<>();
for (int i = 0; i < 10; i++) {
averageValue.add(i);
}
ChronicleMapBuilder<Integer, Set<Integer>> builder = ChronicleMapBuilder
.of(Integer.class, (Class<Set<Integer>>) (Class) Set.class)
.entries(Builder.SIZE)
.averageValueSize(3000) // more than HashSet of 10 Integers on average, serialized
.averageValue(averageValue)
.entryOperations(growOnlySetValuedMapEntryOperations())
.remoteOperations(growOnlySetValuedMapRemoteOperations());