2017-07-07 47 views
1

这种配置在2.0版本无效当存储离堆Apache中点燃默认缓存2.0

<!-- Enable off-heap storage with unlimited size. --> 
<property name="offHeapMaxMemory" value="0"/> 

错误:

WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'grid.cfg' defined in URL [file:/home/ignite/sample-cache.xml]: Cannot create inner bean 
'org.apache.ignite.configuration.CacheConfiguration#4cc0edeb' of type [org.apache.ignite.configuration.CacheConfiguration] while setting bean 
    property 'cacheConfiguration' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with 
    name 'org.apache.ignite.configuration.CacheConfiguration#4cc0edeb' defined in URL [file:/home/ignite/sample-cache.xml]: Error setting property 
    values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'offHeapMaxMemory' of bean class 
[org.apache.ignite.configuration.CacheConfiguration]: Bean property 'offHeapMaxMemory' is not writable or has an invalid setter method. Does the 
parameter type of the setter match the return type of the getter? 

遮阳帽的SnapShot

Time of the snapshot: 07/07/17, 16:54:35 
+===========================================================================================================================+ 
| Name(@) | Mode  | Nodes |  Entries (Heap/Off-heap)  | Hits | Misses | Reads | Writes | 
+===========================================================================================================================+ 
| txnCache(@c0) | PARTITIONED | 1  | min: 2917681 (2917681/0)   | min: 0 | min: 0 | min: 0 | min: 0 | 
|    |    |  | avg: 2917681.00 (2917681.00/0.00) | avg: 0.00 | avg: 0.00 | avg: 0.00 | avg: 0.00 | 
|    |    |  | max: 2917681 (2917681/0)   | max: 0 | max: 0 | max: 0 | max: 0 | 
+---------------------------------------------------------------------------------------------------------------------------+ 

Cache 'txnCache(@c0)': 
+--------------------------------------------------------------+ 
| Name(@)      | txnCache(@c0)     | 
| Nodes      | 1        | 
| Total size Min/Avg/Max  | 2917681/2917681.00/2917681 | 
| Heap size Min/Avg/Max  | 2917681/2917681.00/2917681 | 
| Off-heap size Min/Avg/Max | 0/0.00/0     | 
+--------------------------------------------------------------+ 

Nodes for: txnCache(@c0) 
+============================================================================================================+ 
|  Node ID8(@), IP  | CPUs | Heap Used | CPU Load | Up Time |   Size   | Hi/Mi/Rd/Wr | 
+============================================================================================================+ 
| 924C5A56(@n0), 10.0.2.55 | 2 | 8.93 % | 93.83 % | 00:12:31:969 | Total: 2917681  | Hi: 0  | 
|       |  |   |   |    | Heap: 2917681  | Mi: 0  | 
|       |  |   |   |    | Off-Heap: 0  | Rd: 0  | 
|       |  |   |   |    | Off-Heap Memory: 0 | Wr: 0  | 
+------------------------------------------------------------------------------------------------------------+ 
'Hi' - Number of cache hits. 
'Mi' - Number of cache misses. 
'Rd' - number of cache reads. 
'Wr' - Number of cache writes. 

Aggregated queries metrics: 
    Minimum execution time: 00:00:00:000 
    Maximum execution time: 00:00:00:000 
    Average execution time: 00:00:00:000 
    Total number of executions: 0 
    Total number of failures: 0 

遮阳板快照显示Off-Heap/Off-Heap-Memory as 0。在文档中,默认情况下会将其作为缺省off堆提及。存储堆外之前是否有任何阈值?我如何配置?

回答

1

自2.0以来CacheConfiguration中没有offHeapMaxMemory属性。

是的,因为默认2.0版缓存存储在堆外的数据。 你可以检查一下:

cache.size(CachePeekMode.OFFHEAP))

而且,遮阳板不能正确计算“离堆条目数”指标,但是这已经是固定的,并且将在2.1

+0

版本可在C++中,是否有任何cache.size(CachePeekMode.OFFHEAP))equivivalent? –

+0

是的,这是一个链接:https://ignite.apache.org/releases/2.0.0/cppdoc/classignite_1_1cache_1_1Cache.html#ae2a4bc2ff23bb72bd6338d3003c8d9f7 –

+0

这个大小代表堆外或堆上条目吗?如果OnHeapCacheEnabled设置为true,计数会发生什么? –