You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sh...@apache.org on 2016/07/13 10:36:35 UTC

[1/2] incubator-atlas git commit: ATLAS-847 UI: Audit versioning does not paginate details from Atlas server (Kalyanikashikar via shwethags)

Repository: incubator-atlas
Updated Branches:
  refs/heads/master 079ce35ef -> 99d514367


ATLAS-847 UI: Audit versioning does not paginate details from Atlas server (Kalyanikashikar via shwethags)


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

Branch: refs/heads/master
Commit: fa9fbbd7c74c2ff9e1e897258f6a102755ad4b4f
Parents: 079ce35
Author: Shwetha GS <ss...@hortonworks.com>
Authored: Wed Jul 13 15:23:09 2016 +0530
Committer: Shwetha GS <ss...@hortonworks.com>
Committed: Wed Jul 13 15:23:09 2016 +0530

----------------------------------------------------------------------
 dashboardv2/public/css/scss/override.scss       | 21 +++++
 dashboardv2/public/css/scss/tag.scss            | 15 ++-
 .../audit/AuditTableLayoutView_tmpl.html        | 17 +++-
 .../schema/SchemaTableLayoutView_tmpl.html      |  2 +-
 .../js/templates/tag/addTagModalView_tmpl.html  | 23 ++---
 .../public/js/utils/CommonViewFunction.js       |  4 +-
 .../js/views/audit/AuditTableLayoutView.js      | 99 +++++++++++++++++---
 .../public/js/views/tag/addTagModalView.js      |  5 +-
 release-log.txt                                 |  1 +
 9 files changed, 147 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/css/scss/override.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/override.scss b/dashboardv2/public/css/scss/override.scss
index 743728a..8732423 100644
--- a/dashboardv2/public/css/scss/override.scss
+++ b/dashboardv2/public/css/scss/override.scss
@@ -148,3 +148,24 @@
     -o-transition: ease-in .1s ease-out;
     transition: ease-in .1s ease-out;
 }
