ClientCacheConfiguration未保存到表格。

huangapple go评论59阅读模式
英文:

ClientCacheConfiguration is not saved to table

问题

在使用Ignite时,我曾使用CacheConfiguration,但遇到了身份验证问题。
因此,我开始将CacheConfiguration更改为clientCacheConfiguration。然而,在将其转换为CacheConfiguration后,我开始注意到它
无法保存到表格,因为它缺少setIndexedTypes方法,例如。
之前

CacheConfiguration<String, IgniteParRate> cacheCfg = new CacheConfiguration<>();
cacheCfg.setName(APIConstants.CACHE_PARRATES);
cacheCfg.setIndexedTypes(String.class, IgniteParRate.class);

现在

ClientCacheConfiguration cacheCfg = new ClientCacheConfiguration();
cacheCfg.setName(APIConstants.CACHE_PARRATES);
//cacheCfg.setIndexedTypes(String.class, IgniteParRate.class);  --> 这不提供

我仍然需要填充表格,以便我们更容易验证(使用像DBeaver这样的客户端IDE)
有办法解决这个问题吗?

英文:

Was using CacheConfiguration in Ignite until I stuck with issue on how to authenticate.
Because of that I was starting to change the CacheConfiguration to clientCacheConfiguration. However after converting it to CacheConfiguration I started to notice that it
does not able to save into table because it lack of method setIndexedTypes eg.
Before

CacheConfiguration&lt;String, IgniteParRate&gt; cacheCfg = new CacheConfiguration&lt;&gt;();
cacheCfg.setName(APIConstants.CACHE_PARRATES);
cacheCfg.setIndexedTypes(String.class, IgniteParRate.class);

New

ClientCacheConfiguration cacheCfg = new ClientCacheConfiguration();
cacheCfg.setName(APIConstants.CACHE_PARRATES);
//cacheCfg.setIndexedTypes(String.class, IgniteParRate.class);  --&gt; this is not provided

I still need the table to be populated so it easier for us to verify ( using Client IDE like DBeaver)
Any way to solve this issue?

答案1

得分: 2

如果需要在使用轻客户端动态创建表格/缓存,您需要使用setQueryEntities()方法手动定义SQL可用的列。(通过传递带有注解的类基本上是定义查询实体的快捷方式。)我不确定为什么在轻客户端中不可用setIndexedTypes(),也许可以在开发者邮件列表中提问。

或者,您可以使用厚客户端预先定义您的缓存/表格。在使用轻客户端时它们仍然可用。

英文:

If you need to create tables/cache dynamically using the thin-client, you'll need to use the setQueryEntities() method to define the columns available to SQL "manually". (Passing in the classes with annotations is basically a shortcut for defining the query entities.) I'm not sure why setIndexedTypes() isn't available in the thin-client; maybe a question for the developer mailing list.

Alternatively, you can define your caches/tables in advance using a thick client. They'll still be available when using the thin-client.

答案2

得分: 1

你可以尝试使用缓存模板来补充现有答案。
https://apacheignite.readme.io/docs/cache-template

预先配置模板,在从薄客户端创建缓存时使用它们。

英文:

To add to existing answer, you can also try to use cache templates for that.
https://apacheignite.readme.io/docs/cache-template

Pre-configure templates, use them when creating caches from thin client.

huangapple
  • 本文由 发表于 2020年1月6日 17:58:36
  • 转载请务必保留本文链接:https://go.coder-hub.com/59609997.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定