阅读Hazelcast 3.7提供的新Eviction Algorithm上的文档,我不清楚该部分中提到的参数是如何与实际的地图驱逐政策相关联的参数。
即,算法说明使用:
{
"query": {
"multi_match": {
"query": "LAURA",
"fields": [
"name",
"venueName",
"venueTown",
]
}
},
"aggs": {
"name": {
"terms": {
"field": "name"
},
"aggs": {
"top": {
"top_hits": {
"size": 1
}
}
}
},
"venue_name": {
"terms": {
"field": "venueName"
},
"aggs": {
"top": {
"top_hits": {
"size": 1
}
}
}
},
"venue_town": {
"terms": {
"field": "venueTown"
},
"aggs": {
"top": {
"top_hits": {
"size": 1
}
}
}
}
}
}
驱逐政策配置提及(其中一些):
GlobalCapacity: User defined maximum cache size (cluster-wide).
PartitionCount: Number of partitions in the cluster (defaults to 271).
BalancedPartitionSize: Number of elements in a balanced partition state, BalancedPartitionSize := GlobalCapacity / PartitionCount.
Deviation: An approximated standard deviation (tests proofed it to be pretty near), Deviation := sqrt(BalancedPartitionSize).
要做的一个假设是<hazelcast>
<map name="default">
...
<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>0</max-idle-seconds>
<eviction-policy>LRU</eviction-policy>
<max-size policy="PER_NODE">5000</max-size>
...
</map>
</hazelcast>
以某种方式链接到GlobalCapacity
属性??
欢迎任何澄清这一点的帮助! :)
答案 0 :(得分:1)
GlobalCapacity:用户定义的最大缓存大小(群集范围) PartitionCount:集群中的分区数(默认为271)。
BalancedPartitionSize:平衡分区中的元素数 state,BalancedPartitionSize:= GlobalCapacity / PartitionCount。
偏差:近似的标准偏差(测试证明它是 非常接近),偏差:= sqrt(BalancedPartitionSize)。
以上是用于解释参考手册中的算法的变量。它们不是API变量。
但特别是在您的问题中:是的,全局容量是等效的,可以由用户在map-config中使用max-size配置来定义。