WSO2 DAS supports several RDBMS types for its underlying Data Access Layer (DAL). In order to use the RDBMS DAL component, a pre-configured installation of a RDBMS is required. The RDBMS implementation for the DAS DAL contains both the implementations of Analytics Record Store and Analytics File System. The following sections describe both implementations of the Cassandra DAL component
...
In order to use RDBMS as the record store/file system, ensure that the RDBMS datasource provider is enabled by following the steps below.
...
Property | Description |
---|---|
<implementation> | The implementation class of the Analytics Record Store relevant for RDBMS, which is org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore . |
<property name="datasource"> | The Carbon datasource name of the RDBMS type, that is used to find the associated RDBMS data source. |
Configurations for the Analytics File System
To configure RDBMS as the underlying datasource implementation for the Analytics Record Store, specify the RDBMS configurations in the <DAS_HOME>repository/conf/analytics/analytics-config.xml
file as shown in the example below.
Code Block | ||
---|---|---|
| ||
<analytics-record-store name="EVENT_STORE">
<implementation>org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsFileSystem</implementation>
<properties>
<!-- the data source name mentioned in data sources configuration -->
<property name="datasource">WSO2_ANALYTICS_EVENT_STORE_DB</property>
</properties>
</analytics-record-store> |
The properties of the above configurations are described below.
Property | Description |
---|---|
<implementation> | The implementation class of the Analytics Record Store relevant for RDBMS, which is org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsFileSystem . |
<property name="datasource"> | The Carbon datasource name of the RDBMS type, that is used to find the associated RDBMS data source. |
RDBMS query configuration
...
RDBMS query configuration
The above Analytics Record Store, depends on a query configuration to execute its implementation. The query configuration contains SQL query templates for each of the RDBMS servers that it interfaces with. Using this configuration, you can modify the existing queries for fine tuning, or create new query configurations for a RDBMS that is not configured out of the box. You can find these configurations in the <DAS_HOME>/repository/conf/analytics/rdbms-query-config.xml
file as shown in the example below. Click on the relevant tab to view the query templates for each database category.
...
Property | Description |
---|---|
database name | The target RDBMS name to which this query template applies, a regular expression can be put here, to give a pattern on to which a database product name can be mapped. For example, DB2 will give different product name strings when running in Windows and Unix based OS environments, so a regular expression like "DB2.*" will match for all DB2 based database server environments. |
minVersion | The minumum version of the database server this configuration will match to, this will be of format "majorVersion.minorVersion". |
maxVersion | The maximum version of the database server this configuration will match to, this will be of format "majorVersion.minorVersion". |
recordCountSupported | This property specifies whether it is possible to take a count of all the records in the record store. |
paginationSupported | This property specifies whether dividing the output of the record store to manageable chunks is allowed. |
paginationMode | This property specifies the pagination mode. Possible values are as follows. |
blobLengthRequired | This property specifies whether a length should be assigned to data blocks saved in the record store /file system or not. |
recordCountQuery | The query template to take a count of the records in the record store. |
recordDeletionQuery | The query template to delete a record in the record store. |
recordDeletionWithIdsQuery | The query template to delete records with specific IDs in the record store. |
recordMergeQuery | The query template to merge two rows of data of a table in the record store. |
forwardOnlyReadEnabled | If this property is set to true , the cursor can only move forward on the result set when retrieving records from record store. |
fetchSize | Number of rows that should be fetched from the database if more rows are needed on the generated result set when retrieving records from record store. |
recordInsertQuery | The query template to insert new rows of data to a table in the record store. |
recordUpdateQuery | The query template to modify the existing table rows in the record store. |
recordRetrievalQuery | The query template to retrieve a record from the record store. |
recordRetrievalWithIdsQuery | The query template to retrieve records with specific IDs from the record store. |
recordTableCheckQuery | The query template to check tables in the record store. |
recordTableDeleteQueries | The query template to delete a table in the record store. |
recordTableInitQueries | The query template to initialize the tables in the record store. |
Configuring the datasources
You need to define datasources to connect to the above underlying RDBMS implementations as described below.
Configuring the datasource for the Analytics Record Store
Change the configurations of the WSO2_ANALYTICS_EVENT_STORE_DB
datasource in the <DAS_HOME>/repository/conf/datasources/
analytics-datasources.xml
file accordingly. For information on the datasource configurations, see Configuring an RDBMS Datasource.
Configuring the datasource for the Analytics File System datasource
Change the configurations of the WSO2_ANALYTICS_FS_DB
datasource in the <DAS_HOME>/repository/conf/datasources/
analytics-datasources.xml
file accordingly. For information on the datasource configurations, see Configuring an RDBMS Datasource.