You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2019/10/09 14:35:42 UTC

[atlas] branch branch-2.0 updated (7c5cc5d -> fbf7b7e)

This is an automated email from the ASF dual-hosted git repository.

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


    from 7c5cc5d  ATLAS-3426: Added Atlas monogram.svg and favicon.ico size increased
     new cc7389f  ATLAS-3441 Add JVM resource metrics for Atlas monitoring
     new 1bd05b3  ATLAS-3449: UI : Beta UI : Invalid Filter validation case for classification
     new fbf7b7e  ATLAS-3448: UI: Regression, Interactive Lineage operations are not working as expected

The 3 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:
 .../public/js/views/graph/LineageLayoutView.js     |   4 +-
 .../public/js/views/graph/LineageLayoutView.js     |   4 +-
 .../js/views/search/SearchDefaultLayoutView.js     | 118 +++++++++------------
 .../org/apache/atlas/services/MetricsService.java  |   8 ++
 .../org/apache/atlas/util/AtlasMetricJVMUtil.java  | 110 +++++++++++++++++++
 5 files changed, 174 insertions(+), 70 deletions(-)
 create mode 100644 repository/src/main/java/org/apache/atlas/util/AtlasMetricJVMUtil.java


[atlas] 02/03: ATLAS-3449: UI : Beta UI : Invalid Filter validation case for classification

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 1bd05b3b112bdec6cb4119d7422fc6bd76015513
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Wed Oct 9 19:46:31 2019 +0530

    ATLAS-3449: UI : Beta UI : Invalid Filter validation case for classification
    
    (cherry picked from commit adfc526e386128dc8f572aae6093720d7954bd31)
---
 .../js/views/search/SearchDefaultLayoutView.js     | 118 +++++++++------------
 1 file changed, 52 insertions(+), 66 deletions(-)

