问题标签 [spring-data-gemfire]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1070 浏览

gemfire - Gemfire 弹簧示例

https://spring.io/guides/gs/caching-gemfire/上的示例表明,如果缓存未命中,我们必须从服务器获取数据并存储在缓存中。

这是作为 Gemfire 服务器运行的 Gemfire 示例还是 Gemfire 客户端?我认为如果缓存未命中,客户端会自动从服务器获取数据。如果是这种情况,客户端是否会出现缓存未命中?

问候,
亚什

0 投票
1 回答
310 浏览

spring - 是否可以在同一个 Gemfire 区域存储两个 bean 对象?

我们正在尝试创建两个 Gemfire 存储库,因为它们正在处理两个不同的 bean 对象,但我们希望将这两个 bean 对象存储到同一个 gemfire 区域中。

这是正确的方法吗?如果“是”,那么该怎么做?

提前致谢。

0 投票
2 回答
315 浏览

spring-boot - 是否可以使来自 gemfire 区域(如 redis)的特定密钥的数据过期

嗨,我是 gemfire 的新手,我想在我设置的空闲时间后从 gemfire 区域中获取特定键的数据。

我通过下面的代码使用redis做到了这一点。

但是如何在 gemfire 中做到这一点。

任何帮助。

谢谢。

0 投票
1 回答
344 浏览

java - 是否可以使用 java 删除 gemfire 中的特定数据(键及其特定值)?

我们可以删除特定区域中的整个数据,但是如果可以,是否可以删除一个特定的键及其在 gemfire 中的值,那么如何? 如果没有,那为什么

GeodeConfiguration 类

@Configuration 公共类 GeodeConfiguration {

}

移动控制器类

@Controller 公共类 MobileController {

}

在上面的代码中,名称是每次都会更改的,我们要删除键及其传递的值

0 投票
1 回答
1080 浏览

java - How to create composite primary key scenario in Gemfire region?

I am working on migration of mainframe to java. I have one table in DB2. I am replicating this table as a region in Gemfire. While doing this, I have composite primary key for that table. To replicate table to gemfire region. I want to make composite primary key for region. I just want to know that, is there any possibility to create composite primary key in region?

0 投票
1 回答
1101 浏览

spring - 如何在不明确定义区域的情况下为 spring 缓存管理器配置 gemfire?

我有一个使用基于 Guava 缓存的弹簧缓存的弹簧应用程序。由于高吞吐量需求和后写功能,我们现在正在考虑迁移到 Gemfire。我成功地将 Gemfire 配置为缓存,并且能够从缓存中读取和写入。在所有配置示例中,配置需要定义 LocalRegionFactory 如下:

bean 定义好后,我们可以使用@Cacheable(value="person")、@CacheEvict(value="person")。如果我们直接使用缓存名称,gemfire 会抛出缓存未定义的错误。

我们使用 Guava(或 Hazelcast、redis 等)的经验是,我们不需要显式定义缓存。它将在第一次出现时由 spring 自动创建。

有没有办法配置 gemfire 也以同样的方式运行?

0 投票
1 回答
649 浏览

gemfire - 如何从 gemfire 缓存加载器获取多个数据?

我们将为我们的项目实施 gemfire。我们目前正在将 gemfire 缓存与我们的 DB2 数据库同步。因此,我们在将数据库数据放入缓存时遇到了问题。

将数据库数据放入区域。我已经实现com.gemstone.gemfire.cache.CacheLoader并覆盖了它的加载方法。正如java doc load 方法所写的,只会返回一个Object。但是对于我们的要求,我们将不得不从 load 方法返回多个 VO

在以List<CmDvceInvtrGemfireBean>gemfire 区域的形式返回多个 VO 时,将其视为单个值。

所以,当我调用时,

它返回一个计数。但我可以看到总共 7 个数据。

所以,我想实现一种机制,将所有 7 个值作为单独的 VO 在 Region

有没有办法使用 Gemfire CacheLoader 来做到这一点?

0 投票
1 回答
281 浏览

java - Spring Data gemfire - 多个 OnServer 函数

是否可以注册多个@OnServer 函数接口?当我们使用@OnServer 为客户端代理启用多个功能时,服务器无法启动并出现以下错误。

设置构造函数参数时无法解析对 bean 'org.springframework.data.gemfire.function.execution.GemfireOnServerFunctionTemplate#0' 的引用;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建名为 'org.springframework.data.gemfire.function.execution.GemfireOnServerFunctionTemplate#0' 的 bean 时出错:设置构造函数参数时无法解析对 bean 'gemfireCache' 的引用;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建名为“gemfireCache”的 bean 时出错:FactoryBean 在创建对象时抛出异常;嵌套异常是 java.lang.IllegalStateException:此 VM 中已存在与分布式系统的连接。它具有以下配置:

gemfire 函数被放置在一个包中,下面被添加到 appContext 以进行组件扫描。

是否有只注册 1 个 OnServer 函数的标准做法(这听起来太严格了)?任何指针都会有所帮助。

0 投票
2 回答
75 浏览

spring-data-gemfire - Spring Data Gemfire - 从 JNDI 读取定位器

我正在尝试从 JNDI 读取定位器主机和端口信息,其值的格式为 host[port],host2[port2]。

在这种情况下,Spring Data gemfire 似乎无法正确识别定位器。它将 JNDI 查找值字符串作为一个主机,并在末尾附加端口 10334。

但是,如果我将主机和端口值作为定位器属性的一部分传递,如下所示,它会按预期工作。

这是 Spring Data Gemfire 中的问题吗?

0 投票
1 回答
413 浏览

java - Gemfire EntryNotFoundException for @CacheEvict

In short, when @CacheEvict is called on a method and if the key for the entry is not found, Gemfire is throwing EntryNotFoundException.

Now in detail,

I have a class

I have two Cache regions defined as personRegion and personByDeptRegion and the Service is as below

When there is a call to updatePerson and if there are no entries in the personByDeptRegion, this would throw an exception that EntryNotFoundException for the key 1 ( or whatever is the dept code ). There is a very good chance that this method will be called before the @Cacheable methods are called and want to avoid this exception. Is there any way we could tweak the Gemfire behavior to gracefully return when the key is not existing for a given region ?. Alternatively, I am also eager to know if there is a better implementation of the above scenario using Gemfire as cache.

Spring Data Gemfire : 1.7.4

Gemfire Version : v8.2.1

Note: The above code is for representation purpose only and I have multiple services with same issue in actual project.