atlas git commit: ATLAS-2769: Atlas start just after the upgrade fails with 'TableNotFoundException: atlas_janus' exception

2018-06-28 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master bae327559 -> 78cfd7184


ATLAS-2769: Atlas start just after the upgrade fails with 
'TableNotFoundException: atlas_janus' exception


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/78cfd718
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/78cfd718
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/78cfd718

Branch: refs/heads/master
Commit: 78cfd718444e81426334ef2e3fdae9b467e60cd1
Parents: bae3275
Author: Sarath Subramanian 
Authored: Thu Jun 28 14:43:11 2018 -0700
Committer: Sarath Subramanian 
Committed: Thu Jun 28 15:04:13 2018 -0700

--
 .../repository/graph/AtlasGraphProvider.java| 70 +++-
 1 file changed, 67 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/78cfd718/repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java
 
b/repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java
index 55934c3..211d2ac 100755
--- 
a/repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java
@@ -19,10 +19,14 @@
 package org.apache.atlas.repository.graph;
 
 import com.google.common.annotations.VisibleForTesting;
+import org.apache.atlas.ApplicationProperties;
+import org.apache.atlas.AtlasException;
 import org.apache.atlas.repository.RepositoryException;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
 import org.apache.atlas.repository.graphdb.GraphDatabase;
 import org.apache.atlas.util.AtlasRepositoryConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
@@ -33,7 +37,15 @@ import org.springframework.context.annotation.Configuration;
 @Configuration
 public class AtlasGraphProvider implements IAtlasGraphProvider {
 
-private static volatile GraphDatabase graphDb_;
+private static volatile GraphDatabase graphDb_;
+
+private static final Logger  LOG  = 
LoggerFactory.getLogger(AtlasGraphProvider.class);
+private static final Integer MAX_RETRY_COUNT  = 
getMaxRetryCount();
+private static final LongRETRY_SLEEP_TIME_MS  = 
getRetrySleepTime();
+private static final String  GRAPH_REPOSITORY_MAX_RETRIES = 
"atlas.graph.repository.max.retries";
+private static final String  GRAPH_REPOSITORY_RETRY_SLEEPTIME = 
"atlas.graph.repository.retry.sleeptime.ms";
+
+private static org.apache.commons.configuration.Configuration 
APPLICATION_PROPERTIES = null;
 
 public static  AtlasGraph getGraphInstance() {
 GraphDatabase db = getGraphDatabase();  
@@ -67,7 +79,59 @@ public class AtlasGraphProvider implements 
IAtlasGraphProvider {
 
 @Override
 @Bean(destroyMethod = "")
-public AtlasGraph get() throws RepositoryException {
-return getGraphInstance();
+public AtlasGraph get() throws RepositoryException{
+try {
+return getGraphInstance();
+} catch (Exception ex) {
+LOG.info("Failed to obtain graph instance, retrying " + 
MAX_RETRY_COUNT + " times, error: " + ex);
+
+return retry();
+}
+}
+
+private AtlasGraph retry() throws RepositoryException {
+int retryCounter = 0;
+
+while (retryCounter < MAX_RETRY_COUNT) {
+try {
+// Retry after 30 sec to get graph instance
+Thread.sleep(RETRY_SLEEP_TIME_MS);
+
+return getGraphInstance();
+} catch (Exception ex) {
+retryCounter++;
+
+LOG.info("Failed to obtain graph instance on retry " + 
retryCounter + " of " + MAX_RETRY_COUNT + " error: " + ex);
+
+if (retryCounter >= MAX_RETRY_COUNT) {
+LOG.info("Max retries exceeded.");
+break;
+}
+}
+}
+
+throw new RepositoryException("Max retries exceeded. Failed to obtain 
graph instance after " + MAX_RETRY_COUNT + " retries");
+}
+
+private static Integer getMaxRetryCount() {
+initApplicationProperties();
+
+return (APPLICATION_PROPERTIES == null) ? 3 : 
APPLICATION_PROPERTIES.getInt(GRAPH_REPOSITORY_MAX_RETRIES, 3);
+}
+
+private static Long getRetrySleepTime() {
+in

atlas git commit: ATLAS-2917: Filter added for Lineage to hide Process entity. [Forced Update!]

2018-10-14 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 14cb82d72 -> 66bf4164c (forced update)


ATLAS-2917: Filter added for Lineage to hide Process entity.

(cherry picked from commit c2a2ec426eac66702cf9ba20a08d634469d78e48)
Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/66bf4164
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/66bf4164
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/66bf4164

Branch: refs/heads/branch-1.0
Commit: 66bf4164c5e62071f441022d1aa2238daaee0e81
Parents: de172af
Author: kevalbhatt 
Authored: Sun Oct 14 12:00:58 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 14 12:08:37 2018 -0700

--
 dashboardv2/public/css/scss/graph.scss  |  14 ++-
 .../templates/graph/LineageLayoutView_tmpl.html |  21 +++-
 .../public/js/views/graph/LineageLayoutView.js  | 108 +++
 3 files changed, 115 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/66bf4164/dashboardv2/public/css/scss/graph.scss
--
diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index 5784095..3fce69d 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -152,11 +152,9 @@ g.type-TK>rect {
 fill: $color_bright_turquoise_approx;
 }
 
-.zoomButtonGroup {
-background-color: $white;
+.hideProcessContainer {
 position: absolute;
-top: 4px;
-right: 5px;
+top: 12px;
 }
 
 .graph-toolbar {
@@ -232,4 +230,12 @@ g.type-TK>rect {
 text-align: left;
 }
 }
+}
+
+.lineage-filter-box {
+background-color: #e6e6e6;
+padding: 4px;
+border-radius: 5px;
+width: 100%;
+box-shadow: 1px 3px 3px 2px #bfbfbf;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/66bf4164/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
--
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 096fb5b..cde8fed 100644
--- a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
@@ -16,16 +16,27 @@
 -->
 
 
+
+
+Load Process:
+Show
+
+
+
+
+Hide
+
+
+ 
+ 
+
+
 
 
 
-
+
 
 Lineage
 Impact
 
-
- 
- 
-
 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/66bf4164/dashboardv2/public/js/views/graph/LineageLayoutView.js
--
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 0d95f0c..5385bc4 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -42,12 +42,14 @@ define(['require',
 
 /** ui selector cache */
 ui: {
-graph: ".graph"
+graph: ".graph",
+checkHideProcess: "[data-id='checkHideProcess']"
 },
 
 /** ui events hash */
 events: function() {
 var events = {};
+events["click " + this.ui.checkHideProcess] = 
'onCheckHideProcess';
 return events;
 },
 
@@ -56,7 +58,7 @@ define(['require',
  * @constructs
  */
 initialize: function(options) {
-_.extend(this, _.pick(options, 'guid', 'entityDefCollection', 
'actionCallBack', 'fetchCollection'));
+_.extend(this, _.pick(options, 'processCheck', 'guid', 
'entityDefCollection', 'actionCallBack', 'fetchCollection'));
 this.collection = new VLineageList();
 this.lineageData = null;
 this.typeMap = {};
@@ -64,16 +66,9 @@ define(['require',
 this.asyncFetchCounter = 0;
 this.edgeCall;
 },
-onRender: function() {
-var that = this;
-this.$('.fontLoader').show();
-this.fetchGraphData();
-if (platform.name === "IE") {
-this.$('svg').css('opacity', '0');
-}
-if (this.layoutRendered) {
-this.layoutRendered(

atlas git commit: ATLAS-2917: Filter added for Lineage to hide Process entity. [Forced Update!]

2018-10-14 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master c2a2ec426 -> 9e9f024b4 (forced update)


ATLAS-2917: Filter added for Lineage to hide Process entity.

Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/9e9f024b
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/9e9f024b
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/9e9f024b

Branch: refs/heads/master
Commit: 9e9f024b4cda210d407bbde43071546d31ca969b
Parents: 82e0403
Author: kevalbhatt 
Authored: Sun Oct 14 12:00:58 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 14 12:07:23 2018 -0700

--
 dashboardv2/public/css/scss/graph.scss  |  14 ++-
 .../templates/graph/LineageLayoutView_tmpl.html |  21 +++-
 .../public/js/views/graph/LineageLayoutView.js  | 108 +++
 3 files changed, 115 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/9e9f024b/dashboardv2/public/css/scss/graph.scss
--
diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index 5784095..3fce69d 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -152,11 +152,9 @@ g.type-TK>rect {
 fill: $color_bright_turquoise_approx;
 }
 
-.zoomButtonGroup {
-background-color: $white;
+.hideProcessContainer {
 position: absolute;
-top: 4px;
-right: 5px;
+top: 12px;
 }
 
 .graph-toolbar {
@@ -232,4 +230,12 @@ g.type-TK>rect {
 text-align: left;
 }
 }
+}
+
+.lineage-filter-box {
+background-color: #e6e6e6;
+padding: 4px;
+border-radius: 5px;
+width: 100%;
+box-shadow: 1px 3px 3px 2px #bfbfbf;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/9e9f024b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
--
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 096fb5b..cde8fed 100644
--- a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
@@ -16,16 +16,27 @@
 -->
 
 
+
+
+Load Process:
+Show
+
+
+
+
+Hide
+
+
+ 
+ 
+
+
 
 
 
-
+
 
 Lineage
 Impact
 
-
- 
- 
-
 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/9e9f024b/dashboardv2/public/js/views/graph/LineageLayoutView.js
--
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 0d95f0c..5385bc4 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -42,12 +42,14 @@ define(['require',
 
 /** ui selector cache */
 ui: {
-graph: ".graph"
+graph: ".graph",
+checkHideProcess: "[data-id='checkHideProcess']"
 },
 
 /** ui events hash */
 events: function() {
 var events = {};
+events["click " + this.ui.checkHideProcess] = 
'onCheckHideProcess';
 return events;
 },
 
@@ -56,7 +58,7 @@ define(['require',
  * @constructs
  */
 initialize: function(options) {
-_.extend(this, _.pick(options, 'guid', 'entityDefCollection', 
'actionCallBack', 'fetchCollection'));
+_.extend(this, _.pick(options, 'processCheck', 'guid', 
'entityDefCollection', 'actionCallBack', 'fetchCollection'));
 this.collection = new VLineageList();
 this.lineageData = null;
 this.typeMap = {};
@@ -64,16 +66,9 @@ define(['require',
 this.asyncFetchCounter = 0;
 this.edgeCall;
 },
-onRender: function() {
-var that = this;
-this.$('.fontLoader').show();
-this.fetchGraphData();
-if (platform.name === "IE") {
-this.$('svg').css('opacity', '0');
-}
-if (this.layoutRendered) {
-this.layoutRendered();
-}
+
+initializeGraph: function() {
+

atlas git commit: ATLAS-2918: Update JanusGraph version to 0.3.1

2018-10-14 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 66bf4164c -> c1c24c522


ATLAS-2918: Update JanusGraph version to 0.3.1

(cherry picked from commit ab801ff27101c80a553e58a1209b14b492b7435f)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/c1c24c52
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/c1c24c52
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/c1c24c52

Branch: refs/heads/branch-1.0
Commit: c1c24c5229b3dc808107d410ce03cc2af7646f36
Parents: 66bf416
Author: Sarath Subramanian 
Authored: Thu Oct 11 22:55:35 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 14 12:16:52 2018 -0700

--
 graphdb/janus/pom.xml| 1 -
 intg/src/test/resources/atlas-application.properties | 1 +
 pom.xml  | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/c1c24c52/graphdb/janus/pom.xml
--
diff --git a/graphdb/janus/pom.xml b/graphdb/janus/pom.xml
index e9553e8..504f7fe 100644
--- a/graphdb/janus/pom.xml
+++ b/graphdb/janus/pom.xml
@@ -35,7 +35,6 @@
 
 
 3.3.3
-0.3.0
 false
 7.3.0
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/c1c24c52/intg/src/test/resources/atlas-application.properties
--
diff --git a/intg/src/test/resources/atlas-application.properties 
b/intg/src/test/resources/atlas-application.properties
index 7e74d51..159f98b 100644
--- a/intg/src/test/resources/atlas-application.properties
+++ b/intg/src/test/resources/atlas-application.properties
@@ -45,6 +45,7 @@ atlas.graphdb.backend=${graphdb.backend.impl}
 
 # Graph Storage
 atlas.graph.storage.backend=${graph.storage.backend}
+atlas.graph.storage.transactions=false
 
 # Entity repository implementation
 atlas.EntityAuditRepository.impl=${entity.repository.impl}

http://git-wip-us.apache.org/repos/asf/atlas/blob/c1c24c52/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 6cd8f45..90e1563 100644
--- a/pom.xml
+++ b/pom.xml
@@ -645,6 +645,7 @@
 2.11
 2.11.0
 3.4.6
+0.3.1
 
 3.2.11
 1.2.17



atlas git commit: ATLAS-2917: Filter added for Lineage to hide Process entity.

2018-10-14 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 de172af37 -> 14cb82d72


ATLAS-2917: Filter added for Lineage to hide Process entity.

(cherry picked from commit c2a2ec426eac66702cf9ba20a08d634469d78e48)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/14cb82d7
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/14cb82d7
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/14cb82d7

Branch: refs/heads/branch-1.0
Commit: 14cb82d72e9577416014a56d4946b4c022603254
Parents: de172af
Author: Sarath Subramanian 
Authored: Sun Oct 14 12:00:58 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 14 12:02:27 2018 -0700

--
 dashboardv2/public/css/scss/graph.scss  |  14 ++-
 .../templates/graph/LineageLayoutView_tmpl.html |  21 +++-
 .../public/js/views/graph/LineageLayoutView.js  | 108 +++
 3 files changed, 115 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/14cb82d7/dashboardv2/public/css/scss/graph.scss
--
diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index 5784095..3fce69d 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -152,11 +152,9 @@ g.type-TK>rect {
 fill: $color_bright_turquoise_approx;
 }
 
-.zoomButtonGroup {
-background-color: $white;
+.hideProcessContainer {
 position: absolute;
-top: 4px;
-right: 5px;
+top: 12px;
 }
 
 .graph-toolbar {
@@ -232,4 +230,12 @@ g.type-TK>rect {
 text-align: left;
 }
 }
+}
+
+.lineage-filter-box {
+background-color: #e6e6e6;
+padding: 4px;
+border-radius: 5px;
+width: 100%;
+box-shadow: 1px 3px 3px 2px #bfbfbf;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/14cb82d7/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
--
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 096fb5b..cde8fed 100644
--- a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
@@ -16,16 +16,27 @@
 -->
 
 
+
+
+Load Process:
+Show
+
+
+
+
+Hide
+
+
+ 
+ 
+
+
 
 
 
-
+
 
 Lineage
 Impact
 
-
- 
- 
-
 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/14cb82d7/dashboardv2/public/js/views/graph/LineageLayoutView.js
--
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 0d95f0c..5385bc4 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -42,12 +42,14 @@ define(['require',
 
 /** ui selector cache */
 ui: {
-graph: ".graph"
+graph: ".graph",
+checkHideProcess: "[data-id='checkHideProcess']"
 },
 
 /** ui events hash */
 events: function() {
 var events = {};
+events["click " + this.ui.checkHideProcess] = 
'onCheckHideProcess';
 return events;
 },
 
@@ -56,7 +58,7 @@ define(['require',
  * @constructs
  */
 initialize: function(options) {
-_.extend(this, _.pick(options, 'guid', 'entityDefCollection', 
'actionCallBack', 'fetchCollection'));
+_.extend(this, _.pick(options, 'processCheck', 'guid', 
'entityDefCollection', 'actionCallBack', 'fetchCollection'));
 this.collection = new VLineageList();
 this.lineageData = null;
 this.typeMap = {};
@@ -64,16 +66,9 @@ define(['require',
 this.asyncFetchCounter = 0;
 this.edgeCall;
 },
-onRender: function() {
-var that = this;
-this.$('.fontLoader').show();
-this.fetchGraphData();
-if (platform.name === "IE") {
-this.$('svg').css('opacity', '0');
-}
-if (this.layoutRendered) {
-this.layoutRendered();
-}
+
+   

atlas git commit: ATLAS-2920: Update JanusGraph Solr clients to use all zookeeper entries

2018-10-14 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 9e9f024b4 -> a98d1bf0b


ATLAS-2920: Update JanusGraph Solr clients to use all zookeeper entries


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/a98d1bf0
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/a98d1bf0
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/a98d1bf0

Branch: refs/heads/master
Commit: a98d1bf0b3c6a354535dc4900869bcb1b2dd90ca
Parents: 9e9f024
Author: Sarath Subramanian 
Authored: Sun Oct 14 12:55:51 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 14 12:55:51 2018 -0700

--
 .../graphdb/janus/AtlasJanusGraphDatabase.java  |   46 +-
 .../janusgraph/diskstorage/solr/Solr6Index.java | 1193 ++
 2 files changed, 1233 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/a98d1bf0/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
--
diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
index 47e561b..80e9cc3 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
@@ -18,6 +18,7 @@
 
 package org.apache.atlas.repository.graphdb.janus;
 
+import com.google.common.collect.ImmutableMap;
 import org.apache.atlas.ApplicationProperties;
 import org.apache.atlas.AtlasException;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
@@ -30,19 +31,24 @@ import 
org.apache.atlas.typesystem.types.DataTypes.TypeCategory;
 import org.apache.atlas.utils.AtlasPerfTracer;
 import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper;
+import org.janusgraph.core.JanusGraph;
 import org.janusgraph.core.JanusGraphException;
-import 
org.janusgraph.graphdb.database.serialize.attribute.SerializableSerializer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.janusgraph.core.JanusGraphFactory;
-import org.janusgraph.core.JanusGraph;
 import org.janusgraph.core.schema.JanusGraphManagement;
+import org.janusgraph.diskstorage.StandardIndexProvider;
+import org.janusgraph.diskstorage.solr.Solr6Index;
+import 
org.janusgraph.graphdb.database.serialize.attribute.SerializableSerializer;
 import org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * Default implementation for Graph Provider that doles out JanusGraph.
@@ -59,6 +65,7 @@ public class AtlasJanusGraphDatabase implements 
GraphDatabase customMap = new 
HashMap<>(StandardIndexProvider.getAllProviderClasses());
+customMap.put("solr", Solr6Index.class.getName());
+ImmutableMap immap = 
ImmutableMap.copyOf(customMap);
+field.set(null, immap);
+
+LOG.debug("Injected solr6 index - {}", Solr6Index.class.getName());
+} catch (Exception e) {
+throw new RuntimeException(e);
+}
+}
+
 public static JanusGraph getGraphInstance() {
 if (graphInstance == null) {
 synchronized (AtlasJanusGraphDatabase.class) {

http://git-wip-us.apache.org/repos/asf/atlas/blob/a98d1bf0/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
--
diff --git 
a/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java 
b/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
new file mode 100644
index 000..1795943
--- /dev/null
+++ 
b/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
@@ -0,0 +1,1193 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distr

atlas git commit: ATLAS-2920: Update JanusGraph Solr clients to use all zookeeper entries

2018-10-14 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 c1c24c522 -> 754302ecc


ATLAS-2920: Update JanusGraph Solr clients to use all zookeeper entries

(cherry picked from commit a98d1bf0b3c6a354535dc4900869bcb1b2dd90ca)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/754302ec
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/754302ec
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/754302ec

Branch: refs/heads/branch-1.0
Commit: 754302eccd8070f91794c6613035facbc7310bbe
Parents: c1c24c5
Author: Sarath Subramanian 
Authored: Sun Oct 14 12:55:51 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 14 12:57:22 2018 -0700

--
 .../graphdb/janus/AtlasJanusGraphDatabase.java  |   46 +-
 .../janusgraph/diskstorage/solr/Solr6Index.java | 1193 ++
 2 files changed, 1233 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/754302ec/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
--
diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
index 47e561b..80e9cc3 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphDatabase.java
@@ -18,6 +18,7 @@
 
 package org.apache.atlas.repository.graphdb.janus;
 
+import com.google.common.collect.ImmutableMap;
 import org.apache.atlas.ApplicationProperties;
 import org.apache.atlas.AtlasException;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
@@ -30,19 +31,24 @@ import 
org.apache.atlas.typesystem.types.DataTypes.TypeCategory;
 import org.apache.atlas.utils.AtlasPerfTracer;
 import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONMapper;
+import org.janusgraph.core.JanusGraph;
 import org.janusgraph.core.JanusGraphException;
-import 
org.janusgraph.graphdb.database.serialize.attribute.SerializableSerializer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.janusgraph.core.JanusGraphFactory;
-import org.janusgraph.core.JanusGraph;
 import org.janusgraph.core.schema.JanusGraphManagement;
+import org.janusgraph.diskstorage.StandardIndexProvider;
+import org.janusgraph.diskstorage.solr.Solr6Index;
+import 
org.janusgraph.graphdb.database.serialize.attribute.SerializableSerializer;
 import org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * Default implementation for Graph Provider that doles out JanusGraph.
@@ -59,6 +65,7 @@ public class AtlasJanusGraphDatabase implements 
GraphDatabase customMap = new 
HashMap<>(StandardIndexProvider.getAllProviderClasses());
+customMap.put("solr", Solr6Index.class.getName());
+ImmutableMap immap = 
ImmutableMap.copyOf(customMap);
+field.set(null, immap);
+
+LOG.debug("Injected solr6 index - {}", Solr6Index.class.getName());
+} catch (Exception e) {
+throw new RuntimeException(e);
+}
+}
+
 public static JanusGraph getGraphInstance() {
 if (graphInstance == null) {
 synchronized (AtlasJanusGraphDatabase.class) {

http://git-wip-us.apache.org/repos/asf/atlas/blob/754302ec/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
--
diff --git 
a/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java 
b/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
new file mode 100644
index 000..1795943
--- /dev/null
+++ 
b/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
@@ -0,0 +1,1193 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unle

atlas git commit: ATLAS-2917: Filter added for Lineage to hide Process entity.

2018-10-14 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 82e040372 -> c2a2ec426


ATLAS-2917: Filter added for Lineage to hide Process entity.


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/c2a2ec42
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/c2a2ec42
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/c2a2ec42

Branch: refs/heads/master
Commit: c2a2ec426eac66702cf9ba20a08d634469d78e48
Parents: 82e0403
Author: Sarath Subramanian 
Authored: Sun Oct 14 12:00:58 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 14 12:00:58 2018 -0700

--
 dashboardv2/public/css/scss/graph.scss  |  14 ++-
 .../templates/graph/LineageLayoutView_tmpl.html |  21 +++-
 .../public/js/views/graph/LineageLayoutView.js  | 108 +++
 3 files changed, 115 insertions(+), 28 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/c2a2ec42/dashboardv2/public/css/scss/graph.scss
--
diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index 5784095..3fce69d 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -152,11 +152,9 @@ g.type-TK>rect {
 fill: $color_bright_turquoise_approx;
 }
 
-.zoomButtonGroup {
-background-color: $white;
+.hideProcessContainer {
 position: absolute;
-top: 4px;
-right: 5px;
+top: 12px;
 }
 
 .graph-toolbar {
@@ -232,4 +230,12 @@ g.type-TK>rect {
 text-align: left;
 }
 }
+}
+
+.lineage-filter-box {
+background-color: #e6e6e6;
+padding: 4px;
+border-radius: 5px;
+width: 100%;
+box-shadow: 1px 3px 3px 2px #bfbfbf;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/c2a2ec42/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
--
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 096fb5b..cde8fed 100644
--- a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
@@ -16,16 +16,27 @@
 -->
 
 
+
+
+Load Process:
+Show
+
+
+
+
+Hide
+
+
+ 
+ 
+
+
 
 
 
-
+
 
 Lineage
 Impact
 
-
- 
- 
-
 
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/c2a2ec42/dashboardv2/public/js/views/graph/LineageLayoutView.js
--
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 0d95f0c..5385bc4 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -42,12 +42,14 @@ define(['require',
 
 /** ui selector cache */
 ui: {
-graph: ".graph"
+graph: ".graph",
+checkHideProcess: "[data-id='checkHideProcess']"
 },
 
 /** ui events hash */
 events: function() {
 var events = {};
+events["click " + this.ui.checkHideProcess] = 
'onCheckHideProcess';
 return events;
 },
 
@@ -56,7 +58,7 @@ define(['require',
  * @constructs
  */
 initialize: function(options) {
-_.extend(this, _.pick(options, 'guid', 'entityDefCollection', 
'actionCallBack', 'fetchCollection'));
+_.extend(this, _.pick(options, 'processCheck', 'guid', 
'entityDefCollection', 'actionCallBack', 'fetchCollection'));
 this.collection = new VLineageList();
 this.lineageData = null;
 this.typeMap = {};
@@ -64,16 +66,9 @@ define(['require',
 this.asyncFetchCounter = 0;
 this.edgeCall;
 },
-onRender: function() {
-var that = this;
-this.$('.fontLoader').show();
-this.fetchGraphData();
-if (platform.name === "IE") {
-this.$('svg').css('opacity', '0');
-}
-if (this.layoutRendered) {
-this.layoutRendered();
-}
+
+initializeGraph: function() {
+this.g = {};
 this.g

atlas git commit: ATLAS-2920: Update JanusGraph Solr clients to use all zookeeper entries #2

2018-10-14 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 754302ecc -> 00fe6c6c3


ATLAS-2920: Update JanusGraph Solr clients to use all zookeeper entries #2

(cherry picked from commit 85a01e180528ab18b31f633aa27932cf748e6ef9)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/00fe6c6c
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/00fe6c6c
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/00fe6c6c

Branch: refs/heads/branch-1.0
Commit: 00fe6c6c3e24f6645a019da0c728e943136b1f99
Parents: 754302e
Author: Sarath Subramanian 
Authored: Sun Oct 14 14:01:08 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 14 14:01:42 2018 -0700

--
 .../main/java/org/janusgraph/diskstorage/solr/Solr6Index.java| 4 
 1 file changed, 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/00fe6c6c/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
--
diff --git 
a/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java 
b/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
index 1795943..d7097d2 100644
--- 
a/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
+++ 
b/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
@@ -141,10 +141,6 @@ import static 
org.janusgraph.diskstorage.solr.SolrIndex.WAIT_SEARCHER;
 import static 
org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.INDEX_MAX_RESULT_SET_SIZE;
 
 /**
- * @author Jared Holmberg (jholmb...@bericotechnologies.com), Pavel Yaskevich 
(pa...@thinkaurelius.com)
- */
-
-/**
  * NOTE: Copied from JanusGraph for supporting Kerberos and adding support for 
multiple zookeeper clients. Do not change
  * This is a copy of SolrIndex.java from org.janusgraph.diskstorage.solr
  */



atlas git commit: ATLAS-2920: Update JanusGraph Solr clients to use all zookeeper entries #2

2018-10-14 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master a98d1bf0b -> 85a01e180


ATLAS-2920: Update JanusGraph Solr clients to use all zookeeper entries #2


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/85a01e18
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/85a01e18
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/85a01e18

Branch: refs/heads/master
Commit: 85a01e180528ab18b31f633aa27932cf748e6ef9
Parents: a98d1bf
Author: Sarath Subramanian 
Authored: Sun Oct 14 14:01:08 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 14 14:01:08 2018 -0700

--
 .../main/java/org/janusgraph/diskstorage/solr/Solr6Index.java| 4 
 1 file changed, 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/85a01e18/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
--
diff --git 
a/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java 
b/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
index 1795943..d7097d2 100644
--- 
a/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
+++ 
b/graphdb/janus/src/main/java/org/janusgraph/diskstorage/solr/Solr6Index.java
@@ -141,10 +141,6 @@ import static 
org.janusgraph.diskstorage.solr.SolrIndex.WAIT_SEARCHER;
 import static 
org.janusgraph.graphdb.configuration.GraphDatabaseConfiguration.INDEX_MAX_RESULT_SET_SIZE;
 
 /**
- * @author Jared Holmberg (jholmb...@bericotechnologies.com), Pavel Yaskevich 
(pa...@thinkaurelius.com)
- */
-
-/**
  * NOTE: Copied from JanusGraph for supporting Kerberos and adding support for 
multiple zookeeper clients. Do not change
  * This is a copy of SolrIndex.java from org.janusgraph.diskstorage.solr
  */



atlas git commit: ATLAS-2924: Use encoded property name in getEncodedProperty() and setEncodedProperty() methods

2018-10-16 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 11555f7e1 -> ee7411082


ATLAS-2924: Use encoded property name in getEncodedProperty() and 
setEncodedProperty() methods


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/ee741108
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/ee741108
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/ee741108

Branch: refs/heads/branch-0.8
Commit: ee7411082e1b192ef7b67c1188bb271ff9358abf
Parents: 11555f7
Author: Sarath Subramanian 
Authored: Tue Oct 16 12:03:03 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Oct 16 12:03:03 2018 -0700

--
 .../atlas/repository/graph/TypedInstanceToGraphMapper.java | 3 ++-
 .../atlas/repository/store/graph/v1/EntityGraphRetriever.java  | 6 --
 .../atlas/repository/typestore/GraphBackedTypeStore.java   | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/ee741108/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
 
b/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
index 7075b53..d43e09e 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
@@ -58,6 +58,7 @@ import java.util.Map;
 import java.util.Set;
 
 import static org.apache.atlas.repository.graph.GraphHelper.string;
+import static 
org.apache.atlas.type.AtlasStructType.AtlasAttribute.encodePropertyKey;
 
 @Component
 @Deprecated
@@ -77,7 +78,7 @@ public final class TypedInstanceToGraphMapper {
 this.deleteHandler = deleteHandler;
 }
 
-private final String SIGNATURE_HASH_PROPERTY_KEY = 
Constants.INTERNAL_PROPERTY_KEY_PREFIX + "signature";
+private final String SIGNATURE_HASH_PROPERTY_KEY = 
encodePropertyKey(Constants.INTERNAL_PROPERTY_KEY_PREFIX + "signature");
 
 public enum Operation {
 CREATE,

http://git-wip-us.apache.org/repos/asf/atlas/blob/ee741108/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
index 5395b7a..0445e27 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
@@ -60,6 +60,7 @@ import java.util.Set;
 
 import static org.apache.atlas.model.typedef.AtlasBaseTypeDef.*;
 import static org.apache.atlas.repository.graph.GraphHelper.EDGE_LABEL_PREFIX;
+import static 
org.apache.atlas.type.AtlasStructType.AtlasAttribute.encodePropertyKey;
 
 @Component
 public final class EntityGraphRetriever {
@@ -491,9 +492,10 @@ public final class EntityGraphRetriever {
 Map ret  = new 
HashMap<>(mapKeys.size());
 
 for (Object mapKey : mapKeys) {
-final String keyPropertyName = String.format(MAP_VALUE_FORMAT, 
propertyName, mapKey);
+StringkeyPropertyName= 
String.format(MAP_VALUE_FORMAT, propertyName, mapKey);
+StringencodedKeyPropertyName = 
encodePropertyKey(keyPropertyName);
+AtlasObjectId mapValue   = 
mapVertexToObjectIdForSoftRef(entityVertex, encodedKeyPropertyName);
 
-AtlasObjectId mapValue = 
mapVertexToObjectIdForSoftRef(entityVertex, keyPropertyName);
 if (mapValue != null) {
 ret.put((String) mapKey, mapValue);
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/ee741108/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
 
b/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
index 9e6ad18..ba71c1e 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java
@@ -295,7 +295,7 @@ public class GraphBackedTypeStore implements ITypeStore {
 List values = GraphHelper.getListProperty(ver

atlas git commit: ATLAS-2924: Use encoded property name in getEncodedProperty() and setEncodedProperty() methods

2018-10-16 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 b085c2cf5 -> 902bd153e


ATLAS-2924: Use encoded property name in getEncodedProperty() and 
setEncodedProperty() methods

(cherry picked from commit fdab2efd718573a014f445cd54f7d8c477407958)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/902bd153
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/902bd153
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/902bd153

Branch: refs/heads/branch-1.0
Commit: 902bd153e44adc5432225071ff7409b056a13ff4
Parents: b085c2c
Author: Sarath Subramanian 
Authored: Tue Oct 16 12:59:13 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Oct 16 13:47:58 2018 -0700

--
 .../repository/store/graph/v2/AtlasStructDefStoreV2.java | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/902bd153/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
index bcd805e..841556e 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
@@ -49,6 +49,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import static 
org.apache.atlas.type.AtlasStructType.AtlasAttribute.encodePropertyKey;
+
 /**
  * StructDef store in v1 format.
  */
@@ -377,7 +379,9 @@ public class AtlasStructDefStoreV2 extends 
AtlasAbstractDefStoreV2 currAttrNames = 
vertex.getProperty(AtlasGraphUtilsV2.getTypeDefPropertyKey(structDef), 
List.class);
+String   structDefPropertyKey= 
AtlasGraphUtilsV2.getTypeDefPropertyKey(structDef);
+String   encodedStructDefPropertyKey = 
encodePropertyKey(structDefPropertyKey);
+List currAttrNames   = 
vertex.getProperty(encodedStructDefPropertyKey, List.class);
 
 // delete attributes that are not present in updated structDef
 if (CollectionUtils.isNotEmpty(currAttrNames)) {
@@ -423,7 +427,7 @@ public class AtlasStructDefStoreV2 extends 
AtlasAbstractDefStoreV2

atlas git commit: ATLAS-2917: Filter added for Lineage to hide Process entity.

2018-10-16 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 d2110c379 -> 5d4f18d51


ATLAS-2917: Filter added for Lineage to hide Process entity.

Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/5d4f18d5
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/5d4f18d5
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/5d4f18d5

Branch: refs/heads/branch-0.8
Commit: 5d4f18d51d7a3f37bc1a9e0a914fd0a75c866036
Parents: d2110c3
Author: kevalbhatt 
Authored: Tue Oct 16 15:20:47 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Oct 16 15:20:47 2018 -0700

--
 dashboardv2/public/css/scss/graph.scss  |  75 ++-
 .../detail_page/DetailPageLayoutView_tmpl.html  |   2 +-
 .../templates/graph/LineageLayoutView_tmpl.html |  25 ++-
 dashboardv2/public/js/utils/Utils.js|  22 +++
 .../views/detail_page/DetailPageLayoutView.js   |  30 ++-
 .../public/js/views/graph/LineageLayoutView.js  | 194 +++
 6 files changed, 294 insertions(+), 54 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/5d4f18d5/dashboardv2/public/css/scss/graph.scss
--
diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index 2d7e8a3..4081dc7 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -111,11 +111,9 @@ g.type-TK>rect {
 fill: $color_bright_turquoise_approx;
 }
 
-.zoomButtonGroup {
-background-color: $white;
+.hideProcessContainer {
 position: absolute;
-top: 4px;
-right: 5px;
+top: 12px;
 }
 
 .legends {
@@ -124,4 +122,73 @@ g.type-TK>rect {
 font-family: 'Source Sans Pro';
 }
 }
+}
+
+.lineage-box {
+.lineage-edge-details {
+position: absolute;
+left: 0;
+overflow: auto;
+top: 0px;
+max-height: 100%;
+box-shadow: 4px 13px 14px -12px;
+background: #e7e7e7;
+transform: scaleX(0);
+width: 200px;
+transition: transform 0.3s ease-in;
+&.open {
+transform: scaleX(1);
+}
+.title {
+background: black;
+color: white;
+padding: 10px;
+padding-left: 17px;
+margin-top: 0;
+font-size: 14px;
+.navigation-font {
+font-family: sans-serif;
+padding: 0px 5px;
+color: #fb4200;
+}
+}
+.close-details {
+position: absolute;
+top: 0;
+color: white;
+left: 0;
+height: 21px;
+width: 21px;
+cursor: pointer;
+font-size: 16px;
+}
+.propagation-list {
+overflow: auto;
+list-style-type: none;
+list-style-position: outside;
+padding-left: 30px;
+}
+.overlay {
+position: absolute;
+left: 0;
+top: 0;
+right: 0;
+bottom: 0;
+background: #d2d2d2b8;
+z-index: 99;
+}
+ul>li {
+word-wrap: break-word;
+margin-bottom: 5px;
+text-align: left;
+}
+}
+}
+
+.lineage-filter-box {
+background-color: #e6e6e6;
+padding: 4px;
+border-radius: 5px;
+width: 100%;
+box-shadow: 1px 3px 3px 2px #bfbfbf;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/5d4f18d5/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
--
diff --git 
a/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
index b893af3..c241a72 100644
--- a/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/detail_page/DetailPageLayoutView_tmpl.html
@@ -57,7 +57,7 @@
 
 
 
-
+
 
 
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/5d4f18d5/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
--
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 76241db..55b9864 100644
--- a/dashboardv2/public/js

atlas git commit: ATLAS-2924: Use encoded property name in getEncodedProperty() and setEncodedProperty() methods

2018-10-16 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 2fbea9f2b -> fdab2efd7


ATLAS-2924: Use encoded property name in getEncodedProperty() and 
setEncodedProperty() methods


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/fdab2efd
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/fdab2efd
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/fdab2efd

Branch: refs/heads/master
Commit: fdab2efd718573a014f445cd54f7d8c477407958
Parents: 2fbea9f
Author: Sarath Subramanian 
Authored: Tue Oct 16 12:59:13 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Oct 16 12:59:13 2018 -0700

--
 .../repository/store/graph/v2/AtlasStructDefStoreV2.java | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/fdab2efd/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
index f043e0d..1b67f11 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasStructDefStoreV2.java
@@ -49,6 +49,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import static 
org.apache.atlas.type.AtlasStructType.AtlasAttribute.encodePropertyKey;
+
 /**
  * StructDef store in v1 format.
  */
@@ -377,7 +379,9 @@ public class AtlasStructDefStoreV2 extends 
AtlasAbstractDefStoreV2 currAttrNames = 
vertex.getProperty(AtlasGraphUtilsV2.getTypeDefPropertyKey(structDef), 
List.class);
+String   structDefPropertyKey= 
AtlasGraphUtilsV2.getTypeDefPropertyKey(structDef);
+String   encodedStructDefPropertyKey = 
encodePropertyKey(structDefPropertyKey);
+List currAttrNames   = 
vertex.getProperty(encodedStructDefPropertyKey, List.class);
 
 // delete attributes that are not present in updated structDef
 if (CollectionUtils.isNotEmpty(currAttrNames)) {
@@ -423,7 +427,7 @@ public class AtlasStructDefStoreV2 extends 
AtlasAbstractDefStoreV2

atlas git commit: ATLAS-2927: Update lineage query for Process entities

2018-10-21 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 23e61364f -> 9653cc5d5


ATLAS-2927: Update lineage query for Process entities

(cherry picked from commit 46b9b7c85835b1c4285eddce6c9773024a1b2114)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/9653cc5d
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/9653cc5d
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/9653cc5d

Branch: refs/heads/branch-1.0
Commit: 9653cc5d544ce07ffe236462ee09a32d58f75011
Parents: 23e6136
Author: Sarath Subramanian 
Authored: Sun Oct 21 22:22:38 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 21 22:24:32 2018 -0700

--
 .../atlas/discovery/EntityLineageService.java   | 68 +---
 .../atlas/util/AtlasGremlin3QueryProvider.java  |  8 +--
 2 files changed, 49 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/9653cc5d/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index 6f2f97b..89c969b 100644
--- 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -41,7 +41,6 @@ import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasTypeRegistry;
 import org.apache.atlas.type.AtlasTypeUtil;
 import org.apache.atlas.util.AtlasGremlinQueryProvider;
-import org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery;
 import org.apache.atlas.v1.model.lineage.SchemaResponse.SchemaDetails;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
@@ -51,6 +50,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -61,6 +62,7 @@ import java.util.stream.Collectors;
 
 import static org.apache.atlas.AtlasClient.DATA_SET_SUPER_TYPE;
 import static org.apache.atlas.AtlasClient.PROCESS_SUPER_TYPE;
+import static org.apache.atlas.AtlasErrorCode.INSTANCE_LINEAGE_QUERY_FAILED;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.BOTH;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.INPUT;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.OUTPUT;
@@ -203,16 +205,16 @@ public class EntityLineageService implements 
AtlasLineageService {
 }
 
 private AtlasLineageInfo getLineageInfo(String guid, LineageDirection 
direction, int depth, boolean isDataSet) throws AtlasBaseException {
+final Map  bindings = new HashMap<>();
+String lineageQuery = getLineageQuery(guid, 
direction, depth, isDataSet, bindings);
+List   results  = 
executeGremlinScript(bindings, lineageQuery);
 Map entities = new HashMap<>();
 Set   relations= new HashSet<>();
-String lineageQuery = getLineageQuery(guid, 
direction, depth, isDataSet);
 
-List edgeMapList = (List) graph.executeGremlinScript(lineageQuery, 
false);
-
-if (CollectionUtils.isNotEmpty(edgeMapList)) {
-for (Object edgeMap : edgeMapList) {
-if (edgeMap instanceof Map) {
-for (final Object o : ((Map) edgeMap).entrySet()) {
+if (CollectionUtils.isNotEmpty(results)) {
+for (Object result : results) {
+if (result instanceof Map) {
+for (final Object o : ((Map) result).entrySet()) {
 final Map.Entry entry = (Map.Entry) o;
 Object  value = entry.getValue();
 
@@ -230,6 +232,8 @@ public class EntityLineageService implements 
AtlasLineageService {
 LOG.warn("Invalid value of type {} found, 
ignoring", (value != null ? value.getClass().getSimpleName() : "null"));
 }
 }
+} else if (result instanceof AtlasEdge) {
+processEdge((AtlasEdge) result, entities, relations);
 }
 }
 }
@@ -237,6 +241,21 @@ public class EntityLineageService implements 
AtlasLineageService {
 return new AtlasLineageInfo(guid, entities, relations, direction, 
depth);
 }
 
+private List 

atlas git commit: ATLAS-2927: Update lineage query for Process entities

2018-10-21 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 3b8a34c51 -> 46b9b7c85


ATLAS-2927: Update lineage query for Process entities


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/46b9b7c8
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/46b9b7c8
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/46b9b7c8

Branch: refs/heads/master
Commit: 46b9b7c85835b1c4285eddce6c9773024a1b2114
Parents: 3b8a34c
Author: Sarath Subramanian 
Authored: Sun Oct 21 22:22:38 2018 -0700
Committer: Sarath Subramanian 
Committed: Sun Oct 21 22:22:38 2018 -0700

--
 .../atlas/discovery/EntityLineageService.java   | 68 +---
 .../atlas/util/AtlasGremlin3QueryProvider.java  |  8 +--
 2 files changed, 49 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/46b9b7c8/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index 6f2f97b..89c969b 100644
--- 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -41,7 +41,6 @@ import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasTypeRegistry;
 import org.apache.atlas.type.AtlasTypeUtil;
 import org.apache.atlas.util.AtlasGremlinQueryProvider;
-import org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery;
 import org.apache.atlas.v1.model.lineage.SchemaResponse.SchemaDetails;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
@@ -51,6 +50,8 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -61,6 +62,7 @@ import java.util.stream.Collectors;
 
 import static org.apache.atlas.AtlasClient.DATA_SET_SUPER_TYPE;
 import static org.apache.atlas.AtlasClient.PROCESS_SUPER_TYPE;
+import static org.apache.atlas.AtlasErrorCode.INSTANCE_LINEAGE_QUERY_FAILED;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.BOTH;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.INPUT;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.OUTPUT;
@@ -203,16 +205,16 @@ public class EntityLineageService implements 
AtlasLineageService {
 }
 
 private AtlasLineageInfo getLineageInfo(String guid, LineageDirection 
direction, int depth, boolean isDataSet) throws AtlasBaseException {
+final Map  bindings = new HashMap<>();
+String lineageQuery = getLineageQuery(guid, 
direction, depth, isDataSet, bindings);
+List   results  = 
executeGremlinScript(bindings, lineageQuery);
 Map entities = new HashMap<>();
 Set   relations= new HashSet<>();
-String lineageQuery = getLineageQuery(guid, 
direction, depth, isDataSet);
 
-List edgeMapList = (List) graph.executeGremlinScript(lineageQuery, 
false);
-
-if (CollectionUtils.isNotEmpty(edgeMapList)) {
-for (Object edgeMap : edgeMapList) {
-if (edgeMap instanceof Map) {
-for (final Object o : ((Map) edgeMap).entrySet()) {
+if (CollectionUtils.isNotEmpty(results)) {
+for (Object result : results) {
+if (result instanceof Map) {
+for (final Object o : ((Map) result).entrySet()) {
 final Map.Entry entry = (Map.Entry) o;
 Object  value = entry.getValue();
 
@@ -230,6 +232,8 @@ public class EntityLineageService implements 
AtlasLineageService {
 LOG.warn("Invalid value of type {} found, 
ignoring", (value != null ? value.getClass().getSimpleName() : "null"));
 }
 }
+} else if (result instanceof AtlasEdge) {
+processEdge((AtlasEdge) result, entities, relations);
 }
 }
 }
@@ -237,6 +241,21 @@ public class EntityLineageService implements 
AtlasLineageService {
 return new AtlasLineageInfo(guid, entities, relations, direction, 
depth);
 }
 
+private List executeGremlinScript(Map bindings, String 
lineageQuery) throws Atlas

atlas git commit: ATLAS-2918: Update JanusGraph version to 0.3.1

2018-10-11 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 614415e0a -> ab801ff27


ATLAS-2918: Update JanusGraph version to 0.3.1


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/ab801ff2
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/ab801ff2
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/ab801ff2

Branch: refs/heads/master
Commit: ab801ff27101c80a553e58a1209b14b492b7435f
Parents: 614415e
Author: Sarath Subramanian 
Authored: Thu Oct 11 22:55:35 2018 -0700
Committer: Sarath Subramanian 
Committed: Thu Oct 11 22:55:35 2018 -0700

--
 graphdb/janus/pom.xml| 1 -
 intg/src/test/resources/atlas-application.properties | 1 +
 pom.xml  | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/ab801ff2/graphdb/janus/pom.xml
--
diff --git a/graphdb/janus/pom.xml b/graphdb/janus/pom.xml
index cd5c82e..5d491e8 100644
--- a/graphdb/janus/pom.xml
+++ b/graphdb/janus/pom.xml
@@ -35,7 +35,6 @@
 
 
 3.3.3
-0.3.0
 false
 7.3.0
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/ab801ff2/intg/src/test/resources/atlas-application.properties
--
diff --git a/intg/src/test/resources/atlas-application.properties 
b/intg/src/test/resources/atlas-application.properties
index 7e74d51..159f98b 100644
--- a/intg/src/test/resources/atlas-application.properties
+++ b/intg/src/test/resources/atlas-application.properties
@@ -45,6 +45,7 @@ atlas.graphdb.backend=${graphdb.backend.impl}
 
 # Graph Storage
 atlas.graph.storage.backend=${graph.storage.backend}
+atlas.graph.storage.transactions=false
 
 # Entity repository implementation
 atlas.EntityAuditRepository.impl=${entity.repository.impl}

http://git-wip-us.apache.org/repos/asf/atlas/blob/ab801ff2/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 92b3218..91ec2c8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -656,6 +656,7 @@
 2.11
 2.11.0
 3.4.6
+0.3.1
 
 3.2.11
 1.2.17



atlas git commit: ATLAS-2927: Update lineage query for Process entities

2018-10-24 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 707bcb1cb -> 2a547434b


ATLAS-2927: Update lineage query for Process entities


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/2a547434
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/2a547434
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/2a547434

Branch: refs/heads/branch-0.8
Commit: 2a547434b5dd5a8a78ed915f17b05b674aa9df95
Parents: 707bcb1
Author: Sarath Subramanian 
Authored: Wed Oct 24 11:10:58 2018 -0700
Committer: Sarath Subramanian 
Committed: Wed Oct 24 11:10:58 2018 -0700

--
 .../atlas/discovery/EntityLineageService.java   | 124 +++
 .../atlas/util/AtlasGremlin2QueryProvider.java  |  10 +-
 2 files changed, 78 insertions(+), 56 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/2a547434/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index c928d35..472d692 100644
--- 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -26,8 +26,10 @@ import org.apache.atlas.model.instance.AtlasEntityHeader;
 import org.apache.atlas.model.lineage.AtlasLineageInfo;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageRelation;
+import org.apache.atlas.repository.graphdb.AtlasEdge;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
 import org.apache.atlas.repository.graphdb.AtlasVertex;
+import org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1;
 import org.apache.atlas.repository.store.graph.v1.EntityGraphRetriever;
 import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasTypeRegistry;
@@ -36,6 +38,8 @@ import org.apache.commons.collections.CollectionUtils;
 import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
+import javax.script.ScriptEngine;
+import javax.script.ScriptException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -45,6 +49,7 @@ import java.util.Set;
 
 import static org.apache.atlas.AtlasClient.DATA_SET_SUPER_TYPE;
 import static org.apache.atlas.AtlasClient.PROCESS_SUPER_TYPE;
+import static org.apache.atlas.AtlasErrorCode.INSTANCE_LINEAGE_QUERY_FAILED;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.BOTH;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.INPUT;
 import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.OUTPUT;
@@ -114,39 +119,14 @@ public class EntityLineageService implements 
AtlasLineageService {
 private AtlasLineageInfo getLineageInfo(String guid, LineageDirection 
direction, int depth, boolean isDataSet) throws AtlasBaseException {
 Map entities = new HashMap<>();
 Set   relations= new HashSet<>();
-String lineageQuery = getLineageQuery(guid, 
direction, depth, isDataSet);
-
-List paths = (List) graph.executeGremlinScript(lineageQuery, true);
-
-if (CollectionUtils.isNotEmpty(paths)) {
-for (Object path : paths) {
-if (path instanceof List) {
-List vertices = (List) path;
-
-if (CollectionUtils.isNotEmpty(vertices)) {
-AtlasEntityHeader prev = null;
-
-for (Object vertex : vertices) {
-if (!(vertex instanceof AtlasVertex)) {
-continue;
-}
-
-AtlasEntityHeader entity = 
entityRetriever.toAtlasEntityHeader((AtlasVertex)vertex);
-
-if (!entities.containsKey(entity.getGuid())) {
-entities.put(entity.getGuid(), entity);
-}
-
-if (prev != null) {
-if (direction.equals(INPUT)) {
-relations.add(new 
LineageRelation(entity.getGuid(), prev.getGuid()));
-} else if (direction.equals(OUTPUT)) {
-relations.add(new 
LineageRelation(prev.getGuid(), entity.getGuid()));
-}
-}
-prev = entity;
-}
-}
+final Map  bin

svn commit: r30554 - in /release/atlas/0.8.3: ./ apache-atlas-0.8.3-sources.tar.gz apache-atlas-0.8.3-sources.tar.gz.asc apache-atlas-0.8.3-sources.tar.gz.md5 apache-atlas-0.8.3-sources.tar.gz.sha512

2018-10-31 Thread sarath
Author: sarath
Date: Wed Oct 31 19:10:22 2018
New Revision: 30554

Log:
Add 0.8.3 release source binaries

Added:
release/atlas/0.8.3/
release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz   (with props)
release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.asc   (with props)
release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.md5   (with props)
release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.sha512   (with props)

Added: release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz
==
Binary file - no diff available.

Propchange: release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz
--
svn:executable = *

Propchange: release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz
--
svn:mime-type = application/octet-stream

Added: release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.asc
==
--- release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.asc (added)
+++ release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.asc Wed Oct 31 
19:10:22 2018
@@ -0,0 +1,16 @@
+-BEGIN PGP SIGNATURE-
+
+iQIzBAABCAAdFiEE21rYRZ40YST4Uh/KotzXCwzuIO4FAlvTl3oACgkQotzXCwzu
+IO6CSA//XrA2GVJFa4En1rN3XbE8uUtaINAEt9n9vMRcyGjTbq+ilmbuikqI7Erk
+gXoRNBSyqIEr34R3JVRVk771PpyFtwmuvfCzwls7CUxbflJlu5YFYyYo4VD7h6wW
+0semgKz3iWUGS+0uCjZpgBj1p9YJGnbhnByIS8xmMOTrwKCY1LFC31vqC59S91Fj
+G5ojeDz3V7tfd6t8SgWQRUF1vfTLFBTRch2S/xZv9dq67zP75DEJSZm8OiT9B4iP
+ED3BecMqa9XMIi/q4IbmI4+degJY2wRBBl8EQt/rta0jZF63DAhZsbhENqg/FOJv
+ah9xU8G55Da3BbZzJDL28Agw9r7jxe8YZi/DazFQMTTQrtJBEsoyXE9tSzwjaOH/
+dpZagVsQc6Vj2Ccvy6sQ7PZP93WO4bwTqtap8O30sEMhzXdOj/24xnMIsfmd9elr
+SkbY/QEtpelyly65XBuSPjmQflfy8mh7+lEcCSzNYAvkx3jKmf84pFmTaxIcC5lR
+keSPV92cusw/aBk7krl5dBmri/8GAIb+1ECBeLvRNTSf+dG+exW230qQYTReUnjr
+JtSXgRmdnSjy0fcjwjKKQAqdccRJPY/7rUtzscEHikyKOf2/ujhvJeD+9w7SWJkt
+3Znohb8oRXxBjmNgex0Bl8W4wDxbAkom+jleOVRsBHNtDCkoUYU=
+=XiBL
+-END PGP SIGNATURE-

Propchange: release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.asc
--
svn:executable = *

Added: release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.md5
==
--- release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.md5 (added)
+++ release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.md5 Wed Oct 31 
19:10:22 2018
@@ -0,0 +1,2 @@
+apache-atlas-0.8.3-sources.tar.gz: 23 52 43 C5 CB 02 5E 07  CE 3A 83 65 C8 68 
95
+   7C

Propchange: release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.md5
--
svn:executable = *

Added: release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.sha512
==
--- release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.sha512 (added)
+++ release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.sha512 Wed Oct 31 
19:10:22 2018
@@ -0,0 +1,4 @@
+apache-atlas-0.8.3-sources.tar.gz: BEFC7F7B E198A1B5 E120BF35 DE577636 B88E2469
+   F60A831B C4F7C804 C1483E50 4DC2F89C 4F9A7606
+   F2719FF8 41E39C0A C89050DF B95FC270 64B2FEEA
+   C1A214D1

Propchange: release/atlas/0.8.3/apache-atlas-0.8.3-sources.tar.gz.sha512
--
svn:executable = *




atlas git commit: ATLAS-2927: Update lineage query for Process entities #2

2018-10-26 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 7aebca8ad -> d426815ca


ATLAS-2927: Update lineage query for Process entities #2

(cherry picked from commit da78c48314c67f2998eab2190324ca3786b3bafc)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/d426815c
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/d426815c
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/d426815c

Branch: refs/heads/branch-1.0
Commit: d426815ca7a494585718663edb9ebf92c3e14f4a
Parents: 7aebca8
Author: Sarath Subramanian 
Authored: Fri Oct 26 16:02:55 2018 -0700
Committer: Sarath Subramanian 
Committed: Fri Oct 26 16:03:41 2018 -0700

--
 .../java/org/apache/atlas/discovery/EntityLineageService.java| 3 ++-
 .../java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java   | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/d426815c/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index 89c969b..9a02046 100644
--- 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -309,7 +309,8 @@ public class EntityLineageService implements 
AtlasLineageService {
 bindings.put("guid", entityGuid);
 bindings.put("incomingEdgeLabel", incomingFrom);
 bindings.put("outgoingEdgeLabel", outgoingTo);
-bindings.put("depth", depth);
+bindings.put("dataSetDepth", depth);
+bindings.put("processDepth", depth - 1);
 
 if (depth < 1) {
 ret = isDataSet ? 
gremlinQueryProvider.getQuery(FULL_LINEAGE_DATASET) :

http://git-wip-us.apache.org/repos/asf/atlas/blob/d426815c/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
 
b/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
index 6d3b1a8..20c570f 100644
--- 
a/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
+++ 
b/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
@@ -48,11 +48,11 @@ public class AtlasGremlin3QueryProvider extends 
AtlasGremlin2QueryProvider {
 case FULL_LINEAGE_DATASET:
 return "g.V().has('__guid', 
guid).repeat(__.inE(incomingEdgeLabel).as('e1').outV().outE(outgoingEdgeLabel).as('e2').inV()).emit().select('e1',
 'e2').toList()";
 case PARTIAL_LINEAGE_DATASET:
-return "g.V().has('__guid', 
guid).repeat(__.inE(incomingEdgeLabel).as('e1').outV().outE(outgoingEdgeLabel).as('e2').inV()).times(depth).emit().select('e1',
 'e2').toList()";
+return "g.V().has('__guid', 
guid).repeat(__.inE(incomingEdgeLabel).as('e1').outV().outE(outgoingEdgeLabel).as('e2').inV()).times(dataSetDepth).emit().select('e1',
 'e2').toList()";
 case FULL_LINEAGE_PROCESS:
 return "g.V().has('__guid', 
guid).outE(outgoingEdgeLabel).store('e').inV().repeat(__.inE(incomingEdgeLabel).store('e').outV().outE(outgoingEdgeLabel).store('e').inV()).cap('e').unfold().toList()";
 case PARTIAL_LINEAGE_PROCESS:
-return "g.V().has('__guid', 
guid).outE(outgoingEdgeLabel).store('e').inV().repeat(__.inE(incomingEdgeLabel).store('e').outV().outE(outgoingEdgeLabel).store('e').inV()).times(depth).cap('e').unfold().toList()";
+return "g.V().has('__guid', 
guid).outE(outgoingEdgeLabel).store('e').inV().until(loops().is(eq(processDepth))).repeat(__.inE(incomingEdgeLabel).store('e').outV().outE(outgoingEdgeLabel).store('e').inV()).cap('e').unfold().toList()";
 case TO_RANGE_LIST:
 return ".range(startIdx, endIdx).toList()";
 case RELATIONSHIP_SEARCH:



atlas git commit: ATLAS-2927: Update lineage query for Process entities #2

2018-10-26 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 572c5d648 -> da78c4831


ATLAS-2927: Update lineage query for Process entities #2


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/da78c483
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/da78c483
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/da78c483

Branch: refs/heads/master
Commit: da78c48314c67f2998eab2190324ca3786b3bafc
Parents: 572c5d6
Author: Sarath Subramanian 
Authored: Fri Oct 26 16:02:55 2018 -0700
Committer: Sarath Subramanian 
Committed: Fri Oct 26 16:02:55 2018 -0700

--
 .../java/org/apache/atlas/discovery/EntityLineageService.java| 3 ++-
 .../java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java   | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/da78c483/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index 89c969b..9a02046 100644
--- 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -309,7 +309,8 @@ public class EntityLineageService implements 
AtlasLineageService {
 bindings.put("guid", entityGuid);
 bindings.put("incomingEdgeLabel", incomingFrom);
 bindings.put("outgoingEdgeLabel", outgoingTo);
-bindings.put("depth", depth);
+bindings.put("dataSetDepth", depth);
+bindings.put("processDepth", depth - 1);
 
 if (depth < 1) {
 ret = isDataSet ? 
gremlinQueryProvider.getQuery(FULL_LINEAGE_DATASET) :

http://git-wip-us.apache.org/repos/asf/atlas/blob/da78c483/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
 
b/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
index 6d3b1a8..20c570f 100644
--- 
a/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
+++ 
b/repository/src/main/java/org/apache/atlas/util/AtlasGremlin3QueryProvider.java
@@ -48,11 +48,11 @@ public class AtlasGremlin3QueryProvider extends 
AtlasGremlin2QueryProvider {
 case FULL_LINEAGE_DATASET:
 return "g.V().has('__guid', 
guid).repeat(__.inE(incomingEdgeLabel).as('e1').outV().outE(outgoingEdgeLabel).as('e2').inV()).emit().select('e1',
 'e2').toList()";
 case PARTIAL_LINEAGE_DATASET:
-return "g.V().has('__guid', 
guid).repeat(__.inE(incomingEdgeLabel).as('e1').outV().outE(outgoingEdgeLabel).as('e2').inV()).times(depth).emit().select('e1',
 'e2').toList()";
+return "g.V().has('__guid', 
guid).repeat(__.inE(incomingEdgeLabel).as('e1').outV().outE(outgoingEdgeLabel).as('e2').inV()).times(dataSetDepth).emit().select('e1',
 'e2').toList()";
 case FULL_LINEAGE_PROCESS:
 return "g.V().has('__guid', 
guid).outE(outgoingEdgeLabel).store('e').inV().repeat(__.inE(incomingEdgeLabel).store('e').outV().outE(outgoingEdgeLabel).store('e').inV()).cap('e').unfold().toList()";
 case PARTIAL_LINEAGE_PROCESS:
-return "g.V().has('__guid', 
guid).outE(outgoingEdgeLabel).store('e').inV().repeat(__.inE(incomingEdgeLabel).store('e').outV().outE(outgoingEdgeLabel).store('e').inV()).times(depth).cap('e').unfold().toList()";
+return "g.V().has('__guid', 
guid).outE(outgoingEdgeLabel).store('e').inV().until(loops().is(eq(processDepth))).repeat(__.inE(incomingEdgeLabel).store('e').outV().outE(outgoingEdgeLabel).store('e').inV()).cap('e').unfold().toList()";
 case TO_RANGE_LIST:
 return ".range(startIdx, endIdx).toList()";
 case RELATIONSHIP_SEARCH:



atlas git commit: ATLAS-2959: Update metrics query to use index query instead of graph query for faster response

2018-11-09 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master e272a28e8 -> 85280ddf0


ATLAS-2959: Update metrics query to use index query instead of graph query for 
faster response


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/85280ddf
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/85280ddf
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/85280ddf

Branch: refs/heads/master
Commit: 85280ddf073a6e930b7b076730c362271437429a
Parents: e272a28
Author: Sarath Subramanian 
Authored: Fri Nov 9 15:45:30 2018 -0800
Committer: Sarath Subramanian 
Committed: Fri Nov 9 15:45:30 2018 -0800

--
 .../repository/graphdb/AtlasIndexQuery.java |   6 +
 .../graphdb/janus/AtlasJanusIndexQuery.java |   5 +
 .../apache/atlas/services/MetricsService.java   | 207 ++--
 .../atlas/services/MetricsServiceTest.java  | 238 ++-
 .../test/resources/metrics-entities-data.zip| Bin 0 -> 25602 bytes
 5 files changed, 206 insertions(+), 250 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/85280ddf/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
--
diff --git 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
index 6bad173..f3722b8 100644
--- 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
+++ 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
@@ -44,6 +44,12 @@ public interface AtlasIndexQuery {
 Iterator> vertices(int offset, int limit);
 
 /**
+ * Gets the total count of query results
+ * @return
+ */
+Long vertexTotals();
+
+/**
  * Query result from an index query.
  *
  * @param 

http://git-wip-us.apache.org/repos/asf/atlas/blob/85280ddf/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
--
diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
index f605266..7c258b7 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
@@ -77,6 +77,11 @@ public class AtlasJanusIndexQuery implements 
AtlasIndexQueryhttp://git-wip-us.apache.org/repos/asf/atlas/blob/85280ddf/repository/src/main/java/org/apache/atlas/services/MetricsService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/services/MetricsService.java 
b/repository/src/main/java/org/apache/atlas/services/MetricsService.java
index c850f23..d74acfb 100644
--- a/repository/src/main/java/org/apache/atlas/services/MetricsService.java
+++ b/repository/src/main/java/org/apache/atlas/services/MetricsService.java
@@ -17,13 +17,12 @@
  */
 package org.apache.atlas.services;
 
-import com.google.common.annotations.VisibleForTesting;
 import org.apache.atlas.annotation.AtlasService;
-import org.apache.atlas.exception.AtlasBaseException;
+import org.apache.atlas.model.instance.AtlasEntity.Status;
 import org.apache.atlas.model.metrics.AtlasMetrics;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
+import org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2;
 import org.apache.atlas.type.AtlasTypeRegistry;
-import org.apache.atlas.util.AtlasGremlinQueryProvider;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.configuration.Configuration;
 import org.slf4j.Logger;
@@ -32,13 +31,14 @@ import org.slf4j.LoggerFactory;
 import javax.inject.Inject;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
 
-import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery;
-import static org.apache.atlas.util.AtlasGremlinQueryProvider.INSTANCE;
+import static org.apache.atlas.discovery.SearchProcessor.AND_STR;
+import static org.apache.atlas.model.instance.AtlasEntity.Status.ACTIVE;
+import static org.apache.atlas.model.instance.AtlasEntity.Status.DELETED;
+import static org.apache.atlas.repository.Constants.ENTITY_TYPE_PROPERTY_KEY;
+import static org.apache.atlas.repository.Constants.STATE_PROPERTY_KEY;
+import static org.apache.atlas.repository.Constants.VERTEX_INDEX;
 
 @AtlasService
 public class Metri

atlas git commit: ATLAS-2959: Update metrics query to use index query instead of graph query for faster response

2018-11-09 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 9e13df6e3 -> 7b165cb91


ATLAS-2959: Update metrics query to use index query instead of graph query for 
faster response

(cherry picked from commit 85280ddf073a6e930b7b076730c362271437429a)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/7b165cb9
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/7b165cb9
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/7b165cb9

Branch: refs/heads/branch-1.0
Commit: 7b165cb914b7f5558618e9b6c916e662aa3bb057
Parents: 9e13df6
Author: Sarath Subramanian 
Authored: Fri Nov 9 15:45:30 2018 -0800
Committer: Sarath Subramanian 
Committed: Fri Nov 9 15:46:03 2018 -0800

--
 .../repository/graphdb/AtlasIndexQuery.java |   6 +
 .../graphdb/janus/AtlasJanusIndexQuery.java |   5 +
 .../apache/atlas/services/MetricsService.java   | 207 ++--
 .../atlas/services/MetricsServiceTest.java  | 238 ++-
 .../test/resources/metrics-entities-data.zip| Bin 0 -> 25602 bytes
 5 files changed, 206 insertions(+), 250 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/7b165cb9/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
--
diff --git 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
index 6bad173..f3722b8 100644
--- 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
+++ 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasIndexQuery.java
@@ -44,6 +44,12 @@ public interface AtlasIndexQuery {
 Iterator> vertices(int offset, int limit);
 
 /**
+ * Gets the total count of query results
+ * @return
+ */
+Long vertexTotals();
+
+/**
  * Query result from an index query.
  *
  * @param 

http://git-wip-us.apache.org/repos/asf/atlas/blob/7b165cb9/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
--
diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
index f605266..7c258b7 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusIndexQuery.java
@@ -77,6 +77,11 @@ public class AtlasJanusIndexQuery implements 
AtlasIndexQueryhttp://git-wip-us.apache.org/repos/asf/atlas/blob/7b165cb9/repository/src/main/java/org/apache/atlas/services/MetricsService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/services/MetricsService.java 
b/repository/src/main/java/org/apache/atlas/services/MetricsService.java
index c850f23..d74acfb 100644
--- a/repository/src/main/java/org/apache/atlas/services/MetricsService.java
+++ b/repository/src/main/java/org/apache/atlas/services/MetricsService.java
@@ -17,13 +17,12 @@
  */
 package org.apache.atlas.services;
 
-import com.google.common.annotations.VisibleForTesting;
 import org.apache.atlas.annotation.AtlasService;
-import org.apache.atlas.exception.AtlasBaseException;
+import org.apache.atlas.model.instance.AtlasEntity.Status;
 import org.apache.atlas.model.metrics.AtlasMetrics;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
+import org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2;
 import org.apache.atlas.type.AtlasTypeRegistry;
-import org.apache.atlas.util.AtlasGremlinQueryProvider;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.configuration.Configuration;
 import org.slf4j.Logger;
@@ -32,13 +31,14 @@ import org.slf4j.LoggerFactory;
 import javax.inject.Inject;
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
-import java.util.stream.Collectors;
-import java.util.stream.IntStream;
 
-import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery;
-import static org.apache.atlas.util.AtlasGremlinQueryProvider.INSTANCE;
+import static org.apache.atlas.discovery.SearchProcessor.AND_STR;
+import static org.apache.atlas.model.instance.AtlasEntity.Status.ACTIVE;
+import static org.apache.atlas.model.instance.AtlasEntity.Status.DELETED;
+import static org.apache.atlas.repository.Constants.ENTITY_TYPE_PROPERTY_KEY;
+import static org.apache.atlas.repository.Constants.STATE_PROPERTY_KEY;
+impo

atlas git commit: ATLAS-2965: Duplicate entities are created when when same qualifiedName is given but different guids

2018-11-15 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 daabed131 -> a36b27ae7


ATLAS-2965: Duplicate entities are created when when same qualifiedName is 
given but different guids


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/a36b27ae
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/a36b27ae
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/a36b27ae

Branch: refs/heads/branch-0.8
Commit: a36b27ae798d97b5b30238d13b8d63a3652a0260
Parents: daabed1
Author: Sarath Subramanian 
Authored: Thu Nov 15 15:43:29 2018 -0800
Committer: Sarath Subramanian 
Committed: Thu Nov 15 15:43:29 2018 -0800

--
 .../test/java/org/apache/atlas/TestUtilsV2.java | 33 
 .../store/graph/v1/AtlasEntityStoreV1.java  | 29 -
 .../store/graph/v1/EntityGraphMapper.java   | 24 +-
 .../store/graph/v1/AtlasEntityStoreV1Test.java  | 23 ++
 4 files changed, 107 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/a36b27ae/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
--
diff --git a/intg/src/test/java/org/apache/atlas/TestUtilsV2.java 
b/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
index 8470054..18f8b25 100755
--- a/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
+++ b/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
@@ -1057,6 +1057,39 @@ public final class TestUtilsV2 {
 return ret;
 }
 
+public static AtlasEntityWithExtInfo 
createTableEntityDuplicatesV2(AtlasEntity dbEntity) {
+AtlasEntity tblEntity = new AtlasEntity(TABLE_TYPE);
+
+tblEntity.setAttribute(NAME, RandomStringUtils.randomAlphanumeric(10));
+tblEntity.setAttribute("description", "random table");
+tblEntity.setAttribute("type", "type");
+tblEntity.setAttribute("tableType", "MANAGED");
+tblEntity.setAttribute("database", 
AtlasTypeUtil.getAtlasObjectId(dbEntity));
+
+AtlasEntity col1 = createColumnEntity(tblEntity);
+col1.setAttribute(NAME, "col1");
+
+AtlasEntity col2 = createColumnEntity(tblEntity);
+col2.setAttribute(NAME, "col1");
+
+AtlasEntity col3 = createColumnEntity(tblEntity);
+col3.setAttribute(NAME, "col1");
+
+// all 3 columns have different guid but same typeName and unique 
attributes
+tblEntity.setAttribute(COLUMNS_ATTR_NAME, 
Arrays.asList(AtlasTypeUtil.getAtlasObjectId(col1),
+
AtlasTypeUtil.getAtlasObjectId(col2),
+
AtlasTypeUtil.getAtlasObjectId(col3)));
+
+AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(tblEntity);
+
+ret.addReferredEntity(dbEntity);
+ret.addReferredEntity(col1);
+ret.addReferredEntity(col2);
+ret.addReferredEntity(col3);
+
+return ret;
+}
+
 public static AtlasEntity createColumnEntity(AtlasEntity tableEntity) {
 return createColumnEntity(tableEntity, "col" + seq.addAndGet(1));
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/a36b27ae/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
index c98c8c4..f578ded 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
@@ -612,10 +612,10 @@ public class AtlasEntityStoreV1 implements 
AtlasEntityStore {
 RequestContextV1requestContext   = RequestContextV1.get();
 
 for (String guid : discoveryContext.getReferencedGuids()) {
-AtlasVertex vertex = 
discoveryContext.getResolvedEntityVertex(guid);
 AtlasEntity entity = entityStream.getByGuid(guid);
 
 if (entity != null) {
+AtlasVertex vertex = getResolvedEntityVertex(discoveryContext, 
entity);
 
 if (vertex != null) {
 // entity would be null if guid is not in the stream but 
referenced by an entity in the stream
@@ -650,6 +650,8 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore 
{
 
 discoveryContext.addResolvedGuid(guid, vertex);
 
+
discoveryContext.addResolvedId

atlas git commit: ATLAS-2965: Duplicate entities are created when when same qualifiedName is given but different guids

2018-11-15 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master d003ddb33 -> 40329046a


ATLAS-2965: Duplicate entities are created when when same qualifiedName is 
given but different guids


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/40329046
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/40329046
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/40329046

Branch: refs/heads/master
Commit: 40329046a1d67059409c02396d696153bb2de653
Parents: d003ddb
Author: Sarath Subramanian 
Authored: Thu Nov 15 15:42:19 2018 -0800
Committer: Sarath Subramanian 
Committed: Thu Nov 15 15:42:19 2018 -0800

--
 .../test/java/org/apache/atlas/TestUtilsV2.java | 33 
 .../store/graph/v2/AtlasEntityStoreV2.java  | 33 +++-
 .../store/graph/v2/EntityGraphRetriever.java| 21 +
 .../graph/v2/AtlasComplexAttributesTest.java| 21 ++---
 .../store/graph/v2/AtlasEntityStoreV2Test.java  | 21 +
 5 files changed, 124 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/40329046/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
--
diff --git a/intg/src/test/java/org/apache/atlas/TestUtilsV2.java 
b/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
index 4e9a651..093105b 100755
--- a/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
+++ b/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
@@ -1256,6 +1256,39 @@ public final class TestUtilsV2 {
 return newtestEntityDef;
 }
 
+public static AtlasEntityWithExtInfo 
createTableEntityDuplicatesV2(AtlasEntity dbEntity) {
+AtlasEntity tblEntity = new AtlasEntity(TABLE_TYPE);
+
+tblEntity.setAttribute(NAME, RandomStringUtils.randomAlphanumeric(10));
+tblEntity.setAttribute("description", "random table");
+tblEntity.setAttribute("type", "type");
+tblEntity.setAttribute("tableType", "MANAGED");
+tblEntity.setAttribute("database", 
AtlasTypeUtil.getAtlasObjectId(dbEntity));
+
+AtlasEntity col1 = createColumnEntity(tblEntity);
+col1.setAttribute(NAME, "col1");
+
+AtlasEntity col2 = createColumnEntity(tblEntity);
+col2.setAttribute(NAME, "col1");
+
+AtlasEntity col3 = createColumnEntity(tblEntity);
+col3.setAttribute(NAME, "col1");
+
+// all 3 columns have different guid but same typeName and unique 
attributes
+tblEntity.setAttribute(COLUMNS_ATTR_NAME, 
Arrays.asList(AtlasTypeUtil.getAtlasObjectId(col1),
+AtlasTypeUtil.getAtlasObjectId(col2),
+AtlasTypeUtil.getAtlasObjectId(col3)));
+
+AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(tblEntity);
+
+ret.addReferredEntity(dbEntity);
+ret.addReferredEntity(col1);
+ret.addReferredEntity(col2);
+ret.addReferredEntity(col3);
+
+return ret;
+}
+
 public static AtlasEntity createColumnEntity(AtlasEntity tableEntity) {
 return createColumnEntity(tableEntity, "col" + seq.addAndGet(1));
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/40329046/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
index ee8de1f..6ee0279 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
@@ -742,10 +742,11 @@ public class AtlasEntityStoreV2 implements 
AtlasEntityStore {
 RequestContext  requestContext   = RequestContext.get();
 
 for (String guid : discoveryContext.getReferencedGuids()) {
-AtlasVertex vertex = 
discoveryContext.getResolvedEntityVertex(guid);
 AtlasEntity entity = entityStream.getByGuid(guid);
 
 if (entity != null) { // entity would be null if guid is not in 
the stream but referenced by an entity in the stream
+AtlasVertex vertex = getResolvedEntityVertex(discoveryContext, 
entity);
+
 if (vertex != null) {
 if (!isPartialUpdate) {
 graphDiscoverer.validateAndNormalize(entity);
@@ -779,6 +780,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore 
{
 
 discoveryContext.addResolvedGuid(gu

atlas git commit: ATLAS-2965: Duplicate entities are created when when same qualifiedName is given but different guids

2018-11-15 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 7869c9a5f -> d3aaef05f


ATLAS-2965: Duplicate entities are created when when same qualifiedName is 
given but different guids

(cherry picked from commit 40329046a1d67059409c02396d696153bb2de653)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/d3aaef05
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/d3aaef05
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/d3aaef05

Branch: refs/heads/branch-1.0
Commit: d3aaef05fa4fdae5e1a5dda4ac8cb6a40748f4c3
Parents: 7869c9a
Author: Sarath Subramanian 
Authored: Thu Nov 15 15:42:19 2018 -0800
Committer: Sarath Subramanian 
Committed: Thu Nov 15 15:42:57 2018 -0800

--
 .../test/java/org/apache/atlas/TestUtilsV2.java | 33 
 .../store/graph/v2/AtlasEntityStoreV2.java  | 33 +++-
 .../store/graph/v2/EntityGraphRetriever.java| 21 +
 .../graph/v2/AtlasComplexAttributesTest.java| 21 ++---
 .../store/graph/v2/AtlasEntityStoreV2Test.java  | 21 +
 5 files changed, 124 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/d3aaef05/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
--
diff --git a/intg/src/test/java/org/apache/atlas/TestUtilsV2.java 
b/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
index 4e9a651..093105b 100755
--- a/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
+++ b/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
@@ -1256,6 +1256,39 @@ public final class TestUtilsV2 {
 return newtestEntityDef;
 }
 
+public static AtlasEntityWithExtInfo 
createTableEntityDuplicatesV2(AtlasEntity dbEntity) {
+AtlasEntity tblEntity = new AtlasEntity(TABLE_TYPE);
+
+tblEntity.setAttribute(NAME, RandomStringUtils.randomAlphanumeric(10));
+tblEntity.setAttribute("description", "random table");
+tblEntity.setAttribute("type", "type");
+tblEntity.setAttribute("tableType", "MANAGED");
+tblEntity.setAttribute("database", 
AtlasTypeUtil.getAtlasObjectId(dbEntity));
+
+AtlasEntity col1 = createColumnEntity(tblEntity);
+col1.setAttribute(NAME, "col1");
+
+AtlasEntity col2 = createColumnEntity(tblEntity);
+col2.setAttribute(NAME, "col1");
+
+AtlasEntity col3 = createColumnEntity(tblEntity);
+col3.setAttribute(NAME, "col1");
+
+// all 3 columns have different guid but same typeName and unique 
attributes
+tblEntity.setAttribute(COLUMNS_ATTR_NAME, 
Arrays.asList(AtlasTypeUtil.getAtlasObjectId(col1),
+AtlasTypeUtil.getAtlasObjectId(col2),
+AtlasTypeUtil.getAtlasObjectId(col3)));
+
+AtlasEntityWithExtInfo ret = new AtlasEntityWithExtInfo(tblEntity);
+
+ret.addReferredEntity(dbEntity);
+ret.addReferredEntity(col1);
+ret.addReferredEntity(col2);
+ret.addReferredEntity(col3);
+
+return ret;
+}
+
 public static AtlasEntity createColumnEntity(AtlasEntity tableEntity) {
 return createColumnEntity(tableEntity, "col" + seq.addAndGet(1));
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/d3aaef05/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
index ee8de1f..6ee0279 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
@@ -742,10 +742,11 @@ public class AtlasEntityStoreV2 implements 
AtlasEntityStore {
 RequestContext  requestContext   = RequestContext.get();
 
 for (String guid : discoveryContext.getReferencedGuids()) {
-AtlasVertex vertex = 
discoveryContext.getResolvedEntityVertex(guid);
 AtlasEntity entity = entityStream.getByGuid(guid);
 
 if (entity != null) { // entity would be null if guid is not in 
the stream but referenced by an entity in the stream
+AtlasVertex vertex = getResolvedEntityVertex(discoveryContext, 
entity);
+
 if (vertex != null) {
 if (!isPartialUpdate) {
 graphDiscoverer.validateAndNormalize(entity);
@@ -779,6 +780,8 @@ public class Atlas

atlas git commit: ATLAS-2969: Attempt to import empty zip file should not throw excpetion

2018-11-15 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 40329046a -> b96c6b7a9


ATLAS-2969: Attempt to import empty zip file should not throw excpetion

(cherry picked from commit 4ca33fcbf4e8845c86340622fb28d88e4457dccd)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/b96c6b7a
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/b96c6b7a
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/b96c6b7a

Branch: refs/heads/master
Commit: b96c6b7a9127021c5e3624048bc0d21b0e1e24e3
Parents: 4032904
Author: Sarath Subramanian 
Authored: Thu Nov 15 23:07:33 2018 -0800
Committer: Sarath Subramanian 
Committed: Thu Nov 15 23:35:27 2018 -0800

--
 .../main/java/org/apache/atlas/web/resources/AdminResource.java  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/b96c6b7a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
--
diff --git 
a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java 
b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
index 3998932..83dac65 100755
--- a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
@@ -410,10 +410,8 @@ public class AdminResource {
 LOG.info(excp.getMessage());
 } else {
 LOG.error("importData(binary) failed", excp);
+throw excp;
 }
-
-throw excp;
-
 } catch (Exception excp) {
 LOG.error("importData(binary) failed", excp);
 



atlas git commit: ATLAS-2969: Attempt to import empty zip file should not throw excpetion

2018-11-15 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 a36b27ae7 -> 4ca33fcbf


ATLAS-2969: Attempt to import empty zip file should not throw excpetion


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4ca33fcb
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4ca33fcb
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4ca33fcb

Branch: refs/heads/branch-0.8
Commit: 4ca33fcbf4e8845c86340622fb28d88e4457dccd
Parents: a36b27a
Author: Sarath Subramanian 
Authored: Thu Nov 15 23:07:33 2018 -0800
Committer: Sarath Subramanian 
Committed: Thu Nov 15 23:07:33 2018 -0800

--
 .../main/java/org/apache/atlas/web/resources/AdminResource.java  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/4ca33fcb/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
--
diff --git 
a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java 
b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
index 9069f44..c0a139e 100755
--- a/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
+++ b/webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
@@ -400,10 +400,8 @@ public class AdminResource {
 LOG.info(excp.getMessage());
 } else {
 LOG.error("importData(binary) failed", excp);
+throw excp;
 }
-
-throw excp;
-
 } catch (Exception excp) {
 LOG.error("importData(binary) failed", excp);
 



atlas git commit: ATLAS-2957: Fix and enable disabled StormHook Integrations Tests

2018-11-06 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 18ee8b5cd -> b71f66436


ATLAS-2957: Fix and enable disabled StormHook Integrations Tests

(cherry picked from commit 243a43218fa8a72ff653bf0b61af9ac1c5b1ef85)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/b71f6643
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/b71f6643
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/b71f6643

Branch: refs/heads/branch-1.0
Commit: b71f66436656202bcfb03071ed0a9ddf5eca9ca6
Parents: 18ee8b5
Author: Sarath Subramanian 
Authored: Tue Nov 6 15:35:35 2018 -0800
Committer: Sarath Subramanian 
Committed: Tue Nov 6 15:43:37 2018 -0800

--
 .../org/apache/atlas/storm/hook/StormAtlasHookIT.java |  5 ++---
 .../org/apache/atlas/hook/FailedMessagesLogger.java   | 14 --
 pom.xml   |  4 
 3 files changed, 14 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/b71f6643/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
--
diff --git 
a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
 
b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
index 7040870..e11e1b8 100644
--- 
a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
+++ 
b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
@@ -36,7 +36,7 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-@Test(enabled = false)
+@Test
 public class StormAtlasHookIT {
 
 public static final Logger LOG = 
LoggerFactory.getLogger(StormAtlasHookIT.class);
@@ -70,8 +70,7 @@ public class StormAtlasHookIT {
 atlasClient = null;
 }
 
-//TODO: Fix failing test
-@Test(enabled = false)
+@Test
 public void testAddEntities() throws Exception {
 StormTopology stormTopology = StormTestUtil.createTestTopology();
 StormTestUtil.submitTopology(stormCluster, TOPOLOGY_NAME, 
stormTopology);

http://git-wip-us.apache.org/repos/asf/atlas/blob/b71f6643/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
--
diff --git 
a/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java 
b/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
index 0b3723a..b319e81 100644
--- a/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
+++ b/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
@@ -73,17 +73,19 @@ public class FailedMessagesLogger {
  * @return directory under which host component's logs are stored.
  */
 private String getRootLoggerDirectory() {
-String rootLoggerDirectory = null;
-org.apache.log4j.Logger rootLogger = 
org.apache.log4j.Logger.getRootLogger();
+String  rootLoggerDirectory = null;
+Logger  rootLogger  = Logger.getRootLogger();
+Enumeration allAppenders= rootLogger.getAllAppenders();
 
-Enumeration allAppenders = rootLogger.getAllAppenders();
 if (allAppenders != null) {
 while (allAppenders.hasMoreElements()) {
 Appender appender = (Appender) allAppenders.nextElement();
+
 if (appender instanceof FileAppender) {
-FileAppender fileAppender = (FileAppender) appender;
-String rootLoggerFile = fileAppender.getFile();
-rootLoggerDirectory = new File(rootLoggerFile).getParent();
+FileAppender fileAppender   = (FileAppender) appender;
+String   rootLoggerFile = fileAppender.getFile();
+
+rootLoggerDirectory = rootLoggerFile != null ? new 
File(rootLoggerFile).getParent() : null;
 break;
 }
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/b71f6643/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 2e13586..146142f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1891,6 +1891,8 @@
 
 ${project.basedir}
 
${project.build.directory}/data
+
${project.build.directory}/logs
+application.log
 
atlas-log4j.xml
 
${project.basedir}/target
 
@@ -1921,6 +1923,8 @@
 
 ${projectBase

atlas git commit: ATLAS-2957: Fix and enable disabled StormHook Integrations Tests

2018-11-06 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master e7b9131db -> 243a43218


ATLAS-2957: Fix and enable disabled StormHook Integrations Tests


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/243a4321
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/243a4321
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/243a4321

Branch: refs/heads/master
Commit: 243a43218fa8a72ff653bf0b61af9ac1c5b1ef85
Parents: e7b9131
Author: Sarath Subramanian 
Authored: Tue Nov 6 15:35:35 2018 -0800
Committer: Sarath Subramanian 
Committed: Tue Nov 6 15:35:35 2018 -0800

--
 .../org/apache/atlas/storm/hook/StormAtlasHookIT.java |  5 ++---
 .../org/apache/atlas/hook/FailedMessagesLogger.java   | 14 --
 pom.xml   |  4 
 3 files changed, 14 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/243a4321/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
--
diff --git 
a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
 
b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
index 7040870..e11e1b8 100644
--- 
a/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
+++ 
b/addons/storm-bridge/src/test/java/org/apache/atlas/storm/hook/StormAtlasHookIT.java
@@ -36,7 +36,7 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
-@Test(enabled = false)
+@Test
 public class StormAtlasHookIT {
 
 public static final Logger LOG = 
LoggerFactory.getLogger(StormAtlasHookIT.class);
@@ -70,8 +70,7 @@ public class StormAtlasHookIT {
 atlasClient = null;
 }
 
-//TODO: Fix failing test
-@Test(enabled = false)
+@Test
 public void testAddEntities() throws Exception {
 StormTopology stormTopology = StormTestUtil.createTestTopology();
 StormTestUtil.submitTopology(stormCluster, TOPOLOGY_NAME, 
stormTopology);

http://git-wip-us.apache.org/repos/asf/atlas/blob/243a4321/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
--
diff --git 
a/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java 
b/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
index 0b3723a..b319e81 100644
--- a/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
+++ b/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java
@@ -73,17 +73,19 @@ public class FailedMessagesLogger {
  * @return directory under which host component's logs are stored.
  */
 private String getRootLoggerDirectory() {
-String rootLoggerDirectory = null;
-org.apache.log4j.Logger rootLogger = 
org.apache.log4j.Logger.getRootLogger();
+String  rootLoggerDirectory = null;
+Logger  rootLogger  = Logger.getRootLogger();
+Enumeration allAppenders= rootLogger.getAllAppenders();
 
-Enumeration allAppenders = rootLogger.getAllAppenders();
 if (allAppenders != null) {
 while (allAppenders.hasMoreElements()) {
 Appender appender = (Appender) allAppenders.nextElement();
+
 if (appender instanceof FileAppender) {
-FileAppender fileAppender = (FileAppender) appender;
-String rootLoggerFile = fileAppender.getFile();
-rootLoggerDirectory = new File(rootLoggerFile).getParent();
+FileAppender fileAppender   = (FileAppender) appender;
+String   rootLoggerFile = fileAppender.getFile();
+
+rootLoggerDirectory = rootLoggerFile != null ? new 
File(rootLoggerFile).getParent() : null;
 break;
 }
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/243a4321/pom.xml
--
diff --git a/pom.xml b/pom.xml
index 0fe73ff..49fe7de 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1902,6 +1902,8 @@
 
 ${project.basedir}
 
${project.build.directory}/data
+
${project.build.directory}/logs
+application.log
 
atlas-log4j.xml
 
${project.basedir}/target
 
@@ -1932,6 +1934,8 @@
 
 ${projectBaseDir}
 
${project.build.directory}/d

atlas git commit: ATLAS-2905: Generate lineage information for process entities #3 fix test

2018-10-04 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 55f8b78fd -> 20525f866


ATLAS-2905: Generate lineage information for process entities #3 fix test


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/20525f86
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/20525f86
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/20525f86

Branch: refs/heads/branch-0.8
Commit: 20525f86675d48ee29f0e4df17d1e4aec2372414
Parents: 55f8b78
Author: Sarath Subramanian 
Authored: Thu Oct 4 14:56:50 2018 -0700
Committer: Sarath Subramanian 
Committed: Thu Oct 4 15:11:03 2018 -0700

--
 .../org/apache/atlas/BaseRepositoryTest.java| 30 ++--
 .../atlas/lineage/EntityLineageServiceTest.java |  4 +--
 2 files changed, 23 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/20525f86/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java
--
diff --git a/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java 
b/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java
index 7c6b60b..fc82cf6 100644
--- a/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java
+++ b/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java
@@ -20,9 +20,12 @@ package org.apache.atlas;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
+import org.apache.atlas.model.typedef.AtlasTypesDef;
 import org.apache.atlas.repository.MetadataRepository;
+import org.apache.atlas.repository.converters.TypeConverterUtil;
 import org.apache.atlas.repository.graph.GraphBackedSearchIndexer;
 import org.apache.atlas.services.MetadataService;
+import org.apache.atlas.store.AtlasTypeDefStore;
 import org.apache.atlas.type.AtlasTypeRegistry;
 import org.apache.atlas.typesystem.ITypedReferenceableInstance;
 import org.apache.atlas.typesystem.Referenceable;
@@ -51,6 +54,12 @@ public class BaseRepositoryTest {
 protected MetadataService metadataService;
 
 @Inject
+protected AtlasTypeRegistry typeRegistry;
+
+@Inject
+protected AtlasTypeDefStore typeDefStore;
+
+@Inject
 protected MetadataRepository repository;
 
 
@@ -71,12 +80,6 @@ public class BaseRepositoryTest {
 TypeSystem.getInstance().reset();
 }
 
-private void setUpTypes() throws Exception {
-TypesDef typesDef = createTypeDefinitions();
-String typesAsJSON = TypesSerialization.toJson(typesDef);
-metadataService.createType(typesAsJSON);
-}
-
 protected static final String DATABASE_TYPE = "hive_db";
 protected static final String HIVE_TABLE_TYPE = "hive_table";
 private static final String COLUMN_TYPE = "hive_column";
@@ -389,9 +392,18 @@ public class BaseRepositoryTest {
 }
 
 private void setUpDefaultTypes() throws Exception {
-TypesDef typesDef = createDefaultTypeDefinitions();
-String typesAsJSON = TypesSerialization.toJson(typesDef);
-metadataService.createType(typesAsJSON);
+createTypesDef(createDefaultTypeDefinitions());
+}
+
+private void setUpTypes() throws Exception {
+createTypesDef(createTypeDefinitions());
+}
+
+private void createTypesDef(TypesDef typesDef) throws Exception {
+StringtypesAsJSON   = TypesSerialization.toJson(typesDef);
+AtlasTypesDef atlasTypesDef = 
TypeConverterUtil.toAtlasTypesDef(typesAsJSON, typeRegistry);
+
+typeDefStore.createTypesDef(atlasTypesDef);
 }
 
 TypesDef createDefaultTypeDefinitions() {

http://git-wip-us.apache.org/repos/asf/atlas/blob/20525f86/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
--
diff --git 
a/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
 
b/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
index f3c26bd..33e0992 100644
--- 
a/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
+++ 
b/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
@@ -216,8 +216,8 @@ public class EntityLineageServiceTest extends 
BaseRepositoryTest {
 {" ", null, 0, AtlasErrorCode.INSTANCE_GUID_NOT_FOUND},
 {null, null, 0, AtlasErrorCode.TYPE_NAME_NOT_FOUND},
 {"invalidGuid", LineageDirection.OUTPUT, 6, 
AtlasErrorCode.INSTANCE_GUID_NOT_FOUND},
-{entityGuid, null, -10, AtlasErrorCode.TYPE_NAME_NOT_FOUND},
-{entityGuid, null, 5, AtlasErrorCode.TYPE_NA

atlas git commit: ATLAS-2905: Generate lineage information for process entities #2 fix test

2018-10-03 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 d6bd99065 -> 360be1480


ATLAS-2905: Generate lineage information for process entities #2 fix test


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/360be148
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/360be148
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/360be148

Branch: refs/heads/branch-0.8
Commit: 360be1480d8a5d3bf5b92b34f679bb0d407a963b
Parents: d6bd990
Author: Sarath Subramanian 
Authored: Wed Oct 3 12:19:04 2018 -0700
Committer: Sarath Subramanian 
Committed: Wed Oct 3 12:19:04 2018 -0700

--
 .../org/apache/atlas/lineage/EntityLineageServiceTest.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/360be148/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
--
diff --git 
a/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
 
b/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
index 202f20c..f3c26bd 100644
--- 
a/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
+++ 
b/repository/src/test/java/org/apache/atlas/lineage/EntityLineageServiceTest.java
@@ -214,10 +214,10 @@ public class EntityLineageServiceTest extends 
BaseRepositoryTest {
 return new Object[][]{
 {"", null, 0, AtlasErrorCode.INSTANCE_GUID_NOT_FOUND},
 {" ", null, 0, AtlasErrorCode.INSTANCE_GUID_NOT_FOUND},
-{null, null, 0, AtlasErrorCode.INSTANCE_GUID_NOT_FOUND},
+{null, null, 0, AtlasErrorCode.TYPE_NAME_NOT_FOUND},
 {"invalidGuid", LineageDirection.OUTPUT, 6, 
AtlasErrorCode.INSTANCE_GUID_NOT_FOUND},
-{entityGuid, null, -10, 
AtlasErrorCode.INSTANCE_LINEAGE_INVALID_PARAMS},
-{entityGuid, null, 5, 
AtlasErrorCode.INSTANCE_LINEAGE_INVALID_PARAMS}
+{entityGuid, null, -10, AtlasErrorCode.TYPE_NAME_NOT_FOUND},
+{entityGuid, null, 5, AtlasErrorCode.TYPE_NAME_NOT_FOUND}
 };
 }
 



atlas git commit: ATLAS-2905: Generate lineage information for process entities

2018-10-02 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master d5f46e3f5 -> 8cc12be18


ATLAS-2905: Generate lineage information for process entities


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/8cc12be1
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/8cc12be1
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/8cc12be1

Branch: refs/heads/master
Commit: 8cc12be185d388798a9de4e1d798e69de9795374
Parents: d5f46e3
Author: Sarath Subramanian 
Authored: Tue Oct 2 15:37:45 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Oct 2 15:37:45 2018 -0700

--
 .../java/org/apache/atlas/AtlasErrorCode.java   |  2 +-
 .../atlas/discovery/EntityLineageService.java   | 75 
 .../atlas/util/AtlasGremlin2QueryProvider.java  |  4 +-
 .../atlas/util/AtlasGremlin3QueryProvider.java  |  8 ++-
 .../atlas/util/AtlasGremlinQueryProvider.java   |  6 +-
 5 files changed, 60 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/8cc12be1/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
--
diff --git a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 
b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
index 47726aa..2fe389c 100644
--- a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
+++ b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
@@ -173,7 +173,7 @@ public enum AtlasErrorCode {
 RELATIONSHIPDEF_END_TYPE_NAME_NOT_FOUND(404, "ATLAS-404-00-00E", 
"RelationshipDef {0} endDef typename {0} cannot be found"),
 RELATIONSHIP_ALREADY_DELETED(404, "ATLAS-404-00-00F", "Attempting to 
delete a relationship which is already deleted : {0}"),
 INVALID_ENTITY_GUID_FOR_CLASSIFICATION_UPDATE(404, "ATLAS-404-00-010", 
"Updating entityGuid of classification is not allowed."),
-INSTANCE_GUID_NOT_DATASET(404, "ATLAS-404-00-011", "Given instance guid 
{0} is not a dataset"),
+INVALID_LINEAGE_ENTITY_TYPE(404, "ATLAS-404-00-011", "Given instance guid 
{0} with type {1} is not a valid lineage entity type."),
 INSTANCE_GUID_DELETED(404, "ATLAS-404-00-012", "Given instance guid {0} 
has been deleted"),
 NO_PROPAGATED_CLASSIFICATIONS_FOUND_FOR_ENTITY(404, "ATLAS-404-00-013", 
"No propagated classifications associated with entity: {0}"),
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/8cc12be1/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index 5d02ea5..6f2f97b 100644
--- 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -19,7 +19,6 @@
 package org.apache.atlas.discovery;
 
 
-import org.apache.atlas.AtlasClient;
 import org.apache.atlas.AtlasErrorCode;
 import org.apache.atlas.annotation.GraphTransaction;
 import org.apache.atlas.authorize.AtlasAuthorizationUtils;
@@ -33,7 +32,6 @@ import org.apache.atlas.model.instance.AtlasObjectId;
 import org.apache.atlas.model.lineage.AtlasLineageInfo;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageRelation;
-import org.apache.atlas.repository.Constants;
 import org.apache.atlas.repository.graphdb.AtlasEdge;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
 import org.apache.atlas.repository.graphdb.AtlasVertex;
@@ -61,7 +59,16 @@ import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.apache.atlas.AtlasClient.DATA_SET_SUPER_TYPE;
+import static org.apache.atlas.AtlasClient.PROCESS_SUPER_TYPE;
+import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.BOTH;
+import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.INPUT;
+import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.OUTPUT;
 import static 
org.apache.atlas.repository.Constants.RELATIONSHIP_GUID_PROPERTY_KEY;
+import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery.FULL_LINEAGE_DATASET;
+import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery.FULL_LINEAGE_PROCESS;
+import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery.PARTIAL_LINEAGE_DATASET;
+import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery.PARTIAL_LINEA

atlas git commit: ATLAS-2905: Generate lineage information for process entities

2018-10-02 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 963918dd6 -> b4a788c25


ATLAS-2905: Generate lineage information for process entities

(cherry picked from commit 8cc12be185d388798a9de4e1d798e69de9795374)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/b4a788c2
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/b4a788c2
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/b4a788c2

Branch: refs/heads/branch-1.0
Commit: b4a788c2544cc6c8d3e1107178f05f377b08810d
Parents: 963918d
Author: Sarath Subramanian 
Authored: Tue Oct 2 15:37:45 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Oct 2 15:39:37 2018 -0700

--
 .../java/org/apache/atlas/AtlasErrorCode.java   |  2 +-
 .../atlas/discovery/EntityLineageService.java   | 75 
 .../atlas/util/AtlasGremlin2QueryProvider.java  |  4 +-
 .../atlas/util/AtlasGremlin3QueryProvider.java  |  8 ++-
 .../atlas/util/AtlasGremlinQueryProvider.java   |  6 +-
 5 files changed, 60 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/b4a788c2/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
--
diff --git a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 
b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
index 5f901ef..d29ea8e 100644
--- a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
+++ b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
@@ -173,7 +173,7 @@ public enum AtlasErrorCode {
 RELATIONSHIPDEF_END_TYPE_NAME_NOT_FOUND(404, "ATLAS-404-00-00E", 
"RelationshipDef {0} endDef typename {0} cannot be found"),
 RELATIONSHIP_ALREADY_DELETED(404, "ATLAS-404-00-00F", "Attempting to 
delete a relationship which is already deleted : {0}"),
 INVALID_ENTITY_GUID_FOR_CLASSIFICATION_UPDATE(404, "ATLAS-404-00-010", 
"Updating entityGuid of classification is not allowed."),
-INSTANCE_GUID_NOT_DATASET(404, "ATLAS-404-00-011", "Given instance guid 
{0} is not a dataset"),
+INVALID_LINEAGE_ENTITY_TYPE(404, "ATLAS-404-00-011", "Given instance guid 
{0} with type {1} is not a valid lineage entity type."),
 INSTANCE_GUID_DELETED(404, "ATLAS-404-00-012", "Given instance guid {0} 
has been deleted"),
 NO_PROPAGATED_CLASSIFICATIONS_FOUND_FOR_ENTITY(404, "ATLAS-404-00-013", 
"No propagated classifications associated with entity: {0}"),
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/b4a788c2/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index 5d02ea5..6f2f97b 100644
--- 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -19,7 +19,6 @@
 package org.apache.atlas.discovery;
 
 
-import org.apache.atlas.AtlasClient;
 import org.apache.atlas.AtlasErrorCode;
 import org.apache.atlas.annotation.GraphTransaction;
 import org.apache.atlas.authorize.AtlasAuthorizationUtils;
@@ -33,7 +32,6 @@ import org.apache.atlas.model.instance.AtlasObjectId;
 import org.apache.atlas.model.lineage.AtlasLineageInfo;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageRelation;
-import org.apache.atlas.repository.Constants;
 import org.apache.atlas.repository.graphdb.AtlasEdge;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
 import org.apache.atlas.repository.graphdb.AtlasVertex;
@@ -61,7 +59,16 @@ import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import static org.apache.atlas.AtlasClient.DATA_SET_SUPER_TYPE;
+import static org.apache.atlas.AtlasClient.PROCESS_SUPER_TYPE;
+import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.BOTH;
+import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.INPUT;
+import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.OUTPUT;
 import static 
org.apache.atlas.repository.Constants.RELATIONSHIP_GUID_PROPERTY_KEY;
+import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery.FULL_LINEAGE_DATASET;
+import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery.FULL_LINEAGE_PROCESS;
+import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery.PARTIAL_LINEAGE_DATASET;
+import static 
org.a

atlas git commit: ATLAS-2905: Generate lineage information for process entities

2018-10-03 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 6bc4039aa -> d6bd99065


ATLAS-2905: Generate lineage information for process entities


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/d6bd9906
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/d6bd9906
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/d6bd9906

Branch: refs/heads/branch-0.8
Commit: d6bd9906546ca5adf069ae33f39b8b4afd8ddc84
Parents: 6bc4039
Author: Sarath Subramanian 
Authored: Tue Oct 2 15:37:45 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Oct 2 21:42:35 2018 -0700

--
 .../java/org/apache/atlas/AtlasErrorCode.java   |   3 +-
 .../atlas/discovery/EntityLineageService.java   | 110 +++
 .../atlas/util/AtlasGremlin2QueryProvider.java  |  20 ++--
 .../atlas/util/AtlasGremlinQueryProvider.java   |   6 +-
 4 files changed, 81 insertions(+), 58 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/d6bd9906/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
--
diff --git a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java 
b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
index 8163390..ac82f25 100644
--- a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
+++ b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
@@ -92,8 +92,9 @@ public enum AtlasErrorCode {
 INSTANCE_BY_UNIQUE_ATTRIBUTE_NOT_FOUND(404, "ATLAS-404-00-009", "Instance 
{0} with unique attribute {1} does not exist"),
 REFERENCED_ENTITY_NOT_FOUND(404, "ATLAS-404-00-00A", "Referenced entity 
{0} is not found"),
 INSTANCE_NOT_FOUND(404, "ATLAS-404-00-00B", "Given instance is invalid/not 
found: {0}"),
+INVALID_LINEAGE_ENTITY_TYPE(404, "ATLAS-404-00-00C", "Given instance guid 
{0} with type {1} is not a valid lineage entity type."),
 
- // All data conflict errors go here
+// All data conflict errors go here
 TYPE_ALREADY_EXISTS(409, "ATLAS-409-00-001", "Given type {0} already 
exists"),
 TYPE_HAS_REFERENCES(409, "ATLAS-409-00-002", "Given type {0} has 
references"),
 INSTANCE_ALREADY_EXISTS(409, "ATLAS-409-00-003", "failed to update entity: 
{0}"),

http://git-wip-us.apache.org/repos/asf/atlas/blob/d6bd9906/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
index 3ae41c8..c928d35 100644
--- 
a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
+++ 
b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java
@@ -19,7 +19,6 @@
 package org.apache.atlas.discovery;
 
 
-import org.apache.atlas.AtlasClient;
 import org.apache.atlas.AtlasErrorCode;
 import org.apache.atlas.annotation.GraphTransaction;
 import org.apache.atlas.exception.AtlasBaseException;
@@ -27,25 +26,33 @@ import org.apache.atlas.model.instance.AtlasEntityHeader;
 import org.apache.atlas.model.lineage.AtlasLineageInfo;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection;
 import org.apache.atlas.model.lineage.AtlasLineageInfo.LineageRelation;
-import org.apache.atlas.repository.Constants;
-import org.apache.atlas.repository.graph.GraphHelper;
 import org.apache.atlas.repository.graphdb.AtlasGraph;
 import org.apache.atlas.repository.graphdb.AtlasVertex;
 import org.apache.atlas.repository.store.graph.v1.EntityGraphRetriever;
+import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasTypeRegistry;
 import org.apache.atlas.util.AtlasGremlinQueryProvider;
-import org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.stereotype.Service;
 
 import javax.inject.Inject;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import static org.apache.atlas.AtlasClient.DATA_SET_SUPER_TYPE;
+import static org.apache.atlas.AtlasClient.PROCESS_SUPER_TYPE;
+import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.BOTH;
+import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.INPUT;
+import static 
org.apache.atlas.model.lineage.AtlasLineageInfo.LineageDirection.OUTPUT;
+import static 
org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQue

atlas git commit: ATLAS-2875: Implement clear attribute value transformer for Atlas Entity Transformer

2018-09-20 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 16456800b -> 14bc278ad


ATLAS-2875: Implement clear attribute value transformer for Atlas Entity 
Transformer


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/14bc278a
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/14bc278a
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/14bc278a

Branch: refs/heads/branch-0.8
Commit: 14bc278ad4679009d71891640a8d80a95b9fbd8e
Parents: 1645680
Author: Sarath Subramanian 
Authored: Thu Sep 20 11:20:39 2018 -0700
Committer: Sarath Subramanian 
Committed: Thu Sep 20 11:20:39 2018 -0700

--
 .../apache/atlas/entitytransform/Action.java| 18 
 .../entitytransform/BaseEntityHandler.java  |  8 ++
 .../apache/atlas/entitytransform/Condition.java | 22 +
 .../TransformationHandlerTest.java  | 99 
 4 files changed, 147 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/14bc278a/intg/src/main/java/org/apache/atlas/entitytransform/Action.java
--
diff --git a/intg/src/main/java/org/apache/atlas/entitytransform/Action.java 
b/intg/src/main/java/org/apache/atlas/entitytransform/Action.java
index ca5f3a8..f01c6ce 100644
--- a/intg/src/main/java/org/apache/atlas/entitytransform/Action.java
+++ b/intg/src/main/java/org/apache/atlas/entitytransform/Action.java
@@ -31,6 +31,7 @@ public abstract class Action {
 private static final String ACTION_NAME_REPLACE_PREFIX = "REPLACE_PREFIX";
 private static final String ACTION_NAME_TO_LOWER   = "TO_LOWER";
 private static final String ACTION_NAME_TO_UPPER   = "TO_UPPER";
+private static final String ACTION_NAME_CLEAR  = "CLEAR";
 
 protected final String attributeName;
 
@@ -80,6 +81,10 @@ public abstract class Action {
 ret = new SetAction(key, actionValue);
 break;
 
+case ACTION_NAME_CLEAR:
+ret = new ClearAction(key);
+break;
+
 default:
 ret = new SetAction(key, value); // treat unspecified/unknown 
action as 'SET'
 break;
@@ -196,4 +201,17 @@ public abstract class Action {
 }
 }
 }
+
+public static class ClearAction extends Action {
+public ClearAction(String attributeName) {
+super(attributeName);
+}
+
+@Override
+public void apply(AtlasTransformableEntity entity) {
+if (isValid() && entity.hasAttribute(attributeName)) {
+entity.setAttribute(attributeName, null);
+}
+}
+}
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/14bc278a/intg/src/main/java/org/apache/atlas/entitytransform/BaseEntityHandler.java
--
diff --git 
a/intg/src/main/java/org/apache/atlas/entitytransform/BaseEntityHandler.java 
b/intg/src/main/java/org/apache/atlas/entitytransform/BaseEntityHandler.java
index c1f2869..9d44043 100644
--- a/intg/src/main/java/org/apache/atlas/entitytransform/BaseEntityHandler.java
+++ b/intg/src/main/java/org/apache/atlas/entitytransform/BaseEntityHandler.java
@@ -95,6 +95,10 @@ public class BaseEntityHandler {
 }
 }
 
+if (CollectionUtils.isEmpty(ret)) {
+ret.add(new BaseEntityHandler(transformers));
+}
+
 if (LOG.isDebugEnabled()) {
 LOG.debug("<== 
BaseEntityHandler.createEntityHandlers(transforms={}): ret.size={}", 
transforms, ret.size());
 }
@@ -158,6 +162,10 @@ public class BaseEntityHandler {
 }
 }
 
+public boolean hasAttribute(String attributeName) {
+return getAttribute(attributeName) != null;
+}
+
 public void transformComplete() {
 // implementations can override to set value of computed-attributes
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/14bc278a/intg/src/main/java/org/apache/atlas/entitytransform/Condition.java
--
diff --git a/intg/src/main/java/org/apache/atlas/entitytransform/Condition.java 
b/intg/src/main/java/org/apache/atlas/entitytransform/Condition.java
index d44f575..bc63079 100644
--- a/intg/src/main/java/org/apache/atlas/entitytransform/Condition.java
+++ b/intg/src/main/java/org/apache/atlas/entitytransform/Condition.java
@@ -31,6 +31,7 @@ public abstract class Condition {
 private static final String CONDITION_NAME_EQUALS_IGNORE_CASE  = 
"EQUALS_IGNORE_CASE";
 private static final String CONDITION_NAME_STARTS_WITH = 
"STARTS

atlas git commit: ATLAS-2885: Skip handling of INSERT INTO...VALUES hive query messages

2018-09-25 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 60104c18a -> 7876049ff


ATLAS-2885: Skip handling of INSERT INTO...VALUES hive query messages

Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/7876049f
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/7876049f
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/7876049f

Branch: refs/heads/branch-0.8
Commit: 7876049ff319a1578798df13fc7ce6b2d8b38e31
Parents: 60104c1
Author: apoorvnaik 
Authored: Tue Sep 25 22:10:08 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Sep 25 22:10:08 2018 -0700

--
 .../atlas/hive/hook/events/CreateHiveProcess.java  | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/7876049f/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java
--
diff --git 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java
 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java
index f465e49..c99a699 100644
--- 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java
+++ 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/CreateHiveProcess.java
@@ -63,7 +63,7 @@ public class CreateHiveProcess extends BaseHiveEvent {
 }
 
 public AtlasEntitiesWithExtInfo getEntities() throws Exception {
-AtlasEntitiesWithExtInfo ret = null;
+AtlasEntitiesWithExtInfo ret = null;
 
 if (!skipProcess()) {
 List inputs = new ArrayList<>();
@@ -189,7 +189,7 @@ public class CreateHiveProcess extends BaseHiveEvent {
 ret = (Collection) retGetBaseCols;
 } else {
 LOG.warn("{}: unexpected return type from 
LineageInfo.Dependency.getBaseCols(), expected type {}",
-retGetBaseCols.getClass().getName(), 
"Collection");
+ retGetBaseCols.getClass().getName(), 
"Collection");
 }
 }
 } catch (NoSuchMethodException | InvocationTargetException | 
IllegalAccessException ex) {
@@ -202,8 +202,8 @@ public class CreateHiveProcess extends BaseHiveEvent {
 
 
 private boolean skipProcess() {
-Set  inputs  = getHiveContext().getInputs();
-Set outputs = getHiveContext().getOutputs();
+Set  inputs= getHiveContext().getInputs();
+Set outputs   = getHiveContext().getOutputs();
 
 boolean ret = CollectionUtils.isEmpty(inputs) && 
CollectionUtils.isEmpty(outputs);
 
@@ -220,6 +220,15 @@ public class CreateHiveProcess extends BaseHiveEvent {
 }
 
 }
+
+// skip insert into tbl_x values() statements
+if (!ret && CollectionUtils.isNotEmpty(inputs) && 
inputs.size() == 1) {
+ReadEntity input = inputs.iterator().next();
+
+if (input.getType() == Entity.Type.TABLE && 
input.getTable().isTemporary()) {
+ret = true;
+}
+}
 }
 }
 



atlas git commit: ATLAS-2890: Fix intermittent UT and IT failures for atlas in apache CI

2018-09-25 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 c0dd78d52 -> 60104c18a


ATLAS-2890: Fix intermittent UT and IT failures for atlas in apache CI


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/60104c18
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/60104c18
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/60104c18

Branch: refs/heads/branch-0.8
Commit: 60104c18ab808eee2c777adea2795411c0d4de4b
Parents: c0dd78d
Author: Sarath Subramanian 
Authored: Tue Sep 25 10:27:31 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Sep 25 10:27:31 2018 -0700

--
 .../integration/TypedefsJerseyResourceIT.java   | 42 +++-
 1 file changed, 33 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/60104c18/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
--
diff --git 
a/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
 
b/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
index c46689c..3d1cefb 100644
--- 
a/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
+++ 
b/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
@@ -21,7 +21,9 @@ package org.apache.atlas.web.integration;
 import com.google.common.collect.ImmutableSet;
 import com.sun.jersey.core.util.MultivaluedMapImpl;
 import org.apache.atlas.AtlasClientV2;
+import org.apache.atlas.AtlasErrorCode;
 import org.apache.atlas.AtlasServiceException;
+import org.apache.atlas.exception.AtlasBaseException;
 import org.apache.atlas.model.SearchFilter;
 import org.apache.atlas.model.TypeCategory;
 import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
@@ -45,6 +47,7 @@ import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
 import java.util.Collections;
 
+import static org.apache.atlas.AtlasErrorCode.TYPE_NAME_NOT_FOUND;
 import static 
org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef.Cardinality;
 import static org.apache.atlas.type.AtlasTypeUtil.createClassTypeDef;
 import static org.testng.Assert.assertEquals;
@@ -83,23 +86,22 @@ public class TypedefsJerseyResourceIT extends 
BaseResourceIT {
 public void testCreate() throws Exception {
 createType(typeDefinitions);
 
+// validate if all types created successfully
 for (AtlasEnumDef enumDef : typeDefinitions.getEnumDefs()) {
-AtlasEnumDef byName = 
atlasClientV2.getEnumDefByName(enumDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(enumDef.getName());
 }
+
 for (AtlasStructDef structDef : typeDefinitions.getStructDefs()) {
-AtlasStructDef byName = 
atlasClientV2.getStructDefByName(structDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(structDef.getName());
 }
+
 for (AtlasClassificationDef classificationDef : 
typeDefinitions.getClassificationDefs()) {
-AtlasClassificationDef byName = 
atlasClientV2.getClassificationDefByName(classificationDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(classificationDef.getName());
 }
+
 for (AtlasEntityDef entityDef : typeDefinitions.getEntityDefs()) {
-AtlasEntityDef byName = 
atlasClientV2.getEntityDefByName(entityDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(entityDef.getName());
 }
-
 }
 
 @Test
@@ -367,4 +369,26 @@ public class TypedefsJerseyResourceIT extends 
BaseResourceIT {
 def.getClassificationDefs().clear();
 def.getEntityDefs().clear();
 }
+
+private void checkIfTypeExists(String typeName) throws Exception {
+int retryCount = 0;
+int maxRetries = 3;
+int sleepTime  = 5000;
+
+while (true) {
+try {
+boolean typeExists = 
atlasClientV2.typeWithNameExists(typeName);
+
+if (!typeExists) {
+throw new AtlasBaseException(TYPE_NAME_NOT_FOUND, 
typeName);
+} else {
+break;
+}
+} catch (AtlasBaseException e) {
+Thread.sleep(sleepTime);
+
+if (++retryCount == maxRetries) throw e;
+}
+}
+}
 }



atlas git commit: ATLAS-2890: Fix intermittent UT and IT failures for atlas in apache CI

2018-09-25 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 52719937a -> 42e7b50f7


ATLAS-2890: Fix intermittent UT and IT failures for atlas in apache CI

(cherry picked from commit 60104c18ab808eee2c777adea2795411c0d4de4b)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/42e7b50f
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/42e7b50f
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/42e7b50f

Branch: refs/heads/branch-1.0
Commit: 42e7b50f73f90c47b6cd414cc430a91f1c3a
Parents: 5271993
Author: Sarath Subramanian 
Authored: Tue Sep 25 10:27:31 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Sep 25 11:14:20 2018 -0700

--
 .../integration/TypedefsJerseyResourceIT.java   | 42 +++-
 1 file changed, 33 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/42e7b50f/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
--
diff --git 
a/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
 
b/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
index 219b4e3..331ea2c 100644
--- 
a/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
+++ 
b/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
@@ -20,7 +20,9 @@ package org.apache.atlas.web.integration;
 
 import com.sun.jersey.core.util.MultivaluedMapImpl;
 import org.apache.atlas.AtlasClientV2;
+import org.apache.atlas.AtlasErrorCode;
 import org.apache.atlas.AtlasServiceException;
+import org.apache.atlas.exception.AtlasBaseException;
 import org.apache.atlas.model.SearchFilter;
 import org.apache.atlas.model.TypeCategory;
 import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
@@ -45,6 +47,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 
+import static org.apache.atlas.AtlasErrorCode.TYPE_NAME_NOT_FOUND;
 import static 
org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef.Cardinality;
 import static org.apache.atlas.type.AtlasTypeUtil.createClassTypeDef;
 import static org.testng.Assert.assertEquals;
@@ -83,23 +86,22 @@ public class TypedefsJerseyResourceIT extends 
BaseResourceIT {
 public void testCreate() throws Exception {
 createType(typeDefinitions);
 
+// validate if all types created successfully
 for (AtlasEnumDef enumDef : typeDefinitions.getEnumDefs()) {
-AtlasEnumDef byName = 
atlasClientV2.getEnumDefByName(enumDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(enumDef.getName());
 }
+
 for (AtlasStructDef structDef : typeDefinitions.getStructDefs()) {
-AtlasStructDef byName = 
atlasClientV2.getStructDefByName(structDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(structDef.getName());
 }
+
 for (AtlasClassificationDef classificationDef : 
typeDefinitions.getClassificationDefs()) {
-AtlasClassificationDef byName = 
atlasClientV2.getClassificationDefByName(classificationDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(classificationDef.getName());
 }
+
 for (AtlasEntityDef entityDef : typeDefinitions.getEntityDefs()) {
-AtlasEntityDef byName = 
atlasClientV2.getEntityDefByName(entityDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(entityDef.getName());
 }
-
 }
 
 @Test
@@ -367,4 +369,26 @@ public class TypedefsJerseyResourceIT extends 
BaseResourceIT {
 def.getClassificationDefs().clear();
 def.getEntityDefs().clear();
 }
+
+private void checkIfTypeExists(String typeName) throws Exception {
+int retryCount = 0;
+int maxRetries = 3;
+int sleepTime  = 5000;
+
+while (true) {
+try {
+boolean typeExists = 
atlasClientV2.typeWithNameExists(typeName);
+
+if (!typeExists) {
+throw new AtlasBaseException(TYPE_NAME_NOT_FOUND, 
typeName);
+} else {
+break;
+}
+} catch (AtlasBaseException e) {
+Thread.sleep(sleepTime);
+
+if (++retryCount == maxRetries) throw e;
+}
+}
+}
 }



atlas git commit: ATLAS-2890: Fix intermittent UT and IT failures for atlas in apache CI

2018-09-25 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master ece78ba09 -> 4128f5d2a


ATLAS-2890: Fix intermittent UT and IT failures for atlas in apache CI

(cherry picked from commit 60104c18ab808eee2c777adea2795411c0d4de4b)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4128f5d2
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4128f5d2
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4128f5d2

Branch: refs/heads/master
Commit: 4128f5d2aa1462b5462a94886fbd26c24cbb5a91
Parents: ece78ba
Author: Sarath Subramanian 
Authored: Tue Sep 25 10:27:31 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Sep 25 11:19:02 2018 -0700

--
 .../integration/TypedefsJerseyResourceIT.java   | 42 +++-
 1 file changed, 33 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/4128f5d2/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
--
diff --git 
a/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
 
b/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
index 219b4e3..331ea2c 100644
--- 
a/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
+++ 
b/webapp/src/test/java/org/apache/atlas/web/integration/TypedefsJerseyResourceIT.java
@@ -20,7 +20,9 @@ package org.apache.atlas.web.integration;
 
 import com.sun.jersey.core.util.MultivaluedMapImpl;
 import org.apache.atlas.AtlasClientV2;
+import org.apache.atlas.AtlasErrorCode;
 import org.apache.atlas.AtlasServiceException;
+import org.apache.atlas.exception.AtlasBaseException;
 import org.apache.atlas.model.SearchFilter;
 import org.apache.atlas.model.TypeCategory;
 import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
@@ -45,6 +47,7 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashSet;
 
+import static org.apache.atlas.AtlasErrorCode.TYPE_NAME_NOT_FOUND;
 import static 
org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef.Cardinality;
 import static org.apache.atlas.type.AtlasTypeUtil.createClassTypeDef;
 import static org.testng.Assert.assertEquals;
@@ -83,23 +86,22 @@ public class TypedefsJerseyResourceIT extends 
BaseResourceIT {
 public void testCreate() throws Exception {
 createType(typeDefinitions);
 
+// validate if all types created successfully
 for (AtlasEnumDef enumDef : typeDefinitions.getEnumDefs()) {
-AtlasEnumDef byName = 
atlasClientV2.getEnumDefByName(enumDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(enumDef.getName());
 }
+
 for (AtlasStructDef structDef : typeDefinitions.getStructDefs()) {
-AtlasStructDef byName = 
atlasClientV2.getStructDefByName(structDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(structDef.getName());
 }
+
 for (AtlasClassificationDef classificationDef : 
typeDefinitions.getClassificationDefs()) {
-AtlasClassificationDef byName = 
atlasClientV2.getClassificationDefByName(classificationDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(classificationDef.getName());
 }
+
 for (AtlasEntityDef entityDef : typeDefinitions.getEntityDefs()) {
-AtlasEntityDef byName = 
atlasClientV2.getEntityDefByName(entityDef.getName());
-assertNotNull(byName);
+checkIfTypeExists(entityDef.getName());
 }
-
 }
 
 @Test
@@ -367,4 +369,26 @@ public class TypedefsJerseyResourceIT extends 
BaseResourceIT {
 def.getClassificationDefs().clear();
 def.getEntityDefs().clear();
 }
+
+private void checkIfTypeExists(String typeName) throws Exception {
+int retryCount = 0;
+int maxRetries = 3;
+int sleepTime  = 5000;
+
+while (true) {
+try {
+boolean typeExists = 
atlasClientV2.typeWithNameExists(typeName);
+
+if (!typeExists) {
+throw new AtlasBaseException(TYPE_NAME_NOT_FOUND, 
typeName);
+} else {
+break;
+}
+} catch (AtlasBaseException e) {
+Thread.sleep(sleepTime);
+
+if (++retryCount == maxRetries) throw e;
+}
+}
+}
 }



atlas git commit: ATLAS-2971: Atlas fails to start if there is a empty pid file

2018-11-16 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 d3aaef05f -> 9d6ca7aae


ATLAS-2971: Atlas fails to start if there is a empty pid file

Signed-off-by: Sarath Subramanian 
(cherry picked from commit 945de013f5466ffcf71d16c6ec1772fdee83e2f6)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/9d6ca7aa
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/9d6ca7aa
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/9d6ca7aa

Branch: refs/heads/branch-1.0
Commit: 9d6ca7aae861e474049960867ecdc4520a7daf0d
Parents: d3aaef0
Author: Sandeep Nemuri 
Authored: Fri Nov 16 14:16:03 2018 -0800
Committer: Sarath Subramanian 
Committed: Fri Nov 16 14:16:48 2018 -0800

--
 distro/src/bin/atlas_start.py | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/9d6ca7aa/distro/src/bin/atlas_start.py
--
diff --git a/distro/src/bin/atlas_start.py b/distro/src/bin/atlas_start.py
index 25f1959..963faf4 100755
--- a/distro/src/bin/atlas_start.py
+++ b/distro/src/bin/atlas_start.py
@@ -101,13 +101,13 @@ def main():
pf = file(atlas_pid_file, 'r')
pid = pf.read().strip()
pf.close()
-
-   if mc.exist_pid((int)(pid)):
-   if is_setup:
-   print "Cannot run setup when server is running."
-   mc.server_already_running(pid)
-   else:
-   mc.server_pid_not_running(pid)
+   if pid != "":
+   if mc.exist_pid((int)(pid)):
+   if is_setup:
+   print "Cannot run setup when server is running."
+   mc.server_already_running(pid)
+   else:
+   mc.server_pid_not_running(pid)
 
 if is_hbase and mc.is_hbase_local(confdir):
 print "configured for local hbase."



atlas git commit: ATLAS-2971: Atlas fails to start if there is a empty pid file

2018-11-16 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master b96c6b7a9 -> 945de013f


ATLAS-2971: Atlas fails to start if there is a empty pid file

Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/945de013
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/945de013
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/945de013

Branch: refs/heads/master
Commit: 945de013f5466ffcf71d16c6ec1772fdee83e2f6
Parents: b96c6b7
Author: Sandeep Nemuri 
Authored: Fri Nov 16 14:16:03 2018 -0800
Committer: Sarath Subramanian 
Committed: Fri Nov 16 14:16:03 2018 -0800

--
 distro/src/bin/atlas_start.py | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/945de013/distro/src/bin/atlas_start.py
--
diff --git a/distro/src/bin/atlas_start.py b/distro/src/bin/atlas_start.py
index 25f1959..963faf4 100755
--- a/distro/src/bin/atlas_start.py
+++ b/distro/src/bin/atlas_start.py
@@ -101,13 +101,13 @@ def main():
pf = file(atlas_pid_file, 'r')
pid = pf.read().strip()
pf.close()
-
-   if mc.exist_pid((int)(pid)):
-   if is_setup:
-   print "Cannot run setup when server is running."
-   mc.server_already_running(pid)
-   else:
-   mc.server_pid_not_running(pid)
+   if pid != "":
+   if mc.exist_pid((int)(pid)):
+   if is_setup:
+   print "Cannot run setup when server is running."
+   mc.server_already_running(pid)
+   else:
+   mc.server_pid_not_running(pid)
 
 if is_hbase and mc.is_hbase_local(confdir):
 print "configured for local hbase."



atlas git commit: ATLAS-2971: Atlas fails to start if there is a empty pid file

2018-11-16 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 4ca33fcbf -> 29f7e3f5d


ATLAS-2971: Atlas fails to start if there is a empty pid file

Signed-off-by: Sarath Subramanian 
(cherry picked from commit 945de013f5466ffcf71d16c6ec1772fdee83e2f6)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/29f7e3f5
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/29f7e3f5
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/29f7e3f5

Branch: refs/heads/branch-0.8
Commit: 29f7e3f5d56e9502eafa7e75840161bc479b3e0a
Parents: 4ca33fc
Author: Sandeep Nemuri 
Authored: Fri Nov 16 14:16:03 2018 -0800
Committer: Sarath Subramanian 
Committed: Fri Nov 16 14:16:33 2018 -0800

--
 distro/src/bin/atlas_start.py | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/29f7e3f5/distro/src/bin/atlas_start.py
--
diff --git a/distro/src/bin/atlas_start.py b/distro/src/bin/atlas_start.py
index 5ea93fc..239e64d 100755
--- a/distro/src/bin/atlas_start.py
+++ b/distro/src/bin/atlas_start.py
@@ -101,13 +101,13 @@ def main():
pf = file(atlas_pid_file, 'r')
pid = pf.read().strip()
pf.close()
-
-   if mc.exist_pid((int)(pid)):
-   if is_setup:
-   print "Cannot run setup when server is running."
-   mc.server_already_running(pid)
-   else:
-   mc.server_pid_not_running(pid)
+   if pid != "":
+   if mc.exist_pid((int)(pid)):
+   if is_setup:
+   print "Cannot run setup when server is running."
+   mc.server_already_running(pid)
+   else:
+   mc.server_pid_not_running(pid)
 
 if is_hbase and mc.is_hbase_local(confdir):
 print "configured for local hbase."



[atlas] branch branch-1.0 updated: Update findbugs-maven-plugin version to 3.0.5

2019-01-21 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

sarath 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 c55d3c7  Update findbugs-maven-plugin version to 3.0.5
c55d3c7 is described below

commit c55d3c75403c8160e77723fa02a9f641f891cac8
Author: Sarath Subramanian 
AuthorDate: Mon Jan 21 13:08:20 2019 -0800

Update findbugs-maven-plugin version to 3.0.5

(cherry picked from commit 6435f75db312e2944e8eaf72537e87491cd7af1a)
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 146142f..1e6c13a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1774,7 +1774,7 @@
 
 org.codehaus.mojo
 findbugs-maven-plugin
-3.0.1
+3.0.5
 
 
 



[atlas] branch master updated: Update findbugs-maven-plugin version to 3.0.5

2019-01-21 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 6435f75  Update findbugs-maven-plugin version to 3.0.5
6435f75 is described below

commit 6435f75db312e2944e8eaf72537e87491cd7af1a
Author: Sarath Subramanian 
AuthorDate: Mon Jan 21 13:08:20 2019 -0800

Update findbugs-maven-plugin version to 3.0.5
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 49fe7de..d9b2c9d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1785,7 +1785,7 @@
 
 org.codehaus.mojo
 findbugs-maven-plugin
-3.0.1
+3.0.5
 
 
 



[atlas] branch branch-1.0 updated: ATLAS-3034: Perf enhancement to avoid unnecessary lookup when creating new relationships

2019-01-23 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

sarath 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 7c471dc  ATLAS-3034: Perf enhancement to avoid unnecessary lookup when 
creating new relationships
7c471dc is described below

commit 7c471dc313daf7c9e30e77024ac3e2c94a9a5403
Author: Sarath Subramanian 
AuthorDate: Wed Jan 23 10:35:35 2019 -0800

ATLAS-3034: Perf enhancement to avoid unnecessary lookup when creating new 
relationships

(cherry picked from commit a9aa5b0e1b0a7c2867aef16358e3c3c1977bb140)
---
 .../store/graph/AtlasRelationshipStore.java|   4 +
 .../store/graph/v2/AtlasRelationshipStoreV2.java   | 124 +++--
 .../store/graph/v2/EntityGraphMapper.java  |  32 ++
 3 files changed, 77 insertions(+), 83 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java
index 4468951..53e29e1 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java
@@ -59,6 +59,10 @@ public interface AtlasRelationshipStore {
 
 AtlasEdge getOrCreate(AtlasVertex end1Vertex, AtlasVertex end2Vertex, 
AtlasRelationship relationship) throws AtlasBaseException;
 
+AtlasEdge getRelationship(AtlasVertex end1Vertex, AtlasVertex end2Vertex, 
AtlasRelationship relationship);
+
+AtlasEdge createRelationship(AtlasVertex end1Vertex, AtlasVertex 
end2Vertex, AtlasRelationship relationship) throws AtlasBaseException;
+
 /**
  * Retrieve a relationship if it exists or creates a new relationship 
instance.
  * @param relationship relationship instance definition
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
index 6bc36b3..2791ef3 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
@@ -81,9 +81,8 @@ import static 
org.apache.atlas.repository.graph.GraphHelper.getBlockedClassifica
 import static 
org.apache.atlas.repository.graph.GraphHelper.getClassificationEntityGuid;
 import static 
org.apache.atlas.repository.graph.GraphHelper.getClassificationName;
 import static 
org.apache.atlas.repository.graph.GraphHelper.getClassificationVertices;
-import static 
org.apache.atlas.repository.graph.GraphHelper.getOutGoingEdgesByLabel;
+import static 
org.apache.atlas.repository.graph.GraphHelper.getIncomingEdgesByLabel;
 import static org.apache.atlas.repository.graph.GraphHelper.getPropagateTags;
-import static 
org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2.getIdFromVertex;
 import static 
org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2.getState;
 import static 
org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2.getTypeName;
 
@@ -117,8 +116,6 @@ public class AtlasRelationshipStoreV2 implements 
AtlasRelationshipStore {
 AtlasVertex end1Vertex = getVertexFromEndPoint(relationship.getEnd1());
 AtlasVertex end2Vertex = getVertexFromEndPoint(relationship.getEnd2());
 
-validateRelationship(end1Vertex, end2Vertex, 
relationship.getTypeName(), relationship.getAttributes());
-
 AtlasEdge edge = createRelationship(end1Vertex, end2Vertex, 
relationship);
 
 AtlasRelationship ret = edge != null ? 
entityRetriever.mapEdgeToAtlasRelationship(edge) : null;
@@ -289,36 +286,37 @@ public class AtlasRelationshipStoreV2 implements 
AtlasRelationshipStore {
 
 @Override
 public AtlasEdge getOrCreate(AtlasVertex end1Vertex, AtlasVertex 
end2Vertex, AtlasRelationship relationship) throws AtlasBaseException {
-AtlasEdge ret = getRelationshipEdge(end1Vertex, end2Vertex, 
relationship.getTypeName());
+AtlasEdge ret = getRelationship(end1Vertex, end2Vertex, relationship);
 
 if (ret == null) {
-validateRelationship(end1Vertex, end2Vertex, 
relationship.getTypeName(), relationship.getAttributes());
-
-ret = createRelationship(end1Vertex, end2Vertex, relationship);
+ret = createRelationship(end1Vertex, end2Vertex, relationship, 
false);
 }
 
 return ret;
 }
 
 @Override
+public AtlasEdge getRelationship(AtlasVertex fromVertex, AtlasVertex 
toVertex, AtlasRelationship relationship) {
+String relationshipLabel = getRelationshipEdgeLabel(fromVertex, 
toVertex, relationship.getTypeName());
+
+return getRelationshipEdge(fromVertex, toVertex

[atlas] branch master updated: ATLAS-3034: Perf enhancement to avoid unnecessary lookup when creating new relationships

2019-01-23 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new a9aa5b0  ATLAS-3034: Perf enhancement to avoid unnecessary lookup when 
creating new relationships
a9aa5b0 is described below

commit a9aa5b0e1b0a7c2867aef16358e3c3c1977bb140
Author: Sarath Subramanian 
AuthorDate: Wed Jan 23 10:35:35 2019 -0800

ATLAS-3034: Perf enhancement to avoid unnecessary lookup when creating new 
relationships
---
 .../store/graph/AtlasRelationshipStore.java|   4 +
 .../store/graph/v2/AtlasRelationshipStoreV2.java   | 126 +++--
 .../store/graph/v2/EntityGraphMapper.java  |  32 ++
 3 files changed, 78 insertions(+), 84 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java
index 4468951..53e29e1 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java
@@ -59,6 +59,10 @@ public interface AtlasRelationshipStore {
 
 AtlasEdge getOrCreate(AtlasVertex end1Vertex, AtlasVertex end2Vertex, 
AtlasRelationship relationship) throws AtlasBaseException;
 
+AtlasEdge getRelationship(AtlasVertex end1Vertex, AtlasVertex end2Vertex, 
AtlasRelationship relationship);
+
+AtlasEdge createRelationship(AtlasVertex end1Vertex, AtlasVertex 
end2Vertex, AtlasRelationship relationship) throws AtlasBaseException;
+
 /**
  * Retrieve a relationship if it exists or creates a new relationship 
instance.
  * @param relationship relationship instance definition
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
index 86cc98c..6371f56 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
@@ -82,9 +82,8 @@ import static 
org.apache.atlas.repository.graph.GraphHelper.getBlockedClassifica
 import static 
org.apache.atlas.repository.graph.GraphHelper.getClassificationEntityGuid;
 import static 
org.apache.atlas.repository.graph.GraphHelper.getClassificationName;
 import static 
org.apache.atlas.repository.graph.GraphHelper.getClassificationVertices;
-import static 
org.apache.atlas.repository.graph.GraphHelper.getOutGoingEdgesByLabel;
+import static 
org.apache.atlas.repository.graph.GraphHelper.getIncomingEdgesByLabel;
 import static org.apache.atlas.repository.graph.GraphHelper.getPropagateTags;
-import static 
org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2.getIdFromVertex;
 import static 
org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2.getState;
 import static 
org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2.getTypeName;
 
@@ -118,8 +117,6 @@ public class AtlasRelationshipStoreV2 implements 
AtlasRelationshipStore {
 AtlasVertex end1Vertex = getVertexFromEndPoint(relationship.getEnd1());
 AtlasVertex end2Vertex = getVertexFromEndPoint(relationship.getEnd2());
 
-validateRelationship(end1Vertex, end2Vertex, 
relationship.getTypeName(), relationship.getAttributes());
-
 AtlasEdge edge = createRelationship(end1Vertex, end2Vertex, 
relationship);
 
 AtlasRelationship ret = edge != null ? 
entityRetriever.mapEdgeToAtlasRelationship(edge) : null;
@@ -290,36 +287,37 @@ public class AtlasRelationshipStoreV2 implements 
AtlasRelationshipStore {
 
 @Override
 public AtlasEdge getOrCreate(AtlasVertex end1Vertex, AtlasVertex 
end2Vertex, AtlasRelationship relationship) throws AtlasBaseException {
-AtlasEdge ret = getRelationshipEdge(end1Vertex, end2Vertex, 
relationship.getTypeName());
+AtlasEdge ret = getRelationship(end1Vertex, end2Vertex, relationship);
 
 if (ret == null) {
-validateRelationship(end1Vertex, end2Vertex, 
relationship.getTypeName(), relationship.getAttributes());
-
-ret = createRelationship(end1Vertex, end2Vertex, relationship);
+ret = createRelationship(end1Vertex, end2Vertex, relationship, 
false);
 }
 
 return ret;
 }
 
 @Override
+public AtlasEdge getRelationship(AtlasVertex fromVertex, AtlasVertex 
toVertex, AtlasRelationship relationship) {
+String relationshipLabel = getRelationshipEdgeLabel(fromVertex, 
toVertex, relationship.getTypeName());
+
+return getRelationshipEdge(fromVertex, toVertex, relationshipLabel);
+}
+
+@Override
 public AtlasRelationship getOrCreate

atlas git commit: ATLAS-2979: Added service type dropdown to filter entitydef type

2018-12-21 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 9300924fd -> 6ed883b3d


ATLAS-2979: Added service type dropdown to filter entitydef type

Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/6ed883b3
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/6ed883b3
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/6ed883b3

Branch: refs/heads/master
Commit: 6ed883b3dfc74fd86b81f1bb0325a05a88e9e5b2
Parents: 9300924
Author: Abhishek Kadam 
Authored: Fri Dec 21 11:43:31 2018 -0800
Committer: Sarath Subramanian 
Committed: Fri Dec 21 11:43:31 2018 -0800

--
 dashboardv2/public/css/scss/search.scss | 90 
 dashboardv2/public/js/utils/Overrides.js| 89 +++
 .../public/js/views/search/SearchLayoutView.js  | 66 ++
 3 files changed, 227 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/6ed883b3/dashboardv2/public/css/scss/search.scss
--
diff --git a/dashboardv2/public/css/scss/search.scss 
b/dashboardv2/public/css/scss/search.scss
index 0f9cb1c..0bb8781 100644
--- a/dashboardv2/public/css/scss/search.scss
+++ b/dashboardv2/public/css/scss/search.scss
@@ -139,4 +139,94 @@ $color_celeste_approx: #1D1F2B;
 margin: 0px;
 }
 }
+}
+
+.typeFilter {
+.dropdown {
+span.type-clear-btn {
+position: absolute;
+color: #44;
+font-size: 8px;
+right: 23px;
+top: 12px;
+cursor: pointer;
+}
+}
+button.dropdown-toggle {
+width: 99.5%;
+text-align: left;
+background-color: white;
+color: $color_star_dust_approx;
+border: $color_star_dust_approx;
+&:hover {
+color: $color_star_dust_approx !important;
+border: $color_star_dust_approx !important;
+}
+}
+}
+
+ul.type-filter-ul {
+color: black;
+padding: 10px;
+max-height: 415px;
+overflow: auto;
+width: 100%;
+padding-top: 0px;
+margin-bottom: 0px;
+li {
+padding: 2px;
+}
+.typeLi li {
+padding: 3px;
+background-color: #f7fbff;
+margin: 3px;
+border: 1px solid #dbd6d6;
+border-radius: 4px;
+&:hover {
+color: $white;
+background-color: $color_star_dust_approx;
+cursor: pointer;
+}
+&.active {
+background-color: #37bb9b;
+color: white;
+}
+}
+.filterLi li {
+padding: 2px;
+margin: 4px;
+}
+}
+
+.dark-text {
+color: black;
+}
+
+.type-filter-dropdown {
+position: absolute;
+top: 5px;
+background-color: #323544;
+}
+
+.filter-sticky-div {
+text-align: center;
+position: sticky;
+position: -webkit-sticky;
+top: 0px;
+background-color: white;
+padding-top: 8px;
+& .row {
+margin-right: -10px;
+margin-left: -10px;
+}
+& input.form-control {
+border: 1px #c9c9c9 solid;
+}
+}
+
+hr.hr-filter {
+margin-top: 7px;
+margin-bottom: 7px;
+border: 0;
+border-top: 1px solid #bdc3c7;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/6ed883b3/dashboardv2/public/js/utils/Overrides.js
--
diff --git a/dashboardv2/public/js/utils/Overrides.js 
b/dashboardv2/public/js/utils/Overrides.js
index 44c277d..b3b591c 100644
--- a/dashboardv2/public/js/utils/Overrides.js
+++ b/dashboardv2/public/js/utils/Overrides.js
@@ -133,6 +133,95 @@ define(['require', 'utils/Utils', 'marionette', 
'backgrid', 'asBreadcrumbs', 'jq
 $(this).blur();
 });
 
+$.fn.select2.amd.define("ServiceTypeFilterDropdownAdapter", [
+"select2/utils",
+"select2/dropdown",
+"select2/dropdown/attachBody",
+"select2/dropdown/attachContainer",
+"select2/dropdown/search",
+"select2/dropdown/minimumResultsForSearch",
+"select2/dropdown/closeOnSelect",
+],
+function(Utils, Dropdown, AttachBody, AttachContainer, Search, 
MinimumResultsForSearch, CloseOnSelect) {
+
+// Decorate Dropdown with Search functionalities
+var dropdownWithSearch = Utils.Decorate(Utils.Decorate(Dropdown, 
CloseOnSelect), Search);
+
+dropdownWithSearch.prototype.render = function() {
+// Copy and modify default search render method
+var $rendered = Dropdown.prototype.render.call(this);

atlas git commit: ATLAS-2979: Added service type dropdown to filter entitydef type

2018-12-21 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 2f7ad90e3 -> 96de07966


ATLAS-2979: Added service type dropdown to filter entitydef type

Signed-off-by: Sarath Subramanian 
(cherry picked from commit 6ed883b3dfc74fd86b81f1bb0325a05a88e9e5b2)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/96de0796
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/96de0796
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/96de0796

Branch: refs/heads/branch-1.0
Commit: 96de07966095ce98b3e8a0d14ccd4a19ec96ff12
Parents: 2f7ad90
Author: Abhishek Kadam 
Authored: Fri Dec 21 11:43:31 2018 -0800
Committer: Sarath Subramanian 
Committed: Fri Dec 21 11:48:38 2018 -0800

--
 dashboardv2/public/css/scss/search.scss | 90 
 dashboardv2/public/js/utils/Overrides.js| 89 +++
 .../public/js/views/search/SearchLayoutView.js  | 66 ++
 3 files changed, 227 insertions(+), 18 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/96de0796/dashboardv2/public/css/scss/search.scss
--
diff --git a/dashboardv2/public/css/scss/search.scss 
b/dashboardv2/public/css/scss/search.scss
index 0f9cb1c..0bb8781 100644
--- a/dashboardv2/public/css/scss/search.scss
+++ b/dashboardv2/public/css/scss/search.scss
@@ -139,4 +139,94 @@ $color_celeste_approx: #1D1F2B;
 margin: 0px;
 }
 }
+}
+
+.typeFilter {
+.dropdown {
+span.type-clear-btn {
+position: absolute;
+color: #44;
+font-size: 8px;
+right: 23px;
+top: 12px;
+cursor: pointer;
+}
+}
+button.dropdown-toggle {
+width: 99.5%;
+text-align: left;
+background-color: white;
+color: $color_star_dust_approx;
+border: $color_star_dust_approx;
+&:hover {
+color: $color_star_dust_approx !important;
+border: $color_star_dust_approx !important;
+}
+}
+}
+
+ul.type-filter-ul {
+color: black;
+padding: 10px;
+max-height: 415px;
+overflow: auto;
+width: 100%;
+padding-top: 0px;
+margin-bottom: 0px;
+li {
+padding: 2px;
+}
+.typeLi li {
+padding: 3px;
+background-color: #f7fbff;
+margin: 3px;
+border: 1px solid #dbd6d6;
+border-radius: 4px;
+&:hover {
+color: $white;
+background-color: $color_star_dust_approx;
+cursor: pointer;
+}
+&.active {
+background-color: #37bb9b;
+color: white;
+}
+}
+.filterLi li {
+padding: 2px;
+margin: 4px;
+}
+}
+
+.dark-text {
+color: black;
+}
+
+.type-filter-dropdown {
+position: absolute;
+top: 5px;
+background-color: #323544;
+}
+
+.filter-sticky-div {
+text-align: center;
+position: sticky;
+position: -webkit-sticky;
+top: 0px;
+background-color: white;
+padding-top: 8px;
+& .row {
+margin-right: -10px;
+margin-left: -10px;
+}
+& input.form-control {
+border: 1px #c9c9c9 solid;
+}
+}
+
+hr.hr-filter {
+margin-top: 7px;
+margin-bottom: 7px;
+border: 0;
+border-top: 1px solid #bdc3c7;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/96de0796/dashboardv2/public/js/utils/Overrides.js
--
diff --git a/dashboardv2/public/js/utils/Overrides.js 
b/dashboardv2/public/js/utils/Overrides.js
index 44c277d..b3b591c 100644
--- a/dashboardv2/public/js/utils/Overrides.js
+++ b/dashboardv2/public/js/utils/Overrides.js
@@ -133,6 +133,95 @@ define(['require', 'utils/Utils', 'marionette', 
'backgrid', 'asBreadcrumbs', 'jq
 $(this).blur();
 });
 
+$.fn.select2.amd.define("ServiceTypeFilterDropdownAdapter", [
+"select2/utils",
+"select2/dropdown",
+"select2/dropdown/attachBody",
+"select2/dropdown/attachContainer",
+"select2/dropdown/search",
+"select2/dropdown/minimumResultsForSearch",
+"select2/dropdown/closeOnSelect",
+],
+function(Utils, Dropdown, AttachBody, AttachContainer, Search, 
MinimumResultsForSearch, CloseOnSelect) {
+
+// Decorate Dropdown with Search functionalities
+var dropdownWithSearch = Utils.Decorate(Utils.Decorate(Dropdown, 
CloseOnSelect), Search);
+
+dropdownWithSearch.prototype.render = function() {
+// Copy and modify default search render 

[1/2] atlas git commit: ATLAS-2951: UI : Show entity specific icon for the lineage node

2018-12-03 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 07f026ee3 -> 44b2bfc66


http://git-wip-us.apache.org/repos/asf/atlas/blob/44b2bfc6/dashboardv2/public/js/views/graph/LineageLayoutView.js
--
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 4e81143..1edffbc 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -26,8 +26,9 @@ define(['require',
 'd3-tip',
 'utils/Enums',
 'utils/UrlLinks',
+'utils/Globals',
 'platform'
-], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, 
Utils, dagreD3, d3Tip, Enums, UrlLinks, platform) {
+], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, 
Utils, dagreD3, d3Tip, Enums, UrlLinks, Globals, platform) {
 'use strict';
 
 var LineageLayoutView = Backbone.Marionette.LayoutView.extend(
@@ -44,14 +45,19 @@ define(['require',
 ui: {
 graph: ".graph",
 checkHideProcess: "[data-id='checkHideProcess']",
-selectDepth: 'select[data-id="selectDepth"]'
+checkDeletedEntity: "[data-id='checkDeletedEntity']",
+selectDepth: 'select[data-id="selectDepth"]',
+fltrTogler: '[data-id="fltr-togler"]',
+lineageFilterPanel: '.lineage-fltr-panel'
 },
 
 /** ui events hash */
 events: function() {
 var events = {};
-events["click " + this.ui.checkHideProcess] = 
'onCheckHideProcess';
+events["click " + this.ui.checkHideProcess] = 
'onCheckUnwantedEntity';
+events["click " + this.ui.checkDeletedEntity] = 
'onCheckUnwantedEntity';
 events['change ' + this.ui.selectDepth] = 
'onSelectDepthChange';
+events["click " + this.ui.fltrTogler] = 'onClickFiltrTogler';
 return events;
 },
 
@@ -69,6 +75,7 @@ define(['require',
 this.edgeCall;
 this.filterObj = {
 isProcessHideCheck: false,
+isDeletedEntityHideCheck: false,
 depthCount: ''
 };
 },
@@ -114,13 +121,21 @@ define(['require',
 onShow: function() {
 this.$('.fontLoader').show();
 },
-onCheckHideProcess: function(e) {
+onCheckUnwantedEntity: function(e) {
 var data = $.extend(true, {}, this.lineageData);
 this.fromToObj = {};
 this.initializeGraph();
-this.filterObj.isProcessHideCheck = e.target.checked;
+if ($(e.target).data("id") === "checkHideProcess") {
+this.filterObj.isProcessHideCheck = e.target.checked;
+} else {
+this.filterObj.isDeletedEntityHideCheck = e.target.checked;
+}
 this.generateData(data.relations, data.guidEntityMap);
 },
+onClickFiltrTogler: function() {
+var lineageFilterPanel = this.ui.lineageFilterPanel;
+$(lineageFilterPanel).toggleClass("show-filter-panel");
+},
 
 onSelectDepthChange: function(e, options) {
 this.initializeGraph();
@@ -132,6 +147,8 @@ define(['require',
 var that = this,
 queryParam = options && options.queryParam || {};
 this.fromToObj = {};
+this.$('.fontLoader').show();
+this.$('svg>g').hide();
 this.collection.getLineage(this.guid, {
 skipDefaultError: true,
 queryParam: queryParam,
@@ -147,6 +164,10 @@ define(['require',
 cust_error: function(model, response) {
 that.lineageData = [];
 that.noLineage();
+},
+complete: function() {
+that.$('.fontLoader').hide();
+that.$('svg>g').show();
 }
 })
 },
@@ -170,6 +191,29 @@ define(['require',
 return _.contains(Utils.getNestedSuperTypes({ data: 
entityDef.toJSON(), collection: that.entityDefCollection }), "Process")
 }
 
+function isDeleted(status) {
+return Enums.entityStateReadOnly[status];
+}
+
+function isNodeToBeUpdated(node) {
+if (that.filterObj.isProcessHideCheck) {
+return isProcess(node.typeName);
+} else if (that.filterObj.isDeletedEntityHideCheck) {
+return isDeleted(node.status);
+  

[1/2] atlas git commit: ATLAS-2951: UI : Show entity specific icon for the lineage node

2018-12-03 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master b919d3d09 -> a5e5cec61


http://git-wip-us.apache.org/repos/asf/atlas/blob/a5e5cec6/dashboardv2/public/js/views/graph/LineageLayoutView.js
--
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 4e81143..1edffbc 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -26,8 +26,9 @@ define(['require',
 'd3-tip',
 'utils/Enums',
 'utils/UrlLinks',
+'utils/Globals',
 'platform'
-], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, 
Utils, dagreD3, d3Tip, Enums, UrlLinks, platform) {
+], function(require, Backbone, LineageLayoutViewtmpl, VLineageList, VEntity, 
Utils, dagreD3, d3Tip, Enums, UrlLinks, Globals, platform) {
 'use strict';
 
 var LineageLayoutView = Backbone.Marionette.LayoutView.extend(
@@ -44,14 +45,19 @@ define(['require',
 ui: {
 graph: ".graph",
 checkHideProcess: "[data-id='checkHideProcess']",
-selectDepth: 'select[data-id="selectDepth"]'
+checkDeletedEntity: "[data-id='checkDeletedEntity']",
+selectDepth: 'select[data-id="selectDepth"]',
+fltrTogler: '[data-id="fltr-togler"]',
+lineageFilterPanel: '.lineage-fltr-panel'
 },
 
 /** ui events hash */
 events: function() {
 var events = {};
-events["click " + this.ui.checkHideProcess] = 
'onCheckHideProcess';
+events["click " + this.ui.checkHideProcess] = 
'onCheckUnwantedEntity';
+events["click " + this.ui.checkDeletedEntity] = 
'onCheckUnwantedEntity';
 events['change ' + this.ui.selectDepth] = 
'onSelectDepthChange';
+events["click " + this.ui.fltrTogler] = 'onClickFiltrTogler';
 return events;
 },
 
@@ -69,6 +75,7 @@ define(['require',
 this.edgeCall;
 this.filterObj = {
 isProcessHideCheck: false,
+isDeletedEntityHideCheck: false,
 depthCount: ''
 };
 },
@@ -114,13 +121,21 @@ define(['require',
 onShow: function() {
 this.$('.fontLoader').show();
 },
-onCheckHideProcess: function(e) {
+onCheckUnwantedEntity: function(e) {
 var data = $.extend(true, {}, this.lineageData);
 this.fromToObj = {};
 this.initializeGraph();
-this.filterObj.isProcessHideCheck = e.target.checked;
+if ($(e.target).data("id") === "checkHideProcess") {
+this.filterObj.isProcessHideCheck = e.target.checked;
+} else {
+this.filterObj.isDeletedEntityHideCheck = e.target.checked;
+}
 this.generateData(data.relations, data.guidEntityMap);
 },
+onClickFiltrTogler: function() {
+var lineageFilterPanel = this.ui.lineageFilterPanel;
+$(lineageFilterPanel).toggleClass("show-filter-panel");
+},
 
 onSelectDepthChange: function(e, options) {
 this.initializeGraph();
@@ -132,6 +147,8 @@ define(['require',
 var that = this,
 queryParam = options && options.queryParam || {};
 this.fromToObj = {};
+this.$('.fontLoader').show();
+this.$('svg>g').hide();
 this.collection.getLineage(this.guid, {
 skipDefaultError: true,
 queryParam: queryParam,
@@ -147,6 +164,10 @@ define(['require',
 cust_error: function(model, response) {
 that.lineageData = [];
 that.noLineage();
+},
+complete: function() {
+that.$('.fontLoader').hide();
+that.$('svg>g').show();
 }
 })
 },
@@ -170,6 +191,29 @@ define(['require',
 return _.contains(Utils.getNestedSuperTypes({ data: 
entityDef.toJSON(), collection: that.entityDefCollection }), "Process")
 }
 
+function isDeleted(status) {
+return Enums.entityStateReadOnly[status];
+}
+
+function isNodeToBeUpdated(node) {
+if (that.filterObj.isProcessHideCheck) {
+return isProcess(node.typeName);
+} else if (that.filterObj.isDeletedEntityHideCheck) {
+return isDeleted(node.status);
+  

atlas git commit: ATLAS-2970: UI: Show counts besides the Type and Classification dropdown list in search

2018-11-21 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 e21a2c479 -> 379dc7475


ATLAS-2970: UI: Show counts besides the Type and Classification dropdown list 
in search

Signed-off-by: Sarath Subramanian 
(cherry picked from commit 2b9aa84d627ffec63a36ba345244703a8f4d557a)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/379dc747
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/379dc747
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/379dc747

Branch: refs/heads/branch-1.0
Commit: 379dc7475a135637186a2e699a48c90857d6f0f7
Parents: e21a2c4
Author: Abhishek Kadam 
Authored: Wed Nov 21 12:36:40 2018 -0800
Committer: Sarath Subramanian 
Committed: Wed Nov 21 12:37:10 2018 -0800

--
 dashboardv2/public/js/main.js   | 16 +++-
 dashboardv2/public/js/router/Router.js  |  5 ++-
 dashboardv2/public/js/utils/UrlLinks.js |  3 ++
 .../public/js/views/search/SearchLayoutView.js  | 40 
 4 files changed, 45 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/379dc747/dashboardv2/public/js/main.js
--
diff --git a/dashboardv2/public/js/main.js b/dashboardv2/public/js/main.js
index 510c48f..4accaac 100644
--- a/dashboardv2/public/js/main.js
+++ b/dashboardv2/public/js/main.js
@@ -200,7 +200,7 @@ require(['App',
 'select2'
 ], function(App, Router, CommonViewFunction, Globals, UrlLinks, VEntityList, 
VTagList) {
 var that = this;
-this.asyncFetchCounter = 5;
+this.asyncFetchCounter = 6;
 this.entityDefCollection = new VEntityList();
 this.entityDefCollection.url = UrlLinks.entitiesDefApiUrl();
 this.typeHeaders = new VTagList();
@@ -209,12 +209,16 @@ require(['App',
 this.enumDefCollection.url = UrlLinks.enumDefApiUrl();
 this.enumDefCollection.modelAttrName = "enumDefs";
 this.classificationDefCollection = new VTagList();
+this.entityCountCollection = new VTagList();
+this.entityCountCollection.url = UrlLinks.entityCountApi();
+this.entityCountCollection.modelAttrName = "data";
 
 App.appRouter = new Router({
 entityDefCollection: this.entityDefCollection,
 typeHeaders: this.typeHeaders,
 enumDefCollection: this.enumDefCollection,
-classificationDefCollection: this.classificationDefCollection
+classificationDefCollection: this.classificationDefCollection,
+entityCountCollection: this.entityCountCollection
 });
 
 var startApp = function() {
@@ -293,4 +297,12 @@ require(['App',
 startApp();
 }
 });
+
+this.entityCountCollection.fetch({
+skipDefaultError: true,
+complete: function() {
+--that.asyncFetchCounter;
+startApp();
+}
+});
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/379dc747/dashboardv2/public/js/router/Router.js
--
diff --git a/dashboardv2/public/js/router/Router.js 
b/dashboardv2/public/js/router/Router.js
index daf7974..f323575 100644
--- a/dashboardv2/public/js/router/Router.js
+++ b/dashboardv2/public/js/router/Router.js
@@ -42,7 +42,7 @@ define([
 '*actions': 'defaultAction'
 },
 initialize: function(options) {
-_.extend(this, _.pick(options, 'entityDefCollection', 
'typeHeaders', 'enumDefCollection', 'classificationDefCollection'));
+_.extend(this, _.pick(options, 'entityDefCollection', 
'typeHeaders', 'enumDefCollection', 'classificationDefCollection', 
'entityCountCollection'));
 this.showRegions();
 this.bindCommonEvents();
 this.listenTo(this, 'route', this.postRouteExecute, this);
@@ -57,7 +57,8 @@ define([
 'typeHeaders': this.typeHeaders,
 'enumDefCollection': this.enumDefCollection,
 'classificationDefCollection': 
this.classificationDefCollection,
-'glossaryCollection': this.glossaryCollection
+'glossaryCollection': this.glossaryCollection,
+'entityCountCollection': this.entityCountCollection
 }
 this.sharedObj = {
 searchTableColumns: {},

http://git-wip-us.apache.org/repos/asf/atlas/blob/379dc747/dashboardv2/public/js/utils/UrlLinks.js
--
diff --git a/dashboardv2/public/js/utils/UrlLinks.js 
b/dashboardv2/public/js/utils/UrlLinks.js
index b2ae619..1bc5949 100644
--- a/dashboardv2/public/js/utils/UrlLinks.js
+++ b/dashboardv2/public/js/utils/UrlLinks.js
@@ -40,6 +40,9 @@ define(['require', 'utils/Enums', 'uti

atlas git commit: ATLAS-2970: UI: Show counts besides the Type and Classification dropdown list in search

2018-11-21 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master ed795dc4c -> 2b9aa84d6


ATLAS-2970: UI: Show counts besides the Type and Classification dropdown list 
in search

Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/2b9aa84d
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/2b9aa84d
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/2b9aa84d

Branch: refs/heads/master
Commit: 2b9aa84d627ffec63a36ba345244703a8f4d557a
Parents: ed795dc
Author: Abhishek Kadam 
Authored: Wed Nov 21 12:36:40 2018 -0800
Committer: Sarath Subramanian 
Committed: Wed Nov 21 12:36:40 2018 -0800

--
 dashboardv2/public/js/main.js   | 16 +++-
 dashboardv2/public/js/router/Router.js  |  5 ++-
 dashboardv2/public/js/utils/UrlLinks.js |  3 ++
 .../public/js/views/search/SearchLayoutView.js  | 40 
 4 files changed, 45 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/2b9aa84d/dashboardv2/public/js/main.js
--
diff --git a/dashboardv2/public/js/main.js b/dashboardv2/public/js/main.js
index 510c48f..4accaac 100644
--- a/dashboardv2/public/js/main.js
+++ b/dashboardv2/public/js/main.js
@@ -200,7 +200,7 @@ require(['App',
 'select2'
 ], function(App, Router, CommonViewFunction, Globals, UrlLinks, VEntityList, 
VTagList) {
 var that = this;
-this.asyncFetchCounter = 5;
+this.asyncFetchCounter = 6;
 this.entityDefCollection = new VEntityList();
 this.entityDefCollection.url = UrlLinks.entitiesDefApiUrl();
 this.typeHeaders = new VTagList();
@@ -209,12 +209,16 @@ require(['App',
 this.enumDefCollection.url = UrlLinks.enumDefApiUrl();
 this.enumDefCollection.modelAttrName = "enumDefs";
 this.classificationDefCollection = new VTagList();
+this.entityCountCollection = new VTagList();
+this.entityCountCollection.url = UrlLinks.entityCountApi();
+this.entityCountCollection.modelAttrName = "data";
 
 App.appRouter = new Router({
 entityDefCollection: this.entityDefCollection,
 typeHeaders: this.typeHeaders,
 enumDefCollection: this.enumDefCollection,
-classificationDefCollection: this.classificationDefCollection
+classificationDefCollection: this.classificationDefCollection,
+entityCountCollection: this.entityCountCollection
 });
 
 var startApp = function() {
@@ -293,4 +297,12 @@ require(['App',
 startApp();
 }
 });
+
+this.entityCountCollection.fetch({
+skipDefaultError: true,
+complete: function() {
+--that.asyncFetchCounter;
+startApp();
+}
+});
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/atlas/blob/2b9aa84d/dashboardv2/public/js/router/Router.js
--
diff --git a/dashboardv2/public/js/router/Router.js 
b/dashboardv2/public/js/router/Router.js
index daf7974..f323575 100644
--- a/dashboardv2/public/js/router/Router.js
+++ b/dashboardv2/public/js/router/Router.js
@@ -42,7 +42,7 @@ define([
 '*actions': 'defaultAction'
 },
 initialize: function(options) {
-_.extend(this, _.pick(options, 'entityDefCollection', 
'typeHeaders', 'enumDefCollection', 'classificationDefCollection'));
+_.extend(this, _.pick(options, 'entityDefCollection', 
'typeHeaders', 'enumDefCollection', 'classificationDefCollection', 
'entityCountCollection'));
 this.showRegions();
 this.bindCommonEvents();
 this.listenTo(this, 'route', this.postRouteExecute, this);
@@ -57,7 +57,8 @@ define([
 'typeHeaders': this.typeHeaders,
 'enumDefCollection': this.enumDefCollection,
 'classificationDefCollection': 
this.classificationDefCollection,
-'glossaryCollection': this.glossaryCollection
+'glossaryCollection': this.glossaryCollection,
+'entityCountCollection': this.entityCountCollection
 }
 this.sharedObj = {
 searchTableColumns: {},

http://git-wip-us.apache.org/repos/asf/atlas/blob/2b9aa84d/dashboardv2/public/js/utils/UrlLinks.js
--
diff --git a/dashboardv2/public/js/utils/UrlLinks.js 
b/dashboardv2/public/js/utils/UrlLinks.js
index b2ae619..1bc5949 100644
--- a/dashboardv2/public/js/utils/UrlLinks.js
+++ b/dashboardv2/public/js/utils/UrlLinks.js
@@ -40,6 +40,9 @@ define(['require', 'utils/Enums', 'utils/Utils', 
'underscore'], function(require
 enumDefApiUrl: function(name

[2/2] atlas git commit: ATLAS-2968: Update model files to include service-type for each entityDef

2018-11-19 Thread sarath
ATLAS-2968: Update model files to include service-type for each entityDef

Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/36656ea7
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/36656ea7
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/36656ea7

Branch: refs/heads/master
Commit: 36656ea75eb2f3ad43a7bdf78f8ba9a471fce1b6
Parents: 8129bad
Author: Kapildeo Nayak 
Authored: Mon Nov 19 10:50:57 2018 -0800
Committer: Sarath Subramanian 
Committed: Mon Nov 19 10:50:57 2018 -0800

--
 addons/models/-Area0/0010-base_model.json   |  13 +
 .../models/-Area0/0011-glossary_model.json  |  18 +
 .../002-base_model_add_service_type.json| 221 +++
 addons/models/1000-Hadoop/1020-fs_model.json|   4 +
 addons/models/1000-Hadoop/1030-hive_model.json  |  14 +
 addons/models/1000-Hadoop/1040-sqoop_model.json |   2 +
 .../models/1000-Hadoop/1050-falcon_model.json   |  10 +-
 addons/models/1000-Hadoop/1060-hbase_model.json |   7 +
 addons/models/1000-Hadoop/1065-avro_model.json  |  11 +
 addons/models/1000-Hadoop/1070-kafka_model.json |   3 +
 addons/models/1000-Hadoop/1080-storm_model.json |   5 +
 .../007-hadoop_model_add_service_type.json  | 382 +++
 addons/models/2000-RDBMS/2010-rdbms_model.json  |  15 +
 .../002-rdbms_model_add_service_type.json   | 109 ++
 .../3000-Cloud/3010-aws_common_typedefs.json|   2 +
 .../models/3000-Cloud/3020-aws_s3_typedefs.json |   9 +
 .../001-cloud_model_add_service_type.json   |  81 
 .../org/apache/atlas/repository/Constants.java  |   1 +
 .../atlas/model/typedef/AtlasBaseTypeDef.java   |  21 +-
 .../atlas/model/typedef/AtlasEnumDef.java   |   7 +-
 .../atlas/model/typedef/AtlasStructDef.java |   6 +-
 .../org/apache/atlas/type/AtlasArrayType.java   |  18 +-
 .../apache/atlas/type/AtlasBuiltInTypes.java|  28 +-
 .../org/apache/atlas/type/AtlasMapType.java |  14 +-
 .../java/org/apache/atlas/type/AtlasType.java   |   9 +-
 .../apache/atlas/type/AtlasTypeRegistry.java|  27 +-
 .../org/apache/atlas/type/AtlasTypeUtil.java|  18 +
 .../graph/GraphBackedSearchIndexer.java |   1 +
 .../bootstrap/AtlasTypeDefStoreInitializer.java |  85 ++---
 .../graph/v2/AtlasTypeDefGraphStoreV2.java  |   7 +
 30 files changed, 1052 insertions(+), 96 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/36656ea7/addons/models/-Area0/0010-base_model.json
--
diff --git a/addons/models/-Area0/0010-base_model.json 
b/addons/models/-Area0/0010-base_model.json
index 3af0e0e..8b41ee8 100644
--- a/addons/models/-Area0/0010-base_model.json
+++ b/addons/models/-Area0/0010-base_model.json
@@ -6,6 +6,7 @@
 {
 "name": "Referenceable",
 "superTypes": [],
+"serviceType": "atlas_core",
 "typeVersion": "1.0",
 "attributeDefs": [
 {
@@ -21,6 +22,7 @@
 {
 "name": "__internal",
 "superTypes": [],
+"serviceType": "atlas_core",
 "typeVersion": "1.0",
 "attributeDefs": []
 },
@@ -29,6 +31,7 @@
 "superTypes": [
 "Referenceable"
 ],
+"serviceType": "atlas_core",
 "typeVersion": "1.1",
 "attributeDefs": [
 {
@@ -62,6 +65,7 @@
 "superTypes": [
 "Asset"
 ],
+"serviceType": "atlas_core",
 "typeVersion": "1.1",
 "attributeDefs": []
 },
@@ -71,6 +75,7 @@
 "superTypes": [
 "Asset"
 ],
+"serviceType": "atlas_core",
 "typeVersion": "1.1",
 "attributeDefs": []
 },
@@ -79,6 +84,7 @@
 "superTypes": [
 "Asset"
 ],
+"serviceType": "atlas_core",
 "typeVersion": "1.1",
 "attributeDefs": [
 {
@@ -101,6 +107,7 @@
 },
 {
   "name": "AtlasServer",
+  "serviceType": "atlas_core",
   "typeVersion": "1.0",
   "superTypes": [
 

[2/2] atlas git commit: ATLAS-2968: Update model files to include service-type for each entityDef

2018-11-19 Thread sarath
ATLAS-2968: Update model files to include service-type for each entityDef

Signed-off-by: Sarath Subramanian 
(cherry picked from commit 36656ea75eb2f3ad43a7bdf78f8ba9a471fce1b6)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/35f7b80f
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/35f7b80f
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/35f7b80f

Branch: refs/heads/branch-1.0
Commit: 35f7b80f19859734e088fb18de1b464f8f0fe208
Parents: 9d6ca7a
Author: Kapildeo Nayak 
Authored: Mon Nov 19 10:50:57 2018 -0800
Committer: Sarath Subramanian 
Committed: Mon Nov 19 13:08:22 2018 -0800

--
 addons/models/-Area0/0010-base_model.json   |  13 +
 .../models/-Area0/0011-glossary_model.json  |  18 +
 .../002-base_model_add_service_type.json| 221 +++
 addons/models/1000-Hadoop/1020-fs_model.json|   4 +
 addons/models/1000-Hadoop/1030-hive_model.json  |  14 +
 addons/models/1000-Hadoop/1040-sqoop_model.json |   2 +
 .../models/1000-Hadoop/1050-falcon_model.json   |  10 +-
 addons/models/1000-Hadoop/1060-hbase_model.json |   7 +
 addons/models/1000-Hadoop/1065-avro_model.json  |  11 +
 addons/models/1000-Hadoop/1070-kafka_model.json |   3 +
 addons/models/1000-Hadoop/1080-storm_model.json |   5 +
 .../007-hadoop_model_add_service_type.json  | 382 +++
 addons/models/2000-RDBMS/2010-rdbms_model.json  |  15 +
 .../002-rdbms_model_add_service_type.json   | 109 ++
 .../3000-Cloud/3010-aws_common_typedefs.json|   2 +
 .../models/3000-Cloud/3020-aws_s3_typedefs.json |   9 +
 .../001-cloud_model_add_service_type.json   |  81 
 .../org/apache/atlas/repository/Constants.java  |   1 +
 .../atlas/model/typedef/AtlasBaseTypeDef.java   |  21 +-
 .../atlas/model/typedef/AtlasEnumDef.java   |   7 +-
 .../atlas/model/typedef/AtlasStructDef.java |   6 +-
 .../org/apache/atlas/type/AtlasArrayType.java   |  18 +-
 .../apache/atlas/type/AtlasBuiltInTypes.java|  28 +-
 .../org/apache/atlas/type/AtlasMapType.java |  14 +-
 .../java/org/apache/atlas/type/AtlasType.java   |   9 +-
 .../apache/atlas/type/AtlasTypeRegistry.java|  27 +-
 .../org/apache/atlas/type/AtlasTypeUtil.java|  18 +
 .../graph/GraphBackedSearchIndexer.java |   1 +
 .../bootstrap/AtlasTypeDefStoreInitializer.java |  85 ++---
 .../graph/v2/AtlasTypeDefGraphStoreV2.java  |   7 +
 30 files changed, 1052 insertions(+), 96 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/35f7b80f/addons/models/-Area0/0010-base_model.json
--
diff --git a/addons/models/-Area0/0010-base_model.json 
b/addons/models/-Area0/0010-base_model.json
index 3af0e0e..8b41ee8 100644
--- a/addons/models/-Area0/0010-base_model.json
+++ b/addons/models/-Area0/0010-base_model.json
@@ -6,6 +6,7 @@
 {
 "name": "Referenceable",
 "superTypes": [],
+"serviceType": "atlas_core",
 "typeVersion": "1.0",
 "attributeDefs": [
 {
@@ -21,6 +22,7 @@
 {
 "name": "__internal",
 "superTypes": [],
+"serviceType": "atlas_core",
 "typeVersion": "1.0",
 "attributeDefs": []
 },
@@ -29,6 +31,7 @@
 "superTypes": [
 "Referenceable"
 ],
+"serviceType": "atlas_core",
 "typeVersion": "1.1",
 "attributeDefs": [
 {
@@ -62,6 +65,7 @@
 "superTypes": [
 "Asset"
 ],
+"serviceType": "atlas_core",
 "typeVersion": "1.1",
 "attributeDefs": []
 },
@@ -71,6 +75,7 @@
 "superTypes": [
 "Asset"
 ],
+"serviceType": "atlas_core",
 "typeVersion": "1.1",
 "attributeDefs": []
 },
@@ -79,6 +84,7 @@
 "superTypes": [
 "Asset"
 ],
+"serviceType": "atlas_core",
 "typeVersion": "1.1",
 "attributeDefs": [
 {
@@ -101,6 +107,7 @@
 },
 {
   "name": "AtlasServer",
+  "serviceType": "atlas_core",
   "typeVersion": "1.0&quo

[1/2] atlas git commit: ATLAS-2968: Update model files to include service-type for each entityDef

2018-11-19 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 8129bade5 -> 36656ea75


http://git-wip-us.apache.org/repos/asf/atlas/blob/36656ea7/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
index e2b33bd..25dd81d 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
@@ -40,6 +40,7 @@ import org.apache.atlas.model.typedef.AtlasTypesDef;
 import org.apache.atlas.store.AtlasTypeDefStore;
 import org.apache.atlas.type.AtlasType;
 import org.apache.atlas.type.AtlasTypeRegistry;
+import org.apache.atlas.type.AtlasTypeUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.configuration.Configuration;
@@ -404,8 +405,9 @@ public class AtlasTypeDefStoreInitializer implements 
ActiveStateChangeHandler {
 
 PatchHandler[] patchHandlers = new PatchHandler[] {
 new AddAttributePatchHandler(atlasTypeDefStore, 
atlasTypeRegistry),
+new UpdateAttributePatchHandler(atlasTypeDefStore, 
atlasTypeRegistry),
 new UpdateTypeDefOptionsPatchHandler(atlasTypeDefStore, 
atlasTypeRegistry),
-new UpdateAttributePatchHandler(atlasTypeDefStore, 
atlasTypeRegistry)
+new SetServiceTypePatchHandler(atlasTypeDefStore, 
atlasTypeRegistry)
 };
 
 Map patchHandlerRegistry = new HashMap<>();
@@ -471,6 +473,7 @@ public class AtlasTypeDefStoreInitializer implements 
ActiveStateChangeHandler {
 private Map params;
 private List attributeDefs;
 private Map typeDefOptions;
+private String  serviceType;
 
 public String getAction() {
 return action;
@@ -527,6 +530,14 @@ public class AtlasTypeDefStoreInitializer implements 
ActiveStateChangeHandler {
 public void setTypeDefOptions(Map typeDefOptions) {
 this.typeDefOptions = typeDefOptions;
 }
+
+public String getServiceType() {
+return serviceType;
+}
+
+public void setServiceType(String serviceType) {
+this.serviceType = serviceType;
+}
 }
 
 /**
@@ -709,57 +720,43 @@ public class AtlasTypeDefStoreInitializer implements 
ActiveStateChangeHandler {
 }
 
 if (isPatchApplicable(patch, typeDef)) {
-if (typeDef.getClass().equals(AtlasEntityDef.class)) {
-AtlasEntityDef updatedDef = new 
AtlasEntityDef((AtlasEntityDef)typeDef);
-
-if (updatedDef.getOptions() == null) {
-updatedDef.setOptions(patch.getTypeDefOptions());
-} else {
-
updatedDef.getOptions().putAll(patch.getTypeDefOptions());
-}
-updatedDef.setTypeVersion(patch.getUpdateToVersion());
-
-typeDefStore.updateEntityDefByName(typeName, updatedDef);
-} else if 
(typeDef.getClass().equals(AtlasClassificationDef.class)) {
-AtlasClassificationDef updatedDef = new 
AtlasClassificationDef((AtlasClassificationDef)typeDef);
+if (typeDef.getOptions() == null) {
+typeDef.setOptions(patch.getTypeDefOptions());
+} else {
+typeDef.getOptions().putAll(patch.getTypeDefOptions());
+}
+typeDef.setTypeVersion(patch.getUpdateToVersion());
 
-if (updatedDef.getOptions() == null) {
-updatedDef.setOptions(patch.getTypeDefOptions());
-} else {
-
updatedDef.getOptions().putAll(patch.getTypeDefOptions());
-}
-updatedDef.setTypeVersion(patch.getUpdateToVersion());
+
typeDefStore.updateTypesDef(AtlasTypeUtil.getTypesDef(typeDef));
+} else {
+LOG.info("patch skipped: typeName={}; applyToVersion={}; 
updateToVersion={}",
+ patch.getTypeName(), patch.getApplyToVersion(), 
patch.getUpdateToVersion());
+}
+}
+}
 
-typeDefStore.updateClassificationDefByName(typeName, 
updatedDef);
-} else if (typeDef.getClass().equals(AtlasStructDef.class)) {
-AtlasStructDef updatedDef = new 
AtlasStructDef((AtlasStructDef)typeDef);
+class SetServiceTypePatchHandler extends PatchHandler {

[1/2] atlas git commit: ATLAS-2968: Update model files to include service-type for each entityDef

2018-11-19 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 9d6ca7aae -> 35f7b80f1


http://git-wip-us.apache.org/repos/asf/atlas/blob/35f7b80f/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
index e2b33bd..25dd81d 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/bootstrap/AtlasTypeDefStoreInitializer.java
@@ -40,6 +40,7 @@ import org.apache.atlas.model.typedef.AtlasTypesDef;
 import org.apache.atlas.store.AtlasTypeDefStore;
 import org.apache.atlas.type.AtlasType;
 import org.apache.atlas.type.AtlasTypeRegistry;
+import org.apache.atlas.type.AtlasTypeUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.configuration.Configuration;
@@ -404,8 +405,9 @@ public class AtlasTypeDefStoreInitializer implements 
ActiveStateChangeHandler {
 
 PatchHandler[] patchHandlers = new PatchHandler[] {
 new AddAttributePatchHandler(atlasTypeDefStore, 
atlasTypeRegistry),
+new UpdateAttributePatchHandler(atlasTypeDefStore, 
atlasTypeRegistry),
 new UpdateTypeDefOptionsPatchHandler(atlasTypeDefStore, 
atlasTypeRegistry),
-new UpdateAttributePatchHandler(atlasTypeDefStore, 
atlasTypeRegistry)
+new SetServiceTypePatchHandler(atlasTypeDefStore, 
atlasTypeRegistry)
 };
 
 Map patchHandlerRegistry = new HashMap<>();
@@ -471,6 +473,7 @@ public class AtlasTypeDefStoreInitializer implements 
ActiveStateChangeHandler {
 private Map params;
 private List attributeDefs;
 private Map typeDefOptions;
+private String  serviceType;
 
 public String getAction() {
 return action;
@@ -527,6 +530,14 @@ public class AtlasTypeDefStoreInitializer implements 
ActiveStateChangeHandler {
 public void setTypeDefOptions(Map typeDefOptions) {
 this.typeDefOptions = typeDefOptions;
 }
+
+public String getServiceType() {
+return serviceType;
+}
+
+public void setServiceType(String serviceType) {
+this.serviceType = serviceType;
+}
 }
 
 /**
@@ -709,57 +720,43 @@ public class AtlasTypeDefStoreInitializer implements 
ActiveStateChangeHandler {
 }
 
 if (isPatchApplicable(patch, typeDef)) {
-if (typeDef.getClass().equals(AtlasEntityDef.class)) {
-AtlasEntityDef updatedDef = new 
AtlasEntityDef((AtlasEntityDef)typeDef);
-
-if (updatedDef.getOptions() == null) {
-updatedDef.setOptions(patch.getTypeDefOptions());
-} else {
-
updatedDef.getOptions().putAll(patch.getTypeDefOptions());
-}
-updatedDef.setTypeVersion(patch.getUpdateToVersion());
-
-typeDefStore.updateEntityDefByName(typeName, updatedDef);
-} else if 
(typeDef.getClass().equals(AtlasClassificationDef.class)) {
-AtlasClassificationDef updatedDef = new 
AtlasClassificationDef((AtlasClassificationDef)typeDef);
+if (typeDef.getOptions() == null) {
+typeDef.setOptions(patch.getTypeDefOptions());
+} else {
+typeDef.getOptions().putAll(patch.getTypeDefOptions());
+}
+typeDef.setTypeVersion(patch.getUpdateToVersion());
 
-if (updatedDef.getOptions() == null) {
-updatedDef.setOptions(patch.getTypeDefOptions());
-} else {
-
updatedDef.getOptions().putAll(patch.getTypeDefOptions());
-}
-updatedDef.setTypeVersion(patch.getUpdateToVersion());
+
typeDefStore.updateTypesDef(AtlasTypeUtil.getTypesDef(typeDef));
+} else {
+LOG.info("patch skipped: typeName={}; applyToVersion={}; 
updateToVersion={}",
+ patch.getTypeName(), patch.getApplyToVersion(), 
patch.getUpdateToVersion());
+}
+}
+}
 
-typeDefStore.updateClassificationDefByName(typeName, 
updatedDef);
-} else if (typeDef.getClass().equals(AtlasStructDef.class)) {
-AtlasStructDef updatedDef = new 
AtlasStructDef((AtlasStructDef)typeDef);
+class SetServiceTypePatchHandler extends 

atlas git commit: ATLAS-3006: Option to ignore/prune metadata for temporary/staging Hive tables

2019-01-04 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 a48249e0b -> a35379c1d


ATLAS-3006: Option to ignore/prune metadata for temporary/staging Hive tables

Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/a35379c1
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/a35379c1
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/a35379c1

Branch: refs/heads/branch-0.8
Commit: a35379c1deee6f11396e00916400ec9f475ee8a3
Parents: a48249e
Author: Madhan Neethiraj 
Authored: Fri Jan 4 13:58:58 2019 -0800
Committer: Sarath Subramanian 
Committed: Fri Jan 4 13:58:58 2019 -0800

--
 .../atlas/hive/hook/AtlasHiveHookContext.java   |   5 +
 .../org/apache/atlas/hive/hook/HiveHook.java|  87 ++-
 .../hive/hook/events/AlterTableRename.java  |   9 +-
 .../atlas/hive/hook/events/BaseHiveEvent.java   | 119 +
 .../atlas/hive/hook/events/CreateTable.java |   2 +-
 .../notification/NotificationHookConsumer.java  | 208 ---
 .../preprocessor/EntityPreprocessor.java| 126 +
 .../preprocessor/HivePreprocessor.java  | 253 +++
 .../preprocessor/PreprocessorContext.java   | 229 +
 9 files changed, 943 insertions(+), 95 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/a35379c1/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
--
diff --git 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
index 23cb853..249f48b 100644
--- 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
+++ 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
@@ -20,6 +20,7 @@ package org.apache.atlas.hive.hook;
 
 import org.apache.atlas.model.instance.AtlasEntity;
 import org.apache.atlas.hive.hook.HiveHook.HiveHookObjectNamesCache;
+import org.apache.atlas.hive.hook.HiveHook.PreprocessAction;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.RandomStringUtils;
 import org.apache.hadoop.hive.metastore.api.Database;
@@ -97,6 +98,10 @@ public class AtlasHiveHookContext {
 return hook.getSkipHiveColumnLineageHive20633InputsThreshold();
 }
 
+public PreprocessAction getPreprocessActionForHiveTable(String 
qualifiedName) {
+return hook.getPreprocessActionForHiveTable(qualifiedName);
+}
+
 public String getQualifiedName(Database db) {
 return (db.getName() + QNAME_SEP_CLUSTER_NAME).toLowerCase() + 
getClusterName();
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/a35379c1/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
--
diff --git 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
index 7b60553..4a6b417 100644
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
@@ -21,6 +21,8 @@ package org.apache.atlas.hive.hook;
 import org.apache.atlas.hive.hook.events.*;
 import org.apache.atlas.hook.AtlasHook;
 import org.apache.atlas.model.instance.AtlasEntity;
+import org.apache.atlas.utils.LruCache;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext;
 import org.apache.hadoop.hive.ql.hooks.HookContext;
@@ -30,12 +32,15 @@ import org.apache.hadoop.security.UserGroupInformation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.regex.Pattern;
 
 import static 
org.apache.atlas.hive.hook.events.BaseHiveEvent.ATTRIBUTE_QUALIFIED_NAME;
 import static org.apache.atlas.hive.hook.events.BaseHiveEvent.HIVE_TYPE_DB;
@@ -45,6 +50,8 @@ import static 
org.apache.atlas.hive.hook.events.BaseHiveEvent.HIVE_TYPE_TABLE;
 public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
 private static final Logger LOG = LoggerFactory.getLogger(HiveHook.class);
 
+public enum PreprocessAction { NONE, IGNORE, PRUNE }
+
 public static final String CONF_PREFIX = 
"atlas.hook.hive.";
 public static final String CONF

atlas git commit: ATLAS-3006: Option to ignore/prune metadata for temporary/staging Hive tables

2019-01-04 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/master 400385891 -> 1123f512c


ATLAS-3006: Option to ignore/prune metadata for temporary/staging Hive tables

Signed-off-by: Sarath Subramanian 


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/1123f512
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/1123f512
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/1123f512

Branch: refs/heads/master
Commit: 1123f512cd4ba98f8e1cfecb7f9deff23cbb4949
Parents: 4003858
Author: Madhan Neethiraj 
Authored: Fri Jan 4 14:00:51 2019 -0800
Committer: Sarath Subramanian 
Committed: Fri Jan 4 14:00:51 2019 -0800

--
 .../atlas/hive/hook/AtlasHiveHookContext.java   |   5 +
 .../org/apache/atlas/hive/hook/HiveHook.java|  88 ++-
 .../hive/hook/events/AlterTableRename.java  |   9 +-
 .../atlas/hive/hook/events/BaseHiveEvent.java   | 119 +
 .../atlas/hive/hook/events/CreateTable.java |  38 +--
 .../notification/NotificationHookConsumer.java  | 198 ---
 .../preprocessor/EntityPreprocessor.java| 126 +
 .../preprocessor/HivePreprocessor.java  | 253 +++
 .../preprocessor/PreprocessorContext.java   | 228 +
 9 files changed, 957 insertions(+), 107 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/1123f512/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
--
diff --git 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
index 23cb853..44c6437 100644
--- 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
+++ 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
@@ -19,6 +19,7 @@
 package org.apache.atlas.hive.hook;
 
 import org.apache.atlas.model.instance.AtlasEntity;
+import org.apache.atlas.hive.hook.HiveHook.PreprocessAction;
 import org.apache.atlas.hive.hook.HiveHook.HiveHookObjectNamesCache;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.RandomStringUtils;
@@ -97,6 +98,10 @@ public class AtlasHiveHookContext {
 return hook.getSkipHiveColumnLineageHive20633InputsThreshold();
 }
 
+public PreprocessAction getPreprocessActionForHiveTable(String 
qualifiedName) {
+return hook.getPreprocessActionForHiveTable(qualifiedName);
+}
+
 public String getQualifiedName(Database db) {
 return (db.getName() + QNAME_SEP_CLUSTER_NAME).toLowerCase() + 
getClusterName();
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/1123f512/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
--
diff --git 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
index 0f48578..ee02285 100644
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
@@ -21,6 +21,8 @@ package org.apache.atlas.hive.hook;
 import org.apache.atlas.hive.hook.events.*;
 import org.apache.atlas.hook.AtlasHook;
 import org.apache.atlas.model.instance.AtlasEntity;
+import org.apache.atlas.utils.LruCache;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext;
 import org.apache.hadoop.hive.ql.hooks.HookContext;
@@ -30,12 +32,15 @@ import org.apache.hadoop.security.UserGroupInformation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.regex.Pattern;
 
 import static 
org.apache.atlas.hive.hook.events.BaseHiveEvent.ATTRIBUTE_QUALIFIED_NAME;
 import static org.apache.atlas.hive.hook.events.BaseHiveEvent.HIVE_TYPE_DB;
@@ -45,6 +50,8 @@ import static 
org.apache.atlas.hive.hook.events.BaseHiveEvent.HIVE_TYPE_TABLE;
 public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
 private static final Logger LOG = LoggerFactory.getLogger(HiveHook.class);
 
+public enum PreprocessAction { NONE, IGNORE, PRUNE }
+
 public static final String CONF_PREFIX = 
"atlas.hook.hive.";
 public static final String CONF_CLUSTER_NAME   = 
"atlas.cluster.name";
 pub

atlas git commit: ATLAS-3006: Option to ignore/prune metadata for temporary/staging Hive tables

2019-01-04 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 1c9963746 -> b9c146b72


ATLAS-3006: Option to ignore/prune metadata for temporary/staging Hive tables

Signed-off-by: Sarath Subramanian 
(cherry picked from commit 1123f512cd4ba98f8e1cfecb7f9deff23cbb4949)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/b9c146b7
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/b9c146b7
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/b9c146b7

Branch: refs/heads/branch-1.0
Commit: b9c146b72b1ecb4dd3cdeb6fc69eb842d9166160
Parents: 1c99637
Author: Madhan Neethiraj 
Authored: Fri Jan 4 14:00:51 2019 -0800
Committer: Sarath Subramanian 
Committed: Fri Jan 4 14:08:37 2019 -0800

--
 .../atlas/hive/hook/AtlasHiveHookContext.java   |   5 +
 .../org/apache/atlas/hive/hook/HiveHook.java|  88 ++-
 .../hive/hook/events/AlterTableRename.java  |   9 +-
 .../atlas/hive/hook/events/BaseHiveEvent.java   | 119 +
 .../atlas/hive/hook/events/CreateTable.java |  38 +--
 .../notification/NotificationHookConsumer.java  | 198 ---
 .../preprocessor/EntityPreprocessor.java| 126 +
 .../preprocessor/HivePreprocessor.java  | 253 +++
 .../preprocessor/PreprocessorContext.java   | 228 +
 9 files changed, 957 insertions(+), 107 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/b9c146b7/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
--
diff --git 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
index 23cb853..44c6437 100644
--- 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
+++ 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/AtlasHiveHookContext.java
@@ -19,6 +19,7 @@
 package org.apache.atlas.hive.hook;
 
 import org.apache.atlas.model.instance.AtlasEntity;
+import org.apache.atlas.hive.hook.HiveHook.PreprocessAction;
 import org.apache.atlas.hive.hook.HiveHook.HiveHookObjectNamesCache;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.RandomStringUtils;
@@ -97,6 +98,10 @@ public class AtlasHiveHookContext {
 return hook.getSkipHiveColumnLineageHive20633InputsThreshold();
 }
 
+public PreprocessAction getPreprocessActionForHiveTable(String 
qualifiedName) {
+return hook.getPreprocessActionForHiveTable(qualifiedName);
+}
+
 public String getQualifiedName(Database db) {
 return (db.getName() + QNAME_SEP_CLUSTER_NAME).toLowerCase() + 
getClusterName();
 }

http://git-wip-us.apache.org/repos/asf/atlas/blob/b9c146b7/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
--
diff --git 
a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java 
b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
index 0f48578..ee02285 100644
--- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
+++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveHook.java
@@ -21,6 +21,8 @@ package org.apache.atlas.hive.hook;
 import org.apache.atlas.hive.hook.events.*;
 import org.apache.atlas.hook.AtlasHook;
 import org.apache.atlas.model.instance.AtlasEntity;
+import org.apache.atlas.utils.LruCache;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext;
 import org.apache.hadoop.hive.ql.hooks.HookContext;
@@ -30,12 +32,15 @@ import org.apache.hadoop.security.UserGroupInformation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.regex.Pattern;
 
 import static 
org.apache.atlas.hive.hook.events.BaseHiveEvent.ATTRIBUTE_QUALIFIED_NAME;
 import static org.apache.atlas.hive.hook.events.BaseHiveEvent.HIVE_TYPE_DB;
@@ -45,6 +50,8 @@ import static 
org.apache.atlas.hive.hook.events.BaseHiveEvent.HIVE_TYPE_TABLE;
 public class HiveHook extends AtlasHook implements ExecuteWithHookContext {
 private static final Logger LOG = LoggerFactory.getLogger(HiveHook.class);
 
+public enum PreprocessAction { NONE, IGNORE, PRUNE }
+
 public static final String CONF_PREFIX = 
"atlas.hook.hive.";
 public static final String CONF

atlas git commit: ATLAS-2874: Include handling of Atlas Entity Transformers in current Import logic

2018-09-17 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 6b953b59c -> dc5ebabe1


ATLAS-2874: Include handling of Atlas Entity Transformers in current Import 
logic


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/dc5ebabe
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/dc5ebabe
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/dc5ebabe

Branch: refs/heads/branch-0.8
Commit: dc5ebabe1e55df389d9fb7c206fc22f18f93f9cc
Parents: 6b953b5
Author: Sarath Subramanian 
Authored: Mon Sep 17 21:57:40 2018 -0700
Committer: Sarath Subramanian 
Committed: Mon Sep 17 21:57:40 2018 -0700

--
 .../atlas/model/impexp/AtlasImportRequest.java  |  1 +
 .../atlas/repository/impexp/ImportService.java  | 50 +--
 .../atlas/repository/impexp/ZipSource.java  | 51 
 3 files changed, 89 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/dc5ebabe/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java
--
diff --git 
a/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java 
b/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java
index f56fe22..aa5fe00 100644
--- a/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java
+++ b/intg/src/main/java/org/apache/atlas/model/impexp/AtlasImportRequest.java
@@ -38,6 +38,7 @@ public class AtlasImportRequest implements Serializable {
 private static final long   serialVersionUID = 1L;
 
 public  static final String TRANSFORMS_KEY = "transforms";
+public  static final String TRANSFORMERS_KEY   = "transformers";
 public  static final String OPTION_KEY_REPLICATED_FROM = "replicatedFrom";
 private static final String START_POSITION_KEY = "startPosition";
 private static final String START_GUID_KEY = "startGuid";

http://git-wip-us.apache.org/repos/asf/atlas/blob/dc5ebabe/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
index a88ba2b..a09385e 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ImportService.java
@@ -19,15 +19,17 @@ package org.apache.atlas.repository.impexp;
 
 import com.google.common.annotations.VisibleForTesting;
 import org.apache.atlas.AtlasErrorCode;
+import org.apache.atlas.entitytransform.BaseEntityHandler;
 import org.apache.atlas.exception.AtlasBaseException;
 import org.apache.atlas.model.impexp.AtlasImportRequest;
 import org.apache.atlas.model.impexp.AtlasImportResult;
+import org.apache.atlas.model.impexp.AttributeTransform;
 import org.apache.atlas.model.typedef.AtlasTypesDef;
 import org.apache.atlas.repository.store.graph.BulkImporter;
 import org.apache.atlas.store.AtlasTypeDefStore;
-import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasType;
 import org.apache.atlas.type.AtlasTypeRegistry;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -40,6 +42,11 @@ import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static 
org.apache.atlas.model.impexp.AtlasImportRequest.TRANSFORMERS_KEY;
+import static org.apache.atlas.model.impexp.AtlasImportRequest.TRANSFORMS_KEY;
 
 @Component
 public class ImportService {
@@ -82,9 +89,12 @@ public class ImportService {
 try {
 LOG.info("==> import(user={}, from={}, request={})", userName, 
requestingIP, request);
 
-String transforms = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(AtlasImportRequest.TRANSFORMS_KEY) : null;
-
+String transforms = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(TRANSFORMS_KEY) : null;
 setImportTransform(source, transforms);
+
+String transformers = MapUtils.isNotEmpty(request.getOptions()) ? 
request.getOptions().get(TRANSFORMERS_KEY) : null;
+setEntityTransformerHandlers(source, transformers);
+
 startTimestamp = System.currentTimeMillis();
 processTypes(source.getTypesDef(), result);
 setStartPosition

atlas git commit: ATLAS-2781: Hard Delete : Deleting an entity which is associated to an term associated to a tag fails

2018-09-18 Thread sarath
Repository: atlas
Updated Branches:
  refs/heads/branch-1.0 dd29cb91c -> a00875362


ATLAS-2781: Hard Delete : Deleting an entity which is associated to an term 
associated to a tag fails

(cherry picked from commit 59ae59dbaf8ce4a35886d5a9e5af7020666b1763)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/a0087536
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/a0087536
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/a0087536

Branch: refs/heads/branch-1.0
Commit: a00875362d724a22b2d00d1645f5a28dc8bcd075
Parents: dd29cb9
Author: Sarath Subramanian 
Authored: Fri Jul 6 15:24:41 2018 -0700
Committer: Sarath Subramanian 
Committed: Tue Sep 18 11:39:36 2018 -0700

--
 .../repository/store/graph/v2/AtlasEntityChangeNotifier.java  | 7 +++
 1 file changed, 7 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/atlas/blob/a0087536/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityChangeNotifier.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityChangeNotifier.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityChangeNotifier.java
index 1b09d49..9d8afdf 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityChangeNotifier.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityChangeNotifier.java
@@ -246,7 +246,14 @@ public class AtlasEntityChangeNotifier {
 return;
 }
 
+RequestContext context = RequestContext.get();
+
 for (String guid : entityPropagationMap.keySet()) {
+// if entity is deleted, don't send propagated classifications 
add/remove notifications.
+if (context.isDeletedEntity(guid)) {
+continue;
+}
+
 AtlasEntityWithExtInfo entityWithExtInfo = 
instanceConverter.getAndCacheEntity(guid);
 AtlasEntityentity= entityWithExtInfo != 
null ? entityWithExtInfo.getEntity() : null;
 



[atlas] branch branch-0.8 updated: ATLAS-3036: Improve FullTextMapper performance during entity retrieval

2019-01-27 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/branch-0.8 by this push:
 new a08a5a3  ATLAS-3036: Improve FullTextMapper performance during entity 
retrieval
a08a5a3 is described below

commit a08a5a39a83fcfee0965471a3a1b1c29279feea3
Author: Sarath Subramanian 
AuthorDate: Sun Jan 27 17:04:24 2019 -0800

ATLAS-3036: Improve FullTextMapper performance during entity retrieval
---
 .../converters/AtlasInstanceConverter.java |  4 ++
 .../atlas/repository/graph/FullTextMapperV2.java   | 10 +++--
 .../store/graph/v1/EntityGraphRetriever.java   | 43 +++---
 3 files changed, 41 insertions(+), 16 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/converters/AtlasInstanceConverter.java
 
b/repository/src/main/java/org/apache/atlas/repository/converters/AtlasInstanceConverter.java
index b4d399a..8fd0eb6 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/converters/AtlasInstanceConverter.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/converters/AtlasInstanceConverter.java
@@ -109,6 +109,10 @@ public class AtlasInstanceConverter {
 
 if (ret == null) {
 ret = metadataService.getEntityDefinition(guid);
+
+if (ret != null) {
+RequestContext.get().cache(ret);
+}
 }
 
 return ret;
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/FullTextMapperV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/graph/FullTextMapperV2.java
index 84cd999..79d15ed 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/graph/FullTextMapperV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/graph/FullTextMapperV2.java
@@ -129,14 +129,14 @@ public class FullTextMapperV2 {
 entity= entityWithExtInfo != null ? 
entityWithExtInfo.getEntity() : null;
 entityExtInfo = entityWithExtInfo;
 } else {
-entity= getAndCacheEntity(guid);
+entity= getAndCacheEntity(guid, false);
 entityExtInfo = null;
 }
 
 if (entity != null) {
 StringBuilder sb = new StringBuilder();
 
-map(entity, entityExtInfo, sb, new HashSet());
+map(entity, entityExtInfo, sb, new HashSet<>());
 
 ret = sb.toString();
 }
@@ -252,11 +252,15 @@ public class FullTextMapperV2 {
 }
 
 private AtlasEntity getAndCacheEntity(String guid) throws 
AtlasBaseException {
+return getAndCacheEntity(guid, true);
+}
+
+private AtlasEntity  getAndCacheEntity(String guid, boolean 
includeReferences) throws AtlasBaseException {
 RequestContext context = RequestContext.get();
 AtlasEntityentity  = context.getEntity(guid);
 
 if (entity == null) {
-entity = entityGraphRetriever.toAtlasEntity(guid);
+entity = entityGraphRetriever.toAtlasEntity(guid, 
includeReferences);
 
 if (entity != null) {
 context.cache(entity);
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
index 652265c..5093714 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
@@ -75,6 +75,10 @@ public final class EntityGraphRetriever {
 this.typeRegistry = typeRegistry;
 }
 
+public AtlasEntity toAtlasEntity(String guid, boolean includeReferences) 
throws AtlasBaseException {
+return mapVertexToAtlasEntity(getEntityVertex(guid), null, false, 
includeReferences);
+}
+
 public AtlasEntity toAtlasEntity(String guid) throws AtlasBaseException {
 return toAtlasEntity(getEntityVertex(guid));
 }
@@ -201,6 +205,10 @@ public final class EntityGraphRetriever {
 }
 
 private AtlasEntity mapVertexToAtlasEntity(AtlasVertex entityVertex, 
AtlasEntityExtInfo entityExtInfo, boolean isMinExtInfo) throws 
AtlasBaseException {
+return mapVertexToAtlasEntity(entityVertex, entityExtInfo, 
isMinExtInfo, true);
+}
+
+private AtlasEntity mapVertexToAtlasEntity(AtlasVertex entityVertex, 
AtlasEntityExtInfo entityExtInfo, boolean isMinExtInfo, boolean 
includeReferences) throws AtlasBaseException {
 String  guid   = GraphHelper.getGuid(entityVertex);
 AtlasEntity entity = entityExtInfo != null ? 
entityExtInfo.getEntity(guid) : null;
 
@@ -217,7 +225,7 @@ public final class EntityGraphRetriever {
 
 mapSystemAttributes(entityVertex, 

[atlas] branch master updated: ATLAS-3113: Use index query to search for active entities and better logging in java patch framework

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 66f57da  ATLAS-3113: Use index query to search for active entities and 
better logging in java patch framework
66f57da is described below

commit 66f57da82afd1d348eca4e0c9deccc3838ebe114
Author: Sarath Subramanian 
AuthorDate: Wed Apr 3 05:06:18 2019 -0700

ATLAS-3113: Use index query to search for active entities and better 
logging in java patch framework
---
 .../patches/UniqueAttributePatchHandler.java| 21 +
 .../store/graph/v2/AtlasGraphUtilsV2.java   | 18 +-
 2 files changed, 26 insertions(+), 13 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/patches/UniqueAttributePatchHandler.java
 
b/repository/src/main/java/org/apache/atlas/repository/patches/UniqueAttributePatchHandler.java
index 0e707a5..f2238f1 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/patches/UniqueAttributePatchHandler.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/patches/UniqueAttributePatchHandler.java
@@ -22,6 +22,7 @@ import org.apache.atlas.repository.IndexException;
 import org.apache.atlas.repository.graph.GraphBackedSearchIndexer.UniqueKind;
 import org.apache.atlas.repository.graphdb.AtlasCardinality;
 import org.apache.atlas.repository.graphdb.AtlasGraphManagement;
+import org.apache.atlas.repository.graphdb.AtlasIndexQuery.Result;
 import org.apache.atlas.repository.graphdb.AtlasVertex;
 import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasStructType.AtlasAttribute;
@@ -56,7 +57,7 @@ public class UniqueAttributePatchHandler extends 
AtlasJavaPatchHandler {
 for (AtlasEntityType entityType : allEntityTypes) {
 String  typeName  = 
entityType.getTypeName();
 Map uniqAttributes= 
entityType.getUniqAttributes();
-int entitiesProcessed = 0;
+int patchAppliedCount = 0;
 
 LOG.info("Applying java patch: {} for type: {}", getPatchId(), 
typeName);
 
@@ -67,12 +68,16 @@ public class UniqueAttributePatchHandler extends 
AtlasJavaPatchHandler {
 // register unique attribute property keys in graph
 registerUniqueAttrPropertyKeys(attributes);
 
-Iterator iterator = 
findActiveEntityVerticesByType(typeName);
+Iterator> iterator = 
findActiveEntityVerticesByType(typeName);
 
-while (iterator.hasNext()) {
-AtlasVertex entityVertex = iterator.next();
+int entityCount = 0;
+
+while (iterator != null && iterator.hasNext()) {
+AtlasVertex entityVertex = iterator.next().getVertex();
 boolean patchApplied = false;
 
+entityCount++;
+
 for (AtlasAttribute attribute : attributes) {
 String   uniquePropertyKey = 
attribute.getVertexUniquePropertyName();
 Collection propertyKeys  = 
entityVertex.getPropertyKeys();
@@ -104,11 +109,11 @@ public class UniqueAttributePatchHandler extends 
AtlasJavaPatchHandler {
 }
 
 if (patchApplied) {
-entitiesProcessed++;
+patchAppliedCount++;
 }
 
-if (entitiesProcessed % 1000 == 0) {
-LOG.info("Java patch: {} : processed {} {} 
entities.", getPatchId(), entitiesProcessed, typeName);
+if (entityCount % 1000 == 0) {
+LOG.info("Java patch: {} : applied {}; processed 
{} {} entities.", getPatchId(), patchAppliedCount, entityCount, typeName);
 }
 }
 } catch (IndexException e) {
@@ -120,7 +125,7 @@ public class UniqueAttributePatchHandler extends 
AtlasJavaPatchHandler {
 }
 }
 
-LOG.info("Applied java patch ({}) for type: {}; Total processed: 
{}", getPatchId(), typeName, entitiesProcessed);
+LOG.info("Applied java patch ({}) for type: {}; Total processed: 
{}", getPatchId(), typeName, patchAppliedCount);
 }
 
 if (patchFailed) {
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
index 2882f09..80141b4 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/gr

[atlas] branch master updated: ATLAS-3099: Update graph storage and index backend property to be configurable

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new ee41891  ATLAS-3099: Update graph storage and index backend property 
to be configurable
ee41891 is described below

commit ee4189124cb647dce8afadb3e3ec1a7c959f5554
Author: Sarath Subramanian 
AuthorDate: Tue Mar 26 00:08:02 2019 -0700

ATLAS-3099: Update graph storage and index backend property to be 
configurable
---
 .../org/apache/atlas/ApplicationProperties.java| 68 +-
 1 file changed, 27 insertions(+), 41 deletions(-)

diff --git a/intg/src/main/java/org/apache/atlas/ApplicationProperties.java 
b/intg/src/main/java/org/apache/atlas/ApplicationProperties.java
index 01af49c..3f43496 100644
--- a/intg/src/main/java/org/apache/atlas/ApplicationProperties.java
+++ b/intg/src/main/java/org/apache/atlas/ApplicationProperties.java
@@ -261,62 +261,48 @@ public final class ApplicationProperties extends 
PropertiesConfiguration {
 }
 
 private void setDefaults() {
+// setting value for 'atlas.graphdb.backend' (default = 'janus')
 String graphDbBackend = getString(GRAPHDB_BACKEND_CONF);
 
 if (StringUtils.isEmpty(graphDbBackend)) {
 graphDbBackend = DEFAULT_GRAPHDB_BACKEND;
-
-clearPropertyDirect(GRAPHDB_BACKEND_CONF);
-addPropertyDirect(GRAPHDB_BACKEND_CONF, graphDbBackend);
-LOG.info("No graphdb backend specified. Will use '" + 
graphDbBackend + "'");
-
-// The below default values for storage backend, index backend and 
solr-wait-searcher
-// should be removed once ambari change to handle them is 
committed.
-clearPropertyDirect(STORAGE_BACKEND_CONF);
-addPropertyDirect(STORAGE_BACKEND_CONF, STORAGE_BACKEND_HBASE2);
-LOG.info("Using storage backend '" + STORAGE_BACKEND_HBASE2 + "'");
-
-clearPropertyDirect(INDEX_BACKEND_CONF);
-addPropertyDirect(INDEX_BACKEND_CONF, INDEX_BACKEND_SOLR);
-LOG.info("Using index backend '" + INDEX_BACKEND_SOLR + "'");
-
-clearPropertyDirect(SOLR_WAIT_SEARCHER_CONF);
-addPropertyDirect(SOLR_WAIT_SEARCHER_CONF, 
DEFAULT_SOLR_WAIT_SEARCHER);
-LOG.info("Setting solr-wait-searcher property '" + 
DEFAULT_SOLR_WAIT_SEARCHER + "'");
-
-clearPropertyDirect(INDEX_MAP_NAME_CONF);
-addPropertyDirect(INDEX_MAP_NAME_CONF, DEFAULT_INDEX_MAP_NAME);
-LOG.info("Setting index.search.map-name property '" + 
DEFAULT_INDEX_MAP_NAME + "'");
 }
 
-String storageBackend = getString(STORAGE_BACKEND_CONF);
-
-if (StringUtils.isEmpty(storageBackend)) {
-if (graphDbBackend.contains(GRAPHBD_BACKEND_JANUS)) {
-storageBackend = STORAGE_BACKEND_HBASE2;
-}
+clearPropertyDirect(GRAPHDB_BACKEND_CONF);
+addPropertyDirect(GRAPHDB_BACKEND_CONF, graphDbBackend);
+LOG.info("Using graphdb backend '" + graphDbBackend + "'");
 
-if (StringUtils.isNotEmpty(storageBackend)) {
-clearPropertyDirect(STORAGE_BACKEND_CONF);
-addPropertyDirect(STORAGE_BACKEND_CONF, storageBackend);
+// setting value for 'atlas.graph.storage.backend' (default = 'hbase2')
+String storageBackend = getString(STORAGE_BACKEND_CONF);
 
-LOG.info("No storage backend specified. Will use '" + 
storageBackend + "'");
-}
+if (StringUtils.isEmpty(storageBackend) || 
storageBackend.equalsIgnoreCase(STORAGE_BACKEND_HBASE)) {
+storageBackend = STORAGE_BACKEND_HBASE2;
 }
 
+clearPropertyDirect(STORAGE_BACKEND_CONF);
+addPropertyDirect(STORAGE_BACKEND_CONF, storageBackend);
+LOG.info("Using storage backend '" + storageBackend + "'");
+
+// setting value for 'atlas.graph.index.search.backend' (default = 
'solr')
 String indexBackend = getString(INDEX_BACKEND_CONF);
 
 if (StringUtils.isEmpty(indexBackend)) {
-if (graphDbBackend.contains(GRAPHBD_BACKEND_JANUS)) {
-indexBackend = INDEX_BACKEND_SOLR;
-}
+indexBackend = INDEX_BACKEND_SOLR;
+}
 
-if (StringUtils.isNotEmpty(indexBackend)) {
-clearPropertyDirect(INDEX_BACKEND_CONF);
-addPropertyDirect(INDEX_BACKEND_CONF, indexBackend);
+clearPropertyDirect(INDEX_BACKEND_CONF);
+addPropertyDirect(INDEX_BACKEND_CONF, indexBackend);
+LOG.info("Using index backend '" + indexBackend + "'");
 
-LOG.info("No index backen

[atlas] branch master updated: ATLAS-3067: Fix UT failures related to ATLAS-3077

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new d5f7cc4  ATLAS-3067: Fix UT failures related to ATLAS-3077
d5f7cc4 is described below

commit d5f7cc46cdae050db5d1ee810a2a2ed10c52c15f
Author: Sarath Subramanian 
AuthorDate: Fri Mar 22 16:15:50 2019 -0700

ATLAS-3067: Fix UT failures related to ATLAS-3077
---
 .../org/apache/atlas/repository/migration/ComplexAttributesTest.java| 2 +-
 .../java/org/apache/atlas/repository/migration/HiveParititionTest.java  | 2 +-
 .../test/java/org/apache/atlas/repository/migration/HiveStocksTest.java | 2 +-
 .../src/test/java/org/apache/atlas/repository/migration/PathTest.java   | 2 +-
 .../apache/atlas/repository/migration/TypesWithClassificationTest.java  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/repository/src/test/java/org/apache/atlas/repository/migration/ComplexAttributesTest.java
 
b/repository/src/test/java/org/apache/atlas/repository/migration/ComplexAttributesTest.java
index 51dd3c5..4b7cfb2 100644
--- 
a/repository/src/test/java/org/apache/atlas/repository/migration/ComplexAttributesTest.java
+++ 
b/repository/src/test/java/org/apache/atlas/repository/migration/ComplexAttributesTest.java
@@ -43,7 +43,7 @@ public class ComplexAttributesTest extends 
MigrationBaseAsserts {
 String ENTITY_TYPE = "entity_type";
 String ENTITY_WITH_COMPLEX_COLL_TYPE = 
"entity_with_complex_collection_attr";
 
-final int EXPECTED_TOTAL_COUNT  = 217;
+final int EXPECTED_TOTAL_COUNT  = 218;
 final int EXPECTED_ENTITY_TYPE_COUNT = 16;
 final int EXPECTED_STRUCT_TYPE_COUNT = 3;
 final int EXPECTED_ENTITY_WITH_COMPLEX_COLL_TYPE_COUNT = 1;
diff --git 
a/repository/src/test/java/org/apache/atlas/repository/migration/HiveParititionTest.java
 
b/repository/src/test/java/org/apache/atlas/repository/migration/HiveParititionTest.java
index 7567daa..54c482e 100644
--- 
a/repository/src/test/java/org/apache/atlas/repository/migration/HiveParititionTest.java
+++ 
b/repository/src/test/java/org/apache/atlas/repository/migration/HiveParititionTest.java
@@ -40,7 +40,7 @@ public class HiveParititionTest extends  MigrationBaseAsserts 
{
 
 @Test
 public void fileImporterTest() throws IOException, AtlasBaseException {
-final int EXPECTED_TOTAL_COUNT = 144;
+final int EXPECTED_TOTAL_COUNT = 145;
 final int EXPECTED_DB_COUNT = 1;
 final int EXPECTED_TABLE_COUNT = 2;
 final int EXPECTED_COLUMN_COUNT = 7;
diff --git 
a/repository/src/test/java/org/apache/atlas/repository/migration/HiveStocksTest.java
 
b/repository/src/test/java/org/apache/atlas/repository/migration/HiveStocksTest.java
index 90e714c..283a5c4 100644
--- 
a/repository/src/test/java/org/apache/atlas/repository/migration/HiveStocksTest.java
+++ 
b/repository/src/test/java/org/apache/atlas/repository/migration/HiveStocksTest.java
@@ -38,7 +38,7 @@ public class HiveStocksTest extends MigrationBaseAsserts {
 
 @Test
 public void migrateStocks() throws AtlasBaseException, IOException {
-final int EXPECTED_TOTAL_COUNT  = 191;
+final int EXPECTED_TOTAL_COUNT  = 192;
 final int EXPECTED_DB_COUNT = 1;
 final int EXPECTED_TABLE_COUNT  = 1;
 final int EXPECTED_COLUMN_COUNT = 7;
diff --git 
a/repository/src/test/java/org/apache/atlas/repository/migration/PathTest.java 
b/repository/src/test/java/org/apache/atlas/repository/migration/PathTest.java
index cd01c70..44f59e2 100644
--- 
a/repository/src/test/java/org/apache/atlas/repository/migration/PathTest.java
+++ 
b/repository/src/test/java/org/apache/atlas/repository/migration/PathTest.java
@@ -46,7 +46,7 @@ public class PathTest extends MigrationBaseAsserts {
 
 @Test
 public void migrationImport() throws IOException, AtlasBaseException {
-final int EXPECTED_TOTAL_COUNT = 92;
+final int EXPECTED_TOTAL_COUNT = 93;
 
 runFileImporter("path_db");
 
diff --git 
a/repository/src/test/java/org/apache/atlas/repository/migration/TypesWithClassificationTest.java
 
b/repository/src/test/java/org/apache/atlas/repository/migration/TypesWithClassificationTest.java
index 653144d..9e7e2a6 100644
--- 
a/repository/src/test/java/org/apache/atlas/repository/migration/TypesWithClassificationTest.java
+++ 
b/repository/src/test/java/org/apache/atlas/repository/migration/TypesWithClassificationTest.java
@@ -39,7 +39,7 @@ public class TypesWithClassificationTest extends 
MigrationBaseAsserts {
 
 @Test
 public void verify() throws IOException, AtlasBaseException {
-int EXPECTED_TOTAL_COUNT = 62;
+int EXPECTED_TOTAL_COUNT = 63;
 String ENTITY_TYPE = "ComplexTraitType";
 String LEGACY_TYPE_TRAIT = "legacy_traitprayiv

[atlas] branch master updated: ATLAS-3112: Allow Indexing of array attributes (LIST or SET) in indexing store

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new d234de2  ATLAS-3112: Allow Indexing of array attributes (LIST or SET) 
in indexing store
d234de2 is described below

commit d234de2d7ef4a935db313a852ce80b8aab126c3b
Author: Sarath Subramanian 
AuthorDate: Wed Apr 3 10:11:38 2019 -0700

ATLAS-3112: Allow Indexing of array attributes (LIST or SET) in indexing 
store
---
 .../repository/graphdb/AtlasGraphManagement.java   |  3 +-
 .../graphdb/janus/AtlasJanusGraphManagement.java   |  8 --
 .../graphdb/janus/AbstractGraphDatabaseTest.java   |  2 +-
 .../repository/graph/GraphBackedSearchIndexer.java | 24 
 .../apache/atlas/repository/graph/GraphHelper.java |  4 +--
 .../store/graph/v2/AtlasGraphUtilsV2.java  | 27 ++
 .../store/graph/v2/EntityGraphMapper.java  | 32 --
 .../store/graph/v2/EntityStateChecker.java |  4 +--
 8 files changed, 70 insertions(+), 34 deletions(-)

diff --git 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphManagement.java
 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphManagement.java
index b1e2c5d..cfa1cb4 100644
--- 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphManagement.java
+++ 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphManagement.java
@@ -155,6 +155,7 @@ public interface AtlasGraphManagement {
  *
  * @param vertexIndex
  * @param propertyKey
+ * @param propertyClass
  */
-void addMixedIndex(String vertexIndex, AtlasPropertyKey propertyKey);
+void addMixedIndex(String vertexIndex, AtlasPropertyKey propertyKey, Class 
propertyClass);
 }
diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphManagement.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphManagement.java
index 4e18432..7b034ba 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphManagement.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphManagement.java
@@ -195,11 +195,15 @@ public class AtlasJanusGraphManagement implements 
AtlasGraphManagement {
 }
 
 @Override
-public void addMixedIndex(String indexName, AtlasPropertyKey propertyKey) {
+public void addMixedIndex(String indexName, AtlasPropertyKey propertyKey, 
Class propertyClass) {
 PropertyKey janusKey= 
AtlasJanusObjectFactory.createPropertyKey(propertyKey);
 JanusGraphIndex vertexIndex = management.getGraphIndex(indexName);
 
-management.addIndexKey(vertexIndex, janusKey);
+if (propertyClass == String.class) {
+management.addIndexKey(vertexIndex, janusKey, 
Mapping.STRING.asParameter());
+} else {
+management.addIndexKey(vertexIndex, janusKey);
+}
 }
 
 @Override
diff --git 
a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java
 
b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java
index f72b412..a139d08 100644
--- 
a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java
+++ 
b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java
@@ -99,7 +99,7 @@ public abstract class AbstractGraphDatabaseTest {
 AtlasPropertyKey key = management.makePropertyKey(propertyName, 
propertyClass, cardinality);
 try {
 if (propertyClass != Integer.class) {
-management.addMixedIndex(BACKING_INDEX_NAME, key);
+management.addMixedIndex(BACKING_INDEX_NAME, key, 
propertyClass);
 }
 } catch(Throwable t) {
 //ok
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
 
b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
index c57f8e3..9f75d2a 100755
--- 
a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
@@ -271,12 +271,13 @@ public class GraphBackedSearchIndexer implements 
SearchIndexer, ActiveStateChang
 createVertexIndex(management, VERTEX_ID_IN_IMPORT_KEY, 
UniqueKind.NONE, Long.class, SINGLE, true, false);
 
 createVertexIndex(management, ENTITY_TYPE_PROPERTY_KEY, 
UniqueKind.NONE, String.class, SINGLE, true, false);
-createVertexIndex(management, SUPER_TYPES_PROPERTY_KEY, 
UniqueKind.NONE, String.class, SET, true, false

[atlas] branch master updated: ATLAS-3017: Add Atlas server statistics rest endpoint

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 984445e  ATLAS-3017: Add Atlas server statistics rest endpoint
984445e is described below

commit 984445e9111c743f3f255fc4653fc02555a8f095
Author: nikhilbonte 
AuthorDate: Wed Apr 3 05:31:16 2019 -0700

ATLAS-3017: Add Atlas server statistics rest endpoint

Signed-off-by: Sarath Subramanian 
---
 .../js/templates/common/Statistics_tmpl.html   |  49 +++-
 dashboardv2/public/js/views/common/Statistics.js   |   7 +-
 .../org/apache/atlas/model/AtlasStatistics.java|  78 +++
 .../org/apache/atlas/services/MetricsService.java  |  18 +-
 .../java/org/apache/atlas/util/StatisticsUtil.java | 254 +
 .../notification/NotificationHookConsumer.java |  12 +-
 .../web/service/ActiveInstanceElectorService.java  |   9 +-
 .../NotificationHookConsumerKafkaTest.java |  10 +-
 .../notification/NotificationHookConsumerTest.java |  26 ++-
 .../service/ActiveInstanceElectorServiceTest.java  |  32 +--
 10 files changed, 446 insertions(+), 49 deletions(-)

diff --git a/dashboardv2/public/js/templates/common/Statistics_tmpl.html 
b/dashboardv2/public/js/templates/common/Statistics_tmpl.html
index 13e64a7..71643c7 100644
--- a/dashboardv2/public/js/templates/common/Statistics_tmpl.html
+++ b/dashboardv2/public/js/templates/common/Statistics_tmpl.html
@@ -18,8 +18,8 @@
 
 
 
-  Active Entities (0)
-
+Active Entities (0)
+
 
 
 
@@ -28,10 +28,10 @@
 
 
 
-
-Entity
-Count
-
+
+Entity
+Count
+
 
 
 
@@ -42,8 +42,8 @@
 
 
 
-  Deleted Entities (0)
-
+Deleted Entities (0)
+
 
 
 
@@ -52,10 +52,35 @@
 
 
 
-
-Entity
-Count
-
+
+Entity
+Count
+
+
+
+
+
+
+
+
+
+
+
+
+Server Statistics 
+
+
+
+
+
+
+
+
+
+
+Parameter
+Value
+
 
 
 
diff --git a/dashboardv2/public/js/views/common/Statistics.js 
b/dashboardv2/public/js/views/common/Statistics.js
index fc1596a..009babe 100644
--- a/dashboardv2/public/js/views/common/Statistics.js
+++ b/dashboardv2/public/js/views/common/Statistics.js
@@ -38,7 +38,8 @@ define(['require',
 entityActive: "[data-id='entityActive'] tbody",
 entityDelete: "[data-id='entityDelete'] tbody",
 entityActiveHeader: "[data-id='entityActive'] .count",
-entityDeletedHeader: "[data-id='entityDelete'] .count"
+entityDeletedHeader: "[data-id='entityDelete'] .count",
+stats: "[data-id='stats'] tbody"
 },
 /** ui events hash */
 events: function() {},
@@ -71,7 +72,8 @@ define(['require',
 var data = _.first(data.toJSON()),
 no_records = 'No records found!',
 activeEntityTable = 
_.isEmpty(data.entity.entityActive) ? no_records : that.getTable({ valueObject: 
data.entity.entityActive }),
-deleteEntityTable = 
_.isEmpty(data.entity.entityDeleted) ? no_records : that.getTable({ 
valueObject: data.entity.entityDeleted });
+deleteEntityTable = 
_.isEmpty(data.entity.entityDeleted) ? no_records : that.getTable({ 
valueObject: data.entity.entityDeleted}),
+stats = _.isEmpty(data.general.stats) ? no_records 
: that.getTable({ valueObject: data.general.stats, formatIntVal: false});
 var totalActive = 0,
 totalDeleted = 0;
 if (data.entity && data.general.entityCount) {
@@ -84,6 +86,7 @@ define(['require',
 }

[atlas] branch master updated: ATLAS-3017: Add Atlas server statistics rest endpoint #renaming fields

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new d6fe41d  ATLAS-3017: Add Atlas server statistics rest endpoint 
#renaming fields
d6fe41d is described below

commit d6fe41d4c6e014de1fb1eb7a2a618c0d93be6c48
Author: nikhilbonte 
AuthorDate: Fri Apr 5 11:23:53 2019 -0700

ATLAS-3017: Add Atlas server statistics rest endpoint #renaming fields

Signed-off-by: Sarath Subramanian 
---
 .../org/apache/atlas/model/AtlasStatistics.java| 19 +++--
 .../java/org/apache/atlas/util/StatisticsUtil.java | 32 ++
 2 files changed, 36 insertions(+), 15 deletions(-)

diff --git a/intg/src/main/java/org/apache/atlas/model/AtlasStatistics.java 
b/intg/src/main/java/org/apache/atlas/model/AtlasStatistics.java
index cb43059..0ecbd9a 100644
--- a/intg/src/main/java/org/apache/atlas/model/AtlasStatistics.java
+++ b/intg/src/main/java/org/apache/atlas/model/AtlasStatistics.java
@@ -35,15 +35,16 @@ import static 
com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_
 @JsonSerialize(include = JsonSerialize.Inclusion.ALWAYS)
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class AtlasStatistics {
-public static final String STAT_SERVER_START_TS= 
"serverStartTimeStamp";
-public static final String STAT_SERVER_ACTIVE_TS   = 
"serverActiveTimeStamp";
-public static final String STAT_SERVER_UP_SINCE= 
"serverUpTime";
-public static final String STAT_START_OFFSET   = 
"KafkaTopic:ATLAS_HOOK:startOffset";
-public static final String STAT_CURRENT_OFFSET = 
"KafkaTopic:ATLAS_HOOK:currentOffset";
-public static final String STAT_SOLR_STATUS= 
"solrConnectionStatus";
-public static final String STAT_HBASE_STATUS   = 
"HBaseConnectionStatus";
-public static final String STAT_LAST_MESSAGE_PROCESSED_TIME_TS = 
"lastMessageProcessedTimeStamp";
-public static final String STAT_AVG_MESSAGE_PROCESSING_TIME= 
"avgMessageProcessingTime";
+public static final String STAT_SERVER_START_TS= 
"Server:upFrom";
+public static final String STAT_SERVER_ACTIVE_TS   = 
"Server:activateFrom";
+public static final String STAT_SERVER_UP_SINCE= 
"Server:upTime";
+public static final String STAT_START_OFFSET   = 
"Notification:ATLAS_HOOK:offsetStart";
+public static final String STAT_CURRENT_OFFSET = 
"Notification:ATLAS_HOOK:offsetCurrent";
+public static final String STAT_SOLR_STATUS= 
"ConnectionStatus:Solr";
+public static final String STAT_HBASE_STATUS   = 
"ConnectionStatus:HBase";
+public static final String STAT_LAST_MESSAGE_PROCESSED_TIME_TS = 
"Notification:ATLAS_HOOK:messageLastProcessedAt";
+public static final String STAT_AVG_MESSAGE_PROCESSING_TIME= 
"Notification:ATLAS_HOOK:messageAvgProcessingDuration";
+public static final String STAT_MESSAGES_CONSUMED = 
"Notification:ATLAS_HOOK:messagesConsumed";
 
 private Map data = new HashMap<>();
 
diff --git a/repository/src/main/java/org/apache/atlas/util/StatisticsUtil.java 
b/repository/src/main/java/org/apache/atlas/util/StatisticsUtil.java
index d57f350..efb804b 100644
--- a/repository/src/main/java/org/apache/atlas/util/StatisticsUtil.java
+++ b/repository/src/main/java/org/apache/atlas/util/StatisticsUtil.java
@@ -28,9 +28,11 @@ import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Component;
 
 import javax.inject.Inject;
+import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Locale;
 import java.util.concurrent.*;
 
 import static org.apache.atlas.model.AtlasStatistics.STAT_SERVER_START_TS;
@@ -42,6 +44,7 @@ import static 
org.apache.atlas.model.AtlasStatistics.STAT_SOLR_STATUS;
 import static org.apache.atlas.model.AtlasStatistics.STAT_HBASE_STATUS;
 import static 
org.apache.atlas.model.AtlasStatistics.STAT_LAST_MESSAGE_PROCESSED_TIME_TS;
 import static 
org.apache.atlas.model.AtlasStatistics.STAT_AVG_MESSAGE_PROCESSING_TIME;
+import static org.apache.atlas.model.AtlasStatistics.STAT_MESSAGES_CONSUMED;
 
 @Component
 public class StatisticsUtil {
@@ -61,11 +64,14 @@ public class StatisticsUtil {
 
 private long countMsgProcessed= 0;
 private long totalMsgProcessingTimeMs = 0;
+private Locale locale = new Locale("en", "US");
+private NumberFormat numberFormat;
 
 @Inject
 public Stat

[atlas] branch master updated: ATLAS-3104: Fix stale transaction alerts in atlas logs

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 8dc4041  ATLAS-3104: Fix stale transaction alerts in atlas logs
8dc4041 is described below

commit 8dc4041c69083292d7d5f9996b10f42e33874077
Author: Sarath Subramanian 
AuthorDate: Thu Mar 28 14:00:12 2019 -0700

ATLAS-3104: Fix stale transaction alerts in atlas logs
---
 .../java/org/apache/atlas/repository/graphdb/AtlasGraph.java | 5 +
 .../apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java   | 9 +
 .../apache/atlas/repository/patches/AtlasJavaPatchHandler.java   | 8 
 .../atlas/repository/patches/UniqueAttributePatchHandler.java| 8 ++--
 .../atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java   | 8 
 5 files changed, 28 insertions(+), 10 deletions(-)

diff --git 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java
index 09eab28..d282c99 100644
--- 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java
+++ 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java
@@ -208,6 +208,11 @@ public interface AtlasGraph {
 void clear();
 
 /**
+ * Gets all open transactions.
+ */
+Set getOpenTransactions();
+
+/**
  * Converts the graph to gson and writes it to the specified stream.
  *
  * @param os
diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
index 9328414..8eea96b 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
@@ -60,6 +60,7 @@ import org.janusgraph.core.SchemaViolationException;
 import org.janusgraph.core.schema.JanusGraphIndex;
 import org.janusgraph.core.schema.JanusGraphManagement;
 import org.janusgraph.diskstorage.BackendException;
+import org.janusgraph.graphdb.database.StandardJanusGraph;
 
 import javax.script.Bindings;
 import javax.script.ScriptEngine;
@@ -87,6 +88,7 @@ public class AtlasJanusGraph implements 
AtlasGraph multiProperties  
 = new HashSet<>();
+private final StandardJanusGraph  janusGraph;
 
 public AtlasJanusGraph() {
 //determine multi-properties once at startup
@@ -107,6 +109,8 @@ public class AtlasJanusGraph implements 
AtlasGraph 
patchesRegistry) {
@@ -108,10 +108,10 @@ public abstract class AtlasJavaPatchHandler {
 setEncodedProperty(patchVertex, 
MODIFICATION_TIMESTAMP_PROPERTY_KEY, RequestContext.get().getRequestTime());
 setEncodedProperty(patchVertex, MODIFIED_BY_KEY, getCurrentUser());
 
-graph.commit();
-
 addToPatchesRegistry(getPatchId(), getPatchStatus());
 }
+
+graph.commit();
 }
 
 public PatchStatus getPatchStatus() {
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/patches/UniqueAttributePatchHandler.java
 
b/repository/src/main/java/org/apache/atlas/repository/patches/UniqueAttributePatchHandler.java
index 0c65ef1..0e707a5 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/patches/UniqueAttributePatchHandler.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/patches/UniqueAttributePatchHandler.java
@@ -136,7 +136,6 @@ public class UniqueAttributePatchHandler extends 
AtlasJavaPatchHandler {
 
 private void registerUniqueAttrPropertyKeys(Collection 
attributes) throws IndexException {
 AtlasGraphManagement management = graph.getManagementSystem();
-boolean  idxCreated = false;
 
 for (AtlasAttribute attribute : attributes) {
 String  uniquePropertyName   = 
attribute.getVertexUniquePropertyName();
@@ -150,14 +149,11 @@ public class UniqueAttributePatchHandler extends 
AtlasJavaPatchHandler {
 AtlasCardinality  cardinality= 
indexer.toAtlasCardinality(attributeDef.getCardinality());
 
 indexer.createVertexIndex(management, uniquePropertyName, 
UniqueKind.NONE, propertyClass, cardinality, isIndexable, true);
-
-idxCreated = true;
 }
 }
 
 //Commit indexes
-if (idxCreated) {
-indexer.commit(management);
-}
+indexer.commit(management);
+graph.commit();
 }
 }
\ No newline at end of file
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
index eac2a03..e8d61d1 

[atlas] branch master updated: ATLAS-3031: UI : Allow user to export the lineage in PNG or JPEG format

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 14037ee  ATLAS-3031: UI : Allow user to export the lineage in PNG or 
JPEG format
14037ee is described below

commit 14037eed5c380006b0d622842677e362057a433a
Author: lma 
AuthorDate: Thu Mar 28 16:53:11 2019 -0700

ATLAS-3031: UI : Allow user to export the lineage in PNG or JPEG format

Signed-off-by: Sarath Subramanian 
---
 .../graphdb/janus/AtlasJanusElement.java   |  14 ++-
 .../java/org/apache/atlas/type/AtlasArrayType.java |   8 +-
 .../test/java/org/apache/atlas/TestUtilsV2.java|  37 +++
 .../apache/atlas/repository/graph/GraphHelper.java |   4 -
 .../store/graph/v2/AtlasGraphUtilsV2.java  |   5 +-
 .../store/graph/v2/EntityGraphMapper.java  | 115 -
 .../store/graph/v2/EntityGraphRetriever.java   |  22 ++--
 .../store/graph/v2/AtlasComplexAttributesTest.java |  50 -
 8 files changed, 177 insertions(+), 78 deletions(-)

diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusElement.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusElement.java
index aa92672..a9cc5a6 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusElement.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusElement.java
@@ -109,7 +109,14 @@ public class AtlasJanusElement 
implements AtlasElement {
 @Override
 public void setProperty(String propertyName, Object value) {
 try {
-getWrappedElement().property(propertyName, value);
+if (value == null) {
+Object existingVal = getProperty(propertyName, Object.class);
+if (existingVal != null) {
+removeProperty(propertyName);
+}
+} else {
+getWrappedElement().property(propertyName, value);
+}
 } catch(SchemaViolationException e) {
 throw new AtlasSchemaViolationException(e);
 }
@@ -157,9 +164,6 @@ public class AtlasJanusElement 
implements AtlasElement {
 @Override
 public List getListProperty(String propertyName) {
 List value =  getProperty(propertyName, List.class);
-if (value == null) {
-return Collections.emptyList();
-}
 return value;
 }
 
@@ -200,7 +204,7 @@ public class AtlasJanusElement 
implements AtlasElement {
 
 List value = getListProperty(propertyName);
 
-if (value.isEmpty()) {
+if (value == null || value.isEmpty()) {
 return (List)value;
 }
 
diff --git a/intg/src/main/java/org/apache/atlas/type/AtlasArrayType.java 
b/intg/src/main/java/org/apache/atlas/type/AtlasArrayType.java
index ac1206f..6147eee 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasArrayType.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasArrayType.java
@@ -154,9 +154,9 @@ public class AtlasArrayType extends AtlasType {
 boolean ret = true;
 
 if (val1 == null) {
-ret = isEmptyArrayValue(val2);
+ret = val2 == null;
 } else if (val2 == null) {
-ret = isEmptyArrayValue(val1);
+ret = false;
 } else {
 if (val1.getClass().isArray() && val2.getClass().isArray()) {
 int len = Array.getLength(val1);
@@ -510,9 +510,7 @@ public class AtlasArrayType extends AtlasType {
 }
 
 private boolean isEmptyArrayValue(Object val) {
-if (val == null) {
-return true;
-} else if (val instanceof Collection) {
+if (val instanceof Collection) {
 return ((Collection) val).isEmpty();
 } else if (val.getClass().isArray()) {
 return Array.getLength(val) == 0;
diff --git a/intg/src/test/java/org/apache/atlas/TestUtilsV2.java 
b/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
index 093105b..a109f6a 100755
--- a/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
+++ b/intg/src/test/java/org/apache/atlas/TestUtilsV2.java
@@ -553,6 +553,7 @@ public final class TestUtilsV2 {
 public static final String SERDE_TYPE = "serdeType";
 public static final String COLUMNS_MAP = "columnsMap";
 public static final String COLUMNS_ATTR_NAME = "columns";
+public static final String ENTITY_TYPE_WITH_SIMPLE_ATTR = 
"entity_with_simple_attr";
 public static final String ENTITY_TYPE_WITH_NESTED_COLLECTION_ATTR = 
"entity_with_nested_collection_attr";
 public static final String ENTITY_TYPE_WITH_COMPLEX_COLLECTION_ATTR = 
"entity_with_complex_collection_attr";
 public

[atlas] branch master updated: Revert "ATLAS-3112: Allow Indexing of array attributes (LIST or SET) in indexing store"

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 37eb276  Revert "ATLAS-3112: Allow Indexing of array attributes (LIST 
or SET) in indexing store"
37eb276 is described below

commit 37eb276563fc69ae532acdc63845d20990e2de3f
Author: Sarath Subramanian 
AuthorDate: Sun Apr 7 15:02:33 2019 -0700

Revert "ATLAS-3112: Allow Indexing of array attributes (LIST or SET) in 
indexing store"

This reverts commit d234de2d7ef4a935db313a852ce80b8aab126c3b.
---
 .../repository/graphdb/AtlasGraphManagement.java   |  3 +-
 .../graphdb/janus/AtlasJanusGraphManagement.java   |  8 ++
 .../graphdb/janus/AbstractGraphDatabaseTest.java   |  2 +-
 .../repository/graph/GraphBackedSearchIndexer.java | 24 
 .../apache/atlas/repository/graph/GraphHelper.java |  4 +--
 .../store/graph/v2/AtlasGraphUtilsV2.java  | 27 --
 .../store/graph/v2/EntityGraphMapper.java  | 32 ++
 .../store/graph/v2/EntityStateChecker.java |  4 +--
 8 files changed, 34 insertions(+), 70 deletions(-)

diff --git 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphManagement.java
 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphManagement.java
index cfa1cb4..b1e2c5d 100644
--- 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphManagement.java
+++ 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphManagement.java
@@ -155,7 +155,6 @@ public interface AtlasGraphManagement {
  *
  * @param vertexIndex
  * @param propertyKey
- * @param propertyClass
  */
-void addMixedIndex(String vertexIndex, AtlasPropertyKey propertyKey, Class 
propertyClass);
+void addMixedIndex(String vertexIndex, AtlasPropertyKey propertyKey);
 }
diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphManagement.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphManagement.java
index 7b034ba..4e18432 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphManagement.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraphManagement.java
@@ -195,15 +195,11 @@ public class AtlasJanusGraphManagement implements 
AtlasGraphManagement {
 }
 
 @Override
-public void addMixedIndex(String indexName, AtlasPropertyKey propertyKey, 
Class propertyClass) {
+public void addMixedIndex(String indexName, AtlasPropertyKey propertyKey) {
 PropertyKey janusKey= 
AtlasJanusObjectFactory.createPropertyKey(propertyKey);
 JanusGraphIndex vertexIndex = management.getGraphIndex(indexName);
 
-if (propertyClass == String.class) {
-management.addIndexKey(vertexIndex, janusKey, 
Mapping.STRING.asParameter());
-} else {
-management.addIndexKey(vertexIndex, janusKey);
-}
+management.addIndexKey(vertexIndex, janusKey);
 }
 
 @Override
diff --git 
a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java
 
b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java
index a139d08..f72b412 100644
--- 
a/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java
+++ 
b/graphdb/janus/src/test/java/org/apache/atlas/repository/graphdb/janus/AbstractGraphDatabaseTest.java
@@ -99,7 +99,7 @@ public abstract class AbstractGraphDatabaseTest {
 AtlasPropertyKey key = management.makePropertyKey(propertyName, 
propertyClass, cardinality);
 try {
 if (propertyClass != Integer.class) {
-management.addMixedIndex(BACKING_INDEX_NAME, key, 
propertyClass);
+management.addMixedIndex(BACKING_INDEX_NAME, key);
 }
 } catch(Throwable t) {
 //ok
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
 
b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
index 9f75d2a..c57f8e3 100755
--- 
a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
@@ -271,13 +271,12 @@ public class GraphBackedSearchIndexer implements 
SearchIndexer, ActiveStateChang
 createVertexIndex(management, VERTEX_ID_IN_IMPORT_KEY, 
UniqueKind.NONE, Long.class, SINGLE, true, false);
 
 createVertexIndex(management, ENTITY_TYPE_PROPERTY_KEY, 
UniqueKind.NONE, String.class, SINGLE, true, false);
+createVe

[atlas] branch branch-2.0 created (now 37eb276)

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

sarath pushed a change to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git.


  at 37eb276  Revert "ATLAS-3112: Allow Indexing of array attributes (LIST 
or SET) in indexing store"

No new revisions were added by this update.



[atlas] branch branch-2.0 updated: ATLAS-3091: AtlasGraphProvider Support for Graph with Batch-loading Enable

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

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


The following commit(s) were added to refs/heads/branch-2.0 by this push:
 new 132b9e4  ATLAS-3091: AtlasGraphProvider Support for Graph with 
Batch-loading Enable
132b9e4 is described below

commit 132b9e4072fe68829acbeb77868f91770fe097f9
Author: Ashutosh Mestry 
AuthorDate: Sun Apr 7 23:39:00 2019 -0700

ATLAS-3091: AtlasGraphProvider Support for Graph with Batch-loading Enable

(cherry picked from commit f029a4e024aab36cac60f32c75079357376918ef)
---
 .../atlas/repository/graphdb/GraphDatabase.java|  5 
 .../repository/graphdb/janus/AtlasJanusGraph.java  |  9 +--
 .../graphdb/janus/AtlasJanusGraphDatabase.java |  5 
 .../atlas/repository/graph/AtlasGraphProvider.java | 14 ++
 .../repository/graph/IAtlasGraphProvider.java  |  2 ++
 .../store/graph/v2/BulkLoadingTest.java}   | 30 ++
 6 files changed, 53 insertions(+), 12 deletions(-)

diff --git 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/GraphDatabase.java
 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/GraphDatabase.java
index 3dfc6e8..83f57d1 100644
--- 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/GraphDatabase.java
+++ 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/GraphDatabase.java
@@ -37,6 +37,11 @@ public interface GraphDatabase {
  */
 AtlasGraph getGraph();
 
+/*
+ * Get graph initialized for bulk loading. This instance is used for 
high-performance ingest.
+ */
+AtlasGraph getGraphBulkLoading();
+
 /**
  * Sets things up so that getGraph() will return a graph that can be used 
for running
  * tests.
diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
index 8eea96b..840ebca 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
@@ -78,6 +78,7 @@ import java.util.stream.StreamSupport;
 
 import static 
org.apache.atlas.repository.Constants.INDEX_SEARCH_VERTEX_PREFIX_DEFAULT;
 import static 
org.apache.atlas.repository.Constants.INDEX_SEARCH_VERTEX_PREFIX_PROPERTY;
+import static 
org.apache.atlas.repository.graphdb.janus.AtlasJanusGraphDatabase.getGraphInstance;
 
 /**
  * Janus implementation of AtlasGraph.
@@ -91,11 +92,15 @@ public class AtlasJanusGraph implements 
AtlasGraph keys = 
mgmt.getRelationTypes(PropertyKey.class);
 
@@ -278,7 +283,7 @@ public class AtlasJanusGraph implements 
AtlasGraph getGraphBulkLoading() {
+return new AtlasJanusGraph(getBulkLoadingGraphInstance());
+}
+
 private static void startLocalSolr() {
 if (isEmbeddedSolr()) {
 try {
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java
 
b/repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java
index 5aa8033..dfe4b25 100755
--- 
a/repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/graph/AtlasGraphProvider.java
@@ -72,6 +72,20 @@ public class AtlasGraphProvider implements 
IAtlasGraphProvider {
 }
 }
 
+public AtlasGraph getBulkLoading() {
+try {
+GraphDatabase graphDB = null;
+synchronized (AtlasGraphProvider.class) {
+Class implClass = 
AtlasRepositoryConfiguration.getGraphDatabaseImpl();
+graphDB = (GraphDatabase) implClass.newInstance();
+}
+
+return graphDB.getGraphBulkLoading();
+} catch (IllegalAccessException | InstantiationException e) {
+throw new RuntimeException("Error initializing graph database", e);
+}
+}
+
 @VisibleForTesting
 public static void cleanup() {
 getGraphDatabase().cleanup();
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/IAtlasGraphProvider.java
 
b/repository/src/main/java/org/apache/atlas/repository/graph/IAtlasGraphProvider.java
index a2cac2d..29add20 100755
--- 
a/repository/src/main/java/org/apache/atlas/repository/graph/IAtlasGraphProvider.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/graph/IAtlasGraphProvider.java
@@ -29,4 +29,6 @@ import org.apache.atlas.repository.graphdb.AtlasGraph;
 public interface IAtlasGraphProvider {
 
 AtlasGraph get() throws RepositoryException;
+
+AtlasGraph getBulkLoading() throws RepositoryException;
 }
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/IAtlasGraphProvider.java
 
b/repository/src/test/java/org/apache/atlas/reposi

[atlas] branch master updated: ATLAS-3095: Update QuickStartV2 to use relationships

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 01ea65c  ATLAS-3095: Update QuickStartV2 to use relationships
01ea65c is described below

commit 01ea65c2153c6541f479c6f4f527aa4883e9fbe2
Author: Sarath Subramanian 
AuthorDate: Mon Mar 25 13:54:09 2019 -0700

ATLAS-3095: Update QuickStartV2 to use relationships
---
 .../atlas/model/typedef/AtlasRelationshipDef.java  |   3 +-
 .../java/org/apache/atlas/type/AtlasTypeUtil.java  |  35 ++
 .../store/graph/v2/AtlasGraphUtilsV2.java  |   2 +-
 .../org/apache/atlas/examples/QuickStartV2.java| 472 -
 .../org/apache/atlas/examples/QuickStartV2IT.java  | 119 +++---
 5 files changed, 389 insertions(+), 242 deletions(-)

diff --git 
a/intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java 
b/intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
index e3de460..b9e8af1 100644
--- 
a/intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
+++ 
b/intg/src/main/java/org/apache/atlas/model/typedef/AtlasRelationshipDef.java
@@ -152,13 +152,12 @@ public class AtlasRelationshipDef extends AtlasStructDef 
implements java.io.Seri
  *
  *The ends are defined as 1 and 2 to avoid implying a 
direction. So we do not use to and from.
  *
- * @throws AtlasBaseException
  */
 public AtlasRelationshipDef(String name, String description, String 
typeVersion,
 RelationshipCategory relationshipCategory,
 PropagateTags propagatetags,
 AtlasRelationshipEndDef endDef1,
-AtlasRelationshipEndDef endDef2) throws 
AtlasBaseException {
+AtlasRelationshipEndDef endDef2) {
 this(name, description, typeVersion, 
relationshipCategory,propagatetags, endDef1, endDef2,
  new ArrayList());
 }
diff --git a/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java 
b/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
index 3ba8a12..079a8fc 100644
--- a/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
+++ b/intg/src/main/java/org/apache/atlas/type/AtlasTypeUtil.java
@@ -21,6 +21,7 @@ import org.apache.atlas.model.instance.AtlasClassification;
 import org.apache.atlas.model.instance.AtlasEntity;
 import org.apache.atlas.model.instance.AtlasEntityHeader;
 import org.apache.atlas.model.instance.AtlasObjectId;
+import org.apache.atlas.model.instance.AtlasRelatedObjectId;
 import org.apache.atlas.model.instance.AtlasStruct;
 import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
 import org.apache.atlas.model.typedef.AtlasClassificationDef;
@@ -276,6 +277,10 @@ public class AtlasTypeUtil {
 return new AtlasEntityDef(name, description, version, 
Arrays.asList(attrDefs), superTypes);
 }
 
+public static AtlasEntityDef createClassTypeDef(String name, String 
description, String version, Set superTypes, Map 
options, AtlasAttributeDef... attrDefs) {
+return new AtlasEntityDef(name, description, version, 
Arrays.asList(attrDefs), superTypes, options);
+}
+
 public static AtlasRelationshipDef createRelationshipTypeDef(String
  name,
  String
  description,
  String
  version,
@@ -288,6 +293,10 @@ public class AtlasTypeUtil {
 endDef1, endDef2, 
Arrays.asList(attrDefs));
 }
 
+public static AtlasRelationshipEndDef createRelationshipEndDef(String 
typeName, String name, Cardinality cardinality, boolean isContainer) {
+return new AtlasRelationshipEndDef(typeName, name, cardinality, 
isContainer);
+}
+
 public static AtlasTypesDef getTypesDef(List enums,
 List structs,
 List traits,
@@ -295,6 +304,14 @@ public class AtlasTypeUtil {
 return new AtlasTypesDef(enums, structs, traits, classes);
 }
 
+public static AtlasTypesDef getTypesDef(List enums,
+List structs,
+List 
traits,
+List classes,
+List 
relations) {
+return new AtlasTypesDef(enums, structs, traits, classes, relations);
+}
+
 public static List toTypeDefHeader(AtlasTypesDef 
typesDef) {
 List headerList = new LinkedList<>();
 if (CollectionUtils.isNotEmpty(typesDef.getEnumDefs())) {
@@ -360,6 +377,20 @@ public class AtlasTypeUtil {
 return ret;
 }
 
+public static Collection 
toAtlasRelatedObjectIds(Coll

[atlas] branch branch-1.0 updated: ATLAS-3030: UI : Allow to search the node in the lineage graph

2019-02-25 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

sarath 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 b41788c  ATLAS-3030: UI : Allow to search the node in the lineage graph
b41788c is described below

commit b41788c76a89127b9e8d0665dcf331926da6003a
Author: kevalbhatt 
AuthorDate: Mon Feb 25 11:04:21 2019 -0800

ATLAS-3030: UI : Allow to search the node in the lineage graph

Signed-off-by: Sarath Subramanian 
(cherry picked from commit b9642b62bca574bda897b199c5beb722238f3201)
---
 dashboardv2/public/css/scss/graph.scss |  30 +++
 .../entity-icon/disabled/falcon_feed_creation.png  | Bin 0 -> 6830 bytes
 .../disabled/falcon_feed_replication.png   | Bin 0 -> 6830 bytes
 .../img/entity-icon/disabled/falcon_process.png| Bin 0 -> 6830 bytes
 .../img/entity-icon/falcon_feed_creation.png   | Bin 0 -> 9620 bytes
 .../img/entity-icon/falcon_feed_replication.png| Bin 0 -> 9620 bytes
 .../public/img/entity-icon/falcon_process.png  | Bin 0 -> 9620 bytes
 dashboardv2/public/js/main.js  |   3 +-
 dashboardv2/public/js/router/Router.js |   1 +
 .../js/templates/graph/LineageLayoutView_tmpl.html |  25 ++-
 dashboardv2/public/js/utils/CommonViewFunction.js  |  20 +-
 .../public/js/utils/{Overrides.js => Helper.js}| 202 ++---
 dashboardv2/public/js/utils/Overrides.js   | 182 ---
 dashboardv2/public/js/utils/Utils.js   |   9 -
 dashboardv2/public/js/views/common/Statistics.js   |   8 +-
 .../js/views/detail_page/DetailPageLayoutView.js   |   2 +-
 .../public/js/views/graph/LineageLayoutView.js | 188 +--
 .../public/js/views/search/SearchLayoutView.js |   4 +-
 18 files changed, 231 insertions(+), 443 deletions(-)

diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index 3646261..4a9fd57 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -38,6 +38,12 @@
 stroke: $color_mountain_mist_approx;
 fill: $white;
 stroke-width: 1.5px;
+
+&.serach-rect {
+stroke: $color_keppel_approx;
+fill: transparent;
+stroke-width: 2.5px
+}
 }
 
 .label {
@@ -276,6 +282,7 @@ g.type-TK>rect {
 .lineage-fltr-panel,
 .lineage-search-panel {
 position: absolute;
+top: 45px;
 border: 1px solid #ccc;
 width: 250px;
 max-height: 99%;
@@ -445,6 +452,11 @@ span#zoom_in {
 position: relative;
 width: 100%;
 height: 64vh;
+overflow: hidden !important;
+
+&.auto-height {
+height: auto !important;
+}
 }
 
 .active.fullscreen-mode {
@@ -471,4 +483,22 @@ span#zoom_in {
 .lineage-box {
 padding: 10px !important;
 }
+}
+
+@keyframes zoominoutsinglefeatured {
+0% {
+transform: scale(1, 1);
+}
+
+50% {
+transform: scale(1.2, 1.2);
+}
+
+100% {
+transform: scale(1, 1);
+}
+}
+
+.wobble {
+animation: zoominoutsinglefeatured 1s 5;
 }
\ No newline at end of file
diff --git 
a/dashboardv2/public/img/entity-icon/disabled/falcon_feed_creation.png 
b/dashboardv2/public/img/entity-icon/disabled/falcon_feed_creation.png
new file mode 100644
index 000..b98be6c
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/disabled/falcon_feed_creation.png differ
diff --git 
a/dashboardv2/public/img/entity-icon/disabled/falcon_feed_replication.png 
b/dashboardv2/public/img/entity-icon/disabled/falcon_feed_replication.png
new file mode 100644
index 000..b98be6c
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/disabled/falcon_feed_replication.png differ
diff --git a/dashboardv2/public/img/entity-icon/disabled/falcon_process.png 
b/dashboardv2/public/img/entity-icon/disabled/falcon_process.png
new file mode 100644
index 000..b98be6c
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/disabled/falcon_process.png differ
diff --git a/dashboardv2/public/img/entity-icon/falcon_feed_creation.png 
b/dashboardv2/public/img/entity-icon/falcon_feed_creation.png
new file mode 100644
index 000..ddb3829
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/falcon_feed_creation.png differ
diff --git a/dashboardv2/public/img/entity-icon/falcon_feed_replication.png 
b/dashboardv2/public/img/entity-icon/falcon_feed_replication.png
new file mode 100644
index 000..ddb3829
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/falcon_feed_replication.png differ
diff --git a/dashboardv2/public/img/entity-icon/falcon_process.png 
b/dashboardv2/public/img/entity-icon/falcon_process.png
new file mode 100644
index 000..ddb3829
Binary files /dev/null and 
b/dashboardv2/public/img/entity-ico

[atlas] branch master updated: ATLAS-3030: UI : Allow to search the node in the lineage graph

2019-02-25 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new b9642b6  ATLAS-3030: UI : Allow to search the node in the lineage graph
b9642b6 is described below

commit b9642b62bca574bda897b199c5beb722238f3201
Author: kevalbhatt 
AuthorDate: Mon Feb 25 11:04:21 2019 -0800

ATLAS-3030: UI : Allow to search the node in the lineage graph

Signed-off-by: Sarath Subramanian 
---
 dashboardv2/public/css/scss/graph.scss |  30 +++
 .../entity-icon/disabled/falcon_feed_creation.png  | Bin 0 -> 6830 bytes
 .../disabled/falcon_feed_replication.png   | Bin 0 -> 6830 bytes
 .../img/entity-icon/disabled/falcon_process.png| Bin 0 -> 6830 bytes
 .../img/entity-icon/falcon_feed_creation.png   | Bin 0 -> 9620 bytes
 .../img/entity-icon/falcon_feed_replication.png| Bin 0 -> 9620 bytes
 .../public/img/entity-icon/falcon_process.png  | Bin 0 -> 9620 bytes
 dashboardv2/public/js/main.js  |   3 +-
 dashboardv2/public/js/router/Router.js |   1 +
 .../js/templates/graph/LineageLayoutView_tmpl.html |  25 ++-
 dashboardv2/public/js/utils/CommonViewFunction.js  |  20 +-
 .../public/js/utils/{Overrides.js => Helper.js}| 202 ++---
 dashboardv2/public/js/utils/Overrides.js   | 182 ---
 dashboardv2/public/js/utils/Utils.js   |   9 -
 dashboardv2/public/js/views/common/Statistics.js   |   8 +-
 .../js/views/detail_page/DetailPageLayoutView.js   |   2 +-
 .../public/js/views/graph/LineageLayoutView.js | 188 +--
 .../public/js/views/search/SearchLayoutView.js |   4 +-
 18 files changed, 231 insertions(+), 443 deletions(-)

diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index 3646261..4a9fd57 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -38,6 +38,12 @@
 stroke: $color_mountain_mist_approx;
 fill: $white;
 stroke-width: 1.5px;
+
+&.serach-rect {
+stroke: $color_keppel_approx;
+fill: transparent;
+stroke-width: 2.5px
+}
 }
 
 .label {
@@ -276,6 +282,7 @@ g.type-TK>rect {
 .lineage-fltr-panel,
 .lineage-search-panel {
 position: absolute;
+top: 45px;
 border: 1px solid #ccc;
 width: 250px;
 max-height: 99%;
@@ -445,6 +452,11 @@ span#zoom_in {
 position: relative;
 width: 100%;
 height: 64vh;
+overflow: hidden !important;
+
+&.auto-height {
+height: auto !important;
+}
 }
 
 .active.fullscreen-mode {
@@ -471,4 +483,22 @@ span#zoom_in {
 .lineage-box {
 padding: 10px !important;
 }
+}
+
+@keyframes zoominoutsinglefeatured {
+0% {
+transform: scale(1, 1);
+}
+
+50% {
+transform: scale(1.2, 1.2);
+}
+
+100% {
+transform: scale(1, 1);
+}
+}
+
+.wobble {
+animation: zoominoutsinglefeatured 1s 5;
 }
\ No newline at end of file
diff --git 
a/dashboardv2/public/img/entity-icon/disabled/falcon_feed_creation.png 
b/dashboardv2/public/img/entity-icon/disabled/falcon_feed_creation.png
new file mode 100644
index 000..b98be6c
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/disabled/falcon_feed_creation.png differ
diff --git 
a/dashboardv2/public/img/entity-icon/disabled/falcon_feed_replication.png 
b/dashboardv2/public/img/entity-icon/disabled/falcon_feed_replication.png
new file mode 100644
index 000..b98be6c
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/disabled/falcon_feed_replication.png differ
diff --git a/dashboardv2/public/img/entity-icon/disabled/falcon_process.png 
b/dashboardv2/public/img/entity-icon/disabled/falcon_process.png
new file mode 100644
index 000..b98be6c
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/disabled/falcon_process.png differ
diff --git a/dashboardv2/public/img/entity-icon/falcon_feed_creation.png 
b/dashboardv2/public/img/entity-icon/falcon_feed_creation.png
new file mode 100644
index 000..ddb3829
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/falcon_feed_creation.png differ
diff --git a/dashboardv2/public/img/entity-icon/falcon_feed_replication.png 
b/dashboardv2/public/img/entity-icon/falcon_feed_replication.png
new file mode 100644
index 000..ddb3829
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/falcon_feed_replication.png differ
diff --git a/dashboardv2/public/img/entity-icon/falcon_process.png 
b/dashboardv2/public/img/entity-icon/falcon_process.png
new file mode 100644
index 000..ddb3829
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/falcon_process.png differ
diff --git a/dashboardv2/public/js/main.js b/dashboardv2

[atlas] branch branch-1.0 updated: ATLAS-3062: Add icons for impala process and impala column lineage

2019-02-28 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

sarath 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 bb8cff7  ATLAS-3062: Add icons for impala process and impala column 
lineage
bb8cff7 is described below

commit bb8cff715df660773230733e392c72ad1f568fff
Author: kevalbhatt 
AuthorDate: Thu Feb 28 12:37:05 2019 -0800

ATLAS-3062: Add icons for impala process and impala column lineage

Signed-off-by: Sarath Subramanian 
(cherry picked from commit be84c4d8332e8f779516c61527a6de776a8a6897)
---
 .../disabled/impala_column_lineage_disabled.png  | Bin 0 -> 5630 bytes
 .../img/entity-icon/disabled/impala_process_disabled.png | Bin 0 -> 6214 bytes
 .../public/img/entity-icon/impala_column_lineage.png | Bin 0 -> 7417 bytes
 dashboardv2/public/img/entity-icon/impala_process.png| Bin 0 -> 8176 bytes
 4 files changed, 0 insertions(+), 0 deletions(-)

diff --git 
a/dashboardv2/public/img/entity-icon/disabled/impala_column_lineage_disabled.png
 
b/dashboardv2/public/img/entity-icon/disabled/impala_column_lineage_disabled.png
new file mode 100755
index 000..3b9b8cb
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/disabled/impala_column_lineage_disabled.png
 differ
diff --git 
a/dashboardv2/public/img/entity-icon/disabled/impala_process_disabled.png 
b/dashboardv2/public/img/entity-icon/disabled/impala_process_disabled.png
new file mode 100755
index 000..a207acb
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/disabled/impala_process_disabled.png differ
diff --git a/dashboardv2/public/img/entity-icon/impala_column_lineage.png 
b/dashboardv2/public/img/entity-icon/impala_column_lineage.png
new file mode 100755
index 000..453ac96
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/impala_column_lineage.png differ
diff --git a/dashboardv2/public/img/entity-icon/impala_process.png 
b/dashboardv2/public/img/entity-icon/impala_process.png
new file mode 100755
index 000..c5e17c5
Binary files /dev/null and 
b/dashboardv2/public/img/entity-icon/impala_process.png differ



[atlas] branch master updated: ATLAS-3059: UI : Lineage data structure change to support hide deleted and hide process entities to gather

2019-02-27 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 1cb155a  ATLAS-3059: UI : Lineage data structure change to support 
hide deleted and hide process entities to gather
1cb155a is described below

commit 1cb155a2548f7f415132d229043f9f6bdce755c2
Author: kevalbhatt 
AuthorDate: Wed Feb 27 12:54:42 2019 -0800

ATLAS-3059: UI : Lineage data structure change to support hide deleted and 
hide process entities to gather

Signed-off-by: Sarath Subramanian 
---
 dashboardv2/public/css/scss/graph.scss |  24 +-
 dashboardv2/public/css/scss/relationship.scss  |   4 +-
 .../js/templates/graph/LineageLayoutView_tmpl.html |  39 +-
 .../public/js/views/graph/LineageLayoutView.js | 517 +
 4 files changed, 385 insertions(+), 199 deletions(-)

diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index 4a9fd57..3c4be1e 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -34,6 +34,8 @@
 font-family: $font_1;
 }
 
+transition: opacity 0.3s linear;
+
 rect {
 stroke: $color_mountain_mist_approx;
 fill: $white;
@@ -279,8 +281,7 @@ g.type-TK>rect {
 .zoom-button-group {}
 }
 
-.lineage-fltr-panel,
-.lineage-search-panel {
+.box-panel {
 position: absolute;
 top: 45px;
 border: 1px solid #ccc;
@@ -417,7 +418,8 @@ g.type-TK>rect {
 }
 
 .show-filter-panel,
-.show-search-panel {
+.show-search-panel,
+.show-box-panel {
 right: 0px !important;
 }
 
@@ -501,4 +503,20 @@ span#zoom_in {
 
 .wobble {
 animation: zoominoutsinglefeatured 1s 5;
+}
+
+.hover {
+
+g.node {
+opacity: 0.1 !important;
+}
+
+g.edgePath {
+opacity: 0 !important;
+}
+
+g.node.hover-active,
+g.edgePath.hover-active-node {
+opacity: 1 !important;
+}
 }
\ No newline at end of file
diff --git a/dashboardv2/public/css/scss/relationship.scss 
b/dashboardv2/public/css/scss/relationship.scss
index e41fe58..c1112c5 100644
--- a/dashboardv2/public/css/scss/relationship.scss
+++ b/dashboardv2/public/css/scss/relationship.scss
@@ -16,11 +16,13 @@
  * limitations under the License.
  */
 
-.relationship-box {
+.relationship-box,
+.lineage-box {
 position: absolute;
 height: 100%;
 width: 100%;
 overflow: hidden;
+
 .relatioship-link {
 fill: none;
 stroke-width: 1.5px;
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 3adc8ad..c27ff8c 100644
--- a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
@@ -16,10 +16,10 @@
 -->
 
 
-
+
 
 Filters
-
+
 
 
 
@@ -46,10 +46,10 @@
 
 
 
-
+
 
 Search
-
+
 
 
 
@@ -64,12 +64,39 @@
 
 
 
+
+
+Settings
+
+
+
+
+
+
+
+On hover show current path
+
+
+
+
+
+
+
+Show node details on hover
+
+
+
+
+
 
 
-
+
+
+
+
 
 
-
+
 
 
 
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 5a7262b..e98a6fa 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -49,15 +49,20 @@ define(['require',
 checkHideProcess: "[data-id='checkHideProcess']",
 checkDeletedEntity: "[data-id='checkDeletedEntity']",
 selectDepth: 'select[data-id="selectDepth"]',
-fltrTogler: '[data-id="fltr-togler"]',
-lineageFilterPanel: '.lineage-fltr-panel',
+filterToggler: '[data-id="filter-toggler"]',
+settingToggler: '[data-id="setting-toggler"]',
+searchToggler: '[data-id="search-toggler"]',
+boxClose: '[data-id="box-close"]',
 lineageFullscreenToggler: '[data-id="fullScreen-toggler"]',
-searchTogler: '[data-id="se

[atlas] branch branch-1.0 updated: ATLAS-3059: UI : Lineage data structure change to support hide deleted and hide process entities to gather

2019-02-27 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

sarath 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 b21d218  ATLAS-3059: UI : Lineage data structure change to support 
hide deleted and hide process entities to gather
b21d218 is described below

commit b21d2185cde6ce26ec01d1246c1d3fc5c7cefbd6
Author: kevalbhatt 
AuthorDate: Wed Feb 27 12:54:42 2019 -0800

ATLAS-3059: UI : Lineage data structure change to support hide deleted and 
hide process entities to gather

Signed-off-by: Sarath Subramanian 
(cherry picked from commit 1cb155a2548f7f415132d229043f9f6bdce755c2)
---
 dashboardv2/public/css/scss/graph.scss |  24 +-
 dashboardv2/public/css/scss/relationship.scss  |   4 +-
 .../js/templates/graph/LineageLayoutView_tmpl.html |  39 +-
 .../public/js/views/graph/LineageLayoutView.js | 517 +
 4 files changed, 385 insertions(+), 199 deletions(-)

diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index 4a9fd57..3c4be1e 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -34,6 +34,8 @@
 font-family: $font_1;
 }
 
+transition: opacity 0.3s linear;
+
 rect {
 stroke: $color_mountain_mist_approx;
 fill: $white;
@@ -279,8 +281,7 @@ g.type-TK>rect {
 .zoom-button-group {}
 }
 
-.lineage-fltr-panel,
-.lineage-search-panel {
+.box-panel {
 position: absolute;
 top: 45px;
 border: 1px solid #ccc;
@@ -417,7 +418,8 @@ g.type-TK>rect {
 }
 
 .show-filter-panel,
-.show-search-panel {
+.show-search-panel,
+.show-box-panel {
 right: 0px !important;
 }
 
@@ -501,4 +503,20 @@ span#zoom_in {
 
 .wobble {
 animation: zoominoutsinglefeatured 1s 5;
+}
+
+.hover {
+
+g.node {
+opacity: 0.1 !important;
+}
+
+g.edgePath {
+opacity: 0 !important;
+}
+
+g.node.hover-active,
+g.edgePath.hover-active-node {
+opacity: 1 !important;
+}
 }
\ No newline at end of file
diff --git a/dashboardv2/public/css/scss/relationship.scss 
b/dashboardv2/public/css/scss/relationship.scss
index e41fe58..c1112c5 100644
--- a/dashboardv2/public/css/scss/relationship.scss
+++ b/dashboardv2/public/css/scss/relationship.scss
@@ -16,11 +16,13 @@
  * limitations under the License.
  */
 
-.relationship-box {
+.relationship-box,
+.lineage-box {
 position: absolute;
 height: 100%;
 width: 100%;
 overflow: hidden;
+
 .relatioship-link {
 fill: none;
 stroke-width: 1.5px;
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 3adc8ad..c27ff8c 100644
--- a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
@@ -16,10 +16,10 @@
 -->
 
 
-
+
 
 Filters
-
+
 
 
 
@@ -46,10 +46,10 @@
 
 
 
-
+
 
 Search
-
+
 
 
 
@@ -64,12 +64,39 @@
 
 
 
+
+
+Settings
+
+
+
+
+
+
+
+On hover show current path
+
+
+
+
+
+
+
+Show node details on hover
+
+
+
+
+
 
 
-
+
+
+
+
 
 
-
+
 
 
 
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 5a7262b..e98a6fa 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -49,15 +49,20 @@ define(['require',
 checkHideProcess: "[data-id='checkHideProcess']",
 checkDeletedEntity: "[data-id='checkDeletedEntity']",
 selectDepth: 'select[data-id="selectDepth"]',
-fltrTogler: '[data-id="fltr-togler"]',
-lineageFilterPanel: '.lineage-fltr-panel',
+filterToggler: '[data-id="filter-toggler"]',
+settingToggler: '[data-id="setting-toggler"]',
+searchToggler: '[data-id="search-toggler"]',
+boxClose: '[data-id="box-close"]',
 lineageFullscreenToggler: 

[atlas] branch master updated: ATLAS-3062: UI : Add relationship table inside relationships tab #2 fix date format

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new efb6a36  ATLAS-3062: UI : Add relationship table inside relationships 
tab #2 fix date format
efb6a36 is described below

commit efb6a36563103f6908c0e16c87990412b4d869ac
Author: Sarath Subramanian 
AuthorDate: Mon Mar 4 09:54:13 2019 -0800

ATLAS-3062: UI : Add relationship table inside relationships tab #2 fix 
date format
---
 dashboardv2/public/css/scss/graph.scss |  8 +
 dashboardv2/public/js/utils/CommonViewFunction.js  |  8 -
 .../public/js/views/graph/LineageLayoutView.js | 39 +++---
 3 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index fd2867e..77fc53e 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -411,4 +411,12 @@ span#zoom_in {
 g.edgePath.hover-active-node {
 opacity: 1 !important;
 }
+}
+
+.lineage-node-detail {
+.table-quickMenu {
+td {
+word-break: break-all;
+}
+}
 }
\ No newline at end of file
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js 
b/dashboardv2/public/js/utils/CommonViewFunction.js
index a20635d..f5f4fdc 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -73,6 +73,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Glob
 };
 CommonViewFunction.propertyTable = function(options) {
 var scope = options.scope,
+sortBy = options.sortBy,
 valueObject = options.valueObject,
 extractJSON = options.extractJSON,
 isTable = _.isUndefined(options.isTable) ? true : options.isTable,
@@ -215,7 +216,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Glob
 }
 return subLink;
 }
-_.sortBy(_.keys(valueObject)).map(function(key) {
+var valueObjectKeysList = _.keys(valueObject);
+if (_.isUndefined(sortBy) || sortBy == true) {
+valueObjectKeysList = _.sortBy(valueObjectKeysList);
+}
+valueObjectKeysList.map(function(key) {
+
 key = _.escape(key);
 if (key == "profileData") {
 return;
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index c26928a..790e8cf 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -271,12 +271,13 @@ define(['require',
 },
 getNestedSuperTypes: function(options) {
 var entityDef = options.entityDef;
-return Utils.getNestedSuperTypes({ data: entityDef.toJSON(), 
collection: this.entityDefCollection })
+return Utils.getNestedSuperTypes({ data: entityDef, 
collection: this.entityDefCollection })
 },
 getEntityDef: function(typeName) {
 var entityDef = null;
 if (typeName) {
 entityDef = this.entityDefCollection.fullCollection.find({ 
name: typeName });
+entityDef = entityDef ? entityDef.toJSON() : entityDef;
 }
 return entityDef;
 },
@@ -289,7 +290,7 @@ define(['require',
 serviceType = null;
 if (typeName) {
 if (entityDef) {
-serviceType = entityDef.get("serviceType") || null;
+serviceType = entityDef.serviceType || null;
 }
 }
 return serviceType;
@@ -836,11 +837,39 @@ define(['require',
 },
 updateRelationshipDetails: function(options) {
 var that = this,
-data = that.guidEntityMap[options.guid],
-typeName = data.typeName || options.guid;
+guid = options.guid,
+initialData = that.guidEntityMap[guid],
+typeName = initialData.typeName || guid,
+attributeDefs = that.g._nodes[guid] && 
that.g._nodes[guid].entityDef ? that.g._nodes[guid].entityDef.attributeDefs : 
null;
 this.$("[data-id='typeName']").text(typeName);
 this.entityModel = new VEntity({});
-
this.ui.nodeDetailTable.html(CommonViewFunction.propertyTable({ scope: this, 
valueObject: data, attributeDefs: that.attributeDefs }));
+var config = {
+guid: 'guid',
+typeName: 'typeN

[atlas] branch branch-1.0 updated: ATLAS-3062: UI : Add relationship table inside relationships tab #2 fix date format

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

sarath 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 d53facc  ATLAS-3062: UI : Add relationship table inside relationships 
tab #2 fix date format
d53facc is described below

commit d53facc9105fafe11e633412cba9372711dff030
Author: Sarath Subramanian 
AuthorDate: Mon Mar 4 09:54:13 2019 -0800

ATLAS-3062: UI : Add relationship table inside relationships tab #2 fix 
date format

(cherry picked from commit efb6a36563103f6908c0e16c87990412b4d869ac)
---
 dashboardv2/public/css/scss/graph.scss |  8 +
 dashboardv2/public/js/utils/CommonViewFunction.js  |  8 -
 .../public/js/views/graph/LineageLayoutView.js | 39 +++---
 3 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index fd2867e..77fc53e 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -411,4 +411,12 @@ span#zoom_in {
 g.edgePath.hover-active-node {
 opacity: 1 !important;
 }
+}
+
+.lineage-node-detail {
+.table-quickMenu {
+td {
+word-break: break-all;
+}
+}
 }
\ No newline at end of file
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js 
b/dashboardv2/public/js/utils/CommonViewFunction.js
index 390e523..8532d49 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -73,6 +73,7 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 };
 CommonViewFunction.propertyTable = function(options) {
 var scope = options.scope,
+sortBy = options.sortBy,
 valueObject = options.valueObject,
 extractJSON = options.extractJSON,
 isTable = _.isUndefined(options.isTable) ? true : options.isTable,
@@ -215,7 +216,12 @@ define(['require', 'utils/Utils', 'modules/Modal', 
'utils/Messages', 'utils/Enum
 }
 return subLink;
 }
-_.sortBy(_.keys(valueObject)).map(function(key) {
+var valueObjectKeysList = _.keys(valueObject);
+if (_.isUndefined(sortBy) || sortBy == true) {
+valueObjectKeysList = _.sortBy(valueObjectKeysList);
+}
+valueObjectKeysList.map(function(key) {
+
 key = _.escape(key);
 if (key == "profileData") {
 return;
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index c26928a..790e8cf 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -271,12 +271,13 @@ define(['require',
 },
 getNestedSuperTypes: function(options) {
 var entityDef = options.entityDef;
-return Utils.getNestedSuperTypes({ data: entityDef.toJSON(), 
collection: this.entityDefCollection })
+return Utils.getNestedSuperTypes({ data: entityDef, 
collection: this.entityDefCollection })
 },
 getEntityDef: function(typeName) {
 var entityDef = null;
 if (typeName) {
 entityDef = this.entityDefCollection.fullCollection.find({ 
name: typeName });
+entityDef = entityDef ? entityDef.toJSON() : entityDef;
 }
 return entityDef;
 },
@@ -289,7 +290,7 @@ define(['require',
 serviceType = null;
 if (typeName) {
 if (entityDef) {
-serviceType = entityDef.get("serviceType") || null;
+serviceType = entityDef.serviceType || null;
 }
 }
 return serviceType;
@@ -836,11 +837,39 @@ define(['require',
 },
 updateRelationshipDetails: function(options) {
 var that = this,
-data = that.guidEntityMap[options.guid],
-typeName = data.typeName || options.guid;
+guid = options.guid,
+initialData = that.guidEntityMap[guid],
+typeName = initialData.typeName || guid,
+attributeDefs = that.g._nodes[guid] && 
that.g._nodes[guid].entityDef ? that.g._nodes[guid].entityDef.attributeDefs : 
null;
 this.$("[data-id='typeName']").text(typeName);
 this.entityModel = new VEntity({});
-
this.ui.nodeDetailTable.html(CommonViewFunction.propertyTable({ scope: this, 
valueObject: data, attributeDefs: that.attributeDefs }));
+va

[atlas] branch master updated: ATLAS-3070: Create patch framework to persist typedef patches applied to atlas

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 4925ec3  ATLAS-3070: Create patch framework to persist typedef patches 
applied to atlas
4925ec3 is described below

commit 4925ec35933b8be6a75e758654629f55bb12ee60
Author: Sarath Subramanian 
AuthorDate: Wed Mar 13 01:43:59 2019 -0700

ATLAS-3070: Create patch framework to persist typedef patches applied to 
atlas
---
 .../001-base_model_replication_attributes.json |   2 +
 .../patches/002-base_model_add_service_type.json   |  66 +-
 .../patches/001-hive_column_add_position.json  |   2 +
 .../patches/002-hive_column_table_add_options.json |   4 +
 ...hive_column_update_table_remove_constraint.json |   2 +
 ...04-hbase_table_column_family_add_attribute.json |   4 +
 ...ble_column_family_add_additional_attribute.json |   4 +
 .../patches/006-kafka_topic_add_attribute.json |   2 +
 .../patches/007-hadoop_model_add_service_type.json | 110 +-
 .../patches/008-remove-hive-legacy-attributes.json |  10 +
 .../001-rdbms_column_table_add_options.json|   4 +
 .../patches/002-rdbms_model_add_service_type.json  |  32 ++-
 .../003-remove-rdbms-legacy-attributes.json|  18 ++
 .../patches/001-cloud_model_add_service_type.json  |  22 ++
 .../org/apache/atlas/repository/Constants.java |   9 +
 .../org/apache/atlas/model/patches/AtlasPatch.java | 225 +
 .../java/org/apache/atlas/type/AtlasTypeUtil.java  |   2 +
 .../repository/graph/GraphBackedSearchIndexer.java |   6 +
 .../bootstrap/AtlasTypeDefStoreInitializer.java| 224 
 .../store/graph/v2/AtlasGraphUtilsV2.java  |  98 -
 .../store/graph/v2/AtlasTypeDefGraphStoreV2.java   |   2 +-
 .../apache/atlas/web/resources/AdminResource.java  |  20 +-
 22 files changed, 819 insertions(+), 49 deletions(-)

diff --git 
a/addons/models/-Area0/patches/001-base_model_replication_attributes.json 
b/addons/models/-Area0/patches/001-base_model_replication_attributes.json
index 92c561f..1bedea7 100644
--- 
a/addons/models/-Area0/patches/001-base_model_replication_attributes.json
+++ 
b/addons/models/-Area0/patches/001-base_model_replication_attributes.json
@@ -1,6 +1,8 @@
 {
   "patches": [
 {
+  "id": "TYPEDEF_PATCH__001",
+  "description": "Add 'replicatedFrom' and 'replicatedTo' attributes to 
Referenceable",
   "action": "ADD_ATTRIBUTE",
   "typeName": "Referenceable",
   "applyToVersion": "1.0",
diff --git 
a/addons/models/-Area0/patches/002-base_model_add_service_type.json 
b/addons/models/-Area0/patches/002-base_model_add_service_type.json
index 6d4e80d..13e55fa 100644
--- a/addons/models/-Area0/patches/002-base_model_add_service_type.json
+++ b/addons/models/-Area0/patches/002-base_model_add_service_type.json
@@ -1,13 +1,17 @@
 {
   "patches": [
 {
+  "id":  "TYPEDEF_PATCH__002",
+  "description": "Set serviceType 'atlas_core' to Referenceable",
   "action":  "SET_SERVICE_TYPE",
   "typeName":"Referenceable",
-  "applyToVersion":  "1.0",
-  "updateToVersion": "1.1",
+  "applyToVersion":  "1.1",
+  "updateToVersion": "1.2",
  "serviceType": "atlas_core"
 },
 {
+  "id":  "TYPEDEF_PATCH__003",
+  "description": "Set serviceType 'atlas_core' to __internal",
   "action":  "SET_SERVICE_TYPE",
   "typeName":"__internal",
   "applyToVersion":  "1.0",
@@ -15,6 +19,8 @@
  "serviceType": "atlas_core"
 },
 {
+  "id":  "TYPEDEF_PATCH__004",
+  "description": "Set serviceType 'atlas_core' to Asset",
   "action":  "SET_SERVICE_TYPE",
   "typeName":"Asset",
   "applyToVersion":  "1.1",
@@ -22,6 +28,8 @@
  "serviceType": "atlas_core"
 },
 {
+  "id":  "TYPEDEF_PATCH__005",
+  "description": "Set serviceType 'atlas_core' to DataSet",
   "action":  "SET_SERVICE_TYPE",
   "typeName":"DataSet",
   "applyToVersion":  "1.1",
@@ -29,6 +37,8 @@
  "serv

[atlas] branch master updated: ATLAS-3070: Create patch framework to persist typedef patches applied to atlas #2 fix getPatches() method

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new fa2c3e2  ATLAS-3070: Create patch framework to persist typedef patches 
applied to atlas #2 fix getPatches() method
fa2c3e2 is described below

commit fa2c3e2cc6afc8d06a943a589502d0e1004cdd62
Author: Sarath Subramanian 
AuthorDate: Wed Mar 20 00:38:04 2019 -0700

ATLAS-3070: Create patch framework to persist typedef patches applied to 
atlas #2 fix getPatches() method
---
 .../store/graph/v2/AtlasGraphUtilsV2.java  | 32 ++
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
index 5827dad..2d5fd97 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
@@ -484,23 +484,31 @@ public class AtlasGraphUtilsV2 {
 }
 
 public static AtlasPatches getPatches() {
-List patches= new ArrayList<>();
-String   indexQuery = getIndexSearchPrefix() + 
"\"" + PATCH_ID_PROPERTY_KEY + "\" : (*)";
-Iterator> results= 
AtlasGraphProvider.getGraphInstance().indexQuery(VERTEX_INDEX, 
indexQuery).vertices();
+List ret= new ArrayList<>();
+String   idxQueryString = 
getIndexSearchPrefix() + "\"" + PATCH_ID_PROPERTY_KEY + "\" : (*)";
+AtlasIndexQuery  idxQuery   = 
AtlasGraphProvider.getGraphInstance().indexQuery(VERTEX_INDEX, idxQueryString);
+Iterator> results;
 
-while (results != null && results.hasNext()) {
-AtlasVertex patchVertex = results.next().getVertex();
-AtlasPatch  patch   = toAtlasPatch(patchVertex);
+try {
+results = idxQuery.vertices();
 
-patches.add(patch);
-}
+while (results != null && results.hasNext()) {
+AtlasVertex patchVertex = results.next().getVertex();
+AtlasPatch  patch   = toAtlasPatch(patchVertex);
 
-// Sort the patches based on patch id
-if (CollectionUtils.isNotEmpty(patches)) {
-Collections.sort(patches, (p1, p2) -> 
p1.getId().compareTo(p2.getId()));
+ret.add(patch);
+}
+
+// Sort the patches based on patch id
+if (CollectionUtils.isNotEmpty(ret)) {
+Collections.sort(ret, (p1, p2) -> 
p1.getId().compareTo(p2.getId()));
+}
+} catch (Throwable t) {
+// first time idx query is fired, returns no field exists in solr 
exception
+LOG.warn("getPatches() returned empty result!");
 }
 
-return new AtlasPatches(patches);
+return new AtlasPatches(ret);
 }
 
 private static AtlasPatch toAtlasPatch(AtlasVertex vertex) {



[atlas] branch branch-1.0 updated: ATLAS-3031: UI : Allow user to export the lineage in PNG formatt

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

sarath 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 622d7d3  ATLAS-3031: UI : Allow user to export the lineage in PNG 
formatt
622d7d3 is described below

commit 622d7d32073bbe037da3a38d11da06acfe7503e6
Author: gutkaBinit 
AuthorDate: Wed Mar 20 12:20:44 2019 -0700

ATLAS-3031: UI : Allow user to export the lineage in PNG formatt

Signed-off-by: Sarath Subramanian 
(cherry picked from commit 27916dd49f854678b84bde8023aee6e47cbeb7ce)
---
 dashboardv2/public/css/scss/graph.scss |   4 +
 .../js/templates/graph/LineageLayoutView_tmpl.html |  10 +-
 .../public/js/views/graph/LineageLayoutView.js | 156 +++--
 3 files changed, 157 insertions(+), 13 deletions(-)

diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index b72236a..3073aee 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -421,4 +421,8 @@ span#zoom_in {
 
 word-break: break-all;
 }
+}
+
+.hidden-svg {
+visibility: hidden;
 }
\ No newline at end of file
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 8e10e7f..71edcba 100644
--- a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
@@ -90,6 +90,11 @@
 
 
 
+
+
+
+
+
 
 
 
@@ -127,12 +132,11 @@
 
 
 
-
 
 Current Entity
 Lineage
 Impact
 
-
 http://www.w3.org/2000/svg; xmlns:xlink="http://www.w3.org/1999/xlink; 
version="1.1">
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 790e8cf..de510cb 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -63,7 +63,8 @@ define(['require',
 searchNode: '[data-id="searchNode"]',
 nodeDetailTable: '[data-id="nodeDetailTable"]',
 showOnlyHoverPath: '[data-id="showOnlyHoverPath"]',
-showTooltip: '[data-id="showTooltip"]'
+showTooltip: '[data-id="showTooltip"]',
+saveSvg: '[data-id="saveSvg"]',
 },
 templateHelpers: function() {
 return {
@@ -82,6 +83,7 @@ define(['require',
 events["click " + this.ui.settingToggler] = 
'onClickSettingToggler';
 events["click " + this.ui.lineageFullscreenToggler] = 
'onClickLineageFullscreenToggler';
 events["click " + this.ui.searchToggler] = 
'onClickSearchToggler';
+events["click " + this.ui.saveSvg] = 'onClickSaveSvg';
 return events;
 },
 
@@ -488,7 +490,8 @@ define(['require',
 createGraph: function() {
 var that = this,
 width = this.$('svg').width(),
-height = this.$('svg').height();
+height = this.$('svg').height(),
+imageObject = {};
 this.g.nodes().forEach(function(v) {
 var node = that.g.node(v);
 // Round the corners of the nodes
@@ -500,6 +503,8 @@ define(['require',
 var render = new dagreD3.render();
 // Add our custom arrow (a hollow-point)
 render.arrows().arrowPoint = function normal(parent, id, edge, 
type) {
+var parentNode = parent && parent[0] && parent[0][0] && 
parent[0][0].parentNode ? parent[0][0].parentNode : parent;
+
d3.select(parentNode).select('path.path').attr('marker-end', "url(#" + id + 
")");
 var marker = parent.append("marker")
 .attr("id", id)
 .attr("viewBox", "0 0 10 10")
@@ -536,17 +541,49 @@ define(['require',
 .attr("height", "100%")
 .append('image')
 .attr("xlink:href", function(d) {
+var that = this;
 if (node) {
-return Utils.getEntityIconPath({ entityData: 
node });
+var imageIconPath = Utils.getEntityIco

[atlas] branch master updated: ATLAS-3031: UI : Allow user to export the lineage in PNG formatt

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 27916dd  ATLAS-3031: UI : Allow user to export the lineage in PNG 
formatt
27916dd is described below

commit 27916dd49f854678b84bde8023aee6e47cbeb7ce
Author: gutkaBinit 
AuthorDate: Wed Mar 20 12:20:44 2019 -0700

ATLAS-3031: UI : Allow user to export the lineage in PNG formatt

Signed-off-by: Sarath Subramanian 
---
 dashboardv2/public/css/scss/graph.scss |   4 +
 .../js/templates/graph/LineageLayoutView_tmpl.html |  10 +-
 .../public/js/views/graph/LineageLayoutView.js | 156 +++--
 3 files changed, 157 insertions(+), 13 deletions(-)

diff --git a/dashboardv2/public/css/scss/graph.scss 
b/dashboardv2/public/css/scss/graph.scss
index b72236a..3073aee 100644
--- a/dashboardv2/public/css/scss/graph.scss
+++ b/dashboardv2/public/css/scss/graph.scss
@@ -421,4 +421,8 @@ span#zoom_in {
 
 word-break: break-all;
 }
+}
+
+.hidden-svg {
+visibility: hidden;
 }
\ No newline at end of file
diff --git a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html 
b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
index 8e10e7f..71edcba 100644
--- a/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/graph/LineageLayoutView_tmpl.html
@@ -90,6 +90,11 @@
 
 
 
+
+
+
+
+
 
 
 
@@ -127,12 +132,11 @@
 
 
 
-
 
 Current Entity
 Lineage
 Impact
 
-
 http://www.w3.org/2000/svg; xmlns:xlink="http://www.w3.org/1999/xlink; 
version="1.1">
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js 
b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index 790e8cf..de510cb 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -63,7 +63,8 @@ define(['require',
 searchNode: '[data-id="searchNode"]',
 nodeDetailTable: '[data-id="nodeDetailTable"]',
 showOnlyHoverPath: '[data-id="showOnlyHoverPath"]',
-showTooltip: '[data-id="showTooltip"]'
+showTooltip: '[data-id="showTooltip"]',
+saveSvg: '[data-id="saveSvg"]',
 },
 templateHelpers: function() {
 return {
@@ -82,6 +83,7 @@ define(['require',
 events["click " + this.ui.settingToggler] = 
'onClickSettingToggler';
 events["click " + this.ui.lineageFullscreenToggler] = 
'onClickLineageFullscreenToggler';
 events["click " + this.ui.searchToggler] = 
'onClickSearchToggler';
+events["click " + this.ui.saveSvg] = 'onClickSaveSvg';
 return events;
 },
 
@@ -488,7 +490,8 @@ define(['require',
 createGraph: function() {
 var that = this,
 width = this.$('svg').width(),
-height = this.$('svg').height();
+height = this.$('svg').height(),
+imageObject = {};
 this.g.nodes().forEach(function(v) {
 var node = that.g.node(v);
 // Round the corners of the nodes
@@ -500,6 +503,8 @@ define(['require',
 var render = new dagreD3.render();
 // Add our custom arrow (a hollow-point)
 render.arrows().arrowPoint = function normal(parent, id, edge, 
type) {
+var parentNode = parent && parent[0] && parent[0][0] && 
parent[0][0].parentNode ? parent[0][0].parentNode : parent;
+
d3.select(parentNode).select('path.path').attr('marker-end', "url(#" + id + 
")");
 var marker = parent.append("marker")
 .attr("id", id)
 .attr("viewBox", "0 0 10 10")
@@ -536,17 +541,49 @@ define(['require',
 .attr("height", "100%")
 .append('image')
 .attr("xlink:href", function(d) {
+var that = this;
 if (node) {
-return Utils.getEntityIconPath({ entityData: 
node });
+var imageIconPath = Utils.getEntityIconPath({ 
entityData: node }),
+  

[atlas] branch branch-1.0 updated: ATLAS-3073: Investigate and fix IT failures in EntityJerseyResourceIT

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

sarath 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 24bbbfa  ATLAS-3073: Investigate and fix IT failures in 
EntityJerseyResourceIT
24bbbfa is described below

commit 24bbbfa4efdaa205918b319a7f72a8e19543fe53
Author: Sarath Subramanian 
AuthorDate: Tue Mar 12 11:15:12 2019 -0700

ATLAS-3073: Investigate and fix IT failures in EntityJerseyResourceIT

(cherry picked from commit df44a5cb2a48eae7bdb79d27f45f10aeb8c97d0c)
---
 .../converters/AtlasEntityFormatConverter.java | 45 +++---
 .../store/graph/v2/EntityGraphRetriever.java   | 31 ++-
 2 files changed, 35 insertions(+), 41 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/converters/AtlasEntityFormatConverter.java
 
b/repository/src/main/java/org/apache/atlas/repository/converters/AtlasEntityFormatConverter.java
index 6c82b93..3084e70 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/converters/AtlasEntityFormatConverter.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/converters/AtlasEntityFormatConverter.java
@@ -24,6 +24,7 @@ import org.apache.atlas.model.instance.AtlasClassification;
 import org.apache.atlas.model.instance.AtlasEntity;
 import org.apache.atlas.model.instance.AtlasEntity.Status;
 import org.apache.atlas.model.instance.AtlasObjectId;
+import org.apache.atlas.type.AtlasStructType;
 import org.apache.atlas.v1.model.instance.AtlasSystemAttributes;
 import org.apache.atlas.v1.model.instance.Id;
 import org.apache.atlas.v1.model.instance.Referenceable;
@@ -128,30 +129,12 @@ public class AtlasEntityFormatConverter extends 
AtlasStructFormatConverter {
 throw new 
AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND);
 }
 
-final Map v2Attribs = (Map) 
v2Map.get(ATTRIBUTES_PROPERTY_KEY);
-final Map v2RelationshipAttribs = (Map) 
v2Map.get(RELATIONSHIP_ATTRIBUTES_PROPERTY_KEY);
-final Map attributes;
-
-if (MapUtils.isNotEmpty(v2RelationshipAttribs)) {
-if (MapUtils.isNotEmpty(v2Attribs)) {
-attributes = new HashMap(v2RelationshipAttribs);
-
-for (Object key : v2Attribs.keySet()) {
-if (!attributes.containsKey(key)) {
-attributes.put(key, v2Attribs.get(key));
-}
-}
-} else {
-attributes = v2RelationshipAttribs;
-}
-} else {
-attributes = v2Attribs;
-}
+final Map v2Attribs = (Map) v2Map.get(ATTRIBUTES_PROPERTY_KEY);
 
 if (MapUtils.isEmpty(v2Attribs)) {
 ret = new Id(idStr, 0, typeName);
 } else {
-ret = new Referenceable(idStr, typeName, 
super.fromV2ToV1(entityType, attributes, context));
+ret = new Referenceable(idStr, typeName, 
super.fromV2ToV1(entityType, v2Attribs, context));
 }
 } else if (v2Obj instanceof AtlasEntity) {
 AtlasEntity entity = (AtlasEntity) v2Obj;
@@ -161,28 +144,10 @@ public class AtlasEntityFormatConverter extends 
AtlasStructFormatConverter {
 status = Status.ACTIVE;
 }
 
-final Map v2Attribs = 
entity.getAttributes();
-final Map v2RelationshipAttribs = 
entity.getRelationshipAttributes();
-final Map attributes;
-
-if (MapUtils.isNotEmpty(v2RelationshipAttribs)) {
-if (MapUtils.isNotEmpty(v2Attribs)) {
-attributes = new HashMap(v2RelationshipAttribs);
-
-for (String key : v2Attribs.keySet()) {
-if (!attributes.containsKey(key)) {
-attributes.put(key, v2Attribs.get(key));
-}
-}
-} else {
-attributes = v2RelationshipAttribs;
-}
-} else {
-attributes = v2Attribs;
-}
+final Map v2Attribs = entity.getAttributes();
 
 Referenceable referenceable = new 
Referenceable(entity.getGuid(), entity.getTypeName(), status.name(),
-
fromV2ToV1(entityType, attributes, context),
+
fromV2ToV1(entityType, v2Attribs, context),
 new 
AtlasSystemAttributes

[atlas] branch master updated: ATLAS-3073: Investigate and fix IT failures in atlas-distro module #2

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 3d266b0  ATLAS-3073: Investigate and fix IT failures in atlas-distro 
module #2
3d266b0 is described below

commit 3d266b08c10139652e76daae603c4a44a7b08eeb
Author: Sarath Subramanian 
AuthorDate: Fri Mar 15 19:34:37 2019 -0700

ATLAS-3073: Investigate and fix IT failures in atlas-distro module #2
---
 distro/src/test/python/scripts/TestMetadata.py | 24 
 docs/src/site/twiki/security.twiki |  2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/distro/src/test/python/scripts/TestMetadata.py 
b/distro/src/test/python/scripts/TestMetadata.py
index 31e822f..71d7bd3 100644
--- a/distro/src/test/python/scripts/TestMetadata.py
+++ b/distro/src/test/python/scripts/TestMetadata.py
@@ -92,13 +92,13 @@ class TestMetadata(unittest.TestCase):
  call(['atlas_home\\solr\\bin\\solr.cmd', 'start', '-z', 
'localhost:9838', '-p', '9838'],
   'atlas_home\\logs', False, True),
  call(['atlas_home\\solr\\bin\\solr.cmd', 'create', '-c', 
'vertex_index', '-d',
-   
'atlas_home\\solr\\server\\solr\\configsets\\basic_configs\\conf', '-shards', 
'1',
+   
'atlas_home\\solr\\server\\solr\\configsets\\_default\\conf', '-shards', '1',
'-replicationFactor', '1'], 'atlas_home\\logs', 
False, True),
  call(['atlas_home\\solr\\bin\\solr.cmd', 'create', '-c', 
'edge_index', '-d',
-   
'atlas_home\\solr\\server\\solr\\configsets\\basic_configs\\conf', '-shards', 
'1',
+   
'atlas_home\\solr\\server\\solr\\configsets\\_default\\conf', '-shards', '1',
'-replicationFactor', '1'], 'atlas_home\\logs', 
False, True),
  call(['atlas_home\\solr\\bin\\solr.cmd', 'create', '-c', 
'fulltext_index', '-d',
-   
'atlas_home\\solr\\server\\solr\\configsets\\basic_configs\\conf', '-shards', 
'1',
+   
'atlas_home\\solr\\server\\solr\\configsets\\_default\\conf', '-shards', '1',
'-replicationFactor', '1'], 'atlas_home\\logs', 
False, True)]
 
 runProcess_mock.assert_has_calls(calls)
@@ -109,13 +109,13 @@ class TestMetadata(unittest.TestCase):
 call(['atlas_home/solr/bin/solr', 'start', '-z', 
'localhost:9838', '-p', '9838'], 'atlas_home/logs',
  False, True),
 call(['atlas_home/solr/bin/solr', 'create', '-c', 
'vertex_index', '-d',
-  
'atlas_home/solr/server/solr/configsets/basic_configs/conf', '-shards', '1', 
'-replicationFactor',
+  'atlas_home/solr/server/solr/configsets/_default/conf', 
'-shards', '1', '-replicationFactor',
   '1'], 'atlas_home/logs', False, True),
 call(['atlas_home/solr/bin/solr', 'create', '-c', 
'edge_index', '-d',
-  
'atlas_home/solr/server/solr/configsets/basic_configs/conf', '-shards', '1', 
'-replicationFactor',
+  'atlas_home/solr/server/solr/configsets/_default/conf', 
'-shards', '1', '-replicationFactor',
   '1'], 'atlas_home/logs', False, True),
 call(['atlas_home/solr/bin/solr', 'create', '-c', 
'fulltext_index', '-d',
-  
'atlas_home/solr/server/solr/configsets/basic_configs/conf', '-shards', '1', 
'-replicationFactor',
+  'atlas_home/solr/server/solr/configsets/_default/conf', 
'-shards', '1', '-replicationFactor',
   '1'], 'atlas_home/logs', False, True)]
 
 runProcess_mock.assert_has_calls(calls)
@@ -185,13 +185,13 @@ class TestMetadata(unittest.TestCase):
  call(['atlas_home\\solr\\bin\\solr.cmd', 'start', '-z', 
'localhost:9838', '-p', '9838'],
   'atlas_home\\logs', False, True),
  call(['atlas_home\\solr\\bin\\solr.cmd', 'create', '-c', 
'vertex_index', '-d',
-   
'atlas_home\\solr\\server\\solr\\configsets\\basic_configs\\conf', '-shards', 
'1',
+   
'atlas_home\\solr\\server\\solr\\configsets\\_default\\conf', '-shards', '1',
'-replicationFactor', '1'], 'atlas_home\\logs', 
False, True),
  call(['atlas_home\\solr\\bin\\solr.cmd', 'create', '-c', 
'edge_index', '-d',
-   
'atlas_home\\solr\\server\\solr\\configsets\\basic_configs\\conf', '-shards', 
'1',
+   
'atlas_home\\solr\\server\\solr\\configsets\\_default\\conf', '-shards', '1',
'-replicationFactor', '1

[atlas] branch master updated: ATLAS-3067: Fix intermittent IT failure in HiveHookIT.testAlterTableLocation()

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 67a681f  ATLAS-3067: Fix intermittent IT failure in 
HiveHookIT.testAlterTableLocation()
67a681f is described below

commit 67a681f2b36637ce691f2bec9d4296b674c6c92e
Author: Sarath Subramanian 
AuthorDate: Thu Mar 21 14:47:22 2019 -0700

ATLAS-3067: Fix intermittent IT failure in 
HiveHookIT.testAlterTableLocation()
---
 .../src/test/java/org/apache/atlas/hive/HiveITBase.java  | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git 
a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java 
b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
index ebc5d70..002b908 100644
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
@@ -52,7 +52,6 @@ import org.apache.hadoop.security.UserGroupInformation;
 import org.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 
 import java.io.File;
@@ -60,7 +59,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.Date;
+import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
@@ -71,6 +70,7 @@ import java.util.SortedSet;
 import static org.apache.atlas.hive.bridge.HiveMetaStoreBridge.HDFS_PATH;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 public class HiveITBase {
@@ -287,10 +287,20 @@ public class HiveITBase {
 String testPathNormed = lower(path.toString());
 String hdfsPathId = assertHDFSPathIsRegistered(testPathNormed);
 
-Assert.assertEquals(hdfsPathIds.get(0).getGuid(), hdfsPathId);
+assertHDFSPathIdsContain(hdfsPathIds, hdfsPathId);
 }
 }
 
+private void assertHDFSPathIdsContain(List 
hdfsPathObjectIds, String hdfsPathId) {
+Set hdfsPathGuids = new HashSet<>();
+
+for (AtlasObjectId hdfsPathObjectId : hdfsPathObjectIds) {
+hdfsPathGuids.add(hdfsPathObjectId.getGuid());
+}
+
+assertTrue(hdfsPathGuids.contains(hdfsPathId));
+}
+
 protected String assertHDFSPathIsRegistered(String path) throws Exception {
 LOG.debug("Searching for hdfs path {}", path);
 // ATLAS-2444 HDFS name node federation adds the cluster name to the 
qualifiedName



[atlas] branch branch-1.0 updated: ATLAS-3067: Fix intermittent IT failure in HiveHookIT.testAlterTableLocation()

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

sarath 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 d17713f  ATLAS-3067: Fix intermittent IT failure in 
HiveHookIT.testAlterTableLocation()
d17713f is described below

commit d17713fbf1fc0258dc6f2b9d59981e4999efec59
Author: Sarath Subramanian 
AuthorDate: Thu Mar 21 14:47:22 2019 -0700

ATLAS-3067: Fix intermittent IT failure in 
HiveHookIT.testAlterTableLocation()

(cherry picked from commit 67a681f2b36637ce691f2bec9d4296b674c6c92e)
---
 .../src/test/java/org/apache/atlas/hive/HiveITBase.java  | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git 
a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java 
b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
index 6acf89d..fad24e7 100644
--- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
+++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
@@ -52,7 +52,6 @@ import org.apache.hadoop.security.UserGroupInformation;
 import org.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.testng.Assert;
 import org.testng.annotations.BeforeClass;
 
 import java.io.File;
@@ -60,7 +59,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.Date;
+import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
@@ -71,6 +70,7 @@ import java.util.SortedSet;
 import static org.apache.atlas.hive.bridge.HiveMetaStoreBridge.HDFS_PATH;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.fail;
 
 public class HiveITBase {
@@ -288,10 +288,20 @@ public class HiveITBase {
 String testPathNormed = lower(path.toString());
 String hdfsPathId = assertHDFSPathIsRegistered(testPathNormed);
 
-Assert.assertEquals(hdfsPathIds.get(0).getGuid(), hdfsPathId);
+assertHDFSPathIdsContain(hdfsPathIds, hdfsPathId);
 }
 }
 
+private void assertHDFSPathIdsContain(List 
hdfsPathObjectIds, String hdfsPathId) {
+Set hdfsPathGuids = new HashSet<>();
+
+for (AtlasObjectId hdfsPathObjectId : hdfsPathObjectIds) {
+hdfsPathGuids.add(hdfsPathObjectId.getGuid());
+}
+
+assertTrue(hdfsPathGuids.contains(hdfsPathId));
+}
+
 protected String assertHDFSPathIsRegistered(String path) throws Exception {
 LOG.debug("Searching for hdfs path {}", path);
 // ATLAS-2444 HDFS name node federation adds the cluster name to the 
qualifiedName



[atlas] branch master updated: ATLAS-3067: fix for IT failure in EntityJerseyResourceIT.testCompleteUpdate()

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 2c0a8bc  ATLAS-3067: fix for IT failure in 
EntityJerseyResourceIT.testCompleteUpdate()
2c0a8bc is described below

commit 2c0a8bcc1afe1588a1ffc3ea175bb29055c55894
Author: Sarath Subramanian 
AuthorDate: Wed Mar 20 14:16:04 2019 -0700

ATLAS-3067: fix for IT failure in 
EntityJerseyResourceIT.testCompleteUpdate()
---
 .../web/integration/EntityJerseyResourceIT.java| 25 +++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git 
a/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
 
b/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
index 15a06e3..edb4568 100755
--- 
a/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
+++ 
b/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
@@ -35,6 +35,7 @@ import org.apache.atlas.type.AtlasType;
 import org.apache.atlas.v1.typesystem.types.utils.TypesUtil;
 import org.apache.atlas.utils.AuthenticationUtil;
 import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.StringUtils;
 import org.joda.time.DateTime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -998,8 +999,11 @@ public class EntityJerseyResourceIT extends BaseResourceIT 
{
 List refs = (List) 
hiveTableInstance.get("columns");
 Assert.assertEquals(refs.size(), 2);
 
-Assert.assertEquals(refs.get(0).getValuesMap(), values1);
-Assert.assertEquals(refs.get(1).getValuesMap(), values2);
+Referenceable col3 = getReferenceable(refs, "col3");
+Referenceable col4 = getReferenceable(refs, "col4");
+
+Assert.assertEquals(col3.getValuesMap(), values1);
+Assert.assertEquals(col4.getValuesMap(), values2);
 }
 
 @Test
@@ -1117,4 +1121,19 @@ public class EntityJerseyResourceIT extends 
BaseResourceIT {
 }
 }
 
-}
+private Referenceable getReferenceable(List refs, String 
name) {
+Referenceable ret = null;
+
+for (Referenceable ref : refs) {
+Map values = ref.getValuesMap();
+String  entityName = (String) values.get("name");
+
+if (StringUtils.equalsIgnoreCase(name, entityName)) {
+ret = ref;
+break;
+}
+}
+
+return ret;
+}
+}
\ No newline at end of file



[atlas] branch branch-1.0 updated: ATLAS-3067: fix for IT failure in EntityJerseyResourceIT.testCompleteUpdate()

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

sarath 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 c4ce2b4  ATLAS-3067: fix for IT failure in 
EntityJerseyResourceIT.testCompleteUpdate()
c4ce2b4 is described below

commit c4ce2b4c06e9ae5aae62161828658ce4df6561f8
Author: Sarath Subramanian 
AuthorDate: Wed Mar 20 14:16:04 2019 -0700

ATLAS-3067: fix for IT failure in 
EntityJerseyResourceIT.testCompleteUpdate()

(cherry picked from commit 2c0a8bcc1afe1588a1ffc3ea175bb29055c55894)
---
 .../web/integration/EntityJerseyResourceIT.java| 25 +++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git 
a/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
 
b/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
index 15a06e3..edb4568 100755
--- 
a/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
+++ 
b/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java
@@ -35,6 +35,7 @@ import org.apache.atlas.type.AtlasType;
 import org.apache.atlas.v1.typesystem.types.utils.TypesUtil;
 import org.apache.atlas.utils.AuthenticationUtil;
 import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.StringUtils;
 import org.joda.time.DateTime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -998,8 +999,11 @@ public class EntityJerseyResourceIT extends BaseResourceIT 
{
 List refs = (List) 
hiveTableInstance.get("columns");
 Assert.assertEquals(refs.size(), 2);
 
-Assert.assertEquals(refs.get(0).getValuesMap(), values1);
-Assert.assertEquals(refs.get(1).getValuesMap(), values2);
+Referenceable col3 = getReferenceable(refs, "col3");
+Referenceable col4 = getReferenceable(refs, "col4");
+
+Assert.assertEquals(col3.getValuesMap(), values1);
+Assert.assertEquals(col4.getValuesMap(), values2);
 }
 
 @Test
@@ -1117,4 +1121,19 @@ public class EntityJerseyResourceIT extends 
BaseResourceIT {
 }
 }
 
-}
+private Referenceable getReferenceable(List refs, String 
name) {
+Referenceable ret = null;
+
+for (Referenceable ref : refs) {
+Map values = ref.getValuesMap();
+String  entityName = (String) values.get("name");
+
+if (StringUtils.equalsIgnoreCase(name, entityName)) {
+ret = ref;
+break;
+}
+}
+
+return ret;
+}
+}
\ No newline at end of file



[atlas] branch master updated: ATLAS-3077: Handle java patches in patch framework

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new cd15f76  ATLAS-3077: Handle java patches in patch framework
cd15f76 is described below

commit cd15f768d6c0378925457f4447386a341c84f171
Author: Sarath Subramanian 
AuthorDate: Thu Mar 21 23:39:23 2019 -0700

ATLAS-3077: Handle java patches in patch framework
---
 .../org/apache/atlas/model/patches/AtlasPatch.java |   6 +-
 .../repository/graph/GraphBackedSearchIndexer.java |  14 +-
 .../repository/patches/AtlasJavaPatchHandler.java  | 138 +
 .../atlas/repository/patches/PatchContext.java |  59 
 .../patches/UniqueAttributePatchHandler.java   | 163 +
 .../bootstrap/AtlasTypeDefStoreInitializer.java|  96 
 .../store/graph/v2/AtlasGraphUtilsV2.java  |  66 +
 .../apache/atlas/web/resources/AdminResource.java  |   2 +-
 8 files changed, 475 insertions(+), 69 deletions(-)

diff --git a/intg/src/main/java/org/apache/atlas/model/patches/AtlasPatch.java 
b/intg/src/main/java/org/apache/atlas/model/patches/AtlasPatch.java
index cdf2441..ae0255f 100644
--- a/intg/src/main/java/org/apache/atlas/model/patches/AtlasPatch.java
+++ b/intg/src/main/java/org/apache/atlas/model/patches/AtlasPatch.java
@@ -50,12 +50,12 @@ public class AtlasPatch implements Serializable {
 private longupdatedTime;
 private PatchStatus status;
 
-public enum PatchStatus { APPLIED, SKIPPED, FAILED, UNKNOWN }
+public enum PatchStatus { UNKNOWN, APPLIED, SKIPPED, FAILED }
 
 public AtlasPatch() { }
 
-public AtlasPatch(String id, String patchName, String type, String action, 
PatchStatus status, String updatedBy,
-  String createdBy, long createdTime, long updatedTime) {
+public AtlasPatch(String id, String patchName, String type, String action, 
PatchStatus status,
+  String updatedBy, String createdBy, long createdTime, 
long updatedTime) {
 this.id  = id;
 this.description = patchName;
 this.type= type;
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
 
b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
index 4805435..c57f8e3 100755
--- 
a/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
@@ -108,7 +108,7 @@ public class GraphBackedSearchIndexer implements 
SearchIndexer, ActiveStateChang
 private boolean recomputeIndexedKeys = true;
 private Set vertexIndexKeys  = new HashSet<>();
 
-private enum UniqueKind { NONE, GLOBAL_UNIQUE, PER_TYPE_UNIQUE }
+public enum UniqueKind { NONE, GLOBAL_UNIQUE, PER_TYPE_UNIQUE }
 
 @Inject
 public GraphBackedSearchIndexer(AtlasTypeRegistry typeRegistry) throws 
AtlasException {
@@ -431,7 +431,7 @@ public class GraphBackedSearchIndexer implements 
SearchIndexer, ActiveStateChang
 return type instanceof AtlasRelationshipType;
 }
 
-private Class getPrimitiveClass(String attribTypeName) {
+public Class getPrimitiveClass(String attribTypeName) {
 String attributeTypeName = attribTypeName.toLowerCase();
 
 switch (attributeTypeName) {
@@ -461,7 +461,7 @@ public class GraphBackedSearchIndexer implements 
SearchIndexer, ActiveStateChang
 throw new IllegalArgumentException(String.format("Unknown primitive 
typename %s", attribTypeName));
 }
 
-private AtlasCardinality toAtlasCardinality(AtlasAttributeDef.Cardinality 
cardinality) {
+public AtlasCardinality toAtlasCardinality(AtlasAttributeDef.Cardinality 
cardinality) {
 switch (cardinality) {
 case SINGLE:
 return SINGLE;
@@ -500,8 +500,8 @@ public class GraphBackedSearchIndexer implements 
SearchIndexer, ActiveStateChang
 return propertyKey;
 }
 
-private void createVertexIndex(AtlasGraphManagement management, String 
propertyName, UniqueKind uniqueKind, Class propertyClass,
-   AtlasCardinality cardinality, boolean 
createCompositeIndex, boolean createCompositeIndexWithTypeAndSuperTypes) {
+public void createVertexIndex(AtlasGraphManagement management, String 
propertyName, UniqueKind uniqueKind, Class propertyClass,
+  AtlasCardinality cardinality, boolean 
createCompositeIndex, boolean createCompositeIndexWithTypeAndSuperTypes) {
 if (propertyName != null) {
 AtlasPropertyKey propertyKey = 
management.getPropertyKey(propertyName);
 
@@ -704,7 +704,7 @@ public class GraphBackedSearchIndexer implements 
SearchIndexer, ActiveStateChang

[atlas] branch branch-0.8 updated: ATLAS-3036: Improve FullTextMapper performance during entity retrieval - #3

2019-01-28 Thread sarath
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/branch-0.8 by this push:
 new 2fdbc85  ATLAS-3036: Improve FullTextMapper performance during entity 
retrieval - #3
2fdbc85 is described below

commit 2fdbc851db06f7ebe96cc3fde4d8507d088e7ec6
Author: Sarath Subramanian 
AuthorDate: Mon Jan 28 20:45:00 2019 -0800

ATLAS-3036: Improve FullTextMapper performance during entity retrieval - #3
---
 .../store/graph/v1/EntityGraphRetriever.java   | 47 ++
 1 file changed, 39 insertions(+), 8 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
index 5093714..200f56b 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
@@ -34,6 +34,7 @@ import org.apache.atlas.repository.graphdb.AtlasEdge;
 import org.apache.atlas.repository.graphdb.AtlasEdgeDirection;
 import org.apache.atlas.repository.graphdb.AtlasVertex;
 import org.apache.atlas.type.AtlasArrayType;
+import org.apache.atlas.type.AtlasBuiltInTypes.AtlasObjectIdType;
 import org.apache.atlas.type.AtlasEntityType;
 import org.apache.atlas.type.AtlasMapType;
 import org.apache.atlas.type.AtlasStructType;
@@ -489,19 +490,49 @@ public final class EntityGraphRetriever {
 ret = null;
 }
 break;
-case ARRAY:
-if(attribute.getAttributeDef().isSoftReferenced()) {
-ret = mapVertexToArrayForSoftRef(entityVertex, attribute, 
entityExtInfo, isMinExtInfo);
+case ARRAY: {
+final boolean skipAttribute;
+
+if (!includeReferences) {
+AtlasType elementType = ((AtlasArrayType) 
attrType).getElementType();
+
+skipAttribute = (elementType instanceof AtlasObjectIdType 
|| elementType instanceof AtlasEntityType);
+} else {
+skipAttribute = false;
+}
+
+if (skipAttribute) {
+ret = null;
 } else {
-ret = mapVertexToArray(entityVertex, (AtlasArrayType) 
attrType, qualifiedName, entityExtInfo, isOwnedAttribute, isMinExtInfo, 
includeReferences);
+if (attribute.getAttributeDef().isSoftReferenced()) {
+ret = mapVertexToArrayForSoftRef(entityVertex, 
attribute, entityExtInfo, isMinExtInfo);
+} else {
+ret = mapVertexToArray(entityVertex, (AtlasArrayType) 
attrType, qualifiedName, entityExtInfo, isOwnedAttribute, isMinExtInfo, 
includeReferences);
+}
 }
+}
 break;
-case MAP:
-if(attribute.getAttributeDef().isSoftReferenced()) {
-ret = mapVertexToMapForSoftRef(entityVertex, attribute, 
entityExtInfo, isMinExtInfo);
+case MAP: {
+final boolean skipAttribute;
+
+if (!includeReferences) {
+AtlasType valueType = ((AtlasMapType) 
attrType).getValueType();
+
+skipAttribute = (valueType instanceof AtlasObjectIdType || 
valueType instanceof AtlasEntityType);
+} else {
+skipAttribute = false;
+}
+
+if (skipAttribute) {
+ret = null;
 } else {
-ret = mapVertexToMap(entityVertex, (AtlasMapType) 
attrType, qualifiedName, entityExtInfo, isOwnedAttribute, isMinExtInfo, 
includeReferences);
+if (attribute.getAttributeDef().isSoftReferenced()) {
+ret = mapVertexToMapForSoftRef(entityVertex, 
attribute, entityExtInfo, isMinExtInfo);
+} else {
+ret = mapVertexToMap(entityVertex, (AtlasMapType) 
attrType, qualifiedName, entityExtInfo, isOwnedAttribute, isMinExtInfo, 
includeReferences);
+}
 }
+}
 break;
 case CLASSIFICATION:
 // do nothing



[atlas] branch master updated: ATLAS-2458: RelationshipApi Delete doesnt remove relationshipAttributes from entity

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new fbabb8b  ATLAS-2458: RelationshipApi Delete doesnt remove 
relationshipAttributes from entity
fbabb8b is described below

commit fbabb8ba324e573cdcc5b914b1631417a6256283
Author: Kapildeo Nayak 
AuthorDate: Tue Apr 9 13:39:45 2019 -0700

ATLAS-2458: RelationshipApi Delete doesnt remove relationshipAttributes 
from entity

Signed-off-by: Sarath Subramanian 
---
 .../repository/store/graph/v2/EntityGraphRetriever.java | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java
index 4bfb4ee..764b1e5 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphRetriever.java
@@ -87,6 +87,7 @@ import static 
org.apache.atlas.glossary.GlossaryUtils.TERM_ASSIGNMENT_ATTR_EXPRE
 import static 
org.apache.atlas.glossary.GlossaryUtils.TERM_ASSIGNMENT_ATTR_SOURCE;
 import static 
org.apache.atlas.glossary.GlossaryUtils.TERM_ASSIGNMENT_ATTR_STATUS;
 import static 
org.apache.atlas.glossary.GlossaryUtils.TERM_ASSIGNMENT_ATTR_STEWARD;
+import static org.apache.atlas.model.instance.AtlasRelationship.Status.ACTIVE;
 import static 
org.apache.atlas.model.typedef.AtlasBaseTypeDef.ATLAS_TYPE_BIGDECIMAL;
 import static 
org.apache.atlas.model.typedef.AtlasBaseTypeDef.ATLAS_TYPE_BIGINTEGER;
 import static 
org.apache.atlas.model.typedef.AtlasBaseTypeDef.ATLAS_TYPE_BOOLEAN;
@@ -1088,13 +1089,19 @@ public class EntityGraphRetriever {
 private Object toAtlasObjectId(Object obj) {
 final Object ret;
 
-if (obj instanceof AtlasObjectId) {
-ret = new AtlasObjectId((AtlasObjectId) obj);
+if (obj instanceof AtlasRelatedObjectId) {
+AtlasRelatedObjectId relatedObjId = (AtlasRelatedObjectId) obj;
+
+ret = relatedObjId.getRelationshipStatus() == ACTIVE ? new 
AtlasObjectId((AtlasObjectId) obj) : null;
 } else if (obj instanceof Collection) {
 List list = new ArrayList();
 
 for (Object elem : (Collection) obj) {
-list.add(toAtlasObjectId(elem));
+Object objId = toAtlasObjectId(elem);
+
+if (objId != null) {
+list.add(objId);
+}
 }
 
 ret = list;



[atlas] 01/02: ATLAS-3090: PC Framework: Improve Existing Producer Consumer Framework

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

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

commit e00d2944862622d06e3d637555fa21f24ff2bf14
Author: Ashutosh Mestry 
AuthorDate: Mon Apr 8 13:09:33 2019 -0700

ATLAS-3090: PC Framework: Improve Existing Producer Consumer Framework

Signed-off-by: Sarath Subramanian 
(cherry picked from commit 572c0b80da5a2290b3e1f2614e348b0d1d158990)
---
 .../janus/migration/JsonNodeProcessManager.java|  29 ++--
 .../java/org/apache/atlas/pc/WorkItemConsumer.java |  54 ++--
 .../java/org/apache/atlas/pc/WorkItemManager.java  |  71 +-
 .../org/apache/atlas/pc/WorkItemConsumerTest.java  |   4 +-
 ...t.java => WorkItemConsumerWithResultsTest.java} |  61 +
 .../atlas/pc/WorkItemManagerWithResultsTest.java   | 150 +
 6 files changed, 311 insertions(+), 58 deletions(-)

diff --git 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/JsonNodeProcessManager.java
 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/JsonNodeProcessManager.java
index fb1e684..a0a70ab 100644
--- 
a/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/JsonNodeProcessManager.java
+++ 
b/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/migration/JsonNodeProcessManager.java
@@ -31,6 +31,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.atomic.AtomicLong;
 
 public class JsonNodeProcessManager {
 private static class Consumer extends WorkItemConsumer {
@@ -42,9 +43,9 @@ public class JsonNodeProcessManager {
 protected final Graph  bulkLoadGraph;
 protected final ParseElement   parseElement;
 private   final long   batchSize;
-private long   counter;
+private AtomicLong counter;
 private   final MappedElementCache cache;
-private   final List nodes = new ArrayList<>();
+private   static ThreadLocal> nodes = 
ThreadLocal.withInitial(() -> new ArrayList<>());
 
 public Consumer(BlockingQueue workQueue, Graph graph, Graph 
bulkLoadGraph, ParseElement parseElement, long batchSize) {
 super(workQueue);
@@ -53,7 +54,7 @@ public class JsonNodeProcessManager {
 this.bulkLoadGraph = bulkLoadGraph;
 this.parseElement  = parseElement;
 this.batchSize = batchSize;
-this.counter   = 0;
+this.counter   = new AtomicLong(0);
 this.cache = new MappedElementCache();
 }
 
@@ -63,8 +64,8 @@ public class JsonNodeProcessManager {
 Map result = parseElement.parse(bulkLoadGraph, 
cache, node);
 
 if (result == null) {
-nodes.add(node);
-commitConditionally(counter++);
+addNode(node);
+commitConditionally(counter.getAndIncrement());
 } else {
 commitBulk();
 cache.clearAll();
@@ -77,6 +78,10 @@ public class JsonNodeProcessManager {
 }
 }
 
+private void addNode(JsonNode node) {
+nodes.get().add(node);
+}
+
 @Override
 protected void commitDirty() {
 super.commitDirty();
@@ -89,18 +94,18 @@ public class JsonNodeProcessManager {
 }
 
 private void commitConditionally(long index) {
-if (index % batchSize == 0 && nodes.size() > 0) {
+if (index % batchSize == 0 && nodes.get().size() > 0) {
 commitBulk();
 }
 }
 
 private void commitBulk() {
-commit(bulkLoadGraph, nodes.size());
-nodes.clear();
+commit(bulkLoadGraph, nodes.get().size());
+nodes.get().clear();
 }
 
 private void commitRegular() {
-commit(graph, nodes.size());
+commit(graph, nodes.get().size());
 cache.clearAll();
 }
 
@@ -139,15 +144,15 @@ public class JsonNodeProcessManager {
 }
 
 private void retryBatchCommit() {
-display("Waiting with [{} nodes] for 1 secs.", nodes.size());
+display("Waiting with [{} nodes] for 1 secs.", nodes.get().size());
 
 try {
 Thread.sleep(WAIT_DURATION_AFTER_COMMIT_EXCEPTION);
-for (JsonNode n : nodes) {
+for (JsonNode n : nodes.get()) {
 parseElement.parse(bulkLoadGraph, cache, n);
 }
 commitBulk();
-display("Done!: After re-adding {}.", nodes.size())

[atlas] branch branch-2.0 updated (fe0ee97 -> 39ca642)

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

sarath pushed a change to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git.


from fe0ee97  ATLAS-3127: UI : On Load Graph zoom buttons (+/-) is visible 
on top of relationship Table.
 new e00d294  ATLAS-3090: PC Framework: Improve Existing Producer Consumer 
Framework
 new 39ca642  ATLAS-2458: RelationshipApi Delete doesnt remove 
relationshipAttributes from entity

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../janus/migration/JsonNodeProcessManager.java|  29 ++--
 .../java/org/apache/atlas/pc/WorkItemConsumer.java |  54 ++--
 .../java/org/apache/atlas/pc/WorkItemManager.java  |  71 +-
 .../org/apache/atlas/pc/WorkItemConsumerTest.java  |   4 +-
 ...t.java => WorkItemConsumerWithResultsTest.java} |  61 +
 .../atlas/pc/WorkItemManagerWithResultsTest.java   | 150 +
 .../store/graph/v2/EntityGraphRetriever.java   |  13 +-
 7 files changed, 321 insertions(+), 61 deletions(-)
 copy intg/src/test/java/org/apache/atlas/pc/{WorkItemConsumerTest.java => 
WorkItemConsumerWithResultsTest.java} (53%)
 create mode 100644 
intg/src/test/java/org/apache/atlas/pc/WorkItemManagerWithResultsTest.java



[atlas] branch master updated: ATLAS-3128: UI: Create entity is not working after new relationship attribute introduce

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

sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git


The following commit(s) were added to refs/heads/master by this push:
 new 39b059e  ATLAS-3128: UI: Create entity is not working after new 
relationship attribute introduce
39b059e is described below

commit 39b059e03d3cc728745e7b1c90a7be774ebca0fa
Author: kevalbhatt 
AuthorDate: Wed Apr 10 14:09:53 2019 -0700

ATLAS-3128: UI: Create entity is not working after new relationship 
attribute introduce

Signed-off-by: Sarath Subramanian 
---
 dashboardv2/public/css/scss/form.scss  |  87 +++
 dashboardv2/public/css/scss/override.scss  |   2 +-
 dashboardv2/public/css/scss/theme.scss |  11 +-
 .../entity/CreateEntityLayoutView_tmpl.html|   2 +-
 dashboardv2/public/js/utils/Helper.js  |   3 +
 dashboardv2/public/js/utils/Utils.js   |  79 --
 .../js/views/entity/CreateEntityLayoutView.js  | 272 +
 7 files changed, 385 insertions(+), 71 deletions(-)

diff --git a/dashboardv2/public/css/scss/form.scss 
b/dashboardv2/public/css/scss/form.scss
index b7ade88..3e63e8b 100644
--- a/dashboardv2/public/css/scss/form.scss
+++ b/dashboardv2/public/css/scss/form.scss
@@ -23,10 +23,12 @@
 .control-label-sm {
 padding-top: 3px;
 }
+
 .control-label-sm-pl {
 @extend .control-label-sm;
 padding-left: 10px;
 }
+
 .control-label-sm-pr {
 @extend .control-label-sm;
 padding-right: 10px;
@@ -44,6 +46,7 @@
 &.text-left {
 text-align: left;
 }
+
 &.text-right {
 text-align: right;
 }
@@ -53,6 +56,7 @@
 //Instead of the line below you could use @include 
border-radius($radius, $vertical-radius)
 background-color: $color_mystic_approx;
 border: 1px $color_mystic_approx solid;
+
 &:focus {
 border-color: $color_bali_hai_approx;
 outline: 0; //Instead of the line below you could use @include 
box-shadow($shadow-1, $shadow-2, $shadow-3, $shadow-4, $shadow-5, $shadow-6, 
$shadow-7, $shadow-8, $shadow-9, $shadow-10)
@@ -62,6 +66,7 @@
 }
 
 .form-color {
+
 .form-group span[class^="select2-selection select2-selection--"],
 .form-control {
 background-color: #e8e8e8 !important;
@@ -70,6 +75,7 @@
 
 .sidebar-wrapper {
 z-index: 9 !important;
+
 .form-control {
 background-color: $white;
 border: 1px $white solid;
@@ -83,6 +89,7 @@
 
 textarea {
 resize: none;
+
 &:focus {
 outline: none !important;
 }
@@ -99,6 +106,7 @@ button:focus {
 .btn {
 //Instead of the line below you could use @include border-radius($radius, 
$vertical-radius)
 border-radius: 4px;
+
 &:hover {
 text-decoration: none;
 }
@@ -106,6 +114,7 @@ button:focus {
 
 [class^="col-md-"],
 [class^="col-sm-"] {
+
 .btn.checkbox-inline,
 .btn.radio-inline {
 padding-left: 19px;
@@ -116,6 +125,7 @@ button:focus {
 color: $white;
 background-color: $color_blue_bayoux_approx;
 border-color: $color_blue_bayoux_approx;
+
 &:hover {
 color: $white;
 background-color: $color_pickled_bluewood_approx;
@@ -127,11 +137,13 @@ button:focus {
 color: $white;
 background-color: $color_jungle_green_approx;
 border-color: $color_jungle_green_approx;
+
 &:hover {
 color: $white;
 background-color: $color_jungle_green_approx;
 border-color: $color_jungle_green_approx;
 }
+
 &:focus {
 color: $white;
 background-color: $color_jungle_green_approx;
@@ -143,11 +155,13 @@ button:focus {
 color: $white;
 background-color: $color_picton_blue_approx;
 border-color: $color_picton_blue_approx;
+
 &:hover {
 color: $white;
 background-color: $color_curious_blue_approx;
 border-color: $color_curious_blue_approx;
 }
+
 &:focus {
 color: $white;
 background-color: $color_curious_blue_approx;
@@ -159,11 +173,13 @@ button:focus {
 color: $white;
 background-color: $color_yellow_sea_approx;
 border-color: $color_yellow_sea_approx;
+
 &:hover {
 color: $white;
 background-color: $color_gamboge_approx;
 border-color: $color_gamboge_approx;
 }
+
 &:focus {
 color: $white;
 background-color: $color_gamboge_approx;
@@ -175,11 +191,13 @@ button:focus {
 color: $white;
 background-color: $color_trinidad_approx;
 border-color: $color_trinidad_approx;
+
 &:hover {
 color: $white;
 background-color: $color_grenadier_approx;
 border-color: $color_grenadier_approx;
 }
+
 &:focus {
 color: $white;
 background-color:

[atlas] 01/02: ATLAS-3143: PatchFx: Memory usage and performance improvement.

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

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

commit 8cf09c51e9a8bf4e9077415f0ce21758fc90e5a9
Author: Ashutosh Mestry 
AuthorDate: Wed Apr 17 15:15:37 2019 -0700

ATLAS-3143: PatchFx: Memory usage and performance improvement.

(cherry picked from commit 0bb18f08e6b63ce344d6b01b744d6ce492e16f50)
---
 .../atlas/repository/graphdb/AtlasGraphQuery.java  |  21 ++
 .../tinkerpop/query/NativeTinkerpopGraphQuery.java |  21 ++
 .../tinkerpop/query/TinkerpopGraphQuery.java   |  57 +
 .../graphdb/janus/query/NativeJanusGraphQuery.java |  58 +
 .../java/org/apache/atlas/pc/WorkItemConsumer.java |   4 +-
 .../repository/patches/AtlasPatchHandler.java  |   4 +-
 .../repository/patches/AtlasPatchRegistry.java |  18 +-
 .../repository/patches/UniqueAttributePatch.java   | 270 +
 .../bootstrap/AtlasTypeDefStoreInitializer.java|   5 +-
 .../atlas/patches/AtlasPatchRegistryTest.java  |   3 +-
 10 files changed, 293 insertions(+), 168 deletions(-)

diff --git 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphQuery.java
 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphQuery.java
index 883a31b..1ef4615 100644
--- 
a/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphQuery.java
+++ 
b/graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraphQuery.java
@@ -96,6 +96,27 @@ public interface AtlasGraphQuery {
  */
 Iterable> vertices(int offset, int limit);
 
+/**
+ * Executes the query and returns IDs of matching vertices.
+ * @return
+ */
+Iterable vertexIds();
+
+/**
+ * Executes the query and returns IDs of the matching vertices from given 
offset till the max limit
+ * @param limit max number of vertices
+ * @return
+ */
+Iterable vertexIds(int limit);
+
+/**
+ * Executes the query and returns IDs of the matching vertices from given 
offset till the max limit
+ * @param offset starting offset
+ * @param limit max number of vertices
+ * @return
+ */
+Iterable vertexIds(int offset, int limit);
+
 
 /**
  * Adds a predicate that the returned vertices must have the specified
diff --git 
a/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/tinkerpop/query/NativeTinkerpopGraphQuery.java
 
b/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/tinkerpop/query/NativeTinkerpopGraphQuery.java
index 19ec5e4..27480e6 100644
--- 
a/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/tinkerpop/query/NativeTinkerpopGraphQuery.java
+++ 
b/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/tinkerpop/query/NativeTinkerpopGraphQuery.java
@@ -77,6 +77,27 @@ public interface NativeTinkerpopGraphQuery {
  */
 Iterable> vertices(int offset, int limit);
 
+/**
+ * Executes the graph query.
+ * @return
+ */
+Iterable vertexIds();
+
+/**
+ * Executes graph query
+ * @param limit Max vertices to return
+ * @return
+ */
+Iterable vertexIds(int limit);
+
+/**
+ * Executes graph query
+ * @param offset Starting offset
+ * @param limit Max vertices to return
+ * @return
+ */
+Iterable vertexIds(int offset, int limit);
+
 
 /**
  * Adds an in condition to the query.
diff --git 
a/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/tinkerpop/query/TinkerpopGraphQuery.java
 
b/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/tinkerpop/query/TinkerpopGraphQuery.java
index 5101039..c70e8bf 100644
--- 
a/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/tinkerpop/query/TinkerpopGraphQuery.java
+++ 
b/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/tinkerpop/query/TinkerpopGraphQuery.java
@@ -237,6 +237,63 @@ public abstract class TinkerpopGraphQuery implements 
AtlasGraphQuery
 }
 
 @Override
+public Iterable vertexIds() {
+if (LOG.isDebugEnabled()) {
+LOG.debug("Executing: " + queryCondition);
+}
+
+// Compute the overall result by combining the results of all the 
AndConditions (nested within OR) together.
+Set result = new HashSet<>();
+
+for(AndCondition andExpr : queryCondition.getAndTerms()) {
+NativeTinkerpopGraphQuery andQuery = 
andExpr.create(getQueryFactory());
+for(Object vertexId : andQuery.vertexIds()) {
+result.add(vertexId);
+}
+}
+return result;
+}
+
+@Override
+public Iterable vertexIds(int limit) {
+return vertexIds(0, limit);
+}
+
+@Override
+public Iterable vertexIds(int offset, int limit) {
+if (LOG.isDebugEnabled()) {
+LOG.debug("Ex

[atlas] branch branch-2.0 updated (9350a7d -> 97f6f7c)

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

sarath pushed a change to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git.


from 9350a7d  ATLAS-3132: performance improvements in UniqueAttributesPatch
 new 8cf09c5  ATLAS-3143: PatchFx: Memory usage and performance improvement.
 new 97f6f7c  ATLAS-3148: Implement Hive Metastore hook for Atlas

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/atlas/hive/hook/HiveMetastoreHook.java  | 199 +++
 .../atlas/hive/hook/AtlasHiveHookContext.java  | 134 --
 .../java/org/apache/atlas/hive/hook/HiveHook.java  |  21 +-
 .../atlas/hive/hook/HiveMetastoreHookImpl.java | 193 +++
 .../atlas/hive/hook/HiveOperationContext.java  |  72 ++
 .../atlas/hive/hook/events/AlterDatabase.java  |  34 ++-
 .../apache/atlas/hive/hook/events/AlterTable.java  |   4 +-
 .../atlas/hive/hook/events/AlterTableRename.java   |  52 +++-
 .../hive/hook/events/AlterTableRenameCol.java  |  88 ---
 .../atlas/hive/hook/events/BaseHiveEvent.java  | 127 +++---
 .../atlas/hive/hook/events/CreateDatabase.java |  31 ++-
 .../atlas/hive/hook/events/CreateHiveProcess.java  |  15 +-
 .../apache/atlas/hive/hook/events/CreateTable.java |  83 +--
 .../atlas/hive/hook/events/DropDatabase.java   |  35 ++-
 .../apache/atlas/hive/hook/events/DropTable.java   |  30 ++-
 .../atlas/repository/graphdb/AtlasGraphQuery.java  |  21 ++
 .../tinkerpop/query/NativeTinkerpopGraphQuery.java |  21 ++
 .../tinkerpop/query/TinkerpopGraphQuery.java   |  57 +
 .../graphdb/janus/query/NativeJanusGraphQuery.java |  58 +
 .../java/org/apache/atlas/pc/WorkItemConsumer.java |   4 +-
 .../repository/patches/AtlasPatchHandler.java  |   4 +-
 .../repository/patches/AtlasPatchRegistry.java |  18 +-
 .../repository/patches/UniqueAttributePatch.java   | 270 +
 .../bootstrap/AtlasTypeDefStoreInitializer.java|   5 +-
 .../atlas/patches/AtlasPatchRegistryTest.java  |   3 +-
 25 files changed, 1250 insertions(+), 329 deletions(-)
 create mode 100644 
addons/hive-bridge-shim/src/main/java/org/apache/atlas/hive/hook/HiveMetastoreHook.java
 create mode 100644 
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveMetastoreHookImpl.java
 create mode 100644 
addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/HiveOperationContext.java



<    1   2   3   4   5   6   7   8   >