mirror of
https://github.com/OpenHFT/Chronicle-Map.git
synced 2021-09-13 01:26:12 +00:00
Add ChronicleHashBuilder.averageKey() and ChronicleMapBuilder.averageValue() methods
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user