作為另一款主流的開源數據網格產品,GridGain是Hazelcast的強有力競爭者。同樣提供了社區版和商業版,近日GridGain的開源版本已經進入[Apache孵化器項目Ignite](http://ignite.incubator.apache.org/)(一款開源的內存計算(In-Memory Computing)IMC中間件),目前Apache正在遷移GridGain開源版本的代碼到Ignite項目。鑒于經過之前Hazelcast的介紹已經對數據網格產品有了一定了解,本文著重介紹GridGain與Hazelcast差異化之處。
### 1?重疊功能列舉
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: none;"><tbody><tr><td colspan="2" style="width: 169.85pt; border: 1pt solid white; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="226"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">比較</span></strong></p></td><td style="width: 127.6pt; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-top-color: white; border-right-color: white; border-bottom-color: white; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="170"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span lang="EN-US" style="font-family: 微軟雅黑, sans-serif; color: white;">Hazelcast</span></strong></p></td><td style="width: 117.35pt; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-top-color: white; border-right-color: white; border-bottom-color: white; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="156"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span lang="EN-US" style="font-family: 微軟雅黑, sans-serif; color: white;">GridGain</span></strong></p></td></tr><tr><td rowspan="3" style="width: 56.45pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-color: white; border-bottom-color: white; border-left-color: white; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" width="75"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">使用性</span></strong></p></td><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">安裝</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(247, 202, 172); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><span lang="EN-US" style="font-family: 微軟雅黑, sans-serif;">Maven</span><span style="font-family: 微軟雅黑, sans-serif;">引入<span lang="EN-US">Jar</span>包即可,無需安裝軟件</span></p></td></tr><tr><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">客戶端</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(251, 228, 213); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><span style="font-family: 微軟雅黑, sans-serif;">支持各種語言的客戶端</span></p></td></tr><tr><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">框架集成</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(247, 202, 172); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><span style="font-family: 微軟雅黑, sans-serif;">集成<span lang="EN-US">Hibernate</span>、<span lang="EN-US">Web Session</span>、<span lang="EN-US">Spring</span></span></p></td></tr><tr><td style="width: 56.45pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-color: white; border-bottom-color: white; border-left-color: white; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" width="75"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">基本功能</span></strong></p></td><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">分布式計算工具</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(251, 228, 213); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><span style="font-family: 微軟雅黑, sans-serif;">分布式的<strong>集合</strong>、<strong>并發包</strong>、<strong>消息隊列</strong>、<strong>調度器</strong></span></p></td></tr><tr><td style="width: 56.45pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-color: white; border-bottom-color: white; border-left-color: white; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" width="75"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">性能</span></strong></p></td><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">性能配置</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(247, 202, 172); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif;">內存索引</span></strong><span style="font-family: 微軟雅黑, sans-serif;">、<strong><span lang="EN-US">Near-Cache</span></strong>、<strong>數據親和性</strong></span></p></td></tr><tr><td rowspan="3" style="width: 56.45pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-color: white; border-bottom-color: white; border-left-color: white; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" width="75"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">可靠性</span></strong></p></td><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">數據備份</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(251, 228, 213); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><span style="font-family: 微軟雅黑, sans-serif;">分區數據冗余備份</span></p></td></tr><tr><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">持久化</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(247, 202, 172); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><span lang="EN-US" style="font-family: 微軟雅黑, sans-serif;">read-through</span><span style="font-family: 微軟雅黑, sans-serif;">,<span lang="EN-US">write-through/behind</span></span></p></td></tr><tr><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">事務</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(251, 228, 213); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><span style="font-family: 微軟雅黑, sans-serif;">保證數據一致性</span></p></td></tr><tr><td rowspan="2" style="width: 56.45pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-color: white; border-bottom-color: white; border-left-color: white; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" width="75"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">擴展性</span></strong></p></td><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">自動分區</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(247, 202, 172); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><span style="font-family: 微軟雅黑, sans-serif;">支持<strong>本地</strong>、<strong>分區</strong>、<strong>復制</strong>三種方式</span></p></td></tr><tr><td style="width: 4cm; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(237, 125, 49); padding: 0cm 5.4pt;" valign="top" width="151"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><strong><span style="font-family: 微軟雅黑, sans-serif; color: white;">動態拓撲</span></strong></p></td><td colspan="2" style="width: 244.95pt; border-top-style: none; border-right-style: solid; border-bottom-style: solid; border-left-style: none; border-bottom-color: white; border-bottom-width: 1pt; border-right-color: white; border-right-width: 1pt; background-color: rgb(251, 228, 213); padding: 0cm 5.4pt;" valign="top" width="327"><p align="center" style="margin: 0cm 0cm 0.0001pt; text-align: center; font-size: 10.5pt; font-family: Calibri, sans-serif;"><span style="font-family: 微軟雅黑, sans-serif;">動態添加刪除結點,自動<span lang="EN-US">rebalance</span></span></p></td></tr></tbody></table>
上面簡單列舉了一些Hazelcast和GridGain的重疊功能,而兩者的差異之處主要在于以下幾個方面:
???整體功能的全面性:圍繞內存計算提供的**功能**。
???使用性:對**SQL支持**的完整性、對**Continuous Query**的支持、以及與持久化存儲的**數據集成**。
???性能:免費的**off-heap存儲**實現。
???可靠性方面:**事務**的隔離性、內存**溢出到磁盤**。
???管理:提供強大的**后臺管理界面**。
此外,企業版還提供了Portable跨平臺對象、安全和審計、數據中心復制、可還原的本地cache以及split-brain網絡分段問題解決等功能。本文暫不關注企業版中的附加功能,下面開始著重介紹上面列舉的開源社區版與Hazelcast的功能差異。
### 2?全面的內存計算功能棧
從整體功能上來說,GridGain是個出色的多面手,不僅可以完成本職工作-內存計算/數據網格,還提供了:
1)?????GGFS(GridGain?In-Memory File System),類似Spark生態圈中的Tachyon,能夠加速MapReduce任務的執行。
2)?????完整的ACID和事務支持,可以作為內存數據庫。
3)?????流式數據/事件處理,可以作為CEP事件處理器。


