[13/14] incubator-atlas git commit: ATLAS-1912: fix for defects reported by Coverity scan

2017-07-09 Thread madhan
ATLAS-1912: fix for defects reported by Coverity scan

Signed-off-by: Madhan Neethiraj 


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

Branch: refs/heads/feature-odf
Commit: ee8c81df45801fa3798c19f3999b635140e835f7
Parents: 1c4e8b7
Author: David Radley 
Authored: Fri Jul 7 20:42:45 2017 -0700
Committer: Madhan Neethiraj 
Committed: Fri Jul 7 20:57:37 2017 -0700

--
 .../java/org/apache/atlas/AtlasErrorCode.java   |  1 +
 .../graph/v1/AtlasRelationshipDefStoreV1.java   | 26 +---
 2 files changed, 18 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/ee8c81df/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 73dd33a..e8afed1 100644
--- a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
+++ b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
@@ -100,6 +100,7 @@ public enum AtlasErrorCode {
 INSTANCE_NOT_FOUND(404, "ATLAS-404-00-00B", "Given instance is invalid/not 
found: {0}"),
 RELATIONSHIP_GUID_NOT_FOUND(404, "ATLAS-404-00-00C", "Given relationship 
guid {0} is invalid/not found"),
 RELATIONSHIP_CRUD_INVALID_PARAMS(404, "ATLAS-404-00-00D", "Invalid 
relationship creation/updation parameters passed : {0}"),
+RELATIONSHIPDEF_END_TYPE_NAME_NOT_FOUND(404, "ATLAS-404-00-00E", 
"RelationshipDef {0} endDef typename {0} cannot be found"),
 // 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"),

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/ee8c81df/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
index bd7416e..ddf0af9 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
@@ -78,15 +78,23 @@ public class AtlasRelationshipDefStoreV1 extends 
AtlasAbstractDefStoreV1 impleme
 
 updateVertexPreCreate(relationshipDef, (AtlasRelationshipType) type, 
relationshipDefVertex);
 
-final AtlasRelationshipEndDef endDef1 = relationshipDef.getEndDef1();
-final String type1 = endDef1.getType();
-final AtlasRelationshipEndDef endDef2 = relationshipDef.getEndDef2();
-final String type2 = endDef2.getType();
-final String name1 = endDef1.getName();
-final String name2 = endDef2.getName();
-AtlasVertex end1TypeVertex = typeDefStore.findTypeVertexByName(type1);
-
-AtlasVertex end2TypeVertex = typeDefStore.findTypeVertexByName(type2);
+final AtlasRelationshipEndDef endDef1= 
relationshipDef.getEndDef1();
+final AtlasRelationshipEndDef endDef2= 
relationshipDef.getEndDef2();
+final String  type1  = endDef1.getType();
+final String  type2  = endDef2.getType();
+final String  name1  = endDef1.getName();
+final String  name2  = endDef2.getName();
+final AtlasVertex end1TypeVertex = 
typeDefStore.findTypeVertexByName(type1);
+final AtlasVertex end2TypeVertex = 
typeDefStore.findTypeVertexByName(type2);
+
+if (end1TypeVertex == null) {
+throw new 
AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_END_TYPE_NAME_NOT_FOUND, 
relationshipDef.getName(), type1);
+}
+
+if (end2TypeVertex == null) {
+throw new 
AtlasBaseException(AtlasErrorCode.RELATIONSHIPDEF_END_TYPE_NAME_NOT_FOUND, 
relationshipDef.getName(), type2);
+}
+
 // create an edge between the relationshipDef and each of the 
entityDef vertices.
 AtlasEdge edge1 = typeDefStore.getOrCreateEdge(relationshipDefVertex, 
end1TypeVertex, AtlasGraphUtilsV1.RELATIONSHIPTYPE_EDGE_LABEL);
 



[05/14] incubator-atlas git commit: ATLAS-1894: Search using entity/tag attribute filters

2017-07-09 Thread madhan
ATLAS-1894: Search using entity/tag attribute filters

Signed-off-by: Madhan Neethiraj 


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

Branch: refs/heads/feature-odf
Commit: 9a4ed469cc64cf107b98fba1851525017fec2024
Parents: 7c262b4
Author: kevalbhatt 
Authored: Thu Jun 22 18:45:36 2017 +0530
Committer: Madhan Neethiraj 
Committed: Fri Jun 30 01:49:15 2017 -0700

--
 3party-licenses/bootstrap-datepicker-LICENSE|   21 -
 .../bootstrap-daterangepicker-LICENSE   |9 +
 3party-licenses/jQuery-QueryBuilder-LICENSE |   21 +
 LICENSE |9 +-
 dashboardv2/gruntfile.js|  114 +-
 dashboardv2/package.json|5 +
 dashboardv2/public/css/scss/form.scss   |4 +
 dashboardv2/public/css/scss/override.scss   |   21 +
 dashboardv2/public/css/scss/search.scss |   17 +
 dashboardv2/public/index.html   |3 +-
 dashboardv2/public/js/collection/VSearchList.js |   11 +
 dashboardv2/public/js/collection/VTagList.js|2 +-
 .../datetimepicker/bootstrap-datetimepicker.js  | 2444 --
 .../bootstrap-datetimepicker.min.css|5 -
 dashboardv2/public/js/main.js   |   28 +-
 dashboardv2/public/js/models/VSearch.js |2 +-
 dashboardv2/public/js/models/VTag.js|6 +-
 dashboardv2/public/js/router/Router.js  |   65 +-
 .../js/templates/search/QueryBuilder_tmpl.html  |   17 +
 .../templates/search/SearchLayoutView_tmpl.html |   22 +-
 .../js/templates/search/SearchQuery_tmpl.html   |   21 +
 .../search/SearchResultLayoutView_tmpl.html |   15 +
 .../templates/tag/AddTagAttributeView_tmpl.html |2 +-
 .../templates/tag/createTagLayoutView_tmpl.html |2 +-
 dashboardv2/public/js/utils/Overrides.js|5 +-
 dashboardv2/public/js/utils/UrlLinks.js |   38 +-
 dashboardv2/public/js/utils/Utils.js|   68 +-
 .../views/business_catalog/SideNavLayoutView.js |   10 +-
 .../js/views/entity/CreateEntityLayoutView.js   |   29 +-
 .../public/js/views/search/QueryBuilderView.js  |  181 ++
 .../js/views/search/SearchDetailLayoutView.js   |3 +-
 .../public/js/views/search/SearchLayoutView.js  |  181 +-
 .../public/js/views/search/SearchQueryView.js   |  113 +
 .../js/views/search/SearchResultLayoutView.js   |  113 +-
 .../public/js/views/tag/TagDetailLayoutView.js  |3 +-
 .../public/js/views/tag/TagLayoutView.js|6 +-
 36 files changed, 975 insertions(+), 2641 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9a4ed469/3party-licenses/bootstrap-datepicker-LICENSE
--
diff --git a/3party-licenses/bootstrap-datepicker-LICENSE 
b/3party-licenses/bootstrap-datepicker-LICENSE
deleted file mode 100644
index 3fd94fa..000
--- a/3party-licenses/bootstrap-datepicker-LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Jonathan Peterson (@Eonasdan)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9a4ed469/3party-licenses/bootstrap-daterangepicker-LICENSE
--
diff --git a/3party-licenses/bootstrap-daterangepicker-LICENSE 
b/3party-licenses/bootstrap-daterangepicker-LICENSE
new file mode 100644
index 000..aacee25
--- /dev/null
+++ b/3party-licenses/bootstrap-daterangepicker-LICENSE
@@ -0,0 

[03/14] incubator-atlas git commit: ATLAS-1894: Search using entity/tag attribute filters

2017-07-09 Thread madhan
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9a4ed469/dashboardv2/public/js/external_lib/datetimepicker/bootstrap-datetimepicker.min.css
--
diff --git 
a/dashboardv2/public/js/external_lib/datetimepicker/bootstrap-datetimepicker.min.css
 
b/dashboardv2/public/js/external_lib/datetimepicker/bootstrap-datetimepicker.min.css
deleted file mode 100644
index e9ec816..000
--- 
a/dashboardv2/public/js/external_lib/datetimepicker/bootstrap-datetimepicker.min.css
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- * Datetimepicker for Bootstrap 3
- * version : 4.14.30
- * https://github.com/Eonasdan/bootstrap-datetimepicker/
- 
*/.bootstrap-datetimepicker-widget{list-style:none}.bootstrap-datetimepicker-widget.dropdown-menu{margin:2px
 0;padding:4px;width:19em}@media 
(min-width:768px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media
 
(min-width:992px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}@media
 
(min-width:1200px){.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs{width:38em}}.bootstrap-datetimepicker-widget.dropdown-menu:after,.bootstrap-datetimepicker-widget.dropdown-menu:before{content:'';display:inline-block;position:absolute}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before{border-left:7px
 solid transparent;border-right:7px solid transparent;border-bottom:7px solid 
#ccc;border-bottom-color:rgba(0,0,0,.2);top:-7px;left:7px}.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after{border-left:6px
 solid transparent;border-right:6px solid transparent;border-bottom:6px solid 
#fff;top:-6px;left:8px}.bootstrap-datetime
 picker-widget.dropdown-menu.top:before{border-left:7px solid 
transparent;border-right:7px solid transparent;border-top:7px solid 
#ccc;border-top-color:rgba(0,0,0,.2);bottom:-7px;left:6px}.bootstrap-datetimepicker-widget.dropdown-menu.top:after{border-left:6px
 solid transparent;border-right:6px solid transparent;border-top:6px solid 
#fff;bottom:-6px;left:7px}.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:before{left:auto;right:6px}.bootstrap-datetimepicker-widget.dropdown-menu.pull-right:after{left:auto;right:7px}.bootstrap-datetimepicker-widget
 .list-unstyled{margin:0}.bootstrap-datetimepicker-widget 
a[data-action]{padding:6px 0}.bootstrap-datetimepicker-widget 
a[data-action]:active{box-shadow:none}.bootstrap-datetimepicker-widget 
.timepicker-hour,.bootstrap-datetimepicker-widget 
.timepicker-minute,.bootstrap-datetimepicker-widget 
.timepicker-second{width:54px;font-weight:700;font-size:1.2em;margin:0}.bootstrap-datetimepicker-widget
 button[data-action]{padding:6px}.bootst
 rap-datetimepicker-widget 
.btn[data-action=incrementHours]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Increment
 Hours"}.bootstrap-datetimepicker-widget 
.btn[data-action=incrementMinutes]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Increment
 Minutes"}.bootstrap-datetimepicker-widget 
.btn[data-action=decrementHours]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Decrement
 Hours"}.bootstrap-datetimepicker-widget 
.btn[data-action=decrementMinutes]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Decrement
 Minutes"}.bootstrap-datetimepicker-widget 
.btn[data-action=showHours]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content
 :"Show Hours"}.bootstrap-datetimepicker-widget 
.btn[data-action=showMinutes]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Show
 Minutes"}.bootstrap-datetimepicker-widget 
.btn[data-action=togglePeriod]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Toggle
 AM/PM"}.bootstrap-datetimepicker-widget 
.btn[data-action=clear]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Clear
 the picker"}.bootstrap-datetimepicker-widget 
.btn[data-action=today]::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;content:"Set
 the date to today"}.bootstrap-datetimepicker-widget 
.picker-switch{text-align:center}.bootstrap-datetimepicker-widget 
.picker-switch::after{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflo
 w:hidden;clip:rect(0,0,0,0);border:0;content:"Toggle Date and Time 
Screens"}.bootstrap-datetimepicker-widget .picker-switch 
td{padding:0;margin:0;height:auto;width:auto;line-height:inherit}.bootstrap-datetimepicker-widget
 .picker-switch td 

[04/14] incubator-atlas git commit: ATLAS-1894: Search using entity/tag attribute filters

2017-07-09 Thread madhan
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/9a4ed469/dashboardv2/public/js/external_lib/datetimepicker/bootstrap-datetimepicker.js
--
diff --git 
a/dashboardv2/public/js/external_lib/datetimepicker/bootstrap-datetimepicker.js 
b/dashboardv2/public/js/external_lib/datetimepicker/bootstrap-datetimepicker.js
deleted file mode 100644
index bb930fb..000
--- 
a/dashboardv2/public/js/external_lib/datetimepicker/bootstrap-datetimepicker.js
+++ /dev/null
@@ -1,2444 +0,0 @@
-/*! version : 4.14.30
- =
- bootstrap-datetimejs
- https://github.com/Eonasdan/bootstrap-datetimepicker
- Copyright (c) 2015 Jonathan Peterson
- =
- */
-/*
- The MIT License (MIT)
-
- Copyright (c) 2015 Jonathan Peterson
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- */
-/*global define:false */
-/*global exports:false */
-/*global require:false */
-/*global jQuery:false */
-/*global moment:false */
-(function (factory) {
-'use strict';
-if (typeof define === 'function' && define.amd) {
-// AMD is used - Register as an anonymous module.
-define(['jquery', 'moment'], factory);
-} else if (typeof exports === 'object') {
-factory(require('jquery'), require('moment'));
-} else {
-// Neither AMD nor CommonJS used. Use global variables.
-if (typeof jQuery === 'undefined') {
-throw 'bootstrap-datetimepicker requires jQuery to be loaded 
first';
-}
-if (typeof moment === 'undefined') {
-throw 'bootstrap-datetimepicker requires Moment.js to be loaded 
first';
-}
-factory(jQuery, moment);
-}
-}(function ($, moment) {
-'use strict';
-if (!moment) {
-throw new Error('bootstrap-datetimepicker requires Moment.js to be 
loaded first');
-}
-
-var dateTimePicker = function (element, options) {
-var picker = {},
-date = moment().startOf('d'),
-viewDate = date.clone(),
-unset = true,
-input,
-component = false,
-widget = false,
-use24Hours,
-minViewModeNumber = 0,
-actualFormat,
-parseFormats,
-currentViewMode,
-datePickerModes = [
-{
-clsName: 'days',
-navFnc: 'M',
-navStep: 1
-},
-{
-clsName: 'months',
-navFnc: 'y',
-navStep: 1
-},
-{
-clsName: 'years',
-navFnc: 'y',
-navStep: 10
-},
-{
-clsName: 'decades',
-navFnc: 'y',
-navStep: 100
-}
-],
-viewModes = ['days', 'months', 'years', 'decades'],
-verticalModes = ['top', 'bottom', 'auto'],
-horizontalModes = ['left', 'right', 'auto'],
-toolbarPlacements = ['default', 'top', 'bottom'],
-keyMap = {
-'up': 38,
-38: 'up',
-'down': 40,
-40: 'down',
-'left': 37,
-37: 'left',
-'right': 39,
-39: 'right',
-'tab': 9,
-9: 'tab',
-'escape': 27,
-27: 'escape',
-'enter': 13,
-13: 'enter',
-'pageUp': 33,
-33: 'pageUp',
-'pageDown': 34,
-34: 'pageDown',
-'shift': 16,
-16: 'shift',
-'control': 17,
-17: 'control',
-'space': 32,
-32: 'space',
-

[02/14] incubator-atlas git commit: ATLAS-1880: search API with support for entity/tag attribute filters

2017-07-09 Thread madhan
ATLAS-1880: search API with support for entity/tag attribute filters


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

Branch: refs/heads/feature-odf
Commit: 7c262b40ba4bbf6946c2423f36ddb0f3ee12c8f8
Parents: 8101883
Author: apoorvnaik 
Authored: Wed Jun 28 06:22:34 2017 -0700
Committer: Madhan Neethiraj 
Committed: Fri Jun 30 01:49:08 2017 -0700

--
 .../java/org/apache/atlas/AtlasClientV2.java|  22 +
 .../org/apache/atlas/repository/Constants.java  |   4 +-
 distro/src/conf/atlas-log4j.xml |  17 +
 .../repository/graphdb/AtlasGraphQuery.java |  39 +-
 .../repository/graphdb/AtlasIndexQuery.java |   8 +
 .../repository/graphdb/AtlasVertexQuery.java|  16 +-
 .../titan/query/NativeTitanGraphQuery.java  |  25 +-
 .../graphdb/titan/query/TitanGraphQuery.java|  65 +-
 .../graphdb/titan/query/expr/AndCondition.java  |   8 +-
 .../graphdb/titan/query/expr/HasPredicate.java  |   7 +-
 .../query/graph/GraphCentricQueryBuilder.java   |  28 +-
 .../graphdb/titan0/Titan0IndexQuery.java|  21 +
 .../graphdb/titan0/Titan0VertexQuery.java   |  15 +
 .../titan0/query/NativeTitan0GraphQuery.java|  92 ++-
 .../graphdb/titan1/Titan1IndexQuery.java|  22 +
 .../graphdb/titan1/Titan1VertexQuery.java   |  14 +
 .../titan1/query/NativeTitan1GraphQuery.java|  90 ++-
 .../model/discovery/AtlasSearchResult.java  |  28 +-
 .../atlas/model/discovery/SearchParameters.java | 366 +++
 .../atlas/model/impexp/AtlasImportRequest.java  |  15 +-
 .../atlas/discovery/AtlasDiscoveryService.java  |   9 +
 .../atlas/discovery/EntityDiscoveryService.java |  34 +-
 .../atlas/discovery/EntityLineageService.java   |   2 +
 .../org/apache/atlas/discovery/GremlinStep.java | 388 
 .../apache/atlas/discovery/SearchPipeline.java  | 611 +++
 .../org/apache/atlas/discovery/SolrStep.java| 288 +
 .../graph/GraphBackedSearchIndexer.java |  41 +-
 .../atlas/repository/impexp/ImportService.java  |   5 +-
 .../store/graph/v1/AtlasGraphUtilsV1.java   |   5 +-
 .../store/graph/v1/EntityGraphRetriever.java|  26 +-
 .../org/apache/atlas/util/SearchTracker.java|  73 +++
 .../test/java/org/apache/atlas/TestModules.java |  17 +-
 .../services/EntityDiscoveryServiceTest.java|   8 +
 .../filters/StaleTransactionCleanupFilter.java  |   2 +-
 .../atlas/web/resources/AdminResource.java  |  43 +-
 .../apache/atlas/web/rest/DiscoveryREST.java|  47 ++
 .../atlas/web/resources/AdminResourceTest.java  |   4 +-
 37 files changed, 2381 insertions(+), 124 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/7c262b40/client/src/main/java/org/apache/atlas/AtlasClientV2.java
--
diff --git a/client/src/main/java/org/apache/atlas/AtlasClientV2.java 
b/client/src/main/java/org/apache/atlas/AtlasClientV2.java
index 6141342..7e287e7 100644
--- a/client/src/main/java/org/apache/atlas/AtlasClientV2.java
+++ b/client/src/main/java/org/apache/atlas/AtlasClientV2.java
@@ -22,6 +22,7 @@ import com.sun.jersey.api.client.WebResource;
 import com.sun.jersey.core.util.MultivaluedMapImpl;
 import org.apache.atlas.model.SearchFilter;
 import org.apache.atlas.model.discovery.AtlasSearchResult;
+import org.apache.atlas.model.discovery.SearchParameters;
 import org.apache.atlas.model.instance.AtlasClassification;
 import 
org.apache.atlas.model.instance.AtlasClassification.AtlasClassifications;
 import org.apache.atlas.model.instance.AtlasEntity.AtlasEntitiesWithExtInfo;
@@ -100,9 +101,13 @@ public class AtlasClientV2 extends AtlasBaseClient {
 private static final String DISCOVERY_URI = BASE_URI + "v2/search";
 private static final String DSL_URI   = DISCOVERY_URI + "/dsl";
 private static final String FULL_TEXT_URI = DISCOVERY_URI + "/fulltext";
+private static final String BASIC_SEARCH_URI = DISCOVERY_URI + "/basic";
+private static final String FACETED_SEARCH_URI = BASIC_SEARCH_URI;
 
 private static final APIInfo DSL_SEARCH   = new APIInfo(DSL_URI, 
HttpMethod.GET, Response.Status.OK);
 private static final APIInfo FULL_TEXT_SEARCH = new APIInfo(FULL_TEXT_URI, 
HttpMethod.GET, Response.Status.OK);
+private static final APIInfo BASIC_SEARCH = new APIInfo(BASIC_SEARCH_URI, 
HttpMethod.GET, Response.Status.OK);
+private static final APIInfo FACETED_SEARCH = new 
APIInfo(FACETED_SEARCH_URI, HttpMethod.POST, Response.Status.OK);
 
 
 public AtlasClientV2(String[] baseUrl, String[] 

[06/14] incubator-atlas git commit: updated documentation for import API

2017-07-09 Thread madhan
updated documentation for import API

Signed-off-by: Madhan Neethiraj 


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

Branch: refs/heads/feature-odf
Commit: 958c48c2c1807e68dd8cceda6857ec065c083a4b
Parents: 9a4ed46
Author: ashutoshm 
Authored: Fri Jun 30 16:54:12 2017 -0700
Committer: Madhan Neethiraj 
Committed: Fri Jun 30 22:42:40 2017 -0700

--
 docs/src/site/twiki/Export-API.twiki |   2 +-
 docs/src/site/twiki/Export-HDFS-API.twiki|   2 +-
 docs/src/site/twiki/Import-API-Options.twiki | 121 ++
 docs/src/site/twiki/Import-API.twiki |  17 +--
 docs/src/site/twiki/Import-Export-API.twiki  |   7 +-
 5 files changed, 138 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/958c48c2/docs/src/site/twiki/Export-API.twiki
--
diff --git a/docs/src/site/twiki/Export-API.twiki 
b/docs/src/site/twiki/Export-API.twiki
index 4027f3d..0df6629 100644
--- a/docs/src/site/twiki/Export-API.twiki
+++ b/docs/src/site/twiki/Export-API.twiki
@@ -138,7 +138,7 @@ The _metrics_ contains the number of types and entities 
exported as part of the
 Below are sample CURL calls that demonstrate Export of _!QuickStart_ database.
 
 
-curl -X POST -u admin:admin -H "Content-Type: application/json" -H 
"Cache-Control: no-cache" -d '{
+curl -X POST -u adminuser:password -H "Content-Type: application/json" -H 
"Cache-Control: no-cache" -d '{
 "itemsToExport": [
 { "typeName": "DB", "uniqueAttributes": { "name": "Sales" }
 { "typeName": "DB", "uniqueAttributes": { "name": "Reporting" }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/958c48c2/docs/src/site/twiki/Export-HDFS-API.twiki
--
diff --git a/docs/src/site/twiki/Export-HDFS-API.twiki 
b/docs/src/site/twiki/Export-HDFS-API.twiki
index 64ba123..6c20060 100644
--- a/docs/src/site/twiki/Export-HDFS-API.twiki
+++ b/docs/src/site/twiki/Export-HDFS-API.twiki
@@ -66,7 +66,7 @@ To export entities that represent HDFS path, use the Export 
API using the _match
 Below are sample CURL calls that performs export operation on the _Sample HDFS 
Setup_ shown above.
 
 
-curl -X POST -u admin:admin -H "Content-Type: application/json" -H 
"Cache-Control: no-cache" -d '{
+curl -X POST -u adminuser:password -H "Content-Type: application/json" -H 
"Cache-Control: no-cache" -d '{
 "itemsToExport": [
 { "typeName": "hdfs_path", "uniqueAttributes": { "name": 
"FinanceAll" }
 }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/958c48c2/docs/src/site/twiki/Import-API-Options.twiki
--
diff --git a/docs/src/site/twiki/Import-API-Options.twiki 
b/docs/src/site/twiki/Import-API-Options.twiki
new file mode 100644
index 000..9acfee1
--- /dev/null
+++ b/docs/src/site/twiki/Import-API-Options.twiki
@@ -0,0 +1,121 @@
+---+ Import API Options
+
+Import API options are specified as _options_ JSON. Since the API accepts 
multi-part form data, it is possible to sepecify multipls input streams within 
the CURL call.
+
+---+++ Examples Using CURL Calls
+
+curl -g -X POST -u adminuser:password -H "Content-Type: multipart/form-data"
+-H "Cache-Control: no-cache"
+-F request=@importOptions.json
+-F data=@quickStartDB.zip
+"http://localhost:21000/api/atlas/admin/import;
+
+
+To use the defaults, set the contents of _importOptions.json_ to:
+
+{
+  "options": {
+  }
+}
+
+
+
+---+++ Options
+Following options are supported for Import process:
+
+   * Specify transforms during import operation.
+   * Resume import by specifying starting entity guid.
+   * Optionally import type definition.
+
+--- Transforms
+
+During the import process, the attribute value of the incoming entity can be 
changed.
+
+This is possible by specifying entity type and at attribute to be modified and 
then the manner in which it needs to be modified.
+
+Right now these are the transforms that can be applied:
+   * _lowercase_ Converts the attribute value to lower case.
+   * _replace_ This performs a string find and replace operation. It takes two 
parameters, the first is the string to search for and the next one is the 
string to replace it with.
+
+Example:
+
+The example below applies couple of transforms to the the _qualifiedName_ 
attribute of hive_table. It converts the value to lower case, 

[08/14] incubator-atlas git commit: Coverity fixes for ATLAS-1880

2017-07-09 Thread madhan
Coverity fixes for ATLAS-1880


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

Branch: refs/heads/feature-odf
Commit: d22fa7eba93d3a97800f4a5f2b5c3935223f7625
Parents: 617bc25
Author: apoorvnaik 
Authored: Mon Jul 3 09:29:05 2017 -0700
Committer: apoorvnaik 
Committed: Mon Jul 3 09:29:05 2017 -0700

--
 .../src/main/java/org/apache/atlas/discovery/GremlinStep.java   | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/d22fa7eb/repository/src/main/java/org/apache/atlas/discovery/GremlinStep.java
--
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/GremlinStep.java 
b/repository/src/main/java/org/apache/atlas/discovery/GremlinStep.java
index 5565781..1056b3e 100644
--- a/repository/src/main/java/org/apache/atlas/discovery/GremlinStep.java
+++ b/repository/src/main/java/org/apache/atlas/discovery/GremlinStep.java
@@ -363,6 +363,7 @@ public class GremlinStep implements PipelineStep {
 break;
 case ENDS_WITH:
 query.has(qualifiedAttributeName, 
MatchingOperator.REGEX, getSuffixRegex(attrValue));
+break;
 case IN:
 LOG.warn("{}: unsupported operator. Ignored", 
operator);
 break;