[atlas] branch branch-1.0 updated: ATLAS-3056: updated rdbms types to remove use of ownedRef/inverseRef - #3

2019-04-13 Thread madhan
This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-1.0 by this push:
 new bdd296e  ATLAS-3056: updated rdbms types to remove use of 
ownedRef/inverseRef - #3
bdd296e is described below

commit bdd296ed928ad05a711e74e5adae09a65ada689c
Author: Madhan Neethiraj 
AuthorDate: Sat Apr 13 21:20:57 2019 -0700

ATLAS-3056: updated rdbms types to remove use of ownedRef/inverseRef - #3

(cherry picked from commit 06a3fd3f8beb50e10db11edd1c8607b3bbe977a3)
---
 addons/models/2000-RDBMS/2010-rdbms_model.json | 206 +++--
 1 file changed, 23 insertions(+), 183 deletions(-)

diff --git a/addons/models/2000-RDBMS/2010-rdbms_model.json 
b/addons/models/2000-RDBMS/2010-rdbms_model.json
index 81f0545..3d784bf 100644
--- a/addons/models/2000-RDBMS/2010-rdbms_model.json
+++ b/addons/models/2000-RDBMS/2010-rdbms_model.json
@@ -73,19 +73,6 @@
 "cardinality": "SINGLE",
 "isUnique": false,
 "isIndexable": false
-},
-{
-"name": "databases",
-"typeName": "array",
-"isOptional": true,
-"cardinality": "SET",
-"isUnique": false,
-"isIndexable": false,
-"constraints": [
-   {
-  "type": "ownedRef"
-   }
-]
 }
 ]
 },
@@ -105,41 +92,12 @@
 "isIndexable": true
 },
 {
-"name": "instance",
-"typeName": "rdbms_instance",
-"isOptional": true,
-"cardinality": "SINGLE",
-"isUnique": false,
-"isIndexable": false,
-"constraints": [
-   {
-   "type": "inverseRef",
-   "params": {
-   "attribute": "databases"
-   }
-   }
-]
-},
-{
 "name": "contact_info",
 "typeName": "string",
 "isOptional": true,
 "cardinality": "SINGLE",
 "isUnique": false,
 "isIndexable": false
-},
-{
-"name": "tables",
-"typeName": "array",
-"isOptional": true,
-"cardinality": "SET",
-"isUnique": false,
-"isIndexable": false,
-"constraints": [
-   {
-   "type": "ownedRef"
-   }
-]
 }
 ]
 },
