Note - Tutorial

1. VMs running GemFire discover each other through multicast messaging or a TCP location service, which is called a locator. The locator runs as a separate process to which each new VM connects to first discover the list of available peers.

2. The simplest type of of region is a replicated region. Every peer that hosts a replicated region stores a copy of the entire region locally. Changes to the replicated region are sent synchronously to all peers that host the region.

3. A partitioned region lets you control how many copies of your data will exist in the distributed system. The data is partitioned over all of the peers that host the partitioned region. GemFire automatically maintains the number of copies of each partition that you request.

The listener in only one of the VMs is invoked for each post. That's because partitioned regions choose one of the copies of the post to be the primary copy. By default GemFire only invokes the listener in the peer that holds the primary copy of each post.

4. Once you create a ClientCache, it maintains a pool of connections to the servers similar to a JDBC connection pool. However, with GemFire you do not need to retrieve connections from the pool and return them. That happens automatically as you perform operations on the regions. The pool locator property tells the client how to discover the servers. The client uses the same locator that the peers do to discover cache servers.

5. Setting the subscription enabled and subscription redundancy properties allow the client to subscribe to updates for entries that change in the server regions. You are going to subscribe to notifications about any people that are added. The updates are sent asynchronously to the client. Because the updates are sent asynchronously, they need to be queued on the server side. The subscription redundancy setting controls how many copies of the queue are kept on the server side. Setting the redundancy level to 1 means that you can lose 1 server without missing any updates.

6. Creating regions in the client is similar to creating regions in a peer. There are two main types of client regions, PROXY regions and CACHING_PROXY regions. PROXY regions store no data on the client. CACHING_PROXY regions allow the client to store keys locally on the client.


7. By creating a CACHING_PROXY, you told GemFire to cache any people that you create from this client. However, you can also choose to receive any updates to the people region that happen from other peers or other clients by invoking the registerInterest methods on the client. In this case you want to register interest in all people, so you cache the entire people regon on the client. The regular expression ".*" matches all keys in the people region.

8. You can dynamically add peers to the system while it is running. The new peers are automatically discovered by the other peers and the client. The new peers automatically receive a copy of any replicated regions they create. However, partitioned regions do not automatically redistribute data to the new peer unless you explicitly instruct GemFire to rebalance the partitioned region. With the cacheserver script, you can pass a command line flag indicating that the new peer should trigger a rebalance of all partitioned regions.

9. GemFire supports shared-nothing persistence. Each VM writes its portion of the region data to its own disk files. For the People region, each peer will be writing the entire region to its own disk files. For the Posts region a copy of each post will reside on two different peers.

10. When you restart persistent members, you need to call cacheserver start in parallel for each server.
The reason is that GemFire ensures that your complete data set is recovered before allowing the VMs to start. Remember that each VM is persisting only part of the Posts region. Each GemFire VM waits until all of the posts are available before starting. This protects you from seeing an incomplete view of the posts region.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
用Android帮我设计一个程序,要求如下1. 该 APP 实现的功能是北林电子本科生毕业去向意愿调研 2. 主页面 Page1 包含 4 个按钮,分别为“基本信息”、“我的志愿”、“保存”、“加载”和“退 出”。还有一个本文显示框,用来显示我的基本信息+志愿。 3. 点击“我的信息”,进入第二个页面 Page2,包含四个文本输入框,分别为“班级”、“姓 名”、“学号”、“家乡”,用户可输入内容。还有一个单选按钮“性别:男/女”,默认选 项为“男”。包含两个按钮“清空”和“确认”。点击“清空”按钮,4 个文本输入框的内容 均被清空;点击“确认”按钮,若用户信息填写完整,返回到主页面 Page1,同时将 用户填写的内容返回显示,若用户信息填写不完整,Toast 弹出提示,页面不跳转。 4. 点击主页面 Page1 的“我的志愿”按钮,进入第三个页面 Page3,包含一个单选框, 可选内容包含:保研、考研、出国、工作、创业、二学位、其他,默认选择为“考研”。 还包含一个文本输入框,让用户文本输入目标的执行计划。还包含一个按钮“确定”。 点击“确定”按钮,返回主页面 Page1,同时将用户选择项及文本输入信息返回显示。 5. 点击主页面 Page1 的“保存”按钮,若主页面的文本显示框内容为空,则 Toast 提示, 若非空,则将文本存储到手机中(存储方式自定)。点击“加载”按钮,若已经存储了 文本文件,则读取并显示到文本显示框中,若还没有存储文本文件,则 Toast 提示。 6. 点击主页面 Page1 的“退出”按钮,退出该 APP。 备注: (1) APP 的 UI 自行设计,简洁、美观、实用 即可 (2) 2 个项目中所有自己编写的代码复制粘贴到该 word 中,APP 实测截图
06-10
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值