2017-07-07 43 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,計數會發生什麼? –