Hey all,
I am developing a MySQL plugin, and want to use "Derived Associations" to make a topology to display the relationship between mysql objects and its cluster group. However I run into some trouble. Could anyone help me out? I am really confused.
Here is the code to define Derived Associations
<?xml version="1.0" encoding="UTF-8"?>
<Rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Rule name="mysql_cluster_contains">
<query>
select 'runs_on_cluster' as assoc_type,
c.target_guid as source_me_guid,
b.target_guid as dest_me_guid
HEXTORAW(NULL) as derivation_target_guid
from MGMT_EMX_MYSQL_DBVAR a,MGMT_ECM_GEN_SNAPSHOT b,MGMT_TARGETS c
where a.ecm_snapshot_id=b.SNAPSHOT_GUID
and a.VARIABLE_NAME ='wsrep_cluster_name'
and b.IS_CURRENT='Y'
and c.TARGET_NAME=a.VALUE
and c.TARGET_TYPE='oracle_mysql_cluster'
</query>
<trigger>
<targetType>oracle_mysql_database</targetType>
<snapshotType>MYSQL_MYSQL_DB</snapshotType>
<table>MGMT_EMX_MYSQL_DBVAR</table>
<idColumn>destination</idColumn>
</trigger>
</Rule>
</Rules>
After I get the file under folder metadata\derivedAssocs, and try to pack the plugin, it failed with message as below.
Violation type: NON SDK Access detected
Validation Type: Meta data Embedded SQL
Artifact being accessed: TABLE MGMT_ECM_GEN_SNAPSHOT
Accessed by: SQL String sql0 in /DATA/mysql_cluster_plugin/mysql_cluster/oms/metadata/derivedAssocs/mysql_cluster_assoc_rules.xml
The SQL query embedded in the above file or class is accessing a non SDK DB object. For legibility only SQL IDs are mentioned here. The actual SQL Strings corresponding to these IDs are mentioned towards the end of the report.
Violation type: NON SDK Access detected
Validation Type: Meta data Embedded SQL
Artifact being accessed: TABLE MGMT_TARGETS
Accessed by: SQL String sql0 in /DATA/mysql_cluster_plugin/mysql_cluster/oms/metadata/derivedAssocs/mysql_cluster_assoc_rules.xml
The SQL query embedded in the above file or class is accessing a non SDK DB object. For legibility only SQL IDs are mentioned here. The actual SQL Strings corresponding to these IDs are mentioned towards the end of the report.
SQL IDs to Strings mapping:
sql0:
select 'runs_on_cluster' as assoc_type,
c.target_guid as source_me_guid,
b.target_guid as dest_me_guid
HEXTORAW(NULL) as derivation_target_guid
from MGMT_EMX_MYSQL_DBVAR a,MGMT_ECM_GEN_SNAPSHOT b,MGMT_TARGETS c
where a.ecm_snapshot_id=b.SNAPSHOT_GUID
and a.VARIABLE_NAME ='wsrep_cluster_name'
and b.IS_CURRENT='Y'
and c.TARGET_NAME=a.VALUE
and c.TARGET_TYPE='oracle_mysql_cluster'
I am sure the SQL is right to display the data. I don't know what "NON SDK Access" is and why the code is wrong. :(
Thank you in advance!
Best wishes,
Satine