### 3?豐富的查詢功能
一般開源IMDG產品支持基本的對象過濾查詢能力,但GridGain底層借助H2數據庫引擎來解析和執行SQL,所以支持復雜的對象聯結查詢,類似于GemFire中的OQL提供的功能,以及僅在Hazelcast商業版本中才支持的Continuous Query功能。
首先來看一下我們的測試數據和Entity是什么樣子,代碼忽略了構造函數、getter/setter和toString等方法。Person中包含了id、name、salary三個基本屬性,并與Organization是多對一的關系,與Address是一對一的關系。

對于POJO要注意幾點:1)查詢中涉及的成員變量都要標上**@GridCacheQuerySqlField**注解;2)因為POJO會被哈希到其他結點上的分區,所以要實現**序列化接口**;3)下面例子只測試了**one-to-one**(直接嵌套實體Address)、**many-to-one**(通過orgId關聯其他實體)關系的查詢,而沒有嘗試one-to-many和many-to-many(都是在實體中嵌套另一實體id的集合);4)GridCacheConfiguration要開啟**setQueryIndexEnabled(true)**。
#### 3.1?簡單的過濾查詢
簡單的對象過濾查詢是最常見的,也是其他網格產品像Hazelcast支持的。

#### 3.2?同cache下的join查詢
同cache下可能會關聯的數據,可以通過數據親和性設置使相關數據分配到同一分區中,從而避免網絡傳輸開銷。當然,Hazelcast也是支持數據親和性的,本節關注的重點是join查詢。代碼類似于3.3中的跨cache查詢,差別只不過是:1)Organization對象不是保存到org-cache,而是與Person對象一起保存到person-cache;2)SQL中不需要顯式指明緩存名稱,因為對象都在一個緩存person-cache中。
#### 3.3?跨cache的join查詢
~~被join的cache(org-cache)必須是REPLICATE的,從而在各個結點上都存在,不會產生交叉join。~~(注:Impala支持這種join,將產生N*M次數據通信)

#### 3.4?字段查詢
GridGain不僅支持查詢結果為實體,同時也支持各種SQL函數對實體進行各種操作,如聚合、字符串操作等。

#### 3.5 Continuous查詢
Continuous查詢不支持SQL,只支持Predicate風格組裝查詢。

執行效果如下,首先初始化到緩存中的Person對象中有一個salary=300,滿足條件,所以本地callback收到通知。之后我們試著更新緩存中的一個Person對象的salary=250,于是再次收到通知。最后我們新建一個Person,salary=500,并保存到緩存中,于是再次收到通知。這就是Continuous Query的運行效果。

