第 3 章 配置 Hot Rod C++ 客户端
热 Rod C++ 客户端通过 RemoteCache API 与远程 Data Grid 集群交互。
3.1. 配置和远程缓存管理器 API 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
使用 ConfigurationBuilder API 配置 Hot Rod C++ 客户端连接和 RemoteCacheManager API,以获取和配置远程缓存。
配置构建器
跨站点复制
ConfigurationBuilder builder;
builder.addServer().host("127.0.0.1").port(11222);
// Configure a remote cluster and node when using cross-site replication.
builder.addCluster("NYC").addClusterNode("192.0.2.0", 11322);
ConfigurationBuilder builder;
builder.addServer().host("127.0.0.1").port(11222);
// Configure a remote cluster and node when using cross-site replication.
builder.addCluster("NYC").addClusterNode("192.0.2.0", 11322);
接近缓存
ConfigurationBuilder builder;
builder.addServer().host("127.0.0.1").port(11222);
// Enable near-caching for the client.
builder.nearCache().mode(NearCacheMode::INVALIDATED).maxEntries(4);
ConfigurationBuilder builder;
builder.addServer().host("127.0.0.1").port(11222);
// Enable near-caching for the client.
builder.nearCache().mode(NearCacheMode::INVALIDATED).maxEntries(4);