+
+.pager {
+    margin: 0px;
+    li {
+        >button {
+            display: inline-block;
+            padding: 5px 14px;
+            background-color: #fff;
+            border: 1px solid #ddd;
+            border-radius: 15px;
+            color: $color_jungle_green_approx;
+        }
+        >button,
+        >span {
+            &:hover {
+                background-color: $color_jungle_green_approx;
+                color: $white;
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/css/scss/tag.scss
----------------------------------------------------------------------
diff --git a/dashboardv2/public/css/scss/tag.scss b/dashboardv2/public/css/scss/tag.scss
index a9cba82..0271daa 100644
--- a/dashboardv2/public/css/scss/tag.scss
+++ b/dashboardv2/public/css/scss/tag.scss
@@ -292,8 +292,8 @@ form-control .tagInpput {
 }
 
 .inputAssignTag {
-    display: inline-block;
-    padding: 2px 0px;
+    display: block;
+    padding: 2px 5px;
     border: 1px $action_gray solid;
     color: $action_gray;
     font-size: 14px;
@@ -303,13 +303,12 @@ form-control .tagInpput {
     float: left;
     cursor: pointer;
     background-color: $white;
-    width: 100px;
     white-space: nowrap;
-    i.fa {
-        position: relative;
-        right: -5px;
-        cursor: pointer;
-    }
+    // i.fa {
+    //     position: relative;
+    //     right: -5px;
+    //     cursor: pointer;
+    // }
     &:hover {
         color: $color_dark_grey_approx;
         background-color: $color_mercury_approx;

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html
index fca11a5..2bf3880 100644
--- a/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/audit/AuditTableLayoutView_tmpl.html
@@ -14,4 +14,19 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<div id="r_auditTableLayoutView"></div>
+<div class="position-relative">
+    <div class="fontLoader">
+        <i class="fa fa-refresh fa-spin-custom"></i>
+    </div>
+</div>
+<div class="auditTable">
+    <div id="r_auditTableLayoutView"></div>
+    <ul class="pager">
+        <li>
+            <button data-id="previousAuditData">Previous</button>
+        </li>
+        <li>
+            <button data-id="nextAuditData">Next</button>
+        </li>
+    </ul>
+</div>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html b/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html
index d648009..43447d9 100644
--- a/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html
+++ b/dashboardv2/public/js/templates/schema/SchemaTableLayoutView_tmpl.html
@@ -14,5 +14,5 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<a href="javascript:void(0)" class="inputAssignTag multiSelect" style="display:none" data-id="addTerm"><i class="fa fa-folder-o"> Assign Term</i></a>
+<a href="javascript:void(0)" class="inputAssignTag multiSelect" style="display:none" data-id="addTerm"><i class="fa fa-folder-o"></i> Assign Term</a>
 <div id="r_tagLayoutView"></div>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html b/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html
index 7ada413..f0826ca 100644
--- a/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html
+++ b/dashboardv2/public/js/templates/tag/addTagModalView_tmpl.html
@@ -14,16 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<div class="form-horizontal">
-	<div class="form-group">
-	        <!--  <label class="control-label col-sm-4">Tag definition</label> -->
-	        <div class="col-sm-12">
-	            <select class="form-control row-margin-bottom" data-id="addTagOptions" required>
-	            </select>
-	        </div>
-	</div>
-	<div class="row modalHeight">
-		<div class="col-sm-12" data-id="tagAttribute" style="display:none">
-		</div>
-	</div>
-</div>
\ No newline at end of file
+<div>
+    <div class="form-group">
+        <select class="form-control row-margin-bottom" data-id="addTagOptions" required>
+        </select>
+    </div>
+    <div class="row modalHeight">
+        <div class="col-sm-12" data-id="tagAttribute" style="display:none">
+        </div>
+    </div>
+</div>

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/utils/CommonViewFunction.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js
index 782cb54..495d6b8 100644
--- a/dashboardv2/public/js/utils/CommonViewFunction.js
+++ b/dashboardv2/public/js/utils/CommonViewFunction.js
@@ -349,9 +349,9 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Glob
             html += '<div><a  href="javascript:void(0)" data-id="showMoreLessTerm" class="inputTag inputTagGreen"><span>Show More </span><i class="fa fa-angle-right"></i></a></div>'
         }
         if (model.get('$id$')) {
-            html += '<div><a href="javascript:void(0)" class="inputAssignTag" data-id="addTerm" data-guid="' + model.get('$id$').id + '"><i class="fa fa-folder-o">' + " " + 'Assign Term</i></a></div>'
+            html += '<div><a href="javascript:void(0)" class="inputAssignTag" data-id="addTerm" data-guid="' + model.get('$id$').id + '"><i class="fa fa-folder-o"></i>' + " " + 'Assign Term</a></div>'
         } else {
-            html += '<div><a href="javascript:void(0)" class="inputAssignTag" data-id="addTerm"><i class="fa fa-folder-o">' + " " + 'Assign Term</i></a></div>'
+            html += '<div><a href="javascript:void(0)" class="inputAssignTag" data-id="addTerm"><i class="fa fa-folder-o"></i>' + " " + 'Assign Term</a></div>'
         }
         return {
             html: '<div class="termTableBreadcrumb" dataterm-id="' + id + '">' + html + '</div>',

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
index fd7fabe..23cc50d 100644
--- a/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
+++ b/dashboardv2/public/js/views/audit/AuditTableLayoutView.js
@@ -40,11 +40,15 @@ define(['require',
             ui: {
                 auditValue: "[data-id='auditValue']",
                 auditCreate: "[data-id='auditCreate']",
+                previousAuditData: "[data-id='previousAuditData']",
+                nextAuditData: "[data-id='nextAuditData']"
             },
             /** ui events hash */
             events: function() {
                 var events = {};
                 events["click " + this.ui.auditCreate] = "onClickAuditCreate";
+                events["click " + this.ui.nextAuditData] = "onClickNextAuditData";
+                events["click " + this.ui.previousAuditData] = "onClickPreviousAuditData";
                 return events;
             },
             /**
@@ -54,16 +58,17 @@ define(['require',
             initialize: function(options) {
                 _.extend(this, _.pick(options, 'globalVent', 'guid'));
                 this.entityCollection = new VEntityList();
+                this.count = 25;
                 this.entityCollection.url = "/api/atlas/entities/" + this.guid + "/audit";
-                this.entityCollection.modelAttrName = "events";
-                //this.collectionObject = entityCollection;
+                this.entityCollection.modelAttrName = "events"
                 this.entityModel = new this.entityCollection.model();
+                this.pervOld = [];
                 this.commonTableOptions = {
                     collection: this.entityCollection,
                     includeFilter: false,
-                    includePagination: true,
+                    includePagination: false,
                     includePageSize: false,
-                    includeFooterRecords: true,
+                    includeFooterRecords: false,
                     gridOpts: {
                         className: "table table-hover backgrid table-quickMenu",
                         emptyText: 'No records found!'
@@ -72,16 +77,55 @@ define(['require',
                     paginatorOpts: {}
                 };
             },
-            bindEvents: function() {
-                this.listenTo(this.entityCollection, "reset", function(value) {
-                    this.renderTableLayoutView();
-                }, this);
-            },
             onRender: function() {
-                this.entityCollection.fetch({ reset: true });
-                this.bindEvents();
+                $.extend(this.entityCollection.queryParams, { count: this.count });
+                this.fetchCollection({
+                    next: this.ui.nextAuditData,
+                    nextClick: false,
+                    previous: this.ui.previousAuditData
+                });
                 this.renderTableLayoutView();
             },
+            fetchCollection: function(options) {
+                var that = this;
+                this.$('.fontLoader').show();
+                this.$('.auditTable').hide();
+                if (that.entityCollection.models.length > 1) {
+                    if (options.nextClick) {
+                        this.pervOld.push(that.entityCollection.first().get('eventKey'));
+                    }
+                }
+                this.entityCollection.fetch({
+                    success: function() {
+                        that.$('.fontLoader').hide();
+                        that.$('.auditTable').show();
+                        options.previous.attr('disabled', true);
+                        if (that.entityCollection.models.length <= 1) {
+                            that.pervOld.pop();
+                            options.next.attr('disabled', true);
+                        }
+                        if (that.entityCollection.models.length == 1 && that.next == that.entityCollection.last().get('eventKey')) {
+                            options.next.attr('disabled', true);
+                            options.previous.removeAttr("disabled");
+                        } else {
+                            if (that.entityCollection.models.length > 0) {
+                                that.next = that.entityCollection.last().get('eventKey');
+                                if (options.nextClick) {
+                                    options.previous.removeAttr("disabled");
+                                }
+                                if (options.previousClick) {
+                                    options.previous.removeAttr("disabled");
+                                }
+                                if (that.pervOld.length == 0) {
+                                    options.previous.attr('disabled', true);
+                                }
+                            }
+                            that.renderTableLayoutView();
+                        }
+                    },
+                    silent: true
+                });
+            },
             renderTableLayoutView: function() {
                 var that = this;
                 require(['utils/TableLayout'], function(TableLayout) {
@@ -161,8 +205,39 @@ define(['require',
                     view.on('closeModal', function() {
                         modal.trigger('cancel');
                     });
+                    view.$el.on('click', 'td a', function() {
+                        modal.trigger('cancel');
+                    })
+                });
+            },
+            onClickNextAuditData: function() {
+                var that = this;
+                this.ui.previousAuditData.removeAttr("disabled");
+                $.extend(this.entityCollection.queryParams, {
+                    startKey: function() {
+                        return that.next
+                    }
+                });
+                this.fetchCollection({
+                    next: this.ui.nextAuditData,
+                    nextClick: true,
+                    previous: this.ui.previousAuditData
                 });
-            }
+            },
+            onClickPreviousAuditData: function() {
+                var that = this;
+                this.ui.nextAuditData.removeAttr("disabled");
+                $.extend(this.entityCollection.queryParams, {
+                    startKey: function() {
+                        return that.pervOld.pop()
+                    }
+                });
+                this.fetchCollection({
+                    next: this.ui.nextAuditData,
+                    previousClick: true,
+                    previous: this.ui.previousAuditData
+                });
+            },
         });
     return AuditTableLayoutView;
 });

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/dashboardv2/public/js/views/tag/addTagModalView.js
----------------------------------------------------------------------
diff --git a/dashboardv2/public/js/views/tag/addTagModalView.js b/dashboardv2/public/js/views/tag/addTagModalView.js
index f1cb026..d51be9f 100644
--- a/dashboardv2/public/js/views/tag/addTagModalView.js
+++ b/dashboardv2/public/js/views/tag/addTagModalView.js
@@ -111,9 +111,8 @@ define(['require',
                 for (var i = 0; i < this.commonCollection.models[0].attributes.traitTypes[0].attributeDefinitions.length; i++) {
                     var attribute = this.commonCollection.models[0].attributes.traitTypes[0].attributeDefinitions;
                     this.ui.tagAttribute.show();
-                    strAttribute += '<div class="form-group"><label class="control-label col-sm-2">' + attribute[i].name + '</label>' +
-                        '<div class="col-sm-10">' +
-                        '<input type="text" class="form-control attributeInputVal attrName" data-key="' + attribute[i].name + '" ></input></div></div>';
+                    strAttribute += '<div class="form-group"><label>' + attribute[i].name + '</label>' +
+                        '<input type="text" class="form-control attributeInputVal attrName" data-key="' + attribute[i].name + '" ></input></div>';
                     this.ui.tagAttribute.html(strAttribute);
                 }
                 if (this.commonCollection.models[0].attributes.traitTypes[0].superTypes.length > 0) {

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/fa9fbbd7/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index b1b62fd..f162611 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
 
 
 ALL CHANGES:
+ATLAS-847 UI: Audit versioning does not paginate details from Atlas server (Kalyanikashikar via shwethags)
 ATLAS-1004 Option to enable taxonomy feature (kevalbhatt18 via shwethags)
 ATLAS-1003 DataSetLineageServiceTest, GraphBackedDiscoveryServiceTest, and GraphRepoMapperScaleTest failing in some environments (dkantor via shwethags)
 ATLAS-1002 Create default user rangertagsync in atlas file authentication for Ranger tag sync module (nixonrodrigues via shwethags)


[2/2] incubator-atlas git commit: ATLAS-1009 Source HIVE_HOME and HIVE_CONF_DIR from hive_env.sh (svimal2106 via shwethags)

Posted by sh...@apache.org.
ATLAS-1009 Source HIVE_HOME and HIVE_CONF_DIR from hive_env.sh (svimal2106 via shwethags)


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

Branch: refs/heads/master
Commit: 99d51436752489cc9da440b8876a61ab26a8c68a
Parents: fa9fbbd
Author: Shwetha GS <ss...@hortonworks.com>
Authored: Wed Jul 13 15:34:10 2016 +0530
Committer: Shwetha GS <ss...@hortonworks.com>
Committed: Wed Jul 13 15:34:10 2016 +0530

----------------------------------------------------------------------
 addons/hive-bridge/src/bin/import-hive.sh | 31 +++++++++++---------------
 docs/src/site/twiki/Bridge-Hive.twiki     |  9 ++------
 release-log.txt                           |  1 +
 3 files changed, 16 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/99d51436/addons/hive-bridge/src/bin/import-hive.sh
----------------------------------------------------------------------
diff --git a/addons/hive-bridge/src/bin/import-hive.sh b/addons/hive-bridge/src/bin/import-hive.sh
index dc57de8..7cbc738 100755
--- a/addons/hive-bridge/src/bin/import-hive.sh
+++ b/addons/hive-bridge/src/bin/import-hive.sh
@@ -31,15 +31,6 @@ done
 BASEDIR=`dirname ${PRG}`
 BASEDIR=`cd ${BASEDIR}/..;pwd`
 
-if [ -z "$ATLAS_CONF" ]; then
-  ATLAS_CONF=${BASEDIR}/conf
-fi
-export ATLAS_CONF
-
-if [ -f "${ATLAS_CONF}/atlas-env.sh" ]; then
-  . "${ATLAS_CONF}/atlas-env.sh"
-fi
-
 if test -z "${JAVA_HOME}"
 then
     JAVA_BIN=`which java`
@@ -55,11 +46,8 @@ if [ ! -e "${JAVA_BIN}" ] || [ ! -e "${JAR_BIN}" ]; then
   exit 1
 fi
 
-# Construct classpath using Atlas conf directory
-# and jars from bridge/hive and hook/hive directories.
-ATLASCPPATH="$ATLAS_CONF"
-
-for i in "${BASEDIR}/hook/hive/"*.jar; do
+# Construct Atlas classpath using jars from hook/hive/atlas-hive-plugin-impl/ directory.
+for i in "${BASEDIR}/hook/hive/atlas-hive-plugin-impl/"*.jar; do
   ATLASCPPATH="${ATLASCPPATH}:$i"
 done
 
@@ -72,23 +60,30 @@ TIME=`date +%Y%m%d%H%M%s`
 
 #Add hive conf in classpath
 if [ ! -z "$HIVE_CONF_DIR" ]; then
-    HIVE_CP=$HIVE_CONF_DIR
+    HIVE_CONF=$HIVE_CONF_DIR
 elif [ ! -z "$HIVE_HOME" ]; then
-    HIVE_CP="$HIVE_HOME/conf"
+    HIVE_CONF="$HIVE_HOME/conf"
 elif [ -e /etc/hive/conf ]; then
-    HIVE_CP="/etc/hive/conf"
+    HIVE_CONF="/etc/hive/conf"
 else
     echo "Could not find a valid HIVE configuration"
     exit 1
 fi
 
-echo Using Hive configuration directory ["$HIVE_CP"]
+echo Using Hive configuration directory ["$HIVE_CONF"]
+
+
+if [ -f "${HIVE_CONF}/hive-env.sh" ]; then
+  . "${HIVE_CONF}/hive-env.sh"
+fi
 
 if [ -z "$HIVE_HOME" ]; then
     echo "Please set HIVE_HOME to the root of Hive installation"
     exit 1
 fi
 
+HIVE_CP="${HIVE_CONF}"
+
 for i in "${HIVE_HOME}/lib/"*.jar; do
     HIVE_CP="${HIVE_CP}:$i"
 done

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/99d51436/docs/src/site/twiki/Bridge-Hive.twiki
----------------------------------------------------------------------
diff --git a/docs/src/site/twiki/Bridge-Hive.twiki b/docs/src/site/twiki/Bridge-Hive.twiki
index 77bcc58..40a8b8a 100644
--- a/docs/src/site/twiki/Bridge-Hive.twiki
+++ b/docs/src/site/twiki/Bridge-Hive.twiki
@@ -21,16 +21,11 @@ The entities are created and de-duped using unique qualified name. They provide
 
 
 ---++ Importing Hive Metadata
-org.apache.atlas.hive.bridge.HiveMetaStoreBridge imports the Hive metadata into Atlas using the model defined in org.apache.atlas.hive.model.HiveDataModelGenerator.
-
-import-hive.sh command can be used to facilitate this.
-The script needs Hadoop and Hive classpath jars.
-
+org.apache.atlas.hive.bridge.HiveMetaStoreBridge imports the Hive metadata into Atlas using the model defined in org.apache.atlas.hive.model.HiveDataModelGenerator. import-hive.sh command can be used to facilitate this. The script needs Hadoop and Hive classpath jars.
   * For Hadoop jars, please make sure that the environment variable HADOOP_CLASSPATH is set. Another way is to set HADOOP_HOME to point to root directory of your Hadoop installation
-
   * Similarly, for Hive jars, set HIVE_HOME to the root of Hive installation
-
   * Set environment variable HIVE_CONF_DIR to Hive configuration directory
+  * Copy <atlas-conf>/atlas-application.properties to the hive conf directory
 
     <verbatim>
     Usage: <atlas package>/bin/import-hive.sh

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/99d51436/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index f162611..4469309 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -6,6 +6,7 @@ INCOMPATIBLE CHANGES:
 
 
 ALL CHANGES:
+ATLAS-1009 Source HIVE_HOME and HIVE_CONF_DIR from hive_env.sh (svimal2106 via shwethags)
 ATLAS-847 UI: Audit versioning does not paginate details from Atlas server (Kalyanikashikar via shwethags)
 ATLAS-1004 Option to enable taxonomy feature (kevalbhatt18 via shwethags)
 ATLAS-1003 DataSetLineageServiceTest, GraphBackedDiscoveryServiceTest, and GraphRepoMapperScaleTest failing in some environments (dkantor via shwethags)