Apache Ignite持久性存储针对类版本的推荐方法 [英] Apache Ignite persistent store recommended way for class versions

查看:110
本文介绍了Apache Ignite持久性存储针对类版本的推荐方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在RDBMS系统中,即使表中已经有数据,我也可以添加新列。我不知道在存储类对象时使用Ignite持久性存储执行此操作的建议方法是什么?

In RDBMS systems I can add new columns even when there is already data in a table. I wonder what is the suggested way doing this with Ignite persistent store when storing class objects?

如果我有以下包含大量数据的类:

If I have the following class with lots of data:

public class Person implements Serializable
{
  @QuerySqlField
  String firstName;

  @QuerySqlField
  String lastName;
}

后来我可能想向此类添加一个新字段,例如

And later I may want to add a new fields to this class, like

public class Person implements Serializable
{
  @QuerySqlField
  String firstName;

  @QuerySqlField
  String lastName;

  @QuerySqlField
  Date birthday;
}

我可以放置并获得该类的新旧版本吗?当我从持久性存储中读取类的旧版本时,新字段值会发生什么?

Can I put and get old and new versions of this class without problem? What happens to the new field value when I read an old version of the class from the persistent store?

当旧列生日不可用时,SQL查询将如何工作数据的版本?

How will SQL queries work when the column birthday is not available in old versions of the data?

感谢任何建议。

推荐答案

是的,您可以在客户端更新类定义后透明地放置和获取对象。唯一的要求是不要将此类部署在服务器节点的本地类路径上。

Yes, you can put and get objects transparently after updating the class definition on client side. The only requirement is to NOT deploy this class on local classpath of server nodes.

SQL不会自动选择该类,并且在这种情况下不会处理注释。要在运行时更改SQL模式,您需要使用DDL命令(ALTER TABLE,CREATE IMDEX等)。此处有更多详细信息: https://apacheignite-sql.readme.io/docs/ddl

SQL, however, will not pick this up automatically and annotation will not be processed in this case. To change SQL schema in runtime you need to use DDL commands (ALTER TABLE, CREATE IMDEX, etc.). More details here: https://apacheignite-sql.readme.io/docs/ddl

这篇关于Apache Ignite持久性存储针对类版本的推荐方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