diff --git a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
index ea10738..aa1f777 100644
--- a/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
+++ b/dashboardv3/public/js/views/search/SearchDefaultLayoutView.js
@@ -124,6 +124,8 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
             initialize: function(options) {
                 _.extend(this.options, options);
                 this.hidenFilter = false;
+                this.tagAttributeLength = 0;
+                this.entityAttributeLength = 0;
             },
             bindEvents: function() {},
             onRender: function() {
@@ -138,34 +140,13 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
                 var filters = CommonViewFunction.attributeFilter.extractUrl({ "value": isTag ? this.options.value.tagFilters : this.options.value.entityFilters, "formatDate": true }),
                     rules = filters.rules,
                     filtertype = isTag ? "tagFilters" : "entityFilters",
-                    that = this,
-                    col = [];
+                    that = this;
 
-                function getIdFromRuleObject(rule) {
-                    _.map(rule.rules, function(obj, key) {
-                        if (_.has(obj, "condition")) {
-                            return getIdFromRuleObject(obj);
-                        } else {
-                            return col.push(obj.id);
-                        }
-                    });
-                    return col;
-                }
                 filters.rules = _.filter(rules, function(obj, key) {
                     return obj.id != $(e.currentTarget).data("id");
                 });
                 if (filters) {
-                    var ruleUrl = CommonViewFunction.attributeFilter.generateUrl({ value: filters, formatedDateToLong: true });
-                    that.options.searchTableFilters[filtertype][isTag ? that.options.value.tag : that.options.value.type] = ruleUrl;
-                    //this.makeFilterButtonActive(filtertype);
-                    if (!isTag && that.options.value && that.options.value.type && that.options.searchTableColumns) {
-                        if (!that.options.searchTableColumns[that.options.value.type]) {
-                            that.options.searchTableColumns[that.options.value.type] = ["selected", "name", "owner", "description", "tag", "typeName"];
-                        }
-                        that.options.searchTableColumns[that.options.value.type] = _.sortBy(_.union(that.options.searchTableColumns[that.options.value.type], getIdFromRuleObject(filters)));
-                    }
-                } else {
-
+                    that.updateFilterOptions(filters, filtertype, isTag);
                 }
                 if (filters.rules.length == 0) {
                     if (isTag) {
@@ -262,101 +243,106 @@ define(["require", "backbone", "utils/Globals", "hbs!tmpl/search/SearchDefaultLa
                 if (that.options.value.tag) {
                     this.ui.classificationRegion.show();
                     // this.ui.entityRegion.hide();
-                    var attrObj = that.options.classificationDefCollection.fullCollection.find({ name: that.options.value.tag });
-                    if (attrObj) {
-                        attrObj = Utils.getNestedSuperTypeObj({
-                            data: attrObj.toJSON(),
+                    var attrTagObj = that.options.classificationDefCollection.fullCollection.find({ name: that.options.value.tag });
+                    if (attrTagObj) {
+                        attrTagObj = Utils.getNestedSuperTypeObj({
+                            data: attrTagObj.toJSON(),
                             collection: that.options.classificationDefCollection,
                             attrMerge: true,
                         });
+                        this.tagAttributeLength = attrTagObj.length;
                     }
                     this.renderQueryBuilder(_.extend({}, obj, {
                         tag: true,
                         type: false,
-                        attrObj: attrObj
+                        attrObj: attrTagObj
                     }), this.RQueryBuilderClassification);
                     this.ui.classificationName.html(that.options.value.tag);
                 }
                 if (that.options.value.type) {
                     this.ui.entityRegion.show();
-                    var attrObj = that.options.entityDefCollection.fullCollection.find({ name: that.options.value.type });
-                    if (attrObj) {
-                        attrObj = Utils.getNestedSuperTypeObj({
-                            data: attrObj.toJSON(),
+                    var attrTypeObj = that.options.entityDefCollection.fullCollection.find({ name: that.options.value.type });
+                    if (attrTypeObj) {
+                        attrTypeObj = Utils.getNestedSuperTypeObj({
+                            data: attrTypeObj.toJSON(),
                             collection: that.options.entityDefCollection,
                             attrMerge: true
                         });
+                        this.entityAttributeLength = attrTypeObj.length;
                     }
                     this.renderQueryBuilder(_.extend({}, obj, {
                         tag: false,
                         type: true,
-                        attrObj: attrObj
+                        attrObj: attrTypeObj
                     }), this.RQueryBuilderEntity);
 
                     this.ui.entityName.html(that.options.value.type);
                 }
             },
             okAttrFilterButton: function(e) {
-                // var isTag = this.attrModal.tag ? true : false, 
                 var isTag,
                     filtertype,
                     queryBuilderRef,
-                    col = [],
+                    isFilterValidate = true,
                     that = this;
 
                 if (this.options.value.tag) {
                     isTag = true;
                     filtertype = isTag ? "tagFilters" : "entityFilters";
-                    queryBuilderRef = this.RQueryBuilderClassification.currentView.ui.builder;
-                    searchAttribute();
-
+                    if (this.tagAttributeLength !== 0) {
+                        queryBuilderRef = this.RQueryBuilderClassification.currentView.ui.builder;
+                        searchAttribute();
+                    }
                 }
                 if (this.options.value.type) {
                     isTag = false;
                     filtertype = isTag ? "tagFilters" : "entityFilters";
-                    queryBuilderRef = this.RQueryBuilderEntity.currentView.ui.builder;
-                    searchAttribute();
-
-                }
-
-                function getIdFromRuleObject(rule) {
-                    _.map(rule.rules, function(obj, key) {
-                        if (_.has(obj, "condition")) {
-                            return getIdFromRuleObject(obj);
-                        } else {
-                            return col.push(obj.id);
-                        }
-                    });
-                    return col;
+                    if (this.entityAttributeLength !== 0) {
+                        queryBuilderRef = this.RQueryBuilderEntity.currentView.ui.builder;
+                        searchAttribute();
+                    }
                 }
+                filterPopupStatus();
 
                 function searchAttribute() {
                     if (queryBuilderRef.data("queryBuilder")) {
                         var rule = queryBuilderRef.queryBuilder("getRules");
                     }
-                    if (rule) {
-                        var ruleUrl = CommonViewFunction.attributeFilter.generateUrl({ value: rule, formatedDateToLong: true });
-                        that.options.searchTableFilters[filtertype][isTag ? that.options.value.tag : that.options.value.type] = ruleUrl;
-                        //this.makeFilterButtonActive(filtertype);
-                        if (!isTag && that.options.value && that.options.value.type && that.options.searchTableColumns) {
-                            if (!that.options.searchTableColumns[that.options.value.type]) {
-                                that.options.searchTableColumns[that.options.value.type] = ["selected", "name", "owner", "description", "tag", "typeName"];
-                            }
-                            that.options.searchTableColumns[that.options.value.type] = _.sortBy(_.union(that.options.searchTableColumns[that.options.value.type], getIdFromRuleObject(rule)));
-                        }
+                    rule ? that.updateFilterOptions(rule, filtertype, isTag) : isFilterValidate = false;
+                }
+
+                function filterPopupStatus() {
+                    if (isFilterValidate) {
                         if ($(e.currentTarget).hasClass("search")) {
-                            // this.$('.attribute-filter-container').hide();
-                            // that.$('.fa-chevron-right').toggleClass('fa-chevron-down');
                             that.$('.fa-angle-right').toggleClass('fa-angle-down');
                             that.$('.attribute-filter-container, .attr-filter-overlay').toggleClass('hide');
                             that.searchAttrFilter();
-
                             that.$('.attributeResultContainer').removeClass("overlay");
-                            //console.log('Done')
                         }
                     }
                 }
             },
+            getIdFromRuleObj: function(rule) {
+                var col = []
+                _.map(rule.rules, function(obj, key) {
+                    if (_.has(obj, "condition")) {
+                        return this.getIdFromRuleObj(obj);
+                    } else {
+                        return col.push(obj.id);
+                    }
+                });
+                return col;
+            },
+            updateFilterOptions: function(rule, filtertype, isTag) {
+                var ruleUrl = CommonViewFunction.attributeFilter.generateUrl({ value: rule, formatedDateToLong: true });
+                this.options.searchTableFilters[filtertype][isTag ? this.options.value.tag : this.options.value.type] = ruleUrl;
+                if (!isTag && this.options.value && this.options.value.type && this.options.searchTableColumns) {
+                    if (!this.options.searchTableColumns[this.options.value.type]) {
+                        this.options.searchTableColumns[this.options.value.type] = ["selected", "name", "owner", "description", "tag", "typeName"];
+                    }
+                    this.options.searchTableColumns[this.options.value.type] = _.sortBy(_.union(this.options.searchTableColumns[this.options.value.type], this.getIdFromRuleObj(rule)));
+                }
+            },
             renderQueryBuilder: function(obj, rQueryBuilder) {
                 var that = this;
                 require(['views/search/QueryBuilderView'], function(QueryBuilderView) {


[atlas] 01/03: ATLAS-3441 Add JVM resource metrics for Atlas monitoring

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit cc7389f861be03a0992d93d57bc7780eada64e4f
Author: nikhilbonte <ni...@freestoneinfotech.com>
AuthorDate: Fri Oct 4 18:16:18 2019 +0530

    ATLAS-3441 Add JVM resource metrics for Atlas monitoring
    
    Signed-off-by: kevalbhatt <kb...@apache.org>
    (cherry picked from commit 5dffddd005827137e35b72d837fdd51cd1ce4d5b)
---
 .../org/apache/atlas/services/MetricsService.java  |   8 ++
 .../org/apache/atlas/util/AtlasMetricJVMUtil.java  | 110 +++++++++++++++++++++
 2 files changed, 118 insertions(+)

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 2a65b55..d566f73 100644
--- a/repository/src/main/java/org/apache/atlas/services/MetricsService.java
+++ b/repository/src/main/java/org/apache/atlas/services/MetricsService.java
@@ -27,6 +27,7 @@ import org.apache.atlas.repository.graphdb.AtlasVertex;
 import org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2;
 import org.apache.atlas.type.AtlasTypeRegistry;
 import org.apache.atlas.util.AtlasMetricsUtil;
+import org.apache.atlas.util.AtlasMetricJVMUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -50,6 +51,7 @@ public class MetricsService {
     public static final String ENTITY  = "entity";
     public static final String TAG     = "tag";
     public static final String GENERAL = "general";
+    public static final String SYSTEM  = "system";
 
     // Query names
     protected static final String METRIC_COLLECTION_TIME   = "collectionTime";
@@ -62,6 +64,9 @@ public class MetricsService {
     protected static final String METRIC_ENTITY_SHELL      = ENTITY + "Shell";
     protected static final String METRIC_TAG_COUNT         = TAG + "Count";
     protected static final String METRIC_ENTITIES_PER_TAG  = TAG + "Entities";
+    protected static final String METRIC_RUNTIME           = "runtime";
+    protected static final String METRIC_MEMORY            = "memory";
+    protected static final String METRIC_OS                = "os";
 
     private final AtlasGraph        atlasGraph;
     private final AtlasTypeRegistry typeRegistry;
@@ -131,6 +136,9 @@ public class MetricsService {
         metrics.addMetric(ENTITY, METRIC_ENTITY_SHELL, getShellEntityCount());
 
         metrics.addMetric(TAG, METRIC_ENTITIES_PER_TAG, taggedEntityCount);
+        metrics.addMetric(SYSTEM, METRIC_MEMORY, AtlasMetricJVMUtil.getMemoryDetails());
+        metrics.addMetric(SYSTEM, METRIC_OS, AtlasMetricJVMUtil.getSystemInfo());
+        metrics.addMetric(SYSTEM, METRIC_RUNTIME, AtlasMetricJVMUtil.getRuntimeInfo());
 
         return metrics;
     }
diff --git a/repository/src/main/java/org/apache/atlas/util/AtlasMetricJVMUtil.java b/repository/src/main/java/org/apache/atlas/util/AtlasMetricJVMUtil.java
new file mode 100644
index 0000000..f1becf8
--- /dev/null
+++ b/repository/src/main/java/org/apache/atlas/util/AtlasMetricJVMUtil.java
@@ -0,0 +1,110 @@
+/*
+ * 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 distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.atlas.util;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.management.ManagementFactory;
+import java.lang.management.MemoryMXBean;
+import java.lang.management.MemoryPoolMXBean;
+import java.lang.management.MemoryType;
+import java.lang.management.MemoryUsage;
+import java.lang.management.OperatingSystemMXBean;
+import java.lang.management.RuntimeMXBean;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Objects;
+
+public class AtlasMetricJVMUtil {
+    private static final Logger LOG = LoggerFactory.getLogger(AtlasMetricJVMUtil.class);
+
+    private static final RuntimeMXBean RUNTIME;
+    private static final OperatingSystemMXBean OS;
+    private static final MemoryMXBean memBean;
+
+    static {
+        RUNTIME = ManagementFactory.getRuntimeMXBean();
+        OS = ManagementFactory.getOperatingSystemMXBean();
+        memBean = ManagementFactory.getMemoryMXBean();
+    }
+
+    /**
+     * Collect general runtime information.
+     */
+    public static Map<String, Object> getRuntimeInfo() {
+        Map<String, Object> vmDetails = new LinkedHashMap<>();
+        vmDetails.put("name", RUNTIME.getVmName());
+        vmDetails.put("version", RUNTIME.getSystemProperties().get("java.version"));
+        return vmDetails;
+    }
+
+    /**
+     * Add memory details
+     */
+    public static Map<String, Object> getMemoryDetails() {
+        Map<String, Object> memory = new LinkedHashMap<>();
+        heapDetails(memory);
+        pooldivision(memory);
+        return memory;
+    }
+
+    /**
+     * Collect system information.
+     */
+    public static Map<String, Object> getSystemInfo() {
+        Map<String, Object> values = new LinkedHashMap<>();
+        String[] osInfo = {OS.getName(), OS.getArch(), OS.getVersion()};
+        values.put("os.spec", String.join(", ", osInfo));
+        values.put("os.vcpus", String.valueOf(OS.getAvailableProcessors()));
+        return values;
+    }
+
+    /**
+     * collect the pool division of java
+     */
+    private static void pooldivision(Map<String, Object> memory) {
+        Map<String, Object> poolDivisionValues = new LinkedHashMap<>();
+        for (MemoryPoolMXBean mpBean : ManagementFactory.getMemoryPoolMXBeans()) {
+            if (mpBean.getType() == MemoryType.HEAP) {
+                poolDivisionValues.put(mpBean.getName(), mpBean.getUsage());
+            }
+        }
+        memory.put("memory_pool_usages", poolDivisionValues);
+    }
+
+    /**
+     * Collect java heap details
+     */
+    private static void heapDetails(Map<String, Object> memory) {
+        MemoryUsage memHeapUsage = memBean.getHeapMemoryUsage();
+        MemoryUsage nonHeapUsage = memBean.getNonHeapMemoryUsage();
+        memory.put("heapInit", String.valueOf(memHeapUsage.getInit()));
+        memory.put("heapMax", String.valueOf(memHeapUsage.getMax()));
+        memory.put("heapCommitted", String.valueOf(memHeapUsage.getCommitted()));
+        memory.put("heapUsed", String.valueOf(memHeapUsage.getUsed()));
+        memory.put("nonHeapInit", String.valueOf(nonHeapUsage.getInit()));
+        memory.put("nonHeapMax", String.valueOf(nonHeapUsage.getMax()));
+        memory.put("nonHeapCommitted", String.valueOf(nonHeapUsage.getCommitted()));
+        memory.put("nonHeapUsed", String.valueOf(nonHeapUsage.getUsed()));
+    }
+}
\ No newline at end of file


[atlas] 03/03: ATLAS-3448: UI: Regression, Interactive Lineage operations are not working as expected

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fbf7b7e155965647c2682d74f7bc2f235e231ab0
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Wed Oct 9 19:53:44 2019 +0530

    ATLAS-3448: UI: Regression, Interactive Lineage operations are not working as expected
    
    (cherry picked from commit 7ba3213eca2ad9be9dde97502c2d56896870d9d6)
---
 dashboardv2/public/js/views/graph/LineageLayoutView.js | 4 ++--
 dashboardv3/public/js/views/graph/LineageLayoutView.js | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dashboardv2/public/js/views/graph/LineageLayoutView.js b/dashboardv2/public/js/views/graph/LineageLayoutView.js
index e7b5a27..f6a8d00 100644
--- a/dashboardv2/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv2/public/js/views/graph/LineageLayoutView.js
@@ -561,9 +561,9 @@ define(['require',
                         shapeSvg.attr("stroke", "#fb4200")
                     }
                     if (node.isIncomplete === true) {
-                        parent.attr("class", "isIncomplete show");
+                        parent.attr("class", "node isIncomplete show");
                     } else {
-                        parent.attr("class", "isIncomplete");
+                        parent.attr("class", "node isIncomplete");
                     }
 
                     parent.insert("defs")
diff --git a/dashboardv3/public/js/views/graph/LineageLayoutView.js b/dashboardv3/public/js/views/graph/LineageLayoutView.js
index 8dfdfc5..2dbe01f 100644
--- a/dashboardv3/public/js/views/graph/LineageLayoutView.js
+++ b/dashboardv3/public/js/views/graph/LineageLayoutView.js
@@ -576,9 +576,9 @@ define(['require',
                         shapeSvg.attr("stroke", "#fb4200")
                     }
                     if (node.isIncomplete === true) {
-                        parent.attr("class", "isIncomplete show");
+                        parent.attr("class", "node isIncomplete show");
                     } else {
-                        parent.attr("class", "isIncomplete");
+                        parent.attr("class", "node isIncomplete");
                     }
 
                     parent.insert("defs")