Tag: gemfire

值未填充到gemfire缓存中

我有2个xml配置文件,如下所示 APP-context.xml中: 测试cache.xml info 我有一个名为TestCache.java的测试类 @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { “classpath:app-context.xml” }) public class TestCache { @Autowired GemfireTemplate testCache; @Test public void testgetSomeValues() { HashMap map1 = retrieveSomeValues(); HashMap map2 = retrieveSomeValues(); assertEquals(Map1, Map2); } @Cacheable(value = “testCache”) public HashMap retrieveSomeValues() { HashMap obj = new HashMap(); obj.put(“600”, “Auto”); obj.put(“601”, “Life”); return obj; } } 但我发现实际上没有任何东西被缓存到该地区。 […]

gemfire自定义序列化无济于事

我使用gemfire作为我的缓存。 缓存堆大小远高于100GB。 我发现当我们从客户端将数据放入gemfire缓存时,它会将数据序列化并发送到服务器,而在服务器上,数据以序列化forms存储。 问题: 当我尝试执行任何on-server函数调用时,它会开始反序列化数据并且它非常耗时,有时需要一个多小时来迭代缓存中的对象。 (对象数量接近600万)。 我尝试使用gemfire自定义序列化(DataSerializer类)。 并且所有数据在缓存中所占用的内存量大约为60GB,如果我使用Java默认序列化则相同。 我尝试使用一个名为Kryo https://github.com/EsotericSoftware/kryo的库,这确实有很大帮助,但我仍然不明白为什么gemfire序列化对我没有帮助,因为我正在单独序列化该类的每个属性因此编写类标题和任何其他元数据不应该有任何负担。 任何帮助将非常感激。

使用ClientRegionShortcut.PROXY以编程方式控制Gemfire区域的入门时间

是否可以将ClientCache与ClientRegionShortcut.PROXY一起使用以及对入口TTL设置(即服务器中存在的条目)的编程控制? 我看到条目到期ttl设置与ClientRegionShortcut.CACHING_PROXY_HEAP_LRU一起正常工作。 在这种情况下,我可以看到在配置的超时后服务器中的条目无效,以秒为单位,但ClientRegionShortcut.PROXY设置不是这种情况。 是否无法动态控制ClientCache的entry-ttl设置? code / config下面使用ClientRegionShortcut.CACHING_PROXY_HEAP_LRU使用ClientRegionShortcut.PROXY 。 Gemfire version is : 9.0.x pom如下所示 4.0.0 com.springboot.gemfire app 0.0.1-SNAPSHOT jar MyGemfireProject Test Concepts project for Spring Boot with Gemfire org.springframework.boot spring-boot-starter-parent 1.5.3.RELEASE UTF-8 UTF-8 1.8 org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-actuator org.springframework.boot spring-boot-starter-cache org.springframework.data spring-data-gemfire org.springframework.boot spring-boot-starter-test test org.modelmapper modelmapper 0.7.4 com.gemstone.gemfire gemfire 8.2.6 org.springframework.maven.milestone Spring Maven Milestone […]

为什么unix和Java RunTime显示的统计数据存在差异

我的应用程序存在一些内存问题,需要帮助理解这些统计信息。 Unix“top”为我的流程显示了这些统计数据 – VSZ: 37.4g RSS: 20.0g 因此,这意味着目前交换20g用于该过程和使用中。 但是,当我使用Runtime类从我的应用程序中打印统计信息时,我得到: Runtime.totalMemory() : 9.8G Runtime.freeMemory() : 3.6G Runtime.maxMemory() : 14.3G 为什么[Runtime.totalMemory() – Runtime.freeMemory()]与RSS不匹配? 这是该进程当前使用的内存。 这两个数字之间存在巨大差异。 此外,运行时是否将未使用的内存(Runtime.freeMemory())返回给OS以供其他进程使用? 请注意,我的应用程序运行在使用共享和复制缓存设置的对等GemFire缓存系统中。 我需要优化应用程序以减少内存占用。

如何从Gemfire获得独特的长度?

我们正在开发一个直接与Gemfire对话的分层Java应用程序。 我们需要能够生成唯一的“长”序列号,保证在应用程序的所有节点上都是唯一的。 (并非所有节点都是群集的) 通常我会在Oracle中创建一个序列,但在这种情况下,即使我们的Gemfire配置与关系数据库有连接以进行写后面持久性,我们的应用程序也没有其他数据库知识。 在不进入数据库的情况下,生成那些保证唯一长值的最佳方法是什么?