搜索

此内容没有您所选择的语言版本。

2.4. External Materialization and Red Hat JBoss Data Grid

download PDF
Red Hat JBoss Data Grid can be used as an external materialized data source system in order to improve query result performance. You can use a JDBC data source for the same reason.

Note

You can also define the materialization through a dynamic VDB. To learn how, look at the [EAP_HOME]/quickstarts/jdg7.1-remote-cache-materialization quick start.

Important

When DDL metadata changes, the only way to promote the change is restart the Red Hat JBoss Data Grid instance. This also impacts VDB versioning.

Important

You cannot query a cache if it contains multiple pojos.

2.4.1. Materializing a View

Prerequisites

You must have two caches and the teiid-alias-naming-cache in Red Hat JBoss Data Grid. (The teiid-alias-naming-cache only needs to be created once because it is shared across all the materializations stored in the Red Hat JBoss Data Grid instance.)

  1. Using Teiid Designer, click on a view that is to be materialized.

    Note

    Make sure the view has a primary key defined as the Red Hat JBoss Data Grid source table needs one for updates. Otherwise, you will need to manually create a primary key on each of the new JDG source tables.
  2. Right-click on the view and click Modeling->Materialize.
  3. Enter the primary and staging cache names.
    Optionally, you can change the JDGSource model name and the directory in which the model is saved.

    Note

    Red Hat JBoss Data Grid restricts the name of the source model because the protobuf code is based on the Java package naming constraints. The model name becomes the package name in the .proto file. This is due to a limitation in the way that the protobuf is defined. Because Red Hat JBoss Data Grid uses Java, the package name must follow the Java package naming standards. Dashes, for instance, are not allowed.
  4. Click Finish.
  5. To control the materialization process, update the materialized view extension properties on the above selected view:
    • MATVIEW_TTL - to set the refresh rate, in milliseconds
    If the materialization management status table is used, then set the following extension properties:
    • ALLOW_MATVIEW_MANAGEMENT = true
    • MATVIEW_STATUS_TABLE = {status table name}
  6. Create the VDB, using the models needed for materialization.
    For the JDGSource model, be sure the JNDI is mapped to the JDG data source. Also, enable native queries. To do this, create a translator override for the infinispan-hotrod translator. Click the supportsDirectQueryProcedure property and set the value to true.
  7. Deploy the VDB.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.