Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmetmircik committed Jun 17, 2021
1 parent a4b14a4 commit 48c5197
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void testPerNodePolicy_withManyNodes() {
public void testPerNodePolicy_afterGracefulShutdown() {
int nodeCount = 3;
int perNodeMaxSize = 1000;
int numberOfPuts = 3000;
int numberOfPuts = 5000;

// eviction takes place if a partitions size exceeds this number
// see EvictionChecker#toPerPartitionMaxSize
Expand Down Expand Up @@ -132,6 +132,13 @@ public void testPerNodePolicy_afterGracefulShutdown() {
+ (PARTITION_COUNT / nodeCount) >= currentMapSize);
}
}

// check also backup entry count is around perNodeMaxSize.
IMap<Object, Object> map1 = nodes.get(1).getMap(mapName);
IMap<Object, Object> map2 = nodes.get(2).getMap(mapName);
long totalBackupEntryCount = getTotalBackupEntryCount(map1, map2);
assertTrue("totalBackupEntryCount=" + totalBackupEntryCount, ((nodeCount - 1) * perNodeMaxSize)
+ (PARTITION_COUNT / nodeCount) >= totalBackupEntryCount);
});
}

Expand Down Expand Up @@ -431,6 +438,7 @@ Config createConfig(MaxSizePolicy maxSizePolicy, int maxSize, String mapName) {
config.setProperty(ClusterProperty.PARTITION_COUNT.getName(), String.valueOf(PARTITION_COUNT));

MapConfig mapConfig = config.getMapConfig(mapName);
mapConfig.setBackupCount(1);
EvictionConfig evictionConfig = mapConfig.getEvictionConfig();
evictionConfig.setEvictionPolicy(EvictionPolicy.LRU);
evictionConfig.setMaxSizePolicy(maxSizePolicy);
Expand Down

0 comments on commit 48c5197

Please sign in to comment.