@@ -154,22 +112,6 @@
 },
 "attributeDefs": [
 {
-"name": "db",
-"typeName": "rdbms_db",
-"isOptional": true,
-"cardinality": "SINGLE",
-"isUnique": false,
-"isIndexable": false,
-"constraints": [
-   {
-   "type": "inverseRef",
-   "params": {
-   "attribute": "tables"
-   }
-   }
-]
-},
-{
 "name": "name_path",
 "typeName": "string",
 "isOptional": true,
@@ -210,45 +152,6 @@
 "valuesMaxCount": 1,
 "isUnique": false,
 "isIndexable": false
-},
-{
-"name": "columns",
-"typeName": "array",
-"isOptional": true,
-"cardinality": "SET",
-"isUnique": false,
-"isIndexable": false,
-"constraints": [
-{
-"type": "ownedRef"
-}
-]
-},
-{
-"name": "indexes",
-"typeName": "array",
-"isOptional": true,
-"cardinality": "SET",
-"isUnique": false,
-"isIndexable": false,
-"constraints": [
-{
-"type": "ownedRef"
-}
-]
-},
-{
-   

[atlas] branch branch-1.0 updated: ATLAS-3056: updated rdbms types to remove use of ownedRef/inverseRef

2019-03-07 Thread madhan
This is an automated email from the ASF dual-hosted git repository.

madhan pushed a commit to branch branch-1.0
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/branch-1.0 by this push:
 new be98213  ATLAS-3056: updated rdbms types to remove use of 
ownedRef/inverseRef
be98213 is described below

commit be98213f5d60d6af7d485782dc077e06e92b0089
Author: Madhan Neethiraj 
AuthorDate: Thu Feb 21 18:16:34 2019 -0800

ATLAS-3056: updated rdbms types to remove use of ownedRef/inverseRef

(cherry picked from commit f103e1438bbfc0c61912ded3551e22578876fbbe)
(cherry picked from commit 5d99c40a51d910d3858d4d25e321afad5f12996d)
---
 addons/models/2000-RDBMS/2010-rdbms_model.json |   6 +-
 .../003-remove-rdbms-legacy-attributes.json|  90 +
 .../apache/atlas/model/instance/AtlasStruct.java   |   6 +-
 .../bootstrap/AtlasTypeDefStoreInitializer.java|  25 +++-
 .../graph/v2/AtlasRelationshipDefStoreV2.java  |  11 +-
 .../notification/NotificationHookConsumer.java |  30 -
 .../preprocessor/EntityPreprocessor.java   |  39 +-
 .../preprocessor/PreprocessorContext.java  |  86 +
 .../preprocessor/RdbmsPreprocessor.java| 139 +
 9 files changed, 384 insertions(+), 48 deletions(-)

diff --git a/addons/models/2000-RDBMS/2010-rdbms_model.json 
b/addons/models/2000-RDBMS/2010-rdbms_model.json
index 386446c..e72e13a 100644
--- a/addons/models/2000-RDBMS/2010-rdbms_model.json
+++ b/addons/models/2000-RDBMS/2010-rdbms_model.json
@@ -21,7 +21,7 @@
 {
 "name": "platform",
 "typeName": "string",
-"isOptional": false,
+"isOptional": true,
 "cardinality": "SINGLE",
 "isUnique": false,
 "isIndexable": true
@@ -99,7 +99,7 @@
 {
 "name": "prodOrOther",
 "typeName": "string",
-"isOptional": false,
+"isOptional": true,
 "cardinality": "SINGLE",
 "isUnique": false,
 "isIndexable": true
@@ -259,7 +259,7 @@
 {
 "name": "data_type",
 "typeName": "string",
-"isOptional": false,
+"isOptional": true,
 "cardinality": "SINGLE",
 "isUnique": false,
 "isIndexable": true
diff --git 
a/addons/models/2000-RDBMS/patches/003-remove-rdbms-legacy-attributes.json 
b/addons/models/2000-RDBMS/patches/003-remove-rdbms-legacy-attributes.json
new file mode 100644
index 000..d087c66
--- /dev/null
+++ b/addons/models/2000-RDBMS/patches/003-remove-rdbms-legacy-attributes.json
@@ -0,0 +1,90 @@
+{
+  "patches": [
+{
+  "action":  "REMOVE_LEGACY_ATTRIBUTES",
+  "typeName":"rdbms_instance_databases",
+  "applyToVersion":  "1.0",
+  "updateToVersion": "1.1",
+  "params": {
+"relationshipLabel":"__rdbms_instance.databases",
+"relationshipCategory": "COMPOSITION"
+  }
+},
+{
+  "action":  "REMOVE_LEGACY_ATTRIBUTES",
+  "typeName":"rdbms_db_tables",
+  "applyToVersion":  "1.0",
+  "updateToVersion": "1.1",
+  "params": {
+"relationshipLabel":"__rdbms_db.tables",
+"relationshipCategory": "COMPOSITION"
+  }
+},
+{
+  "action":  "REMOVE_LEGACY_ATTRIBUTES",
+  "typeName":"rdbms_table_columns",
+  "applyToVersion":  "1.0",
+  "updateToVersion": "1.1",
+  "params": {
+"relationshipLabel":"__rdbms_table.columns",
+"relationshipCategory": "COMPOSITION"
+  }
+},
+{
+  "action":  "REMOVE_LEGACY_ATTRIBUTES",
+  "typeName":"rdbms_table_indexes",
+  "applyToVersion":  "1.0",
+  "updateToVersion": "1.1",
+  "params": {
+"relationshipLabel":"__rdbms_table.indexes",
+"relationshipCategory": "COMPOSITION"
+  }
+},
+{
+  "action":  "REMOVE_LEGACY_ATTRIBUTES",
+  "typeName":"rdbms_table_foreign_key",
+  "applyToVersion":  "1.0",
+  "updateToVersion": "1.1",
+  "params": {
+"relationshipLabel":"__rdbms_table.foreign_keys",
+"relationshipCategory": "COMPOSITION"
+  }
+},
+{
+  "action":  "REMOVE_LEGACY_ATTRIBUTES",
+  "typeName":"rdbms_index_columns",
+  "applyToVersion":  "1.0",
+  "updateToVersion": "1.1",
+  "params": {
+"relationshipLabel": "__rdbms_index.columns"
+  }
+},
+{
+  "action":  "REMOVE_LEGACY_ATTRIBUTES",
+  "typeName":"rdbms_foreign_key_key_columns",
+  "applyToVersion":  "1.0",
+  "updateToVersion": "1.1",
+