### 4?集成持久化存儲
類似Hazelcast,GridGain也提供了**read-through**、**write-through**以及異步**write-behind**三種與后端持久化存儲通信的方式。此外,GridGain還支持事務提交時批量write,以及緩存entry**即將過期時**自動重新re-cache(**refresh-ahead**)功能。像refresh-ahead功能在GemFire等商業產品中才會實現。

### 5?堆外內存存儲
不像Hazelcast等開源產品只在商業版中提供off-heap存儲功能,GridGain在開源版本中就提供了此功能,從而顯著地擴充JVM管理的內存容量,并減輕GC壓力和停頓時間。GridGain提供了*ONHEAP_TIERED*(**默認堆優先,溢出到非堆內存**)、*OFFHEAP_TIERED*(不使用堆,直接將所有entry放入非堆內存)、*OFFHEAP_VALUES*(將key存儲在堆,value存儲在非堆內存)三種模式。當堆和非堆內存都不足時,還可以開啟SWAP,將數據溢出到磁盤(詳見第7部分:數據溢出到磁盤)。下圖表示了堆、非堆、磁盤、外圍存儲的容量和延遲的關系。

### 6?完整的ACID和事務支持
內存事務與傳統數據庫事務有一點點不同。因為IMDG產品使用的是易逝內存,所以故障或斷電時內存數據會全部丟失。一般IMDG重啟時會從備份結點或其他持久化存儲中恢復數據。但這不代表內存事務不重要!只要集群是存活的,GridGain就要保證不同結點間的數據一致性。為此,GridGain提供了兩種*TRANSACTIONAL*和*ATOMIC*兩種配置:
???**TRANSACTIONAL**:完整的ACID屬性的事務,以及顯式的鎖。
???**ATOMIC**:沒有事務和鎖。
GridGain使用**2PC(兩階段提交)協議**實現分布式事務,同時支持**樂觀**和**悲觀**兩種模式。樂觀模式下所有key在提交時才會加鎖,所以在Prepare階段,prepare消息發送給各結點獲取事務中將要操作的key的鎖,各結點通過ACK消息應答。而悲觀模式下,所有key在提交前就已加鎖,所以Prepare階段不需要做任何事。在Commit階段,commit消息發送給各結點提交,若失敗則發送回滾消息給各結點。可以設置各個結點之間是同步還是異步提交(注:Hazelcast支持一種**2PC擴展協議**,具體的優勢還有待研究)。最后,GridGain支持*READ_COMMITTED*,*REPEATABLE_READ*和*SERIALIZABLE*三種事務隔離級別,默認是REPEATABLE_READ。而Hazelcast只支持REPEATABLE_READ一種。
### 7?數據溢出到磁盤
在第5部分堆外內存存儲中提到過GridGain的層次化存儲,以下面的緩存配置為例,它同時開啟了off-heap和swap。1)首先,數據優先保存在堆內存中。2)當entry總數超過100個時,會通過LRU淘汰到非堆內存中。3)當超過非堆內存的最大容量5MB時,會將多出的數據保存在磁盤上。當然,磁盤IO操作的代價是很大,我們可以優先考慮使用超大的**非堆內存**,或者使用**SSD閃存**,以及開啟操作系統的**磁盤IO緩存**來進行優化。
GridCacheConfiguration?cacheCfg?= new?GridCacheConfiguration();
cacheCfg.setEvictionPolicy(new?GridCacheLruEvictionPolicy(**100**));
cacheCfg.setOffHeapMaxMemory(**5 * 1024L * 1024L**);
cacheCfg.setSwapEnabled(**true**);
### 8?強大的管理界面
首先,以相同配置啟動三個GridGain實例。然后,啟動gridgain-fabric-os-6.5.5/bin/?ggvisorui.exe,在Visor GUI中選擇File->Connect->External標簽頁下,直接localhost+默認端口連接即可進入Dashboard。在這能看到我們剛剛啟動的三個結點的總體信息。

點擊Data Grid標簽頁,可以查看各個cache的內存使用、讀寫以及命中情況,例如我們初始化了3個Person和2個Organization對象,并分別保存到了person-cache和org-cache中,于是我們可以在此標簽頁看到Primary Entry和Write個數都是3和2。
