简体   繁体   English

WSO2 Siddhi RDBMS存储扩展-如何将batchEnable设置为false

[英]WSO2 Siddhi RDBMS Store Extension - how to set batchEnable to false

I'm using siddhi to create some app which also interacts with PostgreSQL DB. 我正在使用siddhi创建一些与PostgreSQL DB交互的应用程序。 Although I'm not sure, I believe, there is a bug about making multiple updates on the same PG table, within a single event (ie upon receiving an event, update a record in the table, and create another one again in the same table) it seems the batch updates are causing some problems. 尽管我不确定,但是我相信在单个事件内对同一PG表进行多次更新存在一个错误(即,在接收到一个事件后,更新表中的记录并在同一事件中再次创建另一个记录)表),似乎批处理更新引起了一些问题。 SO, I just want to give it a try after disabling batchUpdate (it is enabled by default). 所以,我只想在禁用batchUpdate(默认情况下启用)后尝试一下。 I just don't know how to configure it using siddhi-sdk (via Intellij plugin). 我只是不知道如何使用siddhi-sdk(通过Intellij插件)进行配置。 There are two related tickets: https://github.com/wso2-extensions/siddhi-store-rdbms/issues/43 https://github.com/wso2/product-sp/issues/472 Until these are documented, I'd like to get some quick response how to set these fields. 有两张相关的票证: https : //github.com/wso2-extensions/siddhi-store-rdbms/issues/43 https://github.com/wso2/product-sp/issues/472在记录这些文档之前,我想快速获得如何设置这些字段的信息。

Best regards... 最好的祝福...

I'm using siddhi to create some app which also interacts with PostgreSQL DB. 我正在使用siddhi创建一些与PostgreSQL DB交互的应用程序。 Although I'm not sure, I believe, there is a bug about making multiple updates on the same PG table, within a single event (ie upon receiving an event, update a record in the table, and create another one again in the same table) it seems the batch updates are causing some problems. 尽管我不确定,但是我相信在单个事件内对同一PG表进行多次更新存在一个错误(即,在接收到一个事件后,更新表中的记录并在同一事件中再次创建另一个记录)表),似乎批处理更新引起了一些问题。

When batchEnabled has been set to true, it will perform the insert/update operation on batch of events instead of performing those operations on each and every single event. 当batchEnabled设置为true时,它将对事件批次执行插入/更新操作,而不是对每个事件都执行这些操作。 Simply, this has been introduced to improve the performance. 简单地说,已引入此方法来提高性能。

The default value of this parameter is currently set to "true". 该参数的默认值当前设置为“ true”。 However, batchEnable configurations is done through a system parameter called, "{{RDBMS-Name}}.batchEnable" which have to be configured in the WSO2 Stream Processor's deployment.yaml 但是,batchEnable配置是通过名为“ {{RDBMS-Name}}。batchEnable”的系统参数完成的,必须在WSO2流处理器的deployment.yaml中对其进行配置。

If you want to overide this property in Product-SP please find the steps below. 如果要在Product-SP中覆盖此属性,请找到以下步骤。

  1. Open the deployment.yaml file located in {Product-SP-Home}/conf/editor/ 打开{Product-SP-Home} / conf / editor /中的deployment.yaml文件

  2. Insert the following lines in the file. 在文件中插入以下行。

siddhi: extensions: extension: name: store namespace: rdbms properties: PostgreSQL.batchEnable: true

But currently there is no way to overwrite those system configurations from the siddhi app level. 但是,目前无法从siddhi应用程序级别覆盖这些系统配置。 Since you are using the SDK, what you can do is changing the default value of above parameter to " false ". 由于您使用的是SDK,因此您可以将上述参数的默认值更改为“ false ”。

Please find the steps below do it. 请执行以下步骤。

  1. Find the siddhi-store-rdbms-4.x.xx.jar file in the siddhi sdk. 在siddhi sdk中找到siddhi-store-rdbms-4.x.xx.jar文件。 This is located in the {siddhi-sdk-home}/lib/ . 该文件位于{siddhi-sdk-home} / lib /中

  2. Open the jar file using an archive manager and open the rdbms-table-config.xml file located inside it with a text editor. 使用存档管理器打开jar文件,然后使用文本编辑器打开其中的rdbms-table-config.xml文件。

  3. Set false in <batchEnable>true</batchEnable> attribute under the <database name="PostgreSQL"> tag and save it. <database name="PostgreSQL">标记下的<batchEnable>true</batchEnable>属性<batchEnable>true</batchEnable> false设置并保存。

Thanks Raveen. 谢谢拉文。 with a simple dash (-) before "extension" I was able to set the config. 用一个简单的破折号(-)在“扩展名”之前,我可以设置配置。

siddhi: 
  extensions: 
   - extension:
       name: store
       namespace: rdbms
       properties: 
         PostgreSQL.batchEnable: false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM