[25/39] atlas-website git commit: ATLAS-2428: update Apache Atlas website for 0.8.2 release
http://git-wip-us.apache.org/repos/asf/atlas-website/blob/525c122e/0.8.2/api/v2/resources.html -- diff --git a/0.8.2/api/v2/resources.html b/0.8.2/api/v2/resources.html new file mode 100644 index 000..95f10ec --- /dev/null +++ b/0.8.2/api/v2/resources.html @@ -0,0 +1,210 @@ + + + + + + + + + Atlas REST API: Resources + + + + + + https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css;> + + + + + + + + + + + + + + + Toggle navigation + + + + +Atlas REST API: Resources + + + + Resources + Data Types + + + + + + + + + + Back to Top + + + + + + Home + Resources + + + Resources + + +There is a WADL document available that describes the resources API. + + +You may also enjoy the interactive interface provided for this API by http://swagger.io;>Swagger. + + +Try it out! + + + + + name + path + methods + description + + + + +DiscoveryREST + +/v2/search/attribute + /v2/search/basic + /v2/search/dsl + /v2/search/fulltext + /v2/search/relationship + /v2/search/saved + /v2/search/saved/{guid} + /v2/search/saved/{name} + /v2/search/saved/execute/{name} + /v2/search/saved/execute/guid/{guid} + +GET + GET POST + GET + GET + GET + GET POST PUT + DELETE + GET + GET + GET + +REST interface for data discovery using dsl or full text search + + + +EntityREST + +/v2/entity + /v2/entity/bulk + /v2/entity/bulk/classification + /v2/entity/guid/{guid} + /v2/entity/guid/{guid}/classifications + /v2/entity/uniqueAttribute/type/{typeName} + /v2/entity/guid/{guid}/classification/{classificationName} + +POST + DELETE GET POST + POST + DELETE GET PUT + GET POST PUT + DELETE GET PUT + DELETE GET + +REST for a single entity + + + +LineageREST + +/v2/lineage/{guid} + +GET + +REST interface for an entity's lineage information + + + +TypesREST + +/v2/types/typedefs + /v2/types/typedefs/headers + /v2/types/classificationdef/guid/{guid} + /v2/types/classificationdef/name/{name} + /v2/types/entitydef/guid/{guid} + /v2/types/entitydef/name/{name} + /v2/types/enumdef/guid/{guid} + /v2/types/enumdef/name/{name} + /v2/types/structdef/guid/{guid} + /v2/types/structdef/name/{name} + /v2/types/typedef/guid/{guid} + /v2/types/typedef/name/{name} + +DELETE GET POST PUT + GET + GET + GET + GET + GET + GET + GET + GET + GET + GET + GET + +REST interface for CRUD operations on type definitions + + + + + + + +Generated by http://enunciate.webcohesion.com;>Enunciate. + + + + + + + + + + https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"> + + + https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"> + + + https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"> + +$(function() { + $(".clickable-row").click(function() { +window.document.location = $(this).data("href"); + }); + + $('[data-toggle="tooltip"]').tooltip() +}); + + + + http://git-wip-us.apache.org/repos/asf/atlas-website/blob/525c122e/0.8.2/api/v2/syntax_json.html -- diff --git a/0.8.2/api/v2/syntax_json.html b/0.8.2/api/v2/syntax_json.html new file mode 100644 index 000..b925382 --- /dev/null +++ b/0.8.2/api/v2/syntax_json.html @@ -0,0 +1,391 @@ + + + + + + + + + Atlas REST API: JSON + + + + + + https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css;> + + + + + + + + + + + + + + + Toggle navigation + + + + +Atlas REST API: JSON + + + + Resources + Data Types + + + + + + + + + + Back to Top + + + + + + Home + JSON + + + JSON + + + + + type + description + + + + +AtlasAttributeDef + +class that captures details of a struct-attribute. + + + +AtlasBaseModelObject + + + + + +AtlasBaseTypeDef + +Base class that captures common-attributes for all Atlas types. + + + +AtlasClassification + +An instance of a classification; it doesn't have an identity, this object exists only when associated with an entity. + + + +
[38/39] atlas-website git commit: ATLAS-2428: update Apache Atlas website for 0.8.2 release
http://git-wip-us.apache.org/repos/asf/atlas-website/blob/525c122e/0.8.2/Configuration.html -- diff --git a/0.8.2/Configuration.html b/0.8.2/Configuration.html new file mode 100644 index 000..844c497 --- /dev/null +++ b/0.8.2/Configuration.html @@ -0,0 +1,313 @@ + + +http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> + + + + + +Apache Atlas Configuring Apache Atlas - Application Properties + + + + + + + + + + + +Atlas + +About +https://cwiki.apache.org/confluence/display/ATLAS; title="Wiki">Wiki +https://cwiki.apache.org/confluence/display/ATLAS; title="News">News +https://git-wip-us.apache.org/repos/asf/atlas.git; title="Git">Git +https://issues.apache.org/jira/browse/ATLAS; title="Jira">Jira +https://cwiki.apache.org/confluence/display/ATLAS/PoweredBy; title="Powered by">Powered by +http://blogs.apache.org/atlas/; title="Blog">Blog + + + +Project Information + +Summary +Mailing Lists +http://webchat.freenode.net?channels=apacheatlas=d4; title="IRC">IRC +Team +Issue Tracking +Source Repository +License + + + +Releases + +http://www.apache.org/dyn/closer.cgi/atlas/0.8.2/; title="0.8.2">0.8.2 +http://archive.apache.org/dist/incubator/atlas/0.8.1/; title="0.8.1">0.8.1 +http://archive.apache.org/dist/incubator/atlas/0.8.0-incubating/; title="0.8-incubating">0.8-incubating +http://archive.apache.org/dist/incubator/atlas/0.7.1-incubating/; title="0.7.1-incubating">0.7.1-incubating +http://archive.apache.org/dist/incubator/atlas/0.7.0-incubating/; title="0.7-incubating">0.7-incubating +http://archive.apache.org/dist/incubator/atlas/0.6.0-incubating/; title="0.6-incubating">0.6-incubating +http://archive.apache.org/dist/incubator/atlas/0.5.0-incubating/; title="0.5-incubating">0.5-incubating + + + +Documentation + +latest +0.8.2 +0.8.1 +0.8-incubating +0.7.1-incubating +0.7-incubating +0.6-incubating +0.5-incubating + + + +ASF + +http://www.apache.org/foundation/how-it-works.html; title="How Apache Works">How Apache Works +http://www.apache.org/foundation/; title="Foundation">Foundation +http://www.apache.org/foundation/sponsorship.html; title="Sponsoring Apache">Sponsoring Apache +http://www.apache.org/foundation/thanks.html; title="Thanks">Thanks + + + +https://www.google.com/search; method="get" class="navbar-search pull-right" > + http://atlas.apache.org; name="sitesearch" type="hidden"/> + + +asyncJs( 'https://cse.google.com/brand?form=search-form' ) +https://www.facebook.com/plugins/like.php?href=http://atlas.apache.org/atlas-docs=false=button_count=false=like=dark; +scrolling="no" frameborder="0" +style="border:none; width:100px; height:20px; margin-top: 10px;" class="pull-right" > +asyncJs( 'https://apis.google.com/js/plusone.js' ) + +http://atlas.apache.org/atlas-docs; data-size="medium" width="60px" align="right" > + + + + + + + + + + + + + + + http://www.apache.org; class="externalLink" title="Apache">Apache/ + Atlas/ +Configuring Apache Atlas - Application Properties +| Last Published: 2018-02-05 + Version: 0.8.2 + + + + +Configuring Apache Atlas - Application Properties +All configuration in Atlas uses java properties style configuration. The main configuration file is atlas-application.properties which is in the conf dir at the deployed location. It consists of the following sections: + +Graph Configs + +Graph Persistence engine - HBase +Set the following properties to configure Atlas to use HBase as the persistence engine. Please refer to http://s3.thinkaurelius.com/docs/titan/0.5.4/titan-config-ref.html;>link for more details. + +atlas.graph.storage.backend=hbase +atlas.graph.storage.hostname=ZooKeeper Quorum +atlas.graph.storage.hbase.table=atlas + +If any further Titan configuration needs to be setup, please prefix the property name with atlas.graph.. +In addition to setting up configurations, please ensure that environment variable HBASE_CONF_DIR is setup to point to the directory containing HBase
[39/39] atlas-website git commit: ATLAS-2428: update Apache Atlas website for 0.8.2 release
ATLAS-2428: update Apache Atlas website for 0.8.2 release Project: http://git-wip-us.apache.org/repos/asf/atlas-website/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas-website/commit/525c122e Tree: http://git-wip-us.apache.org/repos/asf/atlas-website/tree/525c122e Diff: http://git-wip-us.apache.org/repos/asf/atlas-website/diff/525c122e Branch: refs/heads/asf-site Commit: 525c122e320f34b2997c5300e7f4662e71e671d9 Parents: 3ea1cf7 Author: Madhan Neethiraj <mad...@apache.org> Authored: Mon Feb 5 01:05:23 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Mon Feb 5 01:14:50 2018 -0800 -- 0.8.2/Architecture.html | 166 + 0.8.2/Authentication-Authorization.html | 266 + 0.8.2/Bridge-Falcon.html| 188 + 0.8.2/Bridge-Hive.html | 265 + 0.8.2/Bridge-Sqoop.html | 181 + 0.8.2/Configuration.html| 313 + 0.8.2/EclipseSetup.html | 218 + 0.8.2/Export-API.html | 296 + 0.8.2/Export-HDFS-API.html | 156 + 0.8.2/HighAvailability.html | 296 + 0.8.2/Import-API-Options.html | 259 + 0.8.2/Import-API.html | 285 + 0.8.2/Import-Export-API.html| 160 + 0.8.2/InstallationSteps.html| 394 + 0.8.2/Notification-Entity.html | 158 + 0.8.2/QuickStart.html | 151 + 0.8.2/Search.html | 417 + 0.8.2/StormAtlasHook.html | 197 + 0.8.2/TypeSystem.html | 276 + 0.8.2/api/v2/application.wadl | 842 + 0.8.2/api/v2/css/style.css | 115 + 0.8.2/api/v2/data.html | 446 + 0.8.2/api/v2/index.html | 568 + 0.8.2/api/v2/json_AtlasAttributeDef.html| 222 + 0.8.2/api/v2/json_AtlasBaseModelObject.html | 136 + 0.8.2/api/v2/json_AtlasBaseTypeDef.html | 319 + 0.8.2/api/v2/json_AtlasClassification.html | 142 + 0.8.2/api/v2/json_AtlasClassificationDef.html | 358 + 0.8.2/api/v2/json_AtlasClassifications.html | 167 + 0.8.2/api/v2/json_AtlasConstraintDef.html | 143 + 0.8.2/api/v2/json_AtlasEntitiesWithExtInfo.html | 249 + 0.8.2/api/v2/json_AtlasEntity.html | 234 + 0.8.2/api/v2/json_AtlasEntityDef.html | 358 + 0.8.2/api/v2/json_AtlasEntityExtInfo.html | 187 + 0.8.2/api/v2/json_AtlasEntityHeader.html| 204 + 0.8.2/api/v2/json_AtlasEntityWithExtInfo.html | 223 + 0.8.2/api/v2/json_AtlasEnumDef.html | 310 + 0.8.2/api/v2/json_AtlasEnumElementDef.html | 150 + 0.8.2/api/v2/json_AtlasFullTextResult.html | 163 + 0.8.2/api/v2/json_AtlasLineageInfo.html | 225 + 0.8.2/api/v2/json_AtlasQueryType.html | 138 + 0.8.2/api/v2/json_AtlasSearchResult.html| 361 + 0.8.2/api/v2/json_AtlasStruct.html | 145 + 0.8.2/api/v2/json_AtlasStructDef.html | 338 + 0.8.2/api/v2/json_AtlasTypeDefHeader.html | 150 + 0.8.2/api/v2/json_AtlasTypesDef.html| 532 + 0.8.2/api/v2/json_AtlasUserSavedSearch.html | 207 + 0.8.2/api/v2/json_AttributeSearchResult.html| 140 + 0.8.2/api/v2/json_Cardinality.html | 126 + .../v2/json_ClassificationAssociateRequest.html | 146 + 0.8.2/api/v2/json_Condition.html| 122 + 0.8.2/api/v2/json_Currency.html | 194 + 0.8.2/api/v2/json_DateFormat.html | 599 + 0.8.2/api/v2/json_EntityMutationResponse.html | 561 + 0.8.2/api/v2/json_EntityOperation.html | 130 + 0.8.2/api/v2/json_FilterCriteria.html | 182 + 0.8.2/api/v2/json_Format.html | 125 + 0.8.2/api/v2/json_LineageDirection.html | 126 + 0.8.2/api/v2/json_LineageRelation.html | 140 + 0.8.2/api/v2/json_Locale.html | 357 + 0.8.2/api/v2/json_NumberFormat.html | 609 + 0.8.2/api/v2/json_Operator.html | 176 + 0.8.2/api/v2/json_PList.html| 180 + 0.8.2/api/v2/json_RoundingMode.html | 146 + 0.8.2/api/v2/json_SavedSearchType.html | 122 + 0.8.2/api/v2/json_SearchParameters.html | 252 + 0.8.2/api/v2/json_SortType.html | 126 + 0.8.2/api/v2/json_Status.html | 122 + 0.8.2/api/v2/json_TimeZone.html | 191 + 0.8.2/api/v2/json_TypeCategory.html | 150 + 0.8.2/api/v2/ns0.xsd| 128 + 0.8.2/api/v2/resource_DiscoveryREST.html| 2763 ++ 0.8.2/api/v2/resource_EntityREST.html
[23/39] atlas-website git commit: ATLAS-2428: update Apache Atlas website for 0.8.2 release
http://git-wip-us.apache.org/repos/asf/atlas-website/blob/525c122e/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.svg -- diff --git a/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.svg b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.svg new file mode 100644 index 000..a54 --- /dev/null +++ b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.svg @@ -0,0 +1,411 @@ + +http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd;> +http://www.w3.org/2000/svg;> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/atlas-website/blob/525c122e/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.ttf -- diff --git a/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.ttf b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.ttf new file mode 100644 index 000..15896c4 Binary files /dev/null and b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.ttf differ http://git-wip-us.apache.org/repos/asf/atlas-website/blob/525c122e/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.woff -- diff --git a/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.woff b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.woff new file mode 100644 index 000..67e3e25 Binary files /dev/null and b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.woff differ http://git-wip-us.apache.org/repos/asf/atlas-website/blob/525c122e/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.woff2 -- diff --git a/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.woff2 b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.woff2 new file mode 100644 index 000..1e726a7 Binary files /dev/null and b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-700.woff2 differ http://git-wip-us.apache.org/repos/asf/atlas-website/blob/525c122e/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-regular.eot -- diff --git a/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-regular.eot b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-regular.eot new file mode 100644 index 000..ac2698e Binary files /dev/null and b/0.8.2/api/v2/ui/fonts/droid-sans-v6-latin-regular.eot differ
[27/39] atlas-website git commit: ATLAS-2428: update Apache Atlas website for 0.8.2 release
http://git-wip-us.apache.org/repos/asf/atlas-website/blob/525c122e/0.8.2/api/v2/resource_LineageREST.html -- diff --git a/0.8.2/api/v2/resource_LineageREST.html b/0.8.2/api/v2/resource_LineageREST.html new file mode 100644 index 000..fef8b32 --- /dev/null +++ b/0.8.2/api/v2/resource_LineageREST.html @@ -0,0 +1,272 @@ + + + + + + + + + Atlas REST API: LineageREST + + + + + + https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css;> + + + + + + + + + + + + + + + Toggle navigation + + + + +Atlas REST API: LineageREST + + + + Resources + Data Types + + + + + + + + + + GET /v2/lineage/{guid} + + Back to Top + + + + + + Home + Resources + LineageREST + + + LineageREST Resource + + REST interface for an entity's lineage information + + +GET /v2/lineage/{guid} + +Returns lineage info about entity. + + + Request Parameters + + +name +type +description +default +constraints + + + + +guid +path +- unique entity id + + + + +depth +query +- number of hops for lineage +3 +int + + +direction +query +- input, output or both +BOTH +"BOTH" or "INPUT" or "OUTPUT" + + + + + + Response Codes + + +code +condition + + + + +200 +If Lineage exists for the given entity + + +400 +Bad query parameters + + +404 +If no lineage is found for the given entity + + + + + + Response Body + + +media type +data type +description + + + + +application/json +AtlasLineageInfo + (JSON) +AtlasLineageInfo + + + +Example + + + + + Request + +GET /v2/lineage/{guid} +Accept: application/json + + + + + Response + +HTTP/1.1 200 OK +Content-Type: application/json + + +{ + baseEntityGuid : ..., + guidEntityMap : { +property1 : { + guid : ..., + status : DELETED, + displayText : ..., + classificationNames : [ ..., ... ], + classifications : [ { +typeName : ..., +attributes : { + property1 : { }, + property2 : { } +} + }, { +typeName : ..., +attributes : { + property1 : { }, + property2 : { } +} + } ], + typeName : ..., + attributes : { +property1 : { }, +property2 : { } + } +}, +property2 : { + guid : ..., + status : DELETED, + displayText : ..., + classificationNames : [ ..., ... ], + classifications : [ { +typeName : ..., +attributes : { + property1 : { }, + property2 : { } +} + }, { +typeName : ..., +attributes : { + property1 : { }, + property2 : { } +} + } ], + typeName : ..., + attributes : { +property1 : { }, +property2 : { } + } +} + }, + relations : [ { +fromEntityId : ..., +toEntityId : ... + }, { +fromEntityId : ..., +toEntityId : ... + } ], + lineageDirection : INPUT, + lineageDepth : 12345 +} + + + + + + + + + +Generated by http://enunciate.webcohesion.com;>Enunciate. + + + + + + + + + + https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"> + + + https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"> + + + https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js" type="text/javascript"> + +$(function() { + $(".clickable-row").click(function() { +window.document.location = $(this).data("href"); + }); + + $('[data-toggle="tooltip"]').tooltip() +}); + + + +
atlas-website git commit: ATLAS-2428: update Apache Atlas website for 0.8.2 release (#2)
Repository: atlas-website Updated Branches: refs/heads/asf-site 525c122e3 -> dc29f6a1b ATLAS-2428: update Apache Atlas website for 0.8.2 release (#2) Project: http://git-wip-us.apache.org/repos/asf/atlas-website/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas-website/commit/dc29f6a1 Tree: http://git-wip-us.apache.org/repos/asf/atlas-website/tree/dc29f6a1 Diff: http://git-wip-us.apache.org/repos/asf/atlas-website/diff/dc29f6a1 Branch: refs/heads/asf-site Commit: dc29f6a1b48eff9de0b99f7e52f4748b2141f331 Parents: 525c122 Author: Madhan Neethiraj <mad...@apache.org> Authored: Mon Feb 5 01:26:21 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Mon Feb 5 01:26:21 2018 -0800 -- 0.8.2/Architecture.html | 2 ++ 0.8.2/Authentication-Authorization.html | 2 ++ 0.8.2/Bridge-Falcon.html| 2 ++ 0.8.2/Bridge-Hive.html | 2 ++ 0.8.2/Bridge-Sqoop.html | 2 ++ 0.8.2/Configuration.html| 2 ++ 0.8.2/EclipseSetup.html | 2 ++ 0.8.2/Export-API.html | 2 ++ 0.8.2/Export-HDFS-API.html | 2 ++ 0.8.2/HighAvailability.html | 2 ++ 0.8.2/Import-API-Options.html | 2 ++ 0.8.2/Import-API.html | 2 ++ 0.8.2/Import-Export-API.html| 2 ++ 0.8.2/InstallationSteps.html| 2 ++ 0.8.2/Notification-Entity.html | 2 ++ 0.8.2/QuickStart.html | 2 ++ 0.8.2/Search.html | 2 ++ 0.8.2/StormAtlasHook.html | 2 ++ 0.8.2/TypeSystem.html | 2 ++ 0.8.2/index.html| 4 +++- 0.8.2/issue-tracking.html | 2 ++ 0.8.2/license.html | 2 ++ 0.8.2/mail-lists.html | 2 ++ 0.8.2/project-info.html | 2 ++ 0.8.2/security.html | 2 ++ 0.8.2/source-repository.html| 2 ++ 0.8.2/team-list.html| 2 ++ 27 files changed, 55 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/atlas-website/blob/dc29f6a1/0.8.2/Architecture.html -- diff --git a/0.8.2/Architecture.html b/0.8.2/Architecture.html index e690d0f..2517123 100644 --- a/0.8.2/Architecture.html +++ b/0.8.2/Architecture.html @@ -47,6 +47,7 @@ Releases +http://www.apache.org/dyn/closer.cgi/atlas/1.0.0-alpha/; title="1.0.0-alpha">1.0.0-alpha http://www.apache.org/dyn/closer.cgi/atlas/0.8.2/; title="0.8.2">0.8.2 http://archive.apache.org/dist/incubator/atlas/0.8.1/; title="0.8.1">0.8.1 http://archive.apache.org/dist/incubator/atlas/0.8.0-incubating/; title="0.8-incubating">0.8-incubating @@ -60,6 +61,7 @@ Documentation latest +1.0.0-alpha 0.8.2 0.8.1 0.8-incubating http://git-wip-us.apache.org/repos/asf/atlas-website/blob/dc29f6a1/0.8.2/Authentication-Authorization.html -- diff --git a/0.8.2/Authentication-Authorization.html b/0.8.2/Authentication-Authorization.html index 3704d7c..3fa0a3c 100644 --- a/0.8.2/Authentication-Authorization.html +++ b/0.8.2/Authentication-Authorization.html @@ -47,6 +47,7 @@ Releases +http://www.apache.org/dyn/closer.cgi/atlas/1.0.0-alpha/; title="1.0.0-alpha">1.0.0-alpha http://www.apache.org/dyn/closer.cgi/atlas/0.8.2/; title="0.8.2">0.8.2 http://archive.apache.org/dist/incubator/atlas/0.8.1/; title="0.8.1">0.8.1 http://archive.apache.org/dist/incubator/atlas/0.8.0-incubating/; title="0.8-incubating">0.8-incubating @@ -60,6 +61,7 @@ Documentation latest +1.0.0-alpha 0.8.2 0.8.1 0.8-incubating http://git-wip-us.apache.org/repos/asf/atlas-website/blob/dc29f6a1/0.8.2/Bridge-Falcon.html -- diff --git a/0.8.2/Bridge-Falcon.html b/0.8.2/Bridge-Falcon.html index 73af88c..2dcb207 100644 --- a/0.8.2/Bridge-Falcon.html +++ b/0.8.2/Bridge-Falcon.html @@ -47,6 +47,7 @@ Releases +http://www.apache.org/dyn/closer.cgi/atlas/1.0.0-alpha/; title="1.0.0-alpha">1.0.0-alpha http://www.apache.org/dyn/closer.cgi/atlas/0.8.2/; title="0.8.2">0.8.2 http://archive.apache.org/dist/incubator/atlas/0.8.1/; title="0.8.1">0.8.1 http://archive.apa
[2/2] atlas-website git commit: ATLAS-2428: update Apache Atlas website for 0.8.2 release (#3) - added links from home page
ATLAS-2428: update Apache Atlas website for 0.8.2 release (#3) - added links from home page Project: http://git-wip-us.apache.org/repos/asf/atlas-website/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas-website/commit/f0d507e8 Tree: http://git-wip-us.apache.org/repos/asf/atlas-website/tree/f0d507e8 Diff: http://git-wip-us.apache.org/repos/asf/atlas-website/diff/f0d507e8 Branch: refs/heads/asf-site Commit: f0d507e82517ef02dfecf944cba994312112d075 Parents: dc29f6a Author: Madhan Neethiraj <mad...@apache.org> Authored: Mon Feb 5 01:37:04 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Mon Feb 5 01:42:10 2018 -0800 -- Architecture.html | 8 ++-- Authentication-Authorization.html | 8 ++-- Bridge-Falcon.html| 8 ++-- Bridge-Hive.html | 8 ++-- Bridge-Sqoop.html | 8 ++-- Configuration.html| 8 ++-- EclipseSetup.html | 8 ++-- Export-API.html | 8 ++-- Export-HDFS-API.html | 8 ++-- HighAvailability.html | 8 ++-- Import-API-Options.html | 8 ++-- Import-API.html | 8 ++-- Import-Export-API.html| 8 ++-- InstallationSteps.html| 8 ++-- Notification-Entity.html | 8 ++-- QuickStart.html | 8 ++-- Search.html | 8 ++-- Security.html | 8 ++-- StormAtlasHook.html | 8 ++-- TypeSystem.html | 8 ++-- index.html| 8 ++-- issue-tracking.html | 8 ++-- license.html | 8 ++-- mail-lists.html | 8 ++-- project-info.html | 8 ++-- source-repository.html| 8 ++-- team-list.html| 79 +++--- 27 files changed, 175 insertions(+), 112 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas-website/blob/f0d507e8/Architecture.html -- diff --git a/Architecture.html b/Architecture.html index d2b8e92..78feab3 100644 --- a/Architecture.html +++ b/Architecture.html @@ -1,13 +1,13 @@ http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> - + Apache Atlas Architecture @@ -48,6 +48,7 @@ Releases http://www.apache.org/dyn/closer.cgi/atlas/1.0.0-alpha/; title="1.0.0-alpha">1.0.0-alpha +http://www.apache.org/dyn/closer.cgi/atlas/0.8.2/; title="0.8.2">0.8.2 http://www.apache.org/dyn/closer.cgi/atlas/0.8.1/; title="0.8.1">0.8.1 http://archive.apache.org/dist/incubator/atlas/0.8.0-incubating/; title="0.8-incubating">0.8-incubating http://archive.apache.org/dist/incubator/atlas/0.7.1-incubating/; title="0.7.1-incubating">0.7.1-incubating @@ -61,6 +62,7 @@ latest 1.0.0-alpha +0.8.2 0.8.1 0.8-incubating 0.7.1-incubating @@ -107,7 +109,7 @@ http://www.apache.org; class="externalLink" title="Apache">Apache/ Atlas/ Architecture -| Last Published: 2018-01-25 +| Last Published: 2018-02-05 Version: 1.0.0-alpha http://git-wip-us.apache.org/repos/asf/atlas-website/blob/f0d507e8/Authentication-Authorization.html -- diff --git a/Authentication-Authorization.html b/Authentication-Authorization.html index 6b59678..2ed972c 100644 --- a/Authentication-Authorization.html +++ b/Authentication-Authorization.html @@ -1,13 +1,13 @@ http://www.w3.org/1999/xhtml; xml:lang="en" lang="en"> - + Apache Atlas Authentication & Authorization in Apache Atlas. @@ -48,6 +48,7 @@ Releases http://www.apache.org/dyn/closer.cgi/atlas/1.0.0-alpha/; title="1.0.0-alpha">1.0.0-alpha +http://www.apache.org/dyn/closer.cgi/atlas/0.8.2/; title="0.8.2">0.8.2 http://www.apache.org/dyn/closer.cgi/atlas/0.8.1/; title="0.8.1">0.8.1 http://archive.apache.org/dist/incubator/atlas/0.8.0-incubating/; title="0.8-incubating">0.8-incubating http://archive.apache.org/dist/incubator/atlas/0.7.1-incubating/; title="0.7.1-incubating">0.7.1-incubating @@ -61,6 +62,7 @@ latest 1.0.0-alpha +0.8.2 0.8.1 0.8-incubating
atlas git commit: ATLAS-2432: version in pom.xml files updated from 0.8.2 to 0.8.3-SNAPSHOT
Repository: atlas Updated Branches: refs/heads/branch-0.8 cd8f80d79 -> 99593dff7 ATLAS-2432: version in pom.xml files updated from 0.8.2 to 0.8.3-SNAPSHOT Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/99593dff Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/99593dff Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/99593dff Branch: refs/heads/branch-0.8 Commit: 99593dff779a364994fc5d9f1daf7a72fa20d163 Parents: cd8f80d Author: Madhan Neethiraj <mad...@apache.org> Authored: Mon Feb 5 09:03:29 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Mon Feb 5 09:03:29 2018 -0800 -- addons/falcon-bridge-shim/pom.xml | 2 +- addons/falcon-bridge/pom.xml | 2 +- addons/hbase-bridge-shim/pom.xml | 2 +- addons/hbase-bridge/pom.xml| 2 +- addons/hdfs-model/pom.xml | 2 +- addons/hive-bridge-shim/pom.xml| 2 +- addons/hive-bridge/pom.xml | 2 +- addons/sqoop-bridge-shim/pom.xml | 2 +- addons/sqoop-bridge/pom.xml| 2 +- addons/storm-bridge-shim/pom.xml | 2 +- addons/storm-bridge/pom.xml| 2 +- authorization/pom.xml | 2 +- catalog/pom.xml| 2 +- client/client-v1/pom.xml | 2 +- client/client-v2/pom.xml | 2 +- client/common/pom.xml | 2 +- client/pom.xml | 2 +- common/pom.xml | 2 +- dashboardv2/pom.xml| 2 +- distro/pom.xml | 2 +- docs/pom.xml | 2 +- graphdb/api/pom.xml| 2 +- graphdb/common/pom.xml | 2 +- graphdb/graphdb-impls/pom.xml | 2 +- graphdb/pom.xml| 2 +- graphdb/titan0/pom.xml | 2 +- graphdb/titan1/pom.xml | 2 +- intg/pom.xml | 2 +- notification/pom.xml | 2 +- plugin-classloader/pom.xml | 2 +- pom.xml| 2 +- repository/pom.xml | 2 +- server-api/pom.xml | 2 +- shaded/hbase-client-shaded/pom.xml | 2 +- shaded/hbase-server-shaded/pom.xml | 2 +- typesystem/pom.xml | 2 +- webapp/pom.xml | 2 +- 37 files changed, 37 insertions(+), 37 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/99593dff/addons/falcon-bridge-shim/pom.xml -- diff --git a/addons/falcon-bridge-shim/pom.xml b/addons/falcon-bridge-shim/pom.xml index b3f333f..440da2b 100755 --- a/addons/falcon-bridge-shim/pom.xml +++ b/addons/falcon-bridge-shim/pom.xml @@ -22,7 +22,7 @@ apache-atlas org.apache.atlas -0.8.2 +0.8.3-SNAPSHOT ../../ falcon-bridge-shim http://git-wip-us.apache.org/repos/asf/atlas/blob/99593dff/addons/falcon-bridge/pom.xml -- diff --git a/addons/falcon-bridge/pom.xml b/addons/falcon-bridge/pom.xml index 0630516..06a4b2f 100644 --- a/addons/falcon-bridge/pom.xml +++ b/addons/falcon-bridge/pom.xml @@ -22,7 +22,7 @@ apache-atlas org.apache.atlas -0.8.2 +0.8.3-SNAPSHOT ../../ falcon-bridge http://git-wip-us.apache.org/repos/asf/atlas/blob/99593dff/addons/hbase-bridge-shim/pom.xml -- diff --git a/addons/hbase-bridge-shim/pom.xml b/addons/hbase-bridge-shim/pom.xml index 220cc67..bf9b1b0 100644 --- a/addons/hbase-bridge-shim/pom.xml +++ b/addons/hbase-bridge-shim/pom.xml @@ -22,7 +22,7 @@ apache-atlas org.apache.atlas -0.8.2 +0.8.3-SNAPSHOT ../../ hbase-bridge-shim http://git-wip-us.apache.org/repos/asf/atlas/blob/99593dff/addons/hbase-bridge/pom.xml -- diff --git a/addons/hbase-bridge/pom.xml b/addons/hbase-bridge/pom.xml index c8fc06a..8f50170 100644 --- a/addons/hbase-bridge/pom.xml +++ b/addons/hbase-bridge/pom.xml @@ -22,7 +22,7 @@ apache-atlas org.apache.atlas -0.8.2 +0.8.3-SNAPSHOT ../../ hbase-bridge http://git-wip-us.apache.org/repos/asf/atlas/blob/99593dff/addons/hdfs-model/pom.xml -- diff --git a/addons/hdfs-model/pom.xml b/addons/hdfs-model/pom.xml index d898894..627b6d8 100644 --- a/addons/hdfs-model/pom.xml +++ b/addons/hdfs-model/pom.xml @@ -22,7 +22,7 @@ apache-atlas org.apache.atlas -0.8.2 +0.8.3-SNAPSHOT ../../ hdfs-model http://git-wip-us.apache.org/repos/asf/atla
atlas git commit: ATLAS-2434: Performance improvement for import operation.
Repository: atlas Updated Branches: refs/heads/master 4582d4a45 -> ad4db42ef ATLAS-2434: Performance improvement for import operation. Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/ad4db42e Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/ad4db42e Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/ad4db42e Branch: refs/heads/master Commit: ad4db42ef409d4283741906e22b657bab59f3d58 Parents: 4582d4a Author: Ashutosh Mestry <ames...@hortonworks.com> Authored: Wed Feb 7 13:02:31 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Feb 7 20:57:48 2018 -0800 -- .../apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java | 3 ++- .../apache/atlas/repository/store/graph/v1/BulkImporterImpl.java | 3 +++ .../apache/atlas/repository/store/graph/v1/EntityGraphMapper.java | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/ad4db42e/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java index fdc6024..13ee2a6 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java @@ -253,7 +253,8 @@ public class AtlasGraphUtilsV1 { } else { vertex = AtlasGraphUtilsV1.findByTypeAndPropertyName(entityType.getTypeName(), attribute.getVertexPropertyName(), attrValue); -if (vertex == null) { +// if no instance of given typeName is found, try to find an instance of type's sub-type +if (vertex == null && !entityType.getAllSubTypes().isEmpty()) { vertex = AtlasGraphUtilsV1.findBySuperTypeAndPropertyName(entityType.getTypeName(), attribute.getVertexPropertyName(), attrValue); } } http://git-wip-us.apache.org/repos/asf/atlas/blob/ad4db42e/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java index 467ced7..af31095 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/BulkImporterImpl.java @@ -19,6 +19,7 @@ package org.apache.atlas.repository.store.graph.v1; import com.google.common.annotations.VisibleForTesting; import org.apache.atlas.AtlasErrorCode; +import org.apache.atlas.RequestContextV1; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.model.impexp.AtlasImportResult; import org.apache.atlas.model.instance.AtlasEntity; @@ -98,6 +99,8 @@ public class BulkImporterImpl implements BulkImporter { if (!updateResidualList(abe, residualList, entityWithExtInfo.getEntity().getGuid())) { throw abe; } +} finally { +RequestContextV1.clear(); } } http://git-wip-us.apache.org/repos/asf/atlas/blob/ad4db42e/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java index b961e20..c203ff4 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java @@ -1463,7 +1463,7 @@ public class EntityGraphMapper { AtlasObjectIdobjectId = new AtlasObjectId(GraphHelper.getGuid(vertex), GraphHelper.getTypeName(vertex)); RequestContextV1 req = RequestContextV1.get(); -if (!objectIdsContain(req.getUpdatedEntityIds(), objectId)) { +if (!objectIdsContain(req.getUpdatedEntityIds(), objectId) && !objectIdsContain(req.getCreatedEntityIds(), objectId)) { req.recordEntityUpdate(objectId); } }
atlas git commit: ATLAS-2169: delete request fails when hard-delete is configured
Repository: atlas Updated Branches: refs/heads/master ad6b07a98 -> 154dda0e5 ATLAS-2169: delete request fails when hard-delete is configured Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/154dda0e Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/154dda0e Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/154dda0e Branch: refs/heads/master Commit: 154dda0e5b03020b405faed8fd37f15654f492f4 Parents: ad6b07a Author: Madhan Neethiraj <mad...@apache.org> Authored: Sun Feb 11 02:26:28 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Sun Feb 11 22:31:36 2018 -0800 -- .../model/instance/EntityMutationResponse.java | 35 +- .../atlas/repository/graph/GraphHelper.java | 64 +-- .../graph/v1/AtlasEntityChangeNotifier.java | 15 +- .../store/graph/v1/AtlasEntityStoreV1.java | 14 +- .../store/graph/v1/DeleteHandlerV1.java | 522 ++- .../store/graph/v1/EntityGraphMapper.java | 50 +- .../store/graph/v1/EntityGraphRetriever.java| 64 +++ .../java/org/apache/atlas/RequestContextV1.java | 63 +-- 8 files changed, 452 insertions(+), 375 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/154dda0e/intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java b/intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java index 05411d6..4589262 100644 --- a/intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java +++ b/intg/src/main/java/org/apache/atlas/model/instance/EntityMutationResponse.java @@ -195,7 +195,7 @@ public class EntityMutationResponse { public void addEntity(EntityOperation op, AtlasEntityHeader header) { // if an entity is already included in CREATE, ignore subsequent UPDATE, PARTIAL_UPDATE if (op == EntityOperation.UPDATE || op == EntityOperation.PARTIAL_UPDATE) { -if (entityHeaderExists(getCreatedEntities(), header)) { +if (entityHeaderExists(getCreatedEntities(), header.getGuid())) { return; } } @@ -211,17 +211,42 @@ public class EntityMutationResponse { mutatedEntities.put(op, opEntities); } -if (!entityHeaderExists(opEntities, header)) { +if (!entityHeaderExists(opEntities, header.getGuid())) { opEntities.add(header); } } -private boolean entityHeaderExists(List entityHeaders, AtlasEntityHeader newEntityHeader) { +@JsonIgnore +public void addEntity(EntityOperation op, AtlasObjectId entity) { +if (mutatedEntities == null) { +mutatedEntities = new HashMap<>(); +} else { +// if an entity is already included in CREATE, ignore subsequent UPDATE, PARTIAL_UPDATE +if (op == EntityOperation.UPDATE || op == EntityOperation.PARTIAL_UPDATE) { +if (entityHeaderExists(getCreatedEntities(), entity.getGuid())) { +return; +} +} +} + +List opEntities = mutatedEntities.get(op); + +if (opEntities == null) { +opEntities = new ArrayList<>(); +mutatedEntities.put(op, opEntities); +} + +if (!entityHeaderExists(opEntities, entity.getGuid())) { +opEntities.add(new AtlasEntityHeader(entity.getTypeName(), entity.getGuid(), entity.getUniqueAttributes())); +} +} + +private boolean entityHeaderExists(List entityHeaders, String guid) { boolean ret = false; -if (CollectionUtils.isNotEmpty(entityHeaders) && newEntityHeader != null) { +if (CollectionUtils.isNotEmpty(entityHeaders) && guid != null) { for (AtlasEntityHeader entityHeader : entityHeaders) { -if (StringUtils.equals(entityHeader.getGuid(), newEntityHeader.getGuid())) { +if (StringUtils.equals(entityHeader.getGuid(), guid)) { ret = true; break; } http://git-wip-us.apache.org/repos/asf/atlas/blob/154dda0e/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java index 4d2b284..d61bff2 100755 --- a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java +++ b/repository/src/main/java/org/apache/atlas/repository/grap
atlas git commit: ATLAS-2435: performance improvements in relationship instance create/update, entity update
Repository: atlas Updated Branches: refs/heads/master e545c9ffd -> ad6b07a98 ATLAS-2435: performance improvements in relationship instance create/update, entity update Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/ad6b07a9 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/ad6b07a9 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/ad6b07a9 Branch: refs/heads/master Commit: ad6b07a981510408d0627a7260a6de2aae771f57 Parents: e545c9f Author: Madhan Neethiraj <mad...@apache.org> Authored: Thu Feb 8 22:51:46 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Feb 9 19:18:42 2018 -0800 -- .../java/org/apache/atlas/AtlasErrorCode.java | 3 +- .../model/instance/AtlasClassification.java | 4 + .../atlas/model/instance/AtlasEntity.java | 51 + .../atlas/model/instance/AtlasRelationship.java | 84 .../atlas/model/instance/AtlasStruct.java | 16 ++ .../org/apache/atlas/type/AtlasArrayType.java | 126 .../apache/atlas/type/AtlasBuiltInTypes.java| 54 + .../atlas/type/AtlasClassificationType.java | 11 ++ .../org/apache/atlas/type/AtlasEntityType.java | 12 ++ .../org/apache/atlas/type/AtlasMapType.java | 68 +++ .../atlas/type/AtlasRelationshipType.java | 97 ++--- .../org/apache/atlas/type/AtlasStructType.java | 74 ++- .../java/org/apache/atlas/type/AtlasType.java | 27 +++ .../org/apache/atlas/utils/AtlasEntityUtil.java | 29 +-- .../store/graph/AtlasRelationshipStore.java | 6 + .../graph/v1/AtlasEntityChangeNotifier.java | 21 +- .../store/graph/v1/AtlasEntityStoreV1.java | 79 .../graph/v1/AtlasRelationshipStoreV1.java | 195 ++- .../store/graph/v1/EntityGraphMapper.java | 20 +- .../store/graph/v1/EntityMutationContext.java | 16 +- 20 files changed, 820 insertions(+), 173 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/ad6b07a9/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 7d88547..ff09e6c 100644 --- a/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java +++ b/intg/src/main/java/org/apache/atlas/AtlasErrorCode.java @@ -120,7 +120,8 @@ public enum AtlasErrorCode { INVALID_DSL_DUPLICATE_ALIAS(400, "ATLAS-400-00-066", "DSL Semantic Error - Duplicate alias found: '{0}' for type '{1}' already present."), INVALID_DSL_INVALID_DATE(400, "ATLAS-400-00-067", "DSL Semantic Error - Date format: {0}."), INVALID_DSL_HAS_PROPERTY(400, "ATLAS-400-00-068", "DSL Semantic Error - Property needs to be a primitive type: {0}"), - +RELATIONSHIP_UPDATE_END_CHANGE_NOT_ALLOWED(404, "ATLAS-400-00-069", "change of relationship end is not permitted. relationship-type={}, relationship-guid={}, end-guid={}, updated-end-guid={}"), +RELATIONSHIP_UPDATE_TYPE_CHANGE_NOT_ALLOWED(404, "ATLAS-400-00-06A", "change of relationship type is not permitted. relationship-guid={}, current-type={}, new-type={}"), // All Not found enums go here TYPE_NAME_NOT_FOUND(404, "ATLAS-404-00-001", "Given typename {0} was invalid"), TYPE_GUID_NOT_FOUND(404, "ATLAS-404-00-002", "Given type guid {0} was invalid"), http://git-wip-us.apache.org/repos/asf/atlas/blob/ad6b07a9/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java b/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java index 1920eda..f594a81 100644 --- a/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java +++ b/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java @@ -65,6 +65,10 @@ public class AtlasClassification extends AtlasStruct implements Serializable { super(typeName, attrName, attrValue); } +public AtlasClassification(Map map) { +super(map); +} + public AtlasClassification(AtlasClassification other) { if (other != null) { setTypeName(other.getTypeName()); http://git-wip-us.apache.org/repos/asf/atlas/blob/ad6b07a9/intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/instance/AtlasEntity.java b/intg/src/main/java/org
atlas git commit: ATLAS-2439: updated Sqoop hook to use V2 notifications
Repository: atlas Updated Branches: refs/heads/master 9cd28bbed -> 5618ad4ce ATLAS-2439: updated Sqoop hook to use V2 notifications Signed-off-by: Madhan Neethiraj <mad...@apache.org> (cherry picked from commit e8908dbfe1d4dfe641cc7a802625f396aa0a399d) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/5618ad4c Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/5618ad4c Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/5618ad4c Branch: refs/heads/master Commit: 5618ad4ce3b608a5c6ab98dc794d231fb7a3673e Parents: 9cd28bb Author: rdsolani <rdsol...@gmail.com> Authored: Thu Feb 1 19:41:33 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Tue Feb 13 14:31:29 2018 -0800 -- .../org/apache/atlas/sqoop/hook/SqoopHook.java | 212 ++- 1 file changed, 113 insertions(+), 99 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/5618ad4c/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java -- diff --git a/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java b/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java index 5ded92c..4ca3280 100644 --- a/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java +++ b/addons/sqoop-bridge/src/main/java/org/apache/atlas/sqoop/hook/SqoopHook.java @@ -26,10 +26,12 @@ import org.apache.atlas.hive.bridge.HiveMetaStoreBridge; import org.apache.atlas.hive.model.HiveDataTypes; import org.apache.atlas.hook.AtlasHook; import org.apache.atlas.hook.AtlasHookException; +import org.apache.atlas.model.instance.AtlasEntity; +import org.apache.atlas.model.instance.AtlasEntity.AtlasEntitiesWithExtInfo; import org.apache.atlas.model.notification.HookNotification; -import org.apache.atlas.v1.model.instance.Referenceable; -import org.apache.atlas.v1.model.notification.HookNotificationV1.EntityCreateRequest; +import org.apache.atlas.model.notification.HookNotification.EntityUpdateRequestV2; import org.apache.atlas.sqoop.model.SqoopDataTypes; +import org.apache.atlas.type.AtlasTypeUtil; import org.apache.commons.configuration.Configuration; import org.apache.commons.lang3.StringUtils; import org.apache.sqoop.SqoopJobDataPublisher; @@ -47,151 +49,163 @@ import java.util.Properties; * AtlasHook sends lineage information to the AtlasSever. */ public class SqoopHook extends SqoopJobDataPublisher { - private static final Logger LOG = LoggerFactory.getLogger(SqoopHook.class); -public static final String CONF_PREFIX = "atlas.hook.sqoop."; -public static final String HOOK_NUM_RETRIES = CONF_PREFIX + "numRetries"; -public static final String ATLAS_CLUSTER_NAME = "atlas.cluster.name"; +public static final String CONF_PREFIX = "atlas.hook.sqoop."; +public static final String HOOK_NUM_RETRIES = CONF_PREFIX + "numRetries"; +public static final String ATLAS_CLUSTER_NAME = "atlas.cluster.name"; public static final String DEFAULT_CLUSTER_NAME = "primary"; -public static final String USER = "userName"; -public static final String DB_STORE_TYPE = "dbStoreType"; +public static final String USER = "userName"; +public static final String DB_STORE_TYPE = "dbStoreType"; public static final String DB_STORE_USAGE = "storeUse"; -public static final String SOURCE = "source"; -public static final String DESCRIPTION = "description"; -public static final String STORE_URI = "storeUri"; -public static final String OPERATION = "operation"; -public static final String START_TIME = "startTime"; -public static final String END_TIME = "endTime"; -public static final String CMD_LINE_OPTS = "commandlineOpts"; -// multiple inputs and outputs for process -public static final String INPUTS = "inputs"; -public static final String OUTPUTS = "outputs"; +public static final String SOURCE = "source"; +public static final String DESCRIPTION= "description"; +public static final String STORE_URI = "storeUri"; +public static final String OPERATION = "operation"; +public static final String START_TIME = "startTime"; +public static final String END_TIME = "endTime"; +public static final String CMD_LINE_OPTS = "commandlineOpts"; +public static final String INPUTS = "inputs"; +public static final Stri
atlas git commit: ATLAS-2440: UI: fix to render date attribute values in date-formatted string (instead of a long value)
Repository: atlas Updated Branches: refs/heads/branch-0.8 562739a14 -> 842943709 ATLAS-2440: UI: fix to render date attribute values in date-formatted string (instead of a long value) Signed-off-by: Madhan Neethiraj <mad...@apache.org> (cherry picked from commit a0c85e5aa0966303a3dda250956f2528af83678e) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/84294370 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/84294370 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/84294370 Branch: refs/heads/branch-0.8 Commit: 842943709427555abd6895b719f20dc8a9d6f421 Parents: 562739a Author: pratik24mac <pratik2...@gmail.com> Authored: Wed Feb 14 18:18:42 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Feb 14 09:56:02 2018 -0800 -- dashboardv2/public/js/utils/CommonViewFunction.js | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/84294370/dashboardv2/public/js/utils/CommonViewFunction.js -- diff --git a/dashboardv2/public/js/utils/CommonViewFunction.js b/dashboardv2/public/js/utils/CommonViewFunction.js index 0165bdd..5cfd517 100644 --- a/dashboardv2/public/js/utils/CommonViewFunction.js +++ b/dashboardv2/public/js/utils/CommonViewFunction.js @@ -223,6 +223,8 @@ define(['require', 'utils/Utils', 'modules/Modal', 'utils/Messages', 'utils/Enum val = '' + keyValue + ''; } else if (key === 'guid' || key === "__guid") { val = '' + keyValue + ''; +} else if (key.toLocaleLowerCase().indexOf("time") !== -1 || key.toLocaleLowerCase().indexOf("date") !== -1) { +val = new Date(keyValue); } else { val = _.escape(keyValue); }
atlas git commit: ATLAS-2445: updated HBase hook to handle table-clone and snapshot-restore operations
Repository: atlas Updated Branches: refs/heads/master a0c85e5aa -> 4119f431e ATLAS-2445: updated HBase hook to handle table-clone and snapshot-restore operations Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4119f431 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4119f431 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4119f431 Branch: refs/heads/master Commit: 4119f431ebb7c948fbe6ea031338d918acb30919 Parents: a0c85e5 Author: rmani <rm...@hortonworks.com> Authored: Wed Feb 14 11:28:04 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Feb 14 11:36:42 2018 -0800 -- .../atlas/hbase/hook/HBaseAtlasCoprocessor.java | 25 1 file changed, 25 insertions(+) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/4119f431/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java -- diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java index 8beccd2..af8afd4 100644 --- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java +++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/hook/HBaseAtlasCoprocessor.java @@ -27,6 +27,7 @@ import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.NamespaceDescriptor; import org.apache.hadoop.hbase.coprocessor.MasterCoprocessorEnvironment; import org.apache.hadoop.hbase.coprocessor.ObserverContext; +import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.util.Bytes; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -149,6 +150,30 @@ public class HBaseAtlasCoprocessor extends HBaseAtlasCoprocessorBase { LOG.debug("<== HBaseAtlasCoprocessor.postModifyNamespace()"); } } + +@Override +public void postCloneSnapshot(ObserverContext observerContext, HBaseProtos.SnapshotDescription snapshotDescription, HTableDescriptor hTableDescriptor) throws IOException { +if (LOG.isDebugEnabled()) { +LOG.debug("==> HBaseAtlasCoprocessoror.postCloneSnapshot()"); +} +hbaseAtlasHook.sendHBaseTableOperation(hTableDescriptor, null, HBaseAtlasHook.OPERATION.CREATE_TABLE); +if (LOG.isDebugEnabled()) { +LOG.debug("<== HBaseAtlasCoprocessoror.postCloneSnapshot()"); +} + +} + +@Override +public void postRestoreSnapshot(ObserverContext observerContext, HBaseProtos.SnapshotDescription snapshotDescription, HTableDescriptor hTableDescriptor) throws IOException { +if (LOG.isDebugEnabled()) { +LOG.debug("==> HBaseAtlasCoprocessor.postRestoreSnapshot()"); +} +hbaseAtlasHook.sendHBaseTableOperation(hTableDescriptor, hTableDescriptor.getTableName(), HBaseAtlasHook.OPERATION.ALTER_TABLE); +if (LOG.isDebugEnabled()) { +LOG.debug("<== HBaseAtlasCoprocessor.postRestoreSnapshot()"); +} +} + }
atlas git commit: ATLAS-2446: updated HBase Model to capture more attributes of table and column-family
Repository: atlas Updated Branches: refs/heads/master a2ccdf12c -> 19d67a132 ATLAS-2446: updated HBase Model to capture more attributes of table and column-family Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/19d67a13 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/19d67a13 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/19d67a13 Branch: refs/heads/master Commit: 19d67a13206a68c49ce92926f9513e833c423c83 Parents: a2ccdf1 Author: rmani <rm...@hortonworks.com> Authored: Wed Feb 14 14:43:16 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Feb 14 16:25:04 2018 -0800 -- .../atlas/hbase/bridge/HBaseAtlasHook.java | 56 ++ ..._column_family_add_additional_attribute.json | 183 +++ 2 files changed, 239 insertions(+) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/19d67a13/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java -- diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java index f839f87..2074684 100644 --- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java +++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java @@ -92,6 +92,30 @@ public class HBaseAtlasHook extends AtlasHook { public static final String ATTR_OWNER = "owner"; public static final String ATTR_NAME= "name"; +// column addition metadata +public static final String ATTR_TABLE_MAX_FILESIZE = "maxFileSize"; +public static final String ATTR_TABLE_ISREADONLY= "isReadOnly"; +public static final String ATTR_TABLE_ISCOMPACTION_ENABLED = "isCompactionEnabled"; +public static final String ATTR_TABLE_REPLICATION_PER_REGION= "replicasPerRegion"; +public static final String ATTR_TABLE_DURABLILITY = "durability"; + +// column family additional metadata +public static final String ATTR_CF_BLOOMFILTER_TYPE = "bloomFilterType"; +public static final String ATTR_CF_COMPRESSION_TYPE = "compressionType"; +public static final String ATTR_CF_COMPACTION_COMPRESSION_TYPE = "compactionCompressionType"; +public static final String ATTR_CF_ENCRYPTION_TYPE = "encryptionType"; +public static final String ATTR_CF_KEEP_DELETE_CELLS= "keepDeletedCells"; +public static final String ATTR_CF_MAX_VERSIONS = "maxVersions"; +public static final String ATTR_CF_MIN_VERSIONS = "minVersions"; +public static final String ATTR_CF_DATA_BLOCK_ENCODING = "dataBlockEncoding"; +public static final String ATTR_CF_TTL = "ttl"; +public static final String ATTR_CF_BLOCK_CACHE_ENABLED = "blockCacheEnabled"; +public static final String ATTR_CF_CACHED_BLOOM_ON_WRITE= "cacheBloomsOnWrite"; +public static final String ATTR_CF_CACHED_DATA_ON_WRITE = "cacheDataOnWrite"; +public static final String ATTR_CF_CACHED_INDEXES_ON_WRITE = "cacheIndexesOnWrite"; +public static final String ATTR_CF_EVICT_BLOCK_ONCLOSE = "evictBlocksOnClose"; +public static final String ATTR_CF_PREFETCH_BLOCK_ONOPEN= "prefetchBlocksOnOpen"; + private static final String REFERENCEABLE_ATTRIBUTE_NAME = "qualifiedName"; private String clusterName = null; @@ -422,12 +446,25 @@ public class HBaseAtlasHook extends AtlasHook { table.setAttribute(ATTR_PARAMETERS, hbaseOperationContext.getHbaseConf()); table.setAttribute(ATTR_NAMESPACE, AtlasTypeUtil.getAtlasObjectId(nameSpace)); +HTableDescriptor htableDescriptor = hbaseOperationContext.gethTableDescriptor(); +if (htableDescriptor != null) { +table.setAttribute(ATTR_TABLE_MAX_FILESIZE, htableDescriptor.getMaxFileSize()); +table.setAttribute(ATTR_TABLE_REPLICATION_PER_REGION, htableDescriptor.getRegionReplication()); +table.setAttribute(ATTR_TABLE_ISREADONLY, htableDescriptor.getMaxFileSize()); +table.setAttribute(ATTR_TABLE_ISCOMPACTION_ENABLED, htableDescriptor.isCompactionEnabled()); +table.setAttribute(A
atlas git commit: ATLAS-2446: updated HBase Model to capture more attributes of table and column-family
Repository: atlas Updated Branches: refs/heads/branch-0.8 9640a7c64 -> 043ab72b9 ATLAS-2446: updated HBase Model to capture more attributes of table and column-family Signed-off-by: Madhan Neethiraj <mad...@apache.org> (cherry picked from commit 19d67a13206a68c49ce92926f9513e833c423c83) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/043ab72b Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/043ab72b Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/043ab72b Branch: refs/heads/branch-0.8 Commit: 043ab72b91755bd8b2b5fda112fbcdcfb0151ce8 Parents: 9640a7c Author: rmani <rm...@hortonworks.com> Authored: Wed Feb 14 14:43:16 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Feb 14 16:28:32 2018 -0800 -- .../atlas/hbase/bridge/HBaseAtlasHook.java | 56 ++ ..._column_family_add_additional_attribute.json | 183 +++ 2 files changed, 239 insertions(+) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/043ab72b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java -- diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java index f544a8c..3a2a6ab 100644 --- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java +++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java @@ -92,6 +92,30 @@ public class HBaseAtlasHook extends AtlasHook { public static final String ATTR_OWNER = "owner"; public static final String ATTR_NAME= "name"; +// column addition metadata +public static final String ATTR_TABLE_MAX_FILESIZE = "maxFileSize"; +public static final String ATTR_TABLE_ISREADONLY= "isReadOnly"; +public static final String ATTR_TABLE_ISCOMPACTION_ENABLED = "isCompactionEnabled"; +public static final String ATTR_TABLE_REPLICATION_PER_REGION= "replicasPerRegion"; +public static final String ATTR_TABLE_DURABLILITY = "durability"; + +// column family additional metadata +public static final String ATTR_CF_BLOOMFILTER_TYPE = "bloomFilterType"; +public static final String ATTR_CF_COMPRESSION_TYPE = "compressionType"; +public static final String ATTR_CF_COMPACTION_COMPRESSION_TYPE = "compactionCompressionType"; +public static final String ATTR_CF_ENCRYPTION_TYPE = "encryptionType"; +public static final String ATTR_CF_KEEP_DELETE_CELLS= "keepDeletedCells"; +public static final String ATTR_CF_MAX_VERSIONS = "maxVersions"; +public static final String ATTR_CF_MIN_VERSIONS = "minVersions"; +public static final String ATTR_CF_DATA_BLOCK_ENCODING = "dataBlockEncoding"; +public static final String ATTR_CF_TTL = "ttl"; +public static final String ATTR_CF_BLOCK_CACHE_ENABLED = "blockCacheEnabled"; +public static final String ATTR_CF_CACHED_BLOOM_ON_WRITE= "cacheBloomsOnWrite"; +public static final String ATTR_CF_CACHED_DATA_ON_WRITE = "cacheDataOnWrite"; +public static final String ATTR_CF_CACHED_INDEXES_ON_WRITE = "cacheIndexesOnWrite"; +public static final String ATTR_CF_EVICT_BLOCK_ONCLOSE = "evictBlocksOnClose"; +public static final String ATTR_CF_PREFETCH_BLOCK_ONOPEN= "prefetchBlocksOnOpen"; + private static final String REFERENCEABLE_ATTRIBUTE_NAME = "qualifiedName"; private String clusterName = null; @@ -422,12 +446,25 @@ public class HBaseAtlasHook extends AtlasHook { table.setAttribute(ATTR_PARAMETERS, hbaseOperationContext.getHbaseConf()); table.setAttribute(ATTR_NAMESPACE, AtlasTypeUtil.getAtlasObjectId(nameSpace)); +HTableDescriptor htableDescriptor = hbaseOperationContext.gethTableDescriptor(); +if (htableDescriptor != null) { +table.setAttribute(ATTR_TABLE_MAX_FILESIZE, htableDescriptor.getMaxFileSize()); +table.setAttribute(ATTR_TABLE_REPLICATION_PER_REGION, htableDescriptor.getRegionReplication()); +table.setAttribute(ATTR_TABLE_ISREADONLY, htableDescriptor.getMaxFileSize()); +table.setAttribute(ATTR_TABLE_ISCOMPACTION_ENABLED, ht
atlas git commit: ATLAS-2448: added default values for JanusGraph cache configurations to improve performance
Repository: atlas Updated Branches: refs/heads/master 340f8637d -> 4152bc6d5 ATLAS-2448: added default values for JanusGraph cache configurations to improve performance Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4152bc6d Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4152bc6d Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4152bc6d Branch: refs/heads/master Commit: 4152bc6d5247e6abf11d9e5d7b34e26f6da3511e Parents: 340f863 Author: Ashutosh Mestry <ames...@hortonworks.com> Authored: Wed Feb 14 13:49:52 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Feb 14 23:27:09 2018 -0800 -- .../org/apache/atlas/ApplicationProperties.java | 59 +++- .../apache/atlas/ApplicationPropertiesTest.java | 21 +++ 2 files changed, 77 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/4152bc6d/intg/src/main/java/org/apache/atlas/ApplicationProperties.java -- diff --git a/intg/src/main/java/org/apache/atlas/ApplicationProperties.java b/intg/src/main/java/org/apache/atlas/ApplicationProperties.java index a35bdfe..320563e 100644 --- a/intg/src/main/java/org/apache/atlas/ApplicationProperties.java +++ b/intg/src/main/java/org/apache/atlas/ApplicationProperties.java @@ -21,6 +21,7 @@ import org.apache.atlas.security.InMemoryJAASConfiguration; import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.PropertiesConfiguration; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,6 +30,7 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.InputStream; import java.net.URL; +import java.util.AbstractMap.SimpleEntry; import java.util.Iterator; /** @@ -36,10 +38,15 @@ import java.util.Iterator; */ public final class ApplicationProperties extends PropertiesConfiguration { public static final String ATLAS_CONFIGURATION_DIRECTORY_PROPERTY = "atlas.conf"; - private static final Logger LOG = LoggerFactory.getLogger(ApplicationProperties.class); -public static final String APPLICATION_PROPERTIES = "atlas-application.properties"; +public static final String APPLICATION_PROPERTIES = "atlas-application.properties"; + +public static final SimpleEntry<String, String> DB_CACHE_CONF = new SimpleEntry<>("atlas.graph.cache.db-cache", "true"); +public static final SimpleEntry<String, String> DB_CACHE_CLEAN_WAIT_CONF = new SimpleEntry<>("atlas.graph.cache.db-cache-clean-wait", "20"); +public static final SimpleEntry<String, String> DB_CACHE_SIZE_CONF = new SimpleEntry<>("atlas.graph.cache.db-cache-size", "0.5"); +public static final SimpleEntry<String, String> DB_TX_CACHE_SIZE_CONF = new SimpleEntry<>("atlas.graph.cache.tx-cache.size", "15000"); +public static final SimpleEntry<String, String> DB_CACHE_TX_DIRTY_SIZE_CONF = new SimpleEntry<>("atlas.graph.cache.tx-dirty-size", "120"); private static volatile Configuration instance = null; @@ -90,7 +97,12 @@ public final class ApplicationProperties extends PropertiesConfiguration { LOG.info("Loading {} from {}", fileName, url); -Configuration configuration = new ApplicationProperties(url).interpolatedConfiguration(); +ApplicationProperties appProperties = new ApplicationProperties(url); + +appProperties.setDefaults(); + +Configuration configuration = appProperties.interpolatedConfiguration(); + logConfiguration(configuration); return configuration; } catch (Exception e) { @@ -131,6 +143,21 @@ public final class ApplicationProperties extends PropertiesConfiguration { } } +public static Class getClass(String fullyQualifiedClassName, Class assignableClass) throws AtlasException { +try { +Class clazz = Class.forName(fullyQualifiedClassName); +if (assignableClass == null || assignableClass.isAssignableFrom(clazz)) { +return clazz; +} else { +String message = "Class " + clazz.getName() + " is not assignable to class " + assignableClass.getName(); +LOG.error(message); +throw new AtlasException(message); +
atlas git commit: ATLAS-2443: include unique attributes in entity-delete notifications
Repository: atlas Updated Branches: refs/heads/branch-0.8 11ed3ccd3 -> 18063ef20 ATLAS-2443: include unique attributes in entity-delete notifications Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/18063ef2 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/18063ef2 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/18063ef2 Branch: refs/heads/branch-0.8 Commit: 18063ef209a095be7e054b363dcb7b779500dc3f Parents: 11ed3cc Author: apoorvnaik <apoorvn...@apache.org> Authored: Tue Feb 13 20:24:26 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Feb 16 16:10:50 2018 -0800 -- .../atlas/repository/graph/DeleteHandler.java | 22 +++- .../graph/GraphToTypedInstanceMapper.java | 19 ++ .../graph/v1/AtlasEntityChangeNotifier.java | 38 +++- .../store/graph/v1/DeleteHandlerV1.java | 34 +- .../java/org/apache/atlas/RequestContext.java | 6 ++-- .../typesystem/persistence/StructInstance.java | 12 --- 6 files changed, 112 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/18063ef2/repository/src/main/java/org/apache/atlas/repository/graph/DeleteHandler.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/DeleteHandler.java b/repository/src/main/java/org/apache/atlas/repository/graph/DeleteHandler.java index f0fef1f..b8d95f0 100644 --- a/repository/src/main/java/org/apache/atlas/repository/graph/DeleteHandler.java +++ b/repository/src/main/java/org/apache/atlas/repository/graph/DeleteHandler.java @@ -36,9 +36,11 @@ import org.apache.atlas.repository.graph.GraphHelper.VertexInfo; 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.typesystem.ITypedReferenceableInstance; import org.apache.atlas.typesystem.exception.NullRequiredAttributeException; import org.apache.atlas.typesystem.persistence.Id; import org.apache.atlas.typesystem.types.AttributeInfo; +import org.apache.atlas.typesystem.types.ClassType; import org.apache.atlas.typesystem.types.DataTypes; import org.apache.atlas.typesystem.types.FieldMapping; import org.apache.atlas.typesystem.types.HierarchicalType; @@ -93,7 +95,25 @@ public abstract class DeleteHandler { // Record all deletion candidate GUIDs in RequestContext // and gather deletion candidate vertices. for (VertexInfo vertexInfo : compositeVertices) { - requestContext.recordEntityDelete(vertexInfo.getGuid(), vertexInfo.getTypeName()); + ClassType entityType = typeSystem.getDataType(ClassType.class, vertexInfo.getTypeName()); + ITypedReferenceableInstance entity = entityType.createInstance(new Id(guid, 0, vertexInfo.getTypeName())); + + // populate unique attributes only + for (AttributeInfo attributeInfo : entityType.fieldMapping().fields.values()) { + if (!attributeInfo.isUnique) { + continue; + } + + DataTypes.TypeCategory attrTypeCategory = attributeInfo.dataType().getTypeCategory(); + + if (attrTypeCategory == DataTypes.TypeCategory.PRIMITIVE) { + GraphToTypedInstanceMapper.mapVertexToPrimitive(vertexInfo.getVertex(), entity, attributeInfo); + } else if (attrTypeCategory == DataTypes.TypeCategory.ENUM) { + GraphToTypedInstanceMapper.mapVertexToEnum(vertexInfo.getVertex(), entity, attributeInfo); + } + } + + requestContext.recordEntityDelete(entity); deletionCandidateVertices.add(vertexInfo.getVertex()); } } http://git-wip-us.apache.org/repos/asf/atlas/blob/18063ef2/repository/src/main/java/org/apache/atlas/repository/graph/GraphToTypedInstanceMapper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/GraphToTypedInstanceMapper.java b/repository/src/main/java/org/apache/atlas/repository/graph/GraphToTypedInstanceMapper.java index 00fc57f..55f7076 100644 --- a/repository/src/main/java/org/apache/atlas/repository/graph/GraphToTypedInstanceMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/graph/GraphToTypedInstanceMapper.java @@ -154,12 +154,7 @@ public final class GraphToTypedInstanceMapper { break; // add only if vert
atlas git commit: ATLAS-2455: updated HBase hook to fix incorrect population of hbase_column_family.cacheDataOnWrite attribute
Repository: atlas Updated Branches: refs/heads/master 745b520b2 -> 3fd57d753 ATLAS-2455: updated HBase hook to fix incorrect population of hbase_column_family.cacheDataOnWrite attribute Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/3fd57d75 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/3fd57d75 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/3fd57d75 Branch: refs/heads/master Commit: 3fd57d75309c8dffb070fa5be8ed06932596d6b6 Parents: 745b520 Author: rmani <rm...@hortonworks.com> Authored: Fri Feb 16 17:07:45 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Sat Feb 17 12:01:26 2018 -0800 -- .../main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/3fd57d75/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java -- diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java index 11f24a7..8d02f8d 100644 --- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java +++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java @@ -507,7 +507,7 @@ public class HBaseAtlasHook extends AtlasHook { columnFamily.setAttribute(ATTR_CF_BLOCK_CACHE_ENABLED, hColumnDescriptor.isBlockCacheEnabled()); columnFamily.setAttribute(ATTR_CF_BLOOMFILTER_TYPE, (hColumnDescriptor.getBloomFilterType() != null ? hColumnDescriptor.getBloomFilterType().name():null)); columnFamily.setAttribute(ATTR_CF_CACHED_BLOOM_ON_WRITE, hColumnDescriptor.isCacheBloomsOnWrite()); -columnFamily.setAttribute(ATTR_CF_CACHED_DATA_ON_WRITE, hColumnDescriptor.isCacheBloomsOnWrite()); +columnFamily.setAttribute(ATTR_CF_CACHED_DATA_ON_WRITE, hColumnDescriptor.isCacheDataOnWrite()); columnFamily.setAttribute(ATTR_CF_CACHED_INDEXES_ON_WRITE, hColumnDescriptor.isCacheIndexesOnWrite()); columnFamily.setAttribute(ATTR_CF_COMPACTION_COMPRESSION_TYPE, (hColumnDescriptor.getCompactionCompressionType() != null ? hColumnDescriptor.getCompactionCompressionType().name():null)); columnFamily.setAttribute(ATTR_CF_COMPRESSION_TYPE, (hColumnDescriptor.getCompressionType() != null ? hColumnDescriptor.getCompressionType().name():null));
atlas git commit: ATLAS-2455: updated HBase hook to fix incorrect population of hbase_column_family.cacheDataOnWrite attribute
Repository: atlas Updated Branches: refs/heads/branch-0.8 18063ef20 -> 3d72ae743 ATLAS-2455: updated HBase hook to fix incorrect population of hbase_column_family.cacheDataOnWrite attribute Signed-off-by: Madhan Neethiraj <mad...@apache.org> (cherry picked from commit 3fd57d75309c8dffb070fa5be8ed06932596d6b6) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/3d72ae74 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/3d72ae74 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/3d72ae74 Branch: refs/heads/branch-0.8 Commit: 3d72ae7436ea6c86674dd8bbe443010f8eb5e0e1 Parents: 18063ef Author: rmani <rm...@hortonworks.com> Authored: Fri Feb 16 17:07:45 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Sat Feb 17 12:59:06 2018 -0800 -- .../main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/3d72ae74/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java -- diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java index 3a2a6ab..e40a8ca 100644 --- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java +++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java @@ -507,7 +507,7 @@ public class HBaseAtlasHook extends AtlasHook { columnFamily.setAttribute(ATTR_CF_BLOCK_CACHE_ENABLED, hColumnDescriptor.isBlockCacheEnabled()); columnFamily.setAttribute(ATTR_CF_BLOOMFILTER_TYPE, (hColumnDescriptor.getBloomFilterType() != null ? hColumnDescriptor.getBloomFilterType().name():null)); columnFamily.setAttribute(ATTR_CF_CACHED_BLOOM_ON_WRITE, hColumnDescriptor.isCacheBloomsOnWrite()); -columnFamily.setAttribute(ATTR_CF_CACHED_DATA_ON_WRITE, hColumnDescriptor.isCacheBloomsOnWrite()); +columnFamily.setAttribute(ATTR_CF_CACHED_DATA_ON_WRITE, hColumnDescriptor.isCacheDataOnWrite()); columnFamily.setAttribute(ATTR_CF_CACHED_INDEXES_ON_WRITE, hColumnDescriptor.isCacheIndexesOnWrite()); columnFamily.setAttribute(ATTR_CF_COMPACTION_COMPRESSION_TYPE, (hColumnDescriptor.getCompactionCompressionType() != null ? hColumnDescriptor.getCompactionCompressionType().name():null)); columnFamily.setAttribute(ATTR_CF_COMPRESSION_TYPE, (hColumnDescriptor.getCompressionType() != null ? hColumnDescriptor.getCompressionType().name():null));
atlas git commit: ATLAS-2235: code improvements suggested by static code analysis
Repository: atlas Updated Branches: refs/heads/master 3fd57d753 -> 92b966573 ATLAS-2235: code improvements suggested by static code analysis Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/92b96657 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/92b96657 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/92b96657 Branch: refs/heads/master Commit: 92b966573227e85a7739afc6d707d88c1b428607 Parents: 3fd57d7 Author: rmani <rm...@hortonworks.com> Authored: Sat Feb 17 13:32:55 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Sat Feb 17 14:49:54 2018 -0800 -- .../atlas/hbase/bridge/HBaseAtlasHook.java | 24 - .../apache/atlas/hbase/HBaseAtlasHookIT.java| 28 ++-- 2 files changed, 38 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/92b96657/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java -- diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java index 8d02f8d..f165e98 100644 --- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java +++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java @@ -374,7 +374,11 @@ public class HBaseAtlasHook extends AtlasHook { * @return Unique qualified name to identify the Table instance in Atlas. */ public static String getColumnFamilyQualifiedName(String clusterName, String nameSpace, String tableName, String columnFamily) { -return String.format("%s.%s.%s@%s", nameSpace.toLowerCase(), stripNameSpace(tableName.toLowerCase()), columnFamily.toLowerCase(), clusterName); +if (clusterName == null || nameSpace == null || tableName == null || columnFamily == null) { +return null; +} else { +return String.format("%s.%s.%s@%s", nameSpace.toLowerCase(), stripNameSpace(tableName.toLowerCase()), columnFamily.toLowerCase(), clusterName); +} } /** @@ -386,7 +390,11 @@ public class HBaseAtlasHook extends AtlasHook { * @return Unique qualified name to identify the Table instance in Atlas. */ public static String getTableQualifiedName(String clusterName, String nameSpace, String tableName) { -return String.format("%s.%s@%s", nameSpace.toLowerCase(), stripNameSpace(tableName.toLowerCase()), clusterName); +if (clusterName == null || nameSpace == null || tableName == null) { +return null; +} else { +return String.format("%s.%s@%s", nameSpace.toLowerCase(), stripNameSpace(tableName.toLowerCase()), clusterName); +} } /** @@ -397,7 +405,11 @@ public class HBaseAtlasHook extends AtlasHook { * @return Unique qualified name to identify the HBase NameSpace instance in Atlas. */ public static String getNameSpaceQualifiedName(String clusterName, String nameSpace) { -return String.format("%s@%s", nameSpace.toLowerCase(), clusterName); +if (clusterName == null || nameSpace == null) { +return null; +} else { +return String.format("%s@%s", nameSpace.toLowerCase(), clusterName); +} } private static String stripNameSpace(String tableName) { @@ -765,7 +777,7 @@ public class HBaseAtlasHook extends AtlasHook { UserGroupInformation ugi = getUGI(); User user = getActiveUser(); -String userName = user.getShortName(); +String userName = (user != null) ? user.getShortName() : null; HBaseOperationContext hbaseOperationContext = new HBaseOperationContext(namespaceDescriptor, nameSpace, operation, ugi, userName, userName); createAtlasInstances(hbaseOperationContext); @@ -784,7 +796,7 @@ public class HBaseAtlasHook extends AtlasHook { UserGroupInformation ugi= getUGI(); User user = getActiveUser(); -String userName = user.getShortName(); +String userName = (user != null) ? user.getShortName() : null; Map<String, String> hbaseConf = null; String owner = null; String tableNameSpace = null; @@ -827,7 +839,7 @@ public class HBaseAtlasHook extends AtlasHook { UserGroupIn
atlas git commit: ATLAS-2454: updated import-hbase utility to include additional HBase attributes
Repository: atlas Updated Branches: refs/heads/branch-0.8 0e325b91e -> 96e29e804 ATLAS-2454: updated import-hbase utility to include additional HBase attributes Signed-off-by: Madhan Neethiraj <mad...@apache.org> (cherry picked from commit 9c58d30c7d9ff48307e097bf57cb75d614ab214a) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/96e29e80 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/96e29e80 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/96e29e80 Branch: refs/heads/branch-0.8 Commit: 96e29e80409600925dfa1c8ecece436db8b0be5f Parents: 0e325b9 Author: rmani <rm...@hortonworks.com> Authored: Fri Feb 16 16:42:09 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Sat Feb 17 15:31:59 2018 -0800 -- .../hbase/util/ImportHBaseEntitiesBase.java | 47 +++- 1 file changed, 45 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/96e29e80/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/util/ImportHBaseEntitiesBase.java -- diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/util/ImportHBaseEntitiesBase.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/util/ImportHBaseEntitiesBase.java index f6d511f..d11a1a0 100644 --- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/util/ImportHBaseEntitiesBase.java +++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/util/ImportHBaseEntitiesBase.java @@ -68,6 +68,29 @@ public class ImportHBaseEntitiesBase { static final String TABLE = "table"; static final String COLUMN_FAMILIES = "column_families"; +// column addition metadata +public static final String ATTR_TABLE_MAX_FILESIZE = "maxFileSize"; +public static final String ATTR_TABLE_ISREADONLY= "isReadOnly"; +public static final String ATTR_TABLE_ISCOMPACTION_ENABLED = "isCompactionEnabled"; +public static final String ATTR_TABLE_REPLICATION_PER_REGION= "replicasPerRegion"; +public static final String ATTR_TABLE_DURABLILITY = "durability"; + +// column family additional metadata +public static final String ATTR_CF_BLOOMFILTER_TYPE = "bloomFilterType"; +public static final String ATTR_CF_COMPRESSION_TYPE = "compressionType"; +public static final String ATTR_CF_COMPACTION_COMPRESSION_TYPE = "compactionCompressionType"; +public static final String ATTR_CF_ENCRYPTION_TYPE = "encryptionType"; +public static final String ATTR_CF_KEEP_DELETE_CELLS= "keepDeletedCells"; +public static final String ATTR_CF_MAX_VERSIONS = "maxVersions"; +public static final String ATTR_CF_MIN_VERSIONS = "minVersions"; +public static final String ATTR_CF_DATA_BLOCK_ENCODING = "dataBlockEncoding"; +public static final String ATTR_CF_TTL = "ttl"; +public static final String ATTR_CF_BLOCK_CACHE_ENABLED = "blockCacheEnabled"; +public static final String ATTR_CF_CACHED_BLOOM_ON_WRITE= "cacheBloomsOnWrite"; +public static final String ATTR_CF_CACHED_DATA_ON_WRITE = "cacheDataOnWrite"; +public static final String ATTR_CF_CACHED_INDEXES_ON_WRITE = "cacheIndexesOnWrite"; +public static final String ATTR_CF_EVICT_BLOCK_ONCLOSE = "evictBlocksOnClose"; +public static final String ATTR_CF_PREFETCH_BLOCK_ONOPEN= "prefetchBlocksOnOpen"; protected final HBaseAdmin hbaseAdmin; protected final boolean failOnError; @@ -149,7 +172,7 @@ public class ImportHBaseEntitiesBase { if (tableEntity == null) { LOG.info("Importing Table: " + tblQualifiedName); -AtlasEntity entity = getTableEntity(nameSpace, tableName, owner, nameSapceEntity); +AtlasEntity entity = getTableEntity(nameSpace, tableName, owner, nameSapceEntity, htd); tableEntity = createEntityInAtlas(entity); } @@ -266,7 +289,7 @@ public class ImportHBaseEntitiesBase { return ret; } -private AtlasEntity getTableEntity(String nameSpace, String tableName, String owner, AtlasEntity nameSpaceEntity) { +private AtlasEntity getTableEntity(String nameSpace, String tableName, String owner, AtlasEntity nameSpaceEntity, HTableDescriptor htd) {
[2/3] atlas git commit: ATLAS-2456: Implement tag propagation using relationships
http://git-wip-us.apache.org/repos/asf/atlas/blob/a3374c74/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java index d61bff2..9d56fa9 100755 --- a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java +++ b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java @@ -26,10 +26,12 @@ import org.apache.atlas.AtlasErrorCode; import org.apache.atlas.AtlasException; import org.apache.atlas.RequestContextV1; import org.apache.atlas.exception.AtlasBaseException; +import org.apache.atlas.model.instance.AtlasClassification; import org.apache.atlas.model.instance.AtlasEntity.Status; import org.apache.atlas.model.instance.AtlasObjectId; import org.apache.atlas.model.instance.AtlasRelationship; import org.apache.atlas.model.typedef.AtlasRelationshipDef; +import org.apache.atlas.util.AtlasGremlinQueryProvider; import org.apache.atlas.v1.model.instance.Id; import org.apache.atlas.v1.model.instance.Referenceable; import org.apache.atlas.type.AtlasStructType.AtlasAttribute; @@ -55,6 +57,9 @@ import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import javax.script.Bindings; +import javax.script.ScriptEngine; +import javax.script.ScriptException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -68,6 +73,14 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; +import static org.apache.atlas.model.instance.AtlasEntity.Status.ACTIVE; +import static org.apache.atlas.repository.Constants.PROPAGATED_TRAIT_NAMES_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.TRAIT_NAMES_PROPERTY_KEY; +import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.AtlasRelationshipEdgeDirection.BOTH; +import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.AtlasRelationshipEdgeDirection.IN; +import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.AtlasRelationshipEdgeDirection.OUT; +import static org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery.TAG_PROPAGATION_IMPACTED_INSTANCES; +import static org.apache.atlas.util.AtlasGremlinQueryProvider.AtlasGremlinQuery.TAG_PROPAGATION_IMPACTED_INSTANCES_FOR_REMOVAL; /** * Utility class for graph operations. @@ -80,6 +93,8 @@ public final class GraphHelper { public static final String RETRY_COUNT = "atlas.graph.storage.num.retries"; public static final String RETRY_DELAY = "atlas.graph.storage.retry.sleeptime.ms"; +private final AtlasGremlinQueryProvider queryProvider = AtlasGremlinQueryProvider.INSTANCE; + private static volatile GraphHelper INSTANCE; private AtlasGraph graph; @@ -166,7 +181,7 @@ public final class GraphHelper { return vertexWithoutIdentity; } -private AtlasEdge addEdge(AtlasVertex fromVertex, AtlasVertex toVertex, String edgeLabel) { +public AtlasEdge addEdge(AtlasVertex fromVertex, AtlasVertex toVertex, String edgeLabel) { if (LOG.isDebugEnabled()) { LOG.debug("Adding edge for {} -> label {} -> {}", string(fromVertex), edgeLabel, string(toVertex)); } @@ -266,6 +281,26 @@ public final class GraphHelper { return (AtlasEdge) findElement(false, args); } +public static boolean edgeExists(AtlasVertex outVertex, AtlasVertex inVertex, String edgeLabel) { +boolean ret = false; +Iterator edges = getAdjacentEdgesByLabel(inVertex, AtlasEdgeDirection.IN, edgeLabel); + +while (edges != null && edges.hasNext()) { +AtlasEdge edge = edges.next(); + +if (edge.getOutVertex().equals(outVertex)) { +Status edgeState = getStatus(edge); + +if (edgeState == null || edgeState == ACTIVE) { +ret = true; +break; +} +} +} + +return ret; +} + private AtlasElement findElement(boolean isVertexSearch, Object... args) throws EntityNotFoundException { AtlasGraphQuery query = graph.query(); @@ -522,7 +557,7 @@ public final class GraphHelper { } /** - * Adds an additional value to a multi-property. + * Adds an additional value to a multi-property (SET). * * @param vertex * @param propertyName @@ -539,6 +574,23 @@ public final class GraphHelper { } /** + * Adds an additional value to a multi-property (LIST). + * + * @param vertex + * @param propertyName + * @param value + */ +public static void addListProperty(AtlasVertex vertex, String propertyName, Object value) { +String actualPropertyName = GraphHelper.encodePropertyKey(propertyName);
[3/3] atlas git commit: ATLAS-2456: Implement tag propagation using relationships
ATLAS-2456: Implement tag propagation using relationships Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/a3374c74 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/a3374c74 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/a3374c74 Branch: refs/heads/master Commit: a3374c747fb900ed44358b8b2c643e439820d2e6 Parents: 9c58d30 Author: Sarath Subramanian <ssubraman...@hortonworks.com> Authored: Mon Feb 19 22:58:36 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Tue Feb 20 15:01:32 2018 -0800 -- addons/models/-Area0/0010-base_model.json | 4 +- addons/models/1000-Hadoop/1030-hive_model.json | 8 +- addons/models/1000-Hadoop/1060-hbase_model.json | 6 +- .../org/apache/atlas/repository/Constants.java | 4 + .../atlas/repository/graphdb/AtlasElement.java | 3 +- .../atlas/repository/graphdb/AtlasVertex.java | 8 + .../graphdb/janus/AtlasJanusVertex.java | 8 + .../repository/graphdb/titan0/Titan0Vertex.java | 14 + .../java/org/apache/atlas/AtlasErrorCode.java | 12 +- .../atlas/listener/EntityChangeListenerV2.java | 81 .../atlas/model/audit/EntityAuditEventV2.java | 175 .../model/instance/AtlasClassification.java | 45 +++ .../atlas/model/instance/AtlasEntity.java | 11 + .../model/notification/EntityNotification.java | 2 +- .../notification/EntityNotificationV2.java | 129 ++ .../repository/audit/EntityAuditListener.java | 14 +- .../repository/audit/EntityAuditListenerV2.java | 263 .../repository/audit/EntityAuditRepository.java | 47 ++- .../audit/HBaseBasedAuditRepository.java| 172 +++- .../audit/InMemoryEntityAuditRepository.java| 63 ++- .../audit/NoopEntityAuditRepository.java| 35 +- .../converters/AtlasInstanceConverter.java | 102 - .../graph/GraphBackedSearchIndexer.java | 2 + .../atlas/repository/graph/GraphHelper.java | 288 - .../graph/v1/AtlasEntityChangeNotifier.java | 170 +--- .../store/graph/v1/AtlasEntityStoreV1.java | 70 +--- .../graph/v1/AtlasRelationshipStoreV1.java | 87 +++- .../store/graph/v1/EntityGraphMapper.java | 399 +++ .../store/graph/v1/EntityGraphRetriever.java| 392 +++--- .../atlas/util/AtlasGremlin3QueryProvider.java | 12 + .../atlas/util/AtlasGremlinQueryProvider.java | 5 +- .../util/AtlasRepositoryConfiguration.java | 15 + .../test/java/org/apache/atlas/TestModules.java | 6 + .../audit/AuditRepositoryTestBase.java | 16 +- .../EntityNotificationListenerV2.java | 216 ++ .../NotificationEntityChangeListener.java | 2 +- .../atlas/web/resources/EntityResource.java | 28 +- .../org/apache/atlas/web/rest/EntityREST.java | 59 ++- .../atlas/web/adapters/TestEntityREST.java | 2 +- .../web/integration/EntityJerseyResourceIT.java | 2 +- .../integration/EntityV2JerseyResourceIT.java | 2 +- .../test/resources/atlas-application.properties | 1 + 42 files changed, 2637 insertions(+), 343 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/a3374c74/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 0296e8f..aebe955 100644 --- a/addons/models/-Area0/0010-base_model.json +++ b/addons/models/-Area0/0010-base_model.json @@ -213,7 +213,7 @@ "cardinality": "SET", "isLegacyAttribute": true }, -"propagateTags": "NONE" +"propagateTags": "ONE_TO_TWO" }, { "name": "process_dataset_outputs", @@ -232,7 +232,7 @@ "isContainer": false, "cardinality": "SET" }, - "propagateTags": "NONE" + "propagateTags": "ONE_TO_TWO" } ] } http://git-wip-us.apache.org/repos/asf/atlas/blob/a3374c74/addons/models/1000-Hadoop/1030-hive_model.json -- diff --git a/addons/models/1000-Hadoop/1030-hive_model.json b/addons/models/1000-Hadoop/1030-hive_model.json index 32d9179..68a5c84 100644 --- a/addons/models/1000-Hadoop/1030-hive_model.json +++ b/addons/models/1000-Hadoop/1030-hive_model.json @@ -539,7 +539,7 @@ "cardinality": "SINGLE", "
atlas git commit: ATLAS-2457: updates to support time-boundary in AtlasClassification associations
Repository: atlas Updated Branches: refs/heads/master a3374c747 -> 48b2eaa99 ATLAS-2457: updates to support time-boundary in AtlasClassification associations Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/48b2eaa9 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/48b2eaa9 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/48b2eaa9 Branch: refs/heads/master Commit: 48b2eaa99f91ec615f67fcde3183b262c765d698 Parents: a3374c7 Author: Madhan Neethiraj <mad...@apache.org> Authored: Wed Feb 21 13:53:44 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Feb 21 18:04:59 2018 -0800 -- .../org/apache/atlas/repository/Constants.java | 7 +- .../org/apache/atlas/model/TimeBoundary.java| 120 +++ .../model/instance/AtlasClassification.java | 19 ++- .../store/graph/v1/EntityGraphMapper.java | 8 +- .../store/graph/v1/EntityGraphRetriever.java| 13 +- .../integration/EntityV2JerseyResourceIT.java | 45 ++- 6 files changed, 202 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/48b2eaa9/common/src/main/java/org/apache/atlas/repository/Constants.java -- diff --git a/common/src/main/java/org/apache/atlas/repository/Constants.java b/common/src/main/java/org/apache/atlas/repository/Constants.java index ae52880..b6c639a 100644 --- a/common/src/main/java/org/apache/atlas/repository/Constants.java +++ b/common/src/main/java/org/apache/atlas/repository/Constants.java @@ -116,8 +116,11 @@ public final class Constants { public static final String ATTRIBUTE_NAME_VERSION = "version"; public static final String TEMP_STRUCT_NAME_PREFIX = "__tempQueryResultStruct"; -public static final String CLASSIFICATION_ENTITY_GUID = INTERNAL_PROPERTY_KEY_PREFIX + "entityGuid"; -public static final String CLASSIFICATION_PROPAGATE_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "propagate"; +public static final String CLASSIFICATION_ENTITY_GUID = INTERNAL_PROPERTY_KEY_PREFIX + "entityGuid"; +public static final String CLASSIFICATION_PROPAGATE_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "propagate"; +public static final String CLASSIFICATION_VALIDITY_PERIOD_STARTTIME_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "vp_startTime"; +public static final String CLASSIFICATION_VALIDITY_PERIOD_ENDTIME_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "vp_endTime"; +public static final String CLASSIFICATION_VALIDITY_PERIOD_TIMEZONE_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "vp_timeZone"; private Constants() { } http://git-wip-us.apache.org/repos/asf/atlas/blob/48b2eaa9/intg/src/main/java/org/apache/atlas/model/TimeBoundary.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/TimeBoundary.java b/intg/src/main/java/org/apache/atlas/model/TimeBoundary.java new file mode 100644 index 000..882a33c --- /dev/null +++ b/intg/src/main/java/org/apache/atlas/model/TimeBoundary.java @@ -0,0 +1,120 @@ +/** + * 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.model; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; + +import java.io.Serializable; +import java.util.Objects; + +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE; +import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY; + +/** + * Captures time-boundary details + */ +@JsonAutoDetect(getterVisibility=PUBLIC_ONLY, setterVisibility=PUBLIC_ONL
atlas git commit: ATLAS-2451: UI to list tables in a HBase namespace similar to tables listing for Hive DB
Repository: atlas Updated Branches: refs/heads/master 48b2eaa99 -> d74f0ce9d ATLAS-2451: UI to list tables in a HBase namespace similar to tables listing for Hive DB Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/d74f0ce9 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/d74f0ce9 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/d74f0ce9 Branch: refs/heads/master Commit: d74f0ce9da0960192c9a7bae9e2e42f82a038a76 Parents: 48b2eaa Author: pratik24mac <pratik2...@gmail.com> Authored: Fri Feb 16 23:37:59 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Feb 21 19:44:37 2018 -0800 -- .../views/detail_page/DetailPageLayoutView.js | 6 +- .../js/views/profile/ProfileLayoutView.js | 8 +- .../js/views/search/SearchResultLayoutView.js | 90 ++-- 3 files changed, 54 insertions(+), 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/d74f0ce9/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js -- diff --git a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js index ab74c3e..802f6a4 100644 --- a/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js +++ b/dashboardv2/public/js/views/detail_page/DetailPageLayoutView.js @@ -176,8 +176,8 @@ define(['require', this.renderEntityDetailTableLayoutView(obj); this.renderAuditTableLayoutView(obj); this.renderTagTableLayoutView(obj); -if (collectionJSON && (!_.isUndefined(collectionJSON.attributes['profileData']) || collectionJSON.typeName === "hive_db")) { -if (collectionJSON.typeName === "hive_db") { +if (collectionJSON && (!_.isUndefined(collectionJSON.attributes['profileData']) || collectionJSON.typeName === "hive_db" || collectionJSON.typeName === "hbase_namespace")) { +if (collectionJSON.typeName === "hive_db" || collectionJSON.typeName === "hbase_namespace") { this.$('.profileTab a').text("Tables") } this.$('.profileTab').show(); @@ -282,7 +282,7 @@ define(['require', that.deleteTagData({ 'tagName': tagName, 'guid': that.id, -'el' : $(e.currentTarget) +'el': $(e.currentTarget) }); }); modal.on('closeModal', function() { http://git-wip-us.apache.org/repos/asf/atlas/blob/d74f0ce9/dashboardv2/public/js/views/profile/ProfileLayoutView.js -- diff --git a/dashboardv2/public/js/views/profile/ProfileLayoutView.js b/dashboardv2/public/js/views/profile/ProfileLayoutView.js index 79cf3a5..d807f41 100644 --- a/dashboardv2/public/js/views/profile/ProfileLayoutView.js +++ b/dashboardv2/public/js/views/profile/ProfileLayoutView.js @@ -58,7 +58,7 @@ define(['require', */ initialize: function(options) { _.extend(this, _.pick(options, 'profileData', 'guid', 'value', 'typeName', 'entityDetail', 'typeHeaders', 'entityDefCollection', 'enumDefCollection', 'classificationDefCollection')); -if (this.typeName === "hive_db") { +if (this.typeName === "hive_db" || this.typeName === "hbase_namespace") { this.profileData = { attributes: true }; } }, @@ -67,7 +67,7 @@ define(['require', if (this.profileData) { if (this.typeName === "hive_table") { this.renderProfileTableLayoutView(); -} else if (this.typeName === "hive_db") { +} else if (this.typeName === "hive_db" || this.typeName === "hbase_namespace") { this.renderSearchResultLayoutView(); } else { this.renderProfileColumnLayoutView(); @@ -80,13 +80,15 @@ define(['require', var value = _.extend({}, that.value, { 'guid': that.guid, 'searchType': 'relationship', -'profileDBView': true +'profileDBView' : true, +'typeN
atlas git commit: ATLAS-2457: updated classification to support multiple validity-periods
Repository: atlas Updated Branches: refs/heads/master 5e496e5e1 -> 8d86dd2c6 ATLAS-2457: updated classification to support multiple validity-periods Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/8d86dd2c Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/8d86dd2c Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/8d86dd2c Branch: refs/heads/master Commit: 8d86dd2c61af199045289b6f94ff794ded16d5d3 Parents: 5e496e5 Author: Madhan Neethiraj <mad...@apache.org> Authored: Thu Feb 22 10:37:08 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Feb 22 11:45:05 2018 -0800 -- .../org/apache/atlas/repository/Constants.java | 8 ++--- .../model/instance/AtlasClassification.java | 33 ++-- .../store/graph/v1/EntityGraphMapper.java | 12 --- .../store/graph/v1/EntityGraphRetriever.java| 12 +++ .../integration/EntityV2JerseyResourceIT.java | 6 ++-- 5 files changed, 44 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/8d86dd2c/common/src/main/java/org/apache/atlas/repository/Constants.java -- diff --git a/common/src/main/java/org/apache/atlas/repository/Constants.java b/common/src/main/java/org/apache/atlas/repository/Constants.java index b6c639a..813fc87 100644 --- a/common/src/main/java/org/apache/atlas/repository/Constants.java +++ b/common/src/main/java/org/apache/atlas/repository/Constants.java @@ -116,11 +116,9 @@ public final class Constants { public static final String ATTRIBUTE_NAME_VERSION = "version"; public static final String TEMP_STRUCT_NAME_PREFIX = "__tempQueryResultStruct"; -public static final String CLASSIFICATION_ENTITY_GUID = INTERNAL_PROPERTY_KEY_PREFIX + "entityGuid"; -public static final String CLASSIFICATION_PROPAGATE_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "propagate"; -public static final String CLASSIFICATION_VALIDITY_PERIOD_STARTTIME_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "vp_startTime"; -public static final String CLASSIFICATION_VALIDITY_PERIOD_ENDTIME_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "vp_endTime"; -public static final String CLASSIFICATION_VALIDITY_PERIOD_TIMEZONE_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "vp_timeZone"; +public static final String CLASSIFICATION_ENTITY_GUID = INTERNAL_PROPERTY_KEY_PREFIX + "entityGuid"; +public static final String CLASSIFICATION_PROPAGATE_KEY= INTERNAL_PROPERTY_KEY_PREFIX + "propagate"; +public static final String CLASSIFICATION_VALIDITY_PERIODS_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "validityPeriods"; private Constants() { } http://git-wip-us.apache.org/repos/asf/atlas/blob/8d86dd2c/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java b/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java index 3d2ecef..008314b 100644 --- a/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java +++ b/intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java @@ -19,10 +19,12 @@ package org.apache.atlas.model.instance; import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; @@ -51,9 +53,9 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ public class AtlasClassification extends AtlasStruct implements Serializable { private static final long serialVersionUID = 1L; -private String entityGuid = null; -private boolean propagate = true; -private TimeBoundary validityPeriod = null; +private String entityGuid = null; +private booleanpropagate = true; +private List validityPeriods = null; public AtlasClassification() { @@ -99,12 +101,25 @@ public class AtlasClassification extends AtlasStruct implements Serializable { this.propagate = propagate; } -public TimeBoundary getValidityPeriod() { -return validityPeriod; +public List getValidityPeriods() { +return validityPeriods; } -public void setValidityPeriod(TimeBoundary validi
[1/2] atlas git commit: ATLAS-2452: updated HBase hook to fix incorrect value assigned to hbase_table.isReadOnly attribute
Repository: atlas Updated Branches: refs/heads/master 8a57e6571 -> 745b520b2 ATLAS-2452: updated HBase hook to fix incorrect value assigned to hbase_table.isReadOnly attribute Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/c3a684fd Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/c3a684fd Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/c3a684fd Branch: refs/heads/master Commit: c3a684fd5f5486772ad918e5896a2e27fc8cffb2 Parents: 8a57e65 Author: Sharmadha Sainath <ssain...@hortonworks.com> Authored: Fri Feb 16 19:02:22 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Feb 16 08:22:49 2018 -0800 -- .../main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/c3a684fd/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java -- diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java index 2074684..11f24a7 100644 --- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java +++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseAtlasHook.java @@ -450,7 +450,7 @@ public class HBaseAtlasHook extends AtlasHook { if (htableDescriptor != null) { table.setAttribute(ATTR_TABLE_MAX_FILESIZE, htableDescriptor.getMaxFileSize()); table.setAttribute(ATTR_TABLE_REPLICATION_PER_REGION, htableDescriptor.getRegionReplication()); -table.setAttribute(ATTR_TABLE_ISREADONLY, htableDescriptor.getMaxFileSize()); +table.setAttribute(ATTR_TABLE_ISREADONLY, htableDescriptor.isReadOnly()); table.setAttribute(ATTR_TABLE_ISCOMPACTION_ENABLED, htableDescriptor.isCompactionEnabled()); table.setAttribute(ATTR_TABLE_DURABLILITY, (htableDescriptor.getDurability() != null ? htableDescriptor.getDurability().name() : null)); }
atlas git commit: ATLAS-2444: fix for IT failures
Repository: atlas Updated Branches: refs/heads/master 4152bc6d5 -> c2be0646d ATLAS-2444: fix for IT failures Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/c2be0646 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/c2be0646 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/c2be0646 Branch: refs/heads/master Commit: c2be0646d95b7b38ea3b06382091e0e5bcf9988a Parents: 4152bc6 Author: apoorvnaik <apoorvn...@apache.org> Authored: Wed Feb 14 21:58:31 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Feb 15 16:23:24 2018 -0800 -- .../apache/atlas/hive/bridge/HiveMetaStoreBridge.java | 7 ++- .../src/test/java/org/apache/atlas/hive/HiveITBase.java | 12 ++-- .../java/org/apache/atlas/hive/hook/HiveHookIT.java | 5 ++--- .../org/apache/atlas/utils/HdfsNameServiceResolver.java | 7 --- 4 files changed, 22 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/c2be0646/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java index 3a775b6..4047c16 100755 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java @@ -615,7 +615,12 @@ public class HiveMetaStoreBridge { ref.set("nameServiceId", nameServiceID); } else { ref.set("path", pathUri); -ref.set(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, getHdfsPathQualifiedName(clusterName, pathUri)); +// Only append clusterName for the HDFS path +if (pathUri.startsWith(HdfsNameServiceResolver.HDFS_SCHEME)) { +ref.set(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, getHdfsPathQualifiedName(clusterName, pathUri)); +} else { +ref.set(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, pathUri); +} } ref.set(AtlasConstants.CLUSTER_NAME_ATTRIBUTE, clusterName); return ref; http://git-wip-us.apache.org/repos/asf/atlas/blob/c2be0646/addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java -- 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 01418cf..217c6aa 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 @@ -231,13 +231,21 @@ public class HiveITBase { Referenceable hdfsPathRef = atlasClient.getEntity(hdfsPathId); Assert.assertEquals(hdfsPathRef.get("path"), testPathNormed); Assert.assertEquals(hdfsPathRef.get(NAME), Path.getPathWithoutSchemeAndAuthority(path).toString().toLowerCase()); - Assert.assertEquals(hdfsPathRef.get(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME), testPathNormed); +if (testPathNormed != null) { + Assert.assertTrue(((String)hdfsPathRef.get(AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME)).startsWith(testPathNormed)); +} } } private String assertHDFSPathIsRegistered(String path) throws Exception { LOG.debug("Searching for hdfs path {}", path); -return assertEntityIsRegistered(HiveMetaStoreBridge.HDFS_PATH, AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, path, null); +// ATLAS-2444 HDFS name node federation adds the cluster name to the qualifiedName +if (path.startsWith("hdfs://")) { +String pathWithCluster = path + "@" + CLUSTER_NAME; +return assertEntityIsRegistered(HiveMetaStoreBridge.HDFS_PATH, AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, pathWithCluster, null); +} else { +return assertEntityIsRegistered(HiveMetaStoreBridge.HDFS_PATH, AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, path, null); +} } protected String assertDatabaseIsRegistered(String dbName) throws Exception { http://git-wip-us.apache.org/repos/asf/atlas/blob/c2be0646/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java -- diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java b/addons/h
atlas git commit: ATLAS-2323: remove array form of attribute from term model
Repository: atlas Updated Branches: refs/heads/master 1e64199b2 -> 2a2b07e98 ATLAS-2323: remove array form of attribute from term model Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/2a2b07e9 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/2a2b07e9 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/2a2b07e9 Branch: refs/heads/master Commit: 2a2b07e983851c08f792b72cd5518cb455f59971 Parents: 1e64199 Author: David Radley <david_rad...@uk.ibm.com> Authored: Fri Dec 22 08:55:10 2017 +0000 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Dec 22 09:29:08 2017 -0800 -- addons/models/0300-Area3-SubjectArea/0330-Terms.json | 6 -- 1 file changed, 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/2a2b07e9/addons/models/0300-Area3-SubjectArea/0330-Terms.json -- diff --git a/addons/models/0300-Area3-SubjectArea/0330-Terms.json b/addons/models/0300-Area3-SubjectArea/0330-Terms.json index 73315ab..f492ddf 100644 --- a/addons/models/0300-Area3-SubjectArea/0330-Terms.json +++ b/addons/models/0300-Area3-SubjectArea/0330-Terms.json @@ -86,12 +86,6 @@ "cardinality": "SINGLE", "isIndexable": true, "isOptional": true -}, -{ - "name": "media", - "typeName": "array", - "cardinality": "SINGLE", - "isOptional": true } ] }
atlas git commit: ATLAS-2229: fix for unit test failures in DSL tests; also fixed incorrect handling of orderby/groupby when limit/offset is present
Repository: atlas Updated Branches: refs/heads/master 2a2b07e98 -> 5384a7427 ATLAS-2229: fix for unit test failures in DSL tests; also fixed incorrect handling of orderby/groupby when limit/offset is present Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/5384a742 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/5384a742 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/5384a742 Branch: refs/heads/master Commit: 5384a74274b435118e0c4d4c521557df0b0f7eef Parents: 2a2b07e Author: Madhan Neethiraj <mad...@apache.org> Authored: Fri Dec 22 13:52:14 2017 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Dec 22 13:52:14 2017 -0800 -- .../graphdb/janus/AtlasJanusGraph.java | 2 +- .../org/apache/atlas/query/QueryProcessor.java | 28 + .../org/apache/atlas/query/BasicTestSetup.java | 18 -- .../org/apache/atlas/query/DSLQueriesTest.java | 63 ++-- 4 files changed, 64 insertions(+), 47 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/5384a742/graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java -- 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 ad34787..cd847ad 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 @@ -344,7 +344,7 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE return result; } catch (ScriptException e) { -throw new AtlasBaseException(AtlasErrorCode.GREMLIN_SCRIPT_EXECUTION_FAILED, gremlinQuery); +throw new AtlasBaseException(AtlasErrorCode.GREMLIN_SCRIPT_EXECUTION_FAILED, e, gremlinQuery); } finally { releaseGremlinScriptEngine(scriptEngine); } http://git-wip-us.apache.org/repos/asf/atlas/blob/5384a742/repository/src/main/java/org/apache/atlas/query/QueryProcessor.java -- diff --git a/repository/src/main/java/org/apache/atlas/query/QueryProcessor.java b/repository/src/main/java/org/apache/atlas/query/QueryProcessor.java index 76a10e3..5e07a92 100644 --- a/repository/src/main/java/org/apache/atlas/query/QueryProcessor.java +++ b/repository/src/main/java/org/apache/atlas/query/QueryProcessor.java @@ -281,8 +281,7 @@ public class QueryProcessor { LOG.debug("addGroupBy(item={})", item); } -add(GremlinClause.GROUP); -addByClause(item, false); +addGroupByClause(item); hasGrpBy = true; } @@ -347,8 +346,7 @@ public class QueryProcessor { LOG.debug("addOrderBy(name={}, isDesc={})", name, isDesc); } -add(GremlinClause.ORDER); -addByClause(name, isDesc); +addOrderByClause(name, isDesc); } private void updatePosition(GremlinClause clause) { @@ -407,22 +405,29 @@ public class QueryProcessor { } } -private void addByClause(String name, boolean descr) { +private void addOrderByClause(String name, boolean descr) { if (LOG.isDebugEnabled()) { -LOG.debug("addByClause(name={})", name, descr); +LOG.debug("addOrderByClause(name={})", name, descr); } IdentifierHelper.Advice ia = getAdvice(name); -add((!descr) ? GremlinClause.BY : GremlinClause.BY_DESC, ia.getQualifiedName()); +add((!descr) ? GremlinClause.ORDER_BY : GremlinClause.ORDER_BY_DESC, ia.getQualifiedName()); +} + +private void addGroupByClause(String name) { +if (LOG.isDebugEnabled()) { +LOG.debug("addGroupByClause(name={})", name); +} + +IdentifierHelper.Advice ia = getAdvice(name); +add(GremlinClause.GROUP_BY, ia.getQualifiedName()); } private enum GremlinClause { AS("as('%s')"), -BY("by('%s')"), -BY_DESC("by('%s', decr)"), DEDUP("dedup()"), G("g"), -GROUP("group()"), +GROUP_BY("group().by('%')"), HAS("has('%s', %s)"), HAS_OPERATOR("has('%s', %s(%s))"), HAS_PROPERTY("has('%s')"), @@ -436,7 +441,8 @@ public class QueryProcessor { NESTED_START("__"), NESTED_HAS_OPERATOR("has('%s', %s(%s))"),
atlas git commit: ATLAS-2320: basic-search with wildcard classification fails when full-text query is specified
Repository: atlas Updated Branches: refs/heads/master db77c65be -> 14df38de4 ATLAS-2320: basic-search with wildcard classification fails when full-text query is specified Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/14df38de Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/14df38de Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/14df38de Branch: refs/heads/master Commit: 14df38de4a53baa063cdcaf0e299d5fb46dfb7f5 Parents: db77c65 Author: Madhan Neethiraj <mad...@apache.org> Authored: Thu Dec 21 10:39:16 2017 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Dec 21 10:39:16 2017 -0800 -- .../ClassificationSearchProcessor.java | 2 +- .../atlas/discovery/EntitySearchProcessor.java | 2 +- .../discovery/FullTextSearchProcessor.java | 2 +- .../apache/atlas/util/SearchPredicateUtil.java | 45 4 files changed, 48 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/14df38de/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java -- diff --git a/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java b/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java index 7b75321..4265e09 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java +++ b/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java @@ -155,7 +155,7 @@ public class ClassificationSearchProcessor extends SearchProcessor { entityPredicateTraitNames = SearchPredicateUtil.getContainsAnyPredicateGenerator().generatePredicate(Constants.TRAIT_NAMES_PROPERTY_KEY, classificationType.getTypeAndAllSubTypes(), List.class); } else { entityGraphQueryTraitNames = graph.query().has(Constants.TRAIT_NAMES_PROPERTY_KEY, NOT_EQUAL, null); -entityPredicateTraitNames = SearchPredicateUtil.getNotNullPredicateGenerator().generatePredicate(Constants.TRAIT_NAMES_PROPERTY_KEY, null, List.class); +entityPredicateTraitNames = SearchPredicateUtil.getNotEmptyPredicateGenerator().generatePredicate(Constants.TRAIT_NAMES_PROPERTY_KEY, null, List.class); } if (context.getSearchParameters().getExcludeDeletedEntities()) { http://git-wip-us.apache.org/repos/asf/atlas/blob/14df38de/repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java -- diff --git a/repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java b/repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java index 0a811f4..016ad1b 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java +++ b/repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java @@ -93,7 +93,7 @@ public class EntitySearchProcessor extends SearchProcessor { final Predicate traitPredicate; if (classificationType == SearchContext.MATCH_ALL_CLASSIFICATION) { -traitPredicate = SearchPredicateUtil.getNotNullPredicateGenerator().generatePredicate(Constants.TRAIT_NAMES_PROPERTY_KEY, null, List.class); +traitPredicate = SearchPredicateUtil.getNotEmptyPredicateGenerator().generatePredicate(Constants.TRAIT_NAMES_PROPERTY_KEY, null, List.class); } else { traitPredicate = SearchPredicateUtil.getContainsAnyPredicateGenerator().generatePredicate(Constants.TRAIT_NAMES_PROPERTY_KEY, classificationTypeAndSubTypes, List.class); } http://git-wip-us.apache.org/repos/asf/atlas/blob/14df38de/repository/src/main/java/org/apache/atlas/discovery/FullTextSearchProcessor.java -- diff --git a/repository/src/main/java/org/apache/atlas/discovery/FullTextSearchProcessor.java b/repository/src/main/java/org/apache/atlas/discovery/FullTextSearchProcessor.java index 95372d3..5ffd88b 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/FullTextSearchProcessor.java +++ b/repository/src/main/java/org/apache/atlas/discovery/FullTextSearchProcessor.java @@ -61,7 +61,7 @@ public class FullTextSearchProcessor extends SearchProcessor { // if search includes classification criteria, adding a filter here can help avoid unnecessary // processing (and rejection) by subsequent ClassificationSearchProcessor or EntitySearchProcessor -if (context.getClassificationType() != null) { +if (context.getClassificatio
atlas git commit: ATLAS-2456: fix in conversion of auditAction string to V1/V2 version of EntityAuditAction
Repository: atlas Updated Branches: refs/heads/master bf4bf7fea -> be9b39bf5 ATLAS-2456: fix in conversion of auditAction string to V1/V2 version of EntityAuditAction Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/be9b39bf Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/be9b39bf Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/be9b39bf Branch: refs/heads/master Commit: be9b39bf53f0f3951c5c69a8d124c6727573b568 Parents: bf4bf7f Author: Madhan Neethiraj <mad...@apache.org> Authored: Fri Feb 23 10:48:04 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Feb 23 15:27:33 2018 -0800 -- .../java/org/apache/atlas/EntityAuditEvent.java | 30 +- .../atlas/model/audit/EntityAuditEventV2.java | 30 +- .../audit/HBaseBasedAuditRepository.java| 4 +- .../converters/AtlasInstanceConverter.java | 42 ++-- 4 files changed, 80 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/be9b39bf/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java -- diff --git a/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java b/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java index 3b28452..3cf3e21 100644 --- a/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java +++ b/client/client-v1/src/main/java/org/apache/atlas/EntityAuditEvent.java @@ -47,7 +47,35 @@ import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ public class EntityAuditEvent implements Serializable { public enum EntityAuditAction { ENTITY_CREATE, ENTITY_UPDATE, ENTITY_DELETE, TAG_ADD, TAG_DELETE, TAG_UPDATE, -ENTITY_IMPORT_CREATE, ENTITY_IMPORT_UPDATE, ENTITY_IMPORT_DELETE, +ENTITY_IMPORT_CREATE, ENTITY_IMPORT_UPDATE, ENTITY_IMPORT_DELETE; + +public static EntityAuditAction fromString(String strValue) { +switch (strValue) { +case "ENTITY_CREATE": +return ENTITY_CREATE; +case "ENTITY_UPDATE": +return ENTITY_UPDATE; +case "ENTITY_DELETE": +return ENTITY_DELETE; +case "ENTITY_IMPORT_CREATE": +return ENTITY_IMPORT_CREATE; +case "ENTITY_IMPORT_UPDATE": +return ENTITY_IMPORT_UPDATE; +case "ENTITY_IMPORT_DELETE": +return ENTITY_IMPORT_DELETE; +case "CLASSIFICATION_ADD": +case "TAG_ADD": +return TAG_ADD; +case "CLASSIFICATION_DELETE": +case "TAG_DELETE": +return TAG_DELETE; +case "CLASSIFICATION_UPDATE": +case "TAG_UPDATE": +return TAG_UPDATE; +} + +throw new IllegalArgumentException("No enum constant " + EntityAuditAction.class.getCanonicalName() + "." + strValue); +} } private String entityId; http://git-wip-us.apache.org/repos/asf/atlas/blob/be9b39bf/intg/src/main/java/org/apache/atlas/model/audit/EntityAuditEventV2.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/audit/EntityAuditEventV2.java b/intg/src/main/java/org/apache/atlas/model/audit/EntityAuditEventV2.java index 741e371..1045c77 100644 --- a/intg/src/main/java/org/apache/atlas/model/audit/EntityAuditEventV2.java +++ b/intg/src/main/java/org/apache/atlas/model/audit/EntityAuditEventV2.java @@ -45,7 +45,35 @@ public class EntityAuditEventV2 implements Serializable { public enum EntityAuditAction { ENTITY_CREATE, ENTITY_UPDATE, ENTITY_DELETE, ENTITY_IMPORT_CREATE, ENTITY_IMPORT_UPDATE, ENTITY_IMPORT_DELETE, -CLASSIFICATION_ADD, CLASSIFICATION_DELETE, CLASSIFICATION_UPDATE, +CLASSIFICATION_ADD, CLASSIFICATION_DELETE, CLASSIFICATION_UPDATE; + +public static EntityAuditAction fromString(String strValue) { +switch (strValue) { +case "ENTITY_CREATE": +return ENTITY_CREATE; +case "ENTITY_UPDATE": +return ENTITY_UPDATE; +case "ENTITY_DELETE": +return ENTITY_DELETE; +case "ENTITY_IMPORT_CREATE": +return ENTITY_IMPORT_CREATE; +case "ENTITY_IMPORT_UPDATE": +
[3/4] atlas git commit: ATLAS-2459: Authorization enhancements to support instance level access controls
http://git-wip-us.apache.org/repos/asf/atlas/blob/afbc6975/authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyParser.java -- diff --git a/authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyParser.java b/authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyParser.java deleted file mode 100644 index f61bbf7..000 --- a/authorization/src/main/java/org/apache/atlas/authorize/simple/PolicyParser.java +++ /dev/null @@ -1,252 +0,0 @@ -/** - * 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.authorize.simple; - -import org.apache.atlas.authorize.AtlasActionTypes; -import org.apache.atlas.authorize.AtlasResourceTypes; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.regex.Pattern; - -public class PolicyParser { - -private static Logger LOG = LoggerFactory.getLogger(PolicyParser.class); -private static boolean isDebugEnabled = LOG.isDebugEnabled(); -public static final int POLICYNAME = 0; - -public static final int USER_INDEX = 1; -public static final int USERNAME = 0; -public static final int USER_AUTHORITIES = 1; - -public static final int GROUP_INDEX = 2; -public static final int GROUPNAME = 0; -public static final int GROUP_AUTHORITIES = 1; - -public static final int RESOURCE_INDEX = 3; -public static final int RESOURCE_TYPE = 0; -public static final int RESOURCE_NAME = 1; - -private List getListOfAutorities(String auth) { -if (isDebugEnabled) { -LOG.debug("==> PolicyParser getListOfAutorities"); -} -List authorities = new ArrayList<>(); - -for (int i = 0; i < auth.length(); i++) { -char access = auth.toLowerCase().charAt(i); -switch (access) { -case 'r': -authorities.add(AtlasActionTypes.READ); -break; -case 'w': -authorities.add(AtlasActionTypes.CREATE); -break; -case 'u': -authorities.add(AtlasActionTypes.UPDATE); -break; -case 'd': -authorities.add(AtlasActionTypes.DELETE); -break; - -default: -if (LOG.isErrorEnabled()) { -LOG.error("Invalid action: '{}'", access); -} -break; -} -} -if (isDebugEnabled) { -LOG.debug("<== PolicyParser getListOfAutorities"); -} -return authorities; -} - -public List parsePolicies(List policies) { -if (isDebugEnabled) { -LOG.debug("==> PolicyParser parsePolicies"); -} -List policyDefs = new ArrayList<>(); -for (String policy : policies) { -PolicyDef policyDef = parsePolicy(policy); -if (policyDef != null) { -policyDefs.add(policyDef); -} -} -if (isDebugEnabled) { -LOG.debug("<== PolicyParser parsePolicies"); -LOG.debug(policyDefs.toString()); -} -return policyDefs; -} - -private PolicyDef parsePolicy(String data) { -if (isDebugEnabled) { -LOG.debug("==> PolicyParser parsePolicy"); -} -PolicyDef def = null; -String[] props = data.split(";;"); - -if (props.length < RESOURCE_INDEX) { -LOG.warn("skipping invalid policy line: {}", data); -} else { -def = new PolicyDef(); -def.setPolicyName(props[POLICYNAME]); -parseUsers(props[USER_INDEX], def); -parseGroups(props[GROUP_INDEX], def); -parseResources(props[RESOURCE_INDEX], def); -if (isDebugEnabled) { -LOG.debug("policy successfully parsed!!!"); -LOG.debug("<== PolicyParser parsePolicy"); -} -} -return def; -} - -private boolean
[2/4] atlas git commit: ATLAS-2459: Authorization enhancements to support instance level access controls
http://git-wip-us.apache.org/repos/asf/atlas/blob/afbc6975/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 9e18dfb..ec4125d 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java +++ b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java @@ -22,15 +22,17 @@ 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; +import org.apache.atlas.authorize.AtlasEntityAccessRequest; +import org.apache.atlas.authorize.AtlasPrivilege; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.model.instance.AtlasEntity; +import org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo; import org.apache.atlas.model.instance.AtlasEntityHeader; 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.graph.GraphHelper; import org.apache.atlas.repository.graphdb.AtlasGraph; import org.apache.atlas.repository.graphdb.AtlasVertex; import org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1; @@ -80,8 +82,14 @@ public class EntityLineageService implements AtlasLineageService { public AtlasLineageInfo getAtlasLineageInfo(String guid, LineageDirection direction, int depth) throws AtlasBaseException { AtlasLineageInfo lineageInfo; -if (!entityExists(guid)) { -throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND, guid); +AtlasEntityHeader entity = entityRetriever.toAtlasEntityHeaderWithClassifications(guid); + +AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(atlasTypeRegistry, AtlasPrivilege.ENTITY_READ, entity), "read entity lineage: guid=", guid); + +AtlasEntityType entityType = atlasTypeRegistry.getEntityTypeByName(entity.getTypeName()); + +if (entityType == null || !entityType.getTypeAndAllSuperTypes().contains(AtlasClient.DATA_SET_SUPER_TYPE)) { +throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_DATASET, guid); } if (direction != null) { @@ -129,10 +137,14 @@ public class EntityLineageService implements AtlasLineageService { ret.setDataType(AtlasTypeUtil.toClassTypeDefinition(hive_column)); -AtlasEntity.AtlasEntityWithExtInfo entityWithExtInfo = entityRetriever.toAtlasEntityWithExtInfo(guid); -AtlasEntityentity= entityWithExtInfo.getEntity(); -MapreferredEntities = entityWithExtInfo.getReferredEntities(); -List columnIds = getColumnIds(entity); +AtlasEntityWithExtInfo entityWithExtInfo = entityRetriever.toAtlasEntityWithExtInfo(guid); +AtlasEntityentity= entityWithExtInfo.getEntity(); + +AtlasAuthorizationUtils.verifyAccess(new AtlasEntityAccessRequest(atlasTypeRegistry, AtlasPrivilege.ENTITY_READ, new AtlasEntityHeader(entity)), + "read entity schema: guid=", guid); + +Map referredEntities = entityWithExtInfo.getReferredEntities(); +List columnIds= getColumnIds(entity); if (MapUtils.isNotEmpty(referredEntities)) { List
[4/4] atlas git commit: ATLAS-2459: Authorization enhancements to support instance level access controls
ATLAS-2459: Authorization enhancements to support instance level access controls Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/afbc6975 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/afbc6975 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/afbc6975 Branch: refs/heads/master Commit: afbc6975b3eb0ece492f26f508792cf363ad2211 Parents: be9b39b Author: nixonrodrigues <ni...@apache.org> Authored: Fri Feb 23 15:45:31 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Mon Feb 26 10:37:47 2018 -0800 -- .../test/resources/atlas-application.properties | 9 +- .../test/resources/atlas-application.properties | 9 +- .../test/resources/atlas-application.properties | 9 +- .../test/resources/atlas-application.properties | 9 +- .../test/resources/atlas-application.properties | 9 +- authorization/pom.xml | 10 + .../atlas/authorize/AtlasAccessRequest.java | 85 ++--- .../atlas/authorize/AtlasActionTypes.java | 22 -- .../authorize/AtlasAdminAccessRequest.java | 38 ++ .../authorize/AtlasAuthorizationUtils.java | 161 .../apache/atlas/authorize/AtlasAuthorizer.java | 34 +- .../atlas/authorize/AtlasAuthorizerFactory.java | 52 +-- .../authorize/AtlasEntityAccessRequest.java | 146 +++ .../atlas/authorize/AtlasNoneAuthorizer.java| 47 +++ .../apache/atlas/authorize/AtlasPrivilege.java | 46 +++ .../atlas/authorize/AtlasResourceTypes.java | 23 -- .../atlas/authorize/AtlasTypeAccessRequest.java | 49 +++ .../simple/AtlasAuthorizationUtils.java | 182 - .../authorize/simple/AtlasSimpleAuthorizer.java | 346 + .../simple/AtlasSimpleAuthzPolicy.java | 255 + .../atlas/authorize/simple/FileReaderUtil.java | 56 --- .../atlas/authorize/simple/PolicyDef.java | 70 .../atlas/authorize/simple/PolicyParser.java| 252 .../atlas/authorize/simple/PolicyUtil.java | 107 -- .../authorize/simple/SimpleAtlasAuthorizer.java | 381 --- .../resources/atlas-simple-authz-policy.json| 61 +++ .../simple/AtlasAuthorizationUtilsTest.java | 105 - .../simple/AtlasSimpleAuthorizerTest.java | 107 ++ .../authorize/simple/PolicyParserTest.java | 172 - .../atlas/authorize/simple/PolicyUtilTest.java | 100 - .../simple/SimpleAtlasAuthorizerTest.java | 208 -- .../test/resources/atlas-application.properties | 149 .../resources/atlas-simple-authz-policy.json| 61 +++ distro/src/conf/atlas-application.properties| 8 +- .../org/apache/atlas/ApplicationProperties.java | 40 +- .../java/org/apache/atlas/AtlasErrorCode.java | 3 + .../atlas/model/instance/AtlasEntityHeader.java | 16 + .../atlas/type/AtlasClassificationType.java | 7 + .../java/org/apache/atlas/utils/AtlasJson.java | 15 + .../test/resources/atlas-application.properties | 11 +- repository/pom.xml | 6 + .../atlas/discovery/EntityLineageService.java | 45 +-- .../graph/v1/AtlasClassificationDefStoreV1.java | 24 +- .../store/graph/v1/AtlasEntityDefStoreV1.java | 23 ++ .../store/graph/v1/AtlasEntityStoreV1.java | 297 +-- .../store/graph/v1/AtlasStructDefStoreV1.java | 23 +- .../store/graph/v1/EntityGraphRetriever.java| 31 +- .../util/AtlasRepositoryConfiguration.java | 42 +- .../repository/impexp/ExportServiceTest.java| 2 +- .../repository/impexp/ImportServiceTest.java| 2 +- .../impexp/ZipFileResourceTestUtils.java| 2 +- .../store/graph/AtlasTypeDefGraphStoreTest.java | 2 +- .../store/graph/v1/AtlasEntityStoreV1Test.java | 4 +- .../graph/v1/AtlasRelationshipStoreV1Test.java | 2 +- .../graph/v1/InverseReferenceUpdateV1Test.java | 4 +- .../java/org/apache/atlas/RequestContextV1.java | 18 +- .../java/org/apache/atlas/aspect/Loggable.java | 29 -- .../java/org/apache/atlas/aspect/Monitored.java | 29 -- .../atlas/discovery/DiscoveryException.java | 74 .../exception/SchemaNotFoundException.java | 40 -- .../atlas/exception/TraitNotFoundException.java | 45 --- .../java/org/apache/atlas/metrics/Metrics.java | 68 .../notification/NotificationHookConsumer.java | 91 +++-- .../web/filters/AtlasAuthenticationFilter.java | 5 +- .../web/filters/AtlasAuthorizationFilter.java | 180 - .../apache/atlas/web/filters/AuditFilter.java | 115 -- .../atlas/web/resources/AdminResource.java | 26 +- .../org/apache/atlas/web/rest/TypesREST.java| 2 + .../atlas/web/security/AtlasSecurityConfig.java | 8 +- .../apache/atlas/web/util/DateTimeHelper.java | 84 +--- webapp/src/main/resources/spring-se
[1/4] atlas git commit: ATLAS-2459: Authorization enhancements to support instance level access controls
Repository: atlas Updated Branches: refs/heads/master be9b39bf5 -> afbc6975b http://git-wip-us.apache.org/repos/asf/atlas/blob/afbc6975/webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthorizationFilter.java -- diff --git a/webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthorizationFilter.java b/webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthorizationFilter.java deleted file mode 100644 index 8a29bb3..000 --- a/webapp/src/main/java/org/apache/atlas/web/filters/AtlasAuthorizationFilter.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * 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.web.filters; - -import com.google.common.base.Strings; -import org.apache.atlas.AtlasClient; -import org.apache.atlas.authorize.AtlasAccessRequest; -import org.apache.atlas.authorize.AtlasAuthorizationException; -import org.apache.atlas.authorize.AtlasAuthorizer; -import org.apache.atlas.authorize.AtlasAuthorizerFactory; -import org.apache.atlas.authorize.AtlasResourceTypes; -import org.json.simple.JSONObject; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.GrantedAuthority; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.stereotype.Component; -import org.springframework.web.filter.GenericFilterBean; - -import javax.servlet.FilterChain; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -@Component -public class AtlasAuthorizationFilter extends GenericFilterBean { - -private static final Logger LOG = LoggerFactory.getLogger(AtlasAuthorizationFilter.class); -private static boolean isDebugEnabled = LOG.isDebugEnabled(); -private AtlasAuthorizer authorizer = null; - -private final String BASE_URL = "/" + AtlasClient.BASE_URI; - -public AtlasAuthorizationFilter() { -if (isDebugEnabled) { -LOG.debug("==> AtlasAuthorizationFilter() -- " + "Now initializing the Apache Atlas Authorizer!!!"); -} - -try { -authorizer = AtlasAuthorizerFactory.getAtlasAuthorizer(); -if (authorizer != null) { -authorizer.init(); -} else { -LOG.warn("AtlasAuthorizer not initialized properly, please check the application logs and add proper configurations."); -} -} catch (AtlasAuthorizationException e) { -LOG.error("Unable to obtain AtlasAuthorizer. ", e); -} - -} - -@Override -public void destroy() { -if (isDebugEnabled) { -LOG.debug("==> AtlasAuthorizationFilter destroy"); -} -if (authorizer != null) { -authorizer.cleanUp(); -} -super.destroy(); -} - -@SuppressWarnings("unchecked") -@Override -public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, -ServletException { -if (isDebugEnabled) { -LOG.debug("==> AuthorizationFilter.doFilter"); -} - -HttpServletRequest request = (HttpServletRequest) req; -HttpServletResponse response = (HttpServletResponse) res; -AtlasResponseRequestWrapper responseWrapper = new AtlasResponseRequestWrapper(response); -responseWrapper.setHeader("X-Frame-Options", "DENY"); - -String pathInfo = request.getServletPath(); -if (!Strings.isNullOrEmpty(pathInfo) && (pathInfo.startsWith(BASE_URL) || BASE_URL.startsWith(pathInfo))) { -if (isDebugEnabled) { -LOG.debug("{} is a valid REST API request!!!", pathInfo); -} - -String userName = null; -Set groups = new HashSet<>(); - -Authentication auth = SecurityContextHolder.getContext().getAuthentication(); - -if
atlas git commit: ATLAS-2760: Hive hook updates to handle references to s3 paths
Repository: atlas Updated Branches: refs/heads/master f787bcc2b -> 88ac0fa62 ATLAS-2760: Hive hook updates to handle references to s3 paths Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/88ac0fa6 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/88ac0fa6 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/88ac0fa6 Branch: refs/heads/master Commit: 88ac0fa62186a59ed08a950385c5a1e3c84e517e Parents: f787bcc Author: Madhan Neethiraj Authored: Sun Jun 17 13:20:37 2018 -0700 Committer: Madhan Neethiraj Committed: Tue Jun 19 23:26:04 2018 -0700 -- .../atlas/hive/hook/events/BaseHiveEvent.java | 79 .../atlas/hive/hook/events/CreateTable.java | 2 +- 2 files changed, 64 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/88ac0fa6/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java index ce03287..09f011c 100644 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java @@ -78,6 +78,13 @@ public abstract class BaseHiveEvent { public static final String HDFS_TYPE_PATH = "hdfs_path"; public static final String HBASE_TYPE_TABLE = "hbase_table"; public static final String HBASE_TYPE_NAMESPACE = "hbase_namespace"; +public static final String AWS_S3_BUCKET= "aws_s3_bucket"; +public static final String AWS_S3_PSEUDO_DIR= "aws_s3_pseudo_dir"; +public static final String AWS_S3_OBJECT= "aws_s3_object"; + +public static final String SCHEME_SEPARATOR = "://"; +public static final String S3_SCHEME= "s3" + SCHEME_SEPARATOR; +public static final String S3A_SCHEME = "s3a" + SCHEME_SEPARATOR; public static final String ATTRIBUTE_QUALIFIED_NAME= "qualifiedName"; public static final String ATTRIBUTE_NAME = "name"; @@ -130,6 +137,8 @@ public abstract class BaseHiveEvent { public static final String ATTRIBUTE_URI = "uri"; public static final String ATTRIBUTE_STORAGE_HANDLER = "storage_handler"; public static final String ATTRIBUTE_NAMESPACE = "namespace"; +public static final String ATTRIBUTE_OBJECT_PREFIX = "objectPrefix"; +public static final String ATTRIBUTE_BUCKET= "bucket"; public static final String HBASE_STORAGE_HANDLER_CLASS = "org.apache.hadoop.hive.hbase.HBaseStorageHandler"; public static final String HBASE_DEFAULT_NAMESPACE = "default"; @@ -245,7 +254,7 @@ public abstract class BaseHiveEvent { URI location = entity.getLocation(); if (location != null) { -ret = getHDFSPathEntity(new Path(entity.getLocation())); +ret = getPathEntity(new Path(entity.getLocation()), entityExtInfo); } } break; @@ -494,26 +503,60 @@ public abstract class BaseHiveEvent { return ret; } -protected AtlasEntity getHDFSPathEntity(Path path) { -String strPath = path.toString().toLowerCase(); -String nameServiceID = HdfsNameServiceResolver.getNameServiceIDForPath(strPath); -String attrPath = StringUtils.isEmpty(nameServiceID) ? strPath : HdfsNameServiceResolver.getPathWithNameServiceID(strPath); -String pathQualifiedName = getQualifiedName(attrPath); -AtlasEntity ret = context.getEntity(pathQualifiedName); +protected AtlasEntity getPathEntity(Path path, AtlasEntityExtInfo extInfo) { +AtlasEntity ret; +String strPath = path.toString().toLowerCase(); -if (ret == null) { -ret = new AtlasEntity(HDFS_TYPE_PATH); +if (isS3Path(strPath)) { +String bucketName = path.toUri().getAuthority(); +String bucketQualifiedName = (path.toUri().getScheme() + SCHEME_SEPARATOR + path.toUri().getAuthority() + QNAME_SEP_CLUSTER_NAME).toLowerCase() + getClusterName(); +String pathQualifiedName = (strPath + QNAME_SEP_CLUSTER_N
atlas git commit: ATLAS-2760: Hive hook updates to handle references to s3 paths
Repository: atlas Updated Branches: refs/heads/branch-1.0 bfd88c3c3 -> 674a46d0e ATLAS-2760: Hive hook updates to handle references to s3 paths (cherry picked from commit 88ac0fa62186a59ed08a950385c5a1e3c84e517e) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/674a46d0 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/674a46d0 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/674a46d0 Branch: refs/heads/branch-1.0 Commit: 674a46d0e16b6de052544e48d9b84a3ed811e8cb Parents: bfd88c3 Author: Madhan Neethiraj Authored: Sun Jun 17 13:20:37 2018 -0700 Committer: Madhan Neethiraj Committed: Wed Jun 20 08:38:45 2018 -0700 -- .../atlas/hive/hook/events/BaseHiveEvent.java | 79 .../atlas/hive/hook/events/CreateTable.java | 2 +- 2 files changed, 64 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/674a46d0/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java index ce03287..09f011c 100644 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java @@ -78,6 +78,13 @@ public abstract class BaseHiveEvent { public static final String HDFS_TYPE_PATH = "hdfs_path"; public static final String HBASE_TYPE_TABLE = "hbase_table"; public static final String HBASE_TYPE_NAMESPACE = "hbase_namespace"; +public static final String AWS_S3_BUCKET= "aws_s3_bucket"; +public static final String AWS_S3_PSEUDO_DIR= "aws_s3_pseudo_dir"; +public static final String AWS_S3_OBJECT= "aws_s3_object"; + +public static final String SCHEME_SEPARATOR = "://"; +public static final String S3_SCHEME= "s3" + SCHEME_SEPARATOR; +public static final String S3A_SCHEME = "s3a" + SCHEME_SEPARATOR; public static final String ATTRIBUTE_QUALIFIED_NAME= "qualifiedName"; public static final String ATTRIBUTE_NAME = "name"; @@ -130,6 +137,8 @@ public abstract class BaseHiveEvent { public static final String ATTRIBUTE_URI = "uri"; public static final String ATTRIBUTE_STORAGE_HANDLER = "storage_handler"; public static final String ATTRIBUTE_NAMESPACE = "namespace"; +public static final String ATTRIBUTE_OBJECT_PREFIX = "objectPrefix"; +public static final String ATTRIBUTE_BUCKET= "bucket"; public static final String HBASE_STORAGE_HANDLER_CLASS = "org.apache.hadoop.hive.hbase.HBaseStorageHandler"; public static final String HBASE_DEFAULT_NAMESPACE = "default"; @@ -245,7 +254,7 @@ public abstract class BaseHiveEvent { URI location = entity.getLocation(); if (location != null) { -ret = getHDFSPathEntity(new Path(entity.getLocation())); +ret = getPathEntity(new Path(entity.getLocation()), entityExtInfo); } } break; @@ -494,26 +503,60 @@ public abstract class BaseHiveEvent { return ret; } -protected AtlasEntity getHDFSPathEntity(Path path) { -String strPath = path.toString().toLowerCase(); -String nameServiceID = HdfsNameServiceResolver.getNameServiceIDForPath(strPath); -String attrPath = StringUtils.isEmpty(nameServiceID) ? strPath : HdfsNameServiceResolver.getPathWithNameServiceID(strPath); -String pathQualifiedName = getQualifiedName(attrPath); -AtlasEntity ret = context.getEntity(pathQualifiedName); +protected AtlasEntity getPathEntity(Path path, AtlasEntityExtInfo extInfo) { +AtlasEntity ret; +String strPath = path.toString().toLowerCase(); -if (ret == null) { -ret = new AtlasEntity(HDFS_TYPE_PATH); +if (isS3Path(strPath)) { +String bucketName = path.toUri().getAuthority(); +String bucketQualifiedName = (path.toUri().getScheme() + SCHEME_SEPARATOR + path.toUri().getAuthority() + QNAME_SEP_CLUSTER_NAME).toLowerCase() + getClusterName();
atlas git commit: ATLAS-2793: updated AtlasClient approach of determining if kerberos authentication is enabled or not
Repository: atlas Updated Branches: refs/heads/branch-0.8 fa97b5252 -> 3d2bda3a0 ATLAS-2793: updated AtlasClient approach of determining if kerberos authentication is enabled or not (cherry picked from commit b02238491e451bda71e399725ea4a4d021ec766f) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/3d2bda3a Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/3d2bda3a Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/3d2bda3a Branch: refs/heads/branch-0.8 Commit: 3d2bda3a02398329fcd4a6a2c3224d6e637e8e86 Parents: fa97b52 Author: Madhan Neethiraj Authored: Sun Jul 29 08:39:15 2018 -0700 Committer: Madhan Neethiraj Committed: Mon Jul 30 09:50:02 2018 -0700 -- .../java/org/apache/atlas/AtlasBaseClient.java | 4 +++- .../apache/atlas/utils/AuthenticationUtil.java | 19 +++ 2 files changed, 18 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/3d2bda3a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java -- diff --git a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java index aa1c773..e48061c 100644 --- a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java +++ b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java @@ -261,7 +261,9 @@ public abstract class AtlasBaseClient { final URLConnectionClientHandler handler; -if ((AuthenticationUtil.isKerberosAuthenticationEnabled())) { +boolean isKerberosEnabled = AuthenticationUtil.isKerberosAuthenticationEnabled(ugi); + +if (isKerberosEnabled) { handler = SecureClientUtils.getClientConnectionHandler(config, configuration, doAsUser, ugi); } else { if (configuration.getBoolean(TLS_ENABLED, false)) { http://git-wip-us.apache.org/repos/asf/atlas/blob/3d2bda3a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java -- diff --git a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java index af32afc..a871fa6 100644 --- a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java +++ b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java @@ -20,6 +20,7 @@ package org.apache.atlas.utils; import org.apache.atlas.ApplicationProperties; import org.apache.atlas.AtlasException; import org.apache.commons.configuration.Configuration; +import org.apache.hadoop.security.UserGroupInformation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Console; @@ -34,17 +35,27 @@ public final class AuthenticationUtil { } public static boolean isKerberosAuthenticationEnabled() { -boolean isKerberosAuthenticationEnabled = false; +return isKerberosAuthenticationEnabled((UserGroupInformation) null); +} + +public static boolean isKerberosAuthenticationEnabled(UserGroupInformation ugi) { +boolean defaultValue = ugi != null && ugi.hasKerberosCredentials(); + try { -isKerberosAuthenticationEnabled = isKerberosAuthenticationEnabled(ApplicationProperties.get()); +return isKerberosAuthenticationEnabled(ApplicationProperties.get(), defaultValue); } catch (AtlasException e) { LOG.error("Error while isKerberosAuthenticationEnabled ", e); } -return isKerberosAuthenticationEnabled; + +return defaultValue; } public static boolean isKerberosAuthenticationEnabled(Configuration atlasConf) { -return atlasConf.getBoolean("atlas.authentication.method.kerberos", false); +return isKerberosAuthenticationEnabled(atlasConf, false); +} + +public static boolean isKerberosAuthenticationEnabled(Configuration atlasConf, boolean defaultValue) { +return atlasConf.getBoolean("atlas.authentication.method.kerberos", defaultValue); } public static boolean includeHadoopGroups(){
atlas git commit: ATLAS-2793: updated AtlasClient approach of determining if kerberos authentication is enabled or not
Repository: atlas Updated Branches: refs/heads/master 50c3adf15 -> b02238491 ATLAS-2793: updated AtlasClient approach of determining if kerberos authentication is enabled or not Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/b0223849 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/b0223849 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/b0223849 Branch: refs/heads/master Commit: b02238491e451bda71e399725ea4a4d021ec766f Parents: 50c3adf Author: Madhan Neethiraj Authored: Sun Jul 29 08:39:15 2018 -0700 Committer: Madhan Neethiraj Committed: Sun Jul 29 08:39:15 2018 -0700 -- .../java/org/apache/atlas/AtlasBaseClient.java | 4 +++- .../apache/atlas/utils/AuthenticationUtil.java | 19 +++ 2 files changed, 18 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/b0223849/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java -- diff --git a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java index f8e78ee..4464ade 100644 --- a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java +++ b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java @@ -266,7 +266,9 @@ public abstract class AtlasBaseClient { final URLConnectionClientHandler handler; -if ((AuthenticationUtil.isKerberosAuthenticationEnabled())) { +boolean isKerberosEnabled = AuthenticationUtil.isKerberosAuthenticationEnabled(ugi); + +if (isKerberosEnabled) { handler = SecureClientUtils.getClientConnectionHandler(config, configuration, doAsUser, ugi); } else { if (configuration.getBoolean(TLS_ENABLED, false)) { http://git-wip-us.apache.org/repos/asf/atlas/blob/b0223849/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java -- diff --git a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java index 99b58fe..cf2b38f 100644 --- a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java +++ b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java @@ -20,6 +20,7 @@ package org.apache.atlas.utils; import org.apache.atlas.ApplicationProperties; import org.apache.atlas.AtlasException; import org.apache.commons.configuration.Configuration; +import org.apache.hadoop.security.UserGroupInformation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Console; @@ -34,17 +35,27 @@ public final class AuthenticationUtil { } public static boolean isKerberosAuthenticationEnabled() { -boolean isKerberosAuthenticationEnabled = false; +return isKerberosAuthenticationEnabled((UserGroupInformation) null); +} + +public static boolean isKerberosAuthenticationEnabled(UserGroupInformation ugi) { +boolean defaultValue = ugi != null && ugi.hasKerberosCredentials(); + try { -isKerberosAuthenticationEnabled = isKerberosAuthenticationEnabled(ApplicationProperties.get()); +return isKerberosAuthenticationEnabled(ApplicationProperties.get(), defaultValue); } catch (AtlasException e) { LOG.error("Error while isKerberosAuthenticationEnabled ", e); } -return isKerberosAuthenticationEnabled; + +return defaultValue; } public static boolean isKerberosAuthenticationEnabled(Configuration atlasConf) { -return atlasConf.getBoolean("atlas.authentication.method.kerberos", false); +return isKerberosAuthenticationEnabled(atlasConf, false); +} + +public static boolean isKerberosAuthenticationEnabled(Configuration atlasConf, boolean defaultValue) { +return atlasConf.getBoolean("atlas.authentication.method.kerberos", defaultValue); } public static boolean includeHadoopGroups(){
atlas git commit: ATLAS-2793: updated AtlasClient approach of determining if kerberos authentication is enabled or not
Repository: atlas Updated Branches: refs/heads/branch-1.0 9097d695c -> e218c9ed5 ATLAS-2793: updated AtlasClient approach of determining if kerberos authentication is enabled or not (cherry picked from commit b02238491e451bda71e399725ea4a4d021ec766f) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/e218c9ed Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/e218c9ed Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/e218c9ed Branch: refs/heads/branch-1.0 Commit: e218c9ed503b00f8cc59edcf4e285c01da884d57 Parents: 9097d69 Author: Madhan Neethiraj Authored: Sun Jul 29 08:39:15 2018 -0700 Committer: Madhan Neethiraj Committed: Mon Jul 30 09:49:09 2018 -0700 -- .../java/org/apache/atlas/AtlasBaseClient.java | 4 +++- .../apache/atlas/utils/AuthenticationUtil.java | 19 +++ 2 files changed, 18 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/e218c9ed/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java -- diff --git a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java index f8e78ee..4464ade 100644 --- a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java +++ b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java @@ -266,7 +266,9 @@ public abstract class AtlasBaseClient { final URLConnectionClientHandler handler; -if ((AuthenticationUtil.isKerberosAuthenticationEnabled())) { +boolean isKerberosEnabled = AuthenticationUtil.isKerberosAuthenticationEnabled(ugi); + +if (isKerberosEnabled) { handler = SecureClientUtils.getClientConnectionHandler(config, configuration, doAsUser, ugi); } else { if (configuration.getBoolean(TLS_ENABLED, false)) { http://git-wip-us.apache.org/repos/asf/atlas/blob/e218c9ed/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java -- diff --git a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java index 99b58fe..cf2b38f 100644 --- a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java +++ b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java @@ -20,6 +20,7 @@ package org.apache.atlas.utils; import org.apache.atlas.ApplicationProperties; import org.apache.atlas.AtlasException; import org.apache.commons.configuration.Configuration; +import org.apache.hadoop.security.UserGroupInformation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.Console; @@ -34,17 +35,27 @@ public final class AuthenticationUtil { } public static boolean isKerberosAuthenticationEnabled() { -boolean isKerberosAuthenticationEnabled = false; +return isKerberosAuthenticationEnabled((UserGroupInformation) null); +} + +public static boolean isKerberosAuthenticationEnabled(UserGroupInformation ugi) { +boolean defaultValue = ugi != null && ugi.hasKerberosCredentials(); + try { -isKerberosAuthenticationEnabled = isKerberosAuthenticationEnabled(ApplicationProperties.get()); +return isKerberosAuthenticationEnabled(ApplicationProperties.get(), defaultValue); } catch (AtlasException e) { LOG.error("Error while isKerberosAuthenticationEnabled ", e); } -return isKerberosAuthenticationEnabled; + +return defaultValue; } public static boolean isKerberosAuthenticationEnabled(Configuration atlasConf) { -return atlasConf.getBoolean("atlas.authentication.method.kerberos", false); +return isKerberosAuthenticationEnabled(atlasConf, false); +} + +public static boolean isKerberosAuthenticationEnabled(Configuration atlasConf, boolean defaultValue) { +return atlasConf.getBoolean("atlas.authentication.method.kerberos", defaultValue); } public static boolean includeHadoopGroups(){
atlas git commit: ATLAS-2794: updated AtlasClient to explicitly specify JacksonJaxbJsonProvider
Repository: atlas Updated Branches: refs/heads/master d1b3f21c1 -> 50c3adf15 ATLAS-2794: updated AtlasClient to explicitly specify JacksonJaxbJsonProvider (cherry picked from commit 9097d695c5509b874c86e0eae159cecf2a812de8) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/50c3adf1 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/50c3adf1 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/50c3adf1 Branch: refs/heads/master Commit: 50c3adf1519cb3d4d01ea86c2e90e1bba4df3c46 Parents: d1b3f21 Author: Madhan Neethiraj Authored: Thu Jul 26 21:51:24 2018 -0700 Committer: Madhan Neethiraj Committed: Thu Jul 26 22:50:12 2018 -0700 -- client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/50c3adf1/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java -- diff --git a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java index 5144b25..f8e78ee 100644 --- a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java +++ b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java @@ -19,6 +19,7 @@ package org.apache.atlas; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; import com.google.common.annotations.VisibleForTesting; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientHandlerException; @@ -249,6 +250,7 @@ public abstract class AtlasBaseClient { DefaultClientConfig config = new DefaultClientConfig(); // Enable POJO mapping feature config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE); +config.getClasses().add(JacksonJaxbJsonProvider.class); int readTimeout = configuration.getInt("atlas.client.readTimeoutMSecs", 6); int connectTimeout = configuration.getInt("atlas.client.connectTimeoutMSecs", 6); if (configuration.getBoolean(TLS_ENABLED, false)) {
atlas git commit: ATLAS-2809: updated authorization model to authorize add/update/remove of relationships
Repository: atlas Updated Branches: refs/heads/branch-1.0 e218c9ed5 -> f2a0dc2c7 ATLAS-2809: updated authorization model to authorize add/update/remove of relationships Signed-off-by: Madhan Neethiraj (cherry picked from commit da967ea8be923102c3485a4cbf55c958f57e23fd) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/f2a0dc2c Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/f2a0dc2c Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/f2a0dc2c Branch: refs/heads/branch-1.0 Commit: f2a0dc2c798ee8fb2cd22158b3da3eb9b3952332 Parents: e218c9e Author: nixonrodrigues Authored: Mon Jul 30 18:32:23 2018 +0530 Committer: Madhan Neethiraj Committed: Sat Aug 4 15:34:33 2018 -0700 -- .../atlas/authorize/AtlasAccessRequest.java | 69 ++ .../authorize/AtlasAuthorizationUtils.java | 30 + .../apache/atlas/authorize/AtlasAuthorizer.java | 12 +- .../authorize/AtlasEntityAccessRequest.java | 47 ++- .../atlas/authorize/AtlasNoneAuthorizer.java| 5 + .../apache/atlas/authorize/AtlasPrivilege.java | 6 +- .../AtlasRelationshipAccessRequest.java | 87 + .../authorize/simple/AtlasSimpleAuthorizer.java | 81 +++- .../simple/AtlasSimpleAuthzPolicy.java | 130 +-- .../resources/atlas-simple-authz-policy.json| 34 - .../resources/atlas-simple-authz-policy.json| 12 ++ distro/src/conf/atlas-simple-authz-policy.json | 32 - .../graph/v2/AtlasRelationshipStoreV2.java | 25 +++- 13 files changed, 498 insertions(+), 72 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/f2a0dc2c/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java -- diff --git a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java index 4ae9510..8cdd676 100644 --- a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java +++ b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java @@ -17,10 +17,17 @@ */ package org.apache.atlas.authorize; +import org.apache.atlas.model.instance.AtlasClassification; +import org.apache.atlas.model.instance.AtlasEntityHeader; +import org.apache.atlas.type.AtlasClassificationType; +import org.apache.atlas.type.AtlasEntityType; +import org.apache.atlas.type.AtlasTypeRegistry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collections; import java.util.Date; +import java.util.HashSet; import java.util.Set; public class AtlasAccessRequest { @@ -78,6 +85,68 @@ public class AtlasAccessRequest { this.clientIPAddress = clientIPAddress; } +public Set getEntityTypeAndAllSuperTypes(String entityType, AtlasTypeRegistry typeRegistry) { +final Set ret; + +if (entityType == null) { +ret = Collections.emptySet(); +} else if (typeRegistry == null) { +ret = Collections.singleton(entityType); +} else { +AtlasEntityType entType = typeRegistry.getEntityTypeByName(entityType); + +ret = entType != null ? entType.getTypeAndAllSuperTypes() : Collections.singleton(entityType); +} + +return ret; +} + +public Set getClassificationTypeAndAllSuperTypes(String classificationName, AtlasTypeRegistry typeRegistry) { +final Set ret; + +if (classificationName == null) { +ret = Collections.emptySet(); +} else if (typeRegistry == null) { +ret = Collections.singleton(classificationName); +} else { +AtlasClassificationType classificationType = typeRegistry.getClassificationTypeByName(classificationName); + +return classificationType != null ? classificationType.getTypeAndAllSuperTypes() : Collections.singleton(classificationName); +} + +return ret; +} + +public String getEntityId(AtlasEntityHeader entity) { +final String ret; + +if (entity == null) { +ret = null; +} else { +String qualifiedName = (String) entity.getAttribute("qualifiedName"); + +ret = qualifiedName; +} + +return ret; +} + +public Set getClassificationNames(AtlasEntityHeader entity) { +final Set ret; + +if (entity == null || entity.getClassifications() == null) { +ret = Collections.emptySet(); +} else { +ret = new HashSet<>(); + +for (AtlasClassification classify : entity.getClassifications()) { +ret.add(classify.getTypeName()); +} +
atlas git commit: ATLAS-2809: updated authorization model to authorize add/update/remove of relationships
Repository: atlas Updated Branches: refs/heads/master d5ecfee50 -> da967ea8b ATLAS-2809: updated authorization model to authorize add/update/remove of relationships Signed-off-by: Madhan Neethiraj Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/da967ea8 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/da967ea8 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/da967ea8 Branch: refs/heads/master Commit: da967ea8be923102c3485a4cbf55c958f57e23fd Parents: d5ecfee Author: nixonrodrigues Authored: Mon Jul 30 18:32:23 2018 +0530 Committer: Madhan Neethiraj Committed: Sat Aug 4 11:58:07 2018 -0700 -- .../atlas/authorize/AtlasAccessRequest.java | 69 ++ .../authorize/AtlasAuthorizationUtils.java | 30 + .../apache/atlas/authorize/AtlasAuthorizer.java | 12 +- .../authorize/AtlasEntityAccessRequest.java | 47 ++- .../atlas/authorize/AtlasNoneAuthorizer.java| 5 + .../apache/atlas/authorize/AtlasPrivilege.java | 6 +- .../AtlasRelationshipAccessRequest.java | 87 + .../authorize/simple/AtlasSimpleAuthorizer.java | 81 +++- .../simple/AtlasSimpleAuthzPolicy.java | 130 +-- .../resources/atlas-simple-authz-policy.json| 34 - .../resources/atlas-simple-authz-policy.json| 12 ++ distro/src/conf/atlas-simple-authz-policy.json | 32 - .../graph/v2/AtlasRelationshipStoreV2.java | 25 +++- 13 files changed, 498 insertions(+), 72 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/da967ea8/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java -- diff --git a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java index 4ae9510..8cdd676 100644 --- a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java +++ b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java @@ -17,10 +17,17 @@ */ package org.apache.atlas.authorize; +import org.apache.atlas.model.instance.AtlasClassification; +import org.apache.atlas.model.instance.AtlasEntityHeader; +import org.apache.atlas.type.AtlasClassificationType; +import org.apache.atlas.type.AtlasEntityType; +import org.apache.atlas.type.AtlasTypeRegistry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Collections; import java.util.Date; +import java.util.HashSet; import java.util.Set; public class AtlasAccessRequest { @@ -78,6 +85,68 @@ public class AtlasAccessRequest { this.clientIPAddress = clientIPAddress; } +public Set getEntityTypeAndAllSuperTypes(String entityType, AtlasTypeRegistry typeRegistry) { +final Set ret; + +if (entityType == null) { +ret = Collections.emptySet(); +} else if (typeRegistry == null) { +ret = Collections.singleton(entityType); +} else { +AtlasEntityType entType = typeRegistry.getEntityTypeByName(entityType); + +ret = entType != null ? entType.getTypeAndAllSuperTypes() : Collections.singleton(entityType); +} + +return ret; +} + +public Set getClassificationTypeAndAllSuperTypes(String classificationName, AtlasTypeRegistry typeRegistry) { +final Set ret; + +if (classificationName == null) { +ret = Collections.emptySet(); +} else if (typeRegistry == null) { +ret = Collections.singleton(classificationName); +} else { +AtlasClassificationType classificationType = typeRegistry.getClassificationTypeByName(classificationName); + +return classificationType != null ? classificationType.getTypeAndAllSuperTypes() : Collections.singleton(classificationName); +} + +return ret; +} + +public String getEntityId(AtlasEntityHeader entity) { +final String ret; + +if (entity == null) { +ret = null; +} else { +String qualifiedName = (String) entity.getAttribute("qualifiedName"); + +ret = qualifiedName; +} + +return ret; +} + +public Set getClassificationNames(AtlasEntityHeader entity) { +final Set ret; + +if (entity == null || entity.getClassifications() == null) { +ret = Collections.emptySet(); +} else { +ret = new HashSet<>(); + +for (AtlasClassification classify : entity.getClassifications()) { +ret.add(classify.getTypeName()); +} +} + +return ret; +} + @Override public String toString(
atlas git commit: ATLAS-2823: updated hooks to support asynchronous notifications
Repository: atlas Updated Branches: refs/heads/branch-1.0 c245049a7 -> 56ac0161e ATLAS-2823: updated hooks to support asynchronous notifications (cherry picked from commit 52ef9e7f3962da2bf77a15ab1a1bcef8d47b2877) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/56ac0161 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/56ac0161 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/56ac0161 Branch: refs/heads/branch-1.0 Commit: 56ac0161e4f1ba92bf44235173d2912ea60d99d2 Parents: c245049 Author: Madhan Neethiraj Authored: Tue Aug 14 16:18:19 2018 -0700 Committer: Madhan Neethiraj Committed: Wed Aug 15 15:02:31 2018 -0700 -- .../apache/atlas/falcon/hook/FalconHook.java| 85 +- .../atlas/hbase/bridge/HBaseAtlasHook.java | 273 +++ .../org/apache/atlas/hive/hook/HiveHook.java| 12 +- .../org/apache/atlas/sqoop/hook/SqoopHook.java | 14 +- .../apache/atlas/storm/hook/StormAtlasHook.java | 9 +- .../java/org/apache/atlas/hook/AtlasHook.java | 176 .../org/apache/atlas/hook/AtlasHookTest.java| 12 +- 7 files changed, 180 insertions(+), 401 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/56ac0161/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java -- diff --git a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java index 77177b4..8c09d33 100644 --- a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java +++ b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java @@ -18,13 +18,10 @@ package org.apache.atlas.falcon.hook; -import com.google.common.util.concurrent.ThreadFactoryBuilder; -import org.apache.atlas.AtlasConstants; import org.apache.atlas.falcon.bridge.FalconBridge; import org.apache.atlas.falcon.event.FalconEvent; import org.apache.atlas.falcon.publisher.FalconEventPublisher; import org.apache.atlas.hook.AtlasHook; -import org.apache.atlas.kafka.NotificationProvider; import org.apache.atlas.model.notification.HookNotification; import org.apache.atlas.v1.model.instance.Referenceable; import org.apache.atlas.v1.model.notification.HookNotificationV1.EntityCreateRequest; @@ -32,17 +29,12 @@ import org.apache.falcon.FalconException; import org.apache.falcon.entity.store.ConfigurationStore; import org.apache.falcon.entity.v0.feed.Feed; import org.apache.falcon.entity.v0.process.Process; -import org.apache.hadoop.util.ShutdownHookManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; /** * Falcon hook sends lineage information to the Atlas Service. @@ -50,27 +42,6 @@ import java.util.concurrent.TimeUnit; public class FalconHook extends AtlasHook implements FalconEventPublisher { private static final Logger LOG = LoggerFactory.getLogger(FalconHook.class); -public static final String CONF_PREFIX = "atlas.hook.falcon."; -private static final String MIN_THREADS = CONF_PREFIX + "minThreads"; -private static final String MAX_THREADS = CONF_PREFIX + "maxThreads"; -private static final String KEEP_ALIVE_TIME = CONF_PREFIX + "keepAliveTime"; -public static final String QUEUE_SIZE = CONF_PREFIX + "queueSize"; -public static final String CONF_SYNC = CONF_PREFIX + "synchronous"; - -public static final String HOOK_NUM_RETRIES = CONF_PREFIX + "numRetries"; - -// wait time determines how long we wait before we exit the jvm on -// shutdown. Pending requests after that will not be sent. -private static final int WAIT_TIME = 3; -private static ExecutorService executor; - -private static final int minThreadsDefault = 5; -private static final int maxThreadsDefault = 5; -private static final long keepAliveTimeDefault = 10; -private static final int queueSizeDefault = 1; - -private static boolean sync; - private static ConfigurationStore STORE; private enum Operation { @@ -80,45 +51,11 @@ public class FalconHook extends AtlasHook implements FalconEventPublisher { static { try { -// initialize the async facility to process hook calls. We don't -// want to do this inline since it adds plenty of overhead for the query. -int minThreads = atlasProper
atlas git commit: ATLAS-2823: updated hooks to support asynchronous notifications
Repository: atlas Updated Branches: refs/heads/master 1179aff80 -> 52ef9e7f3 ATLAS-2823: updated hooks to support asynchronous notifications Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/52ef9e7f Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/52ef9e7f Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/52ef9e7f Branch: refs/heads/master Commit: 52ef9e7f3962da2bf77a15ab1a1bcef8d47b2877 Parents: 1179aff Author: Madhan Neethiraj Authored: Tue Aug 14 16:18:19 2018 -0700 Committer: Madhan Neethiraj Committed: Wed Aug 15 13:39:37 2018 -0700 -- .../apache/atlas/falcon/hook/FalconHook.java| 85 +- .../atlas/hbase/bridge/HBaseAtlasHook.java | 273 +++ .../org/apache/atlas/hive/hook/HiveHook.java| 12 +- .../org/apache/atlas/sqoop/hook/SqoopHook.java | 14 +- .../apache/atlas/storm/hook/StormAtlasHook.java | 9 +- .../java/org/apache/atlas/hook/AtlasHook.java | 176 .../org/apache/atlas/hook/AtlasHookTest.java| 12 +- 7 files changed, 180 insertions(+), 401 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/52ef9e7f/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java -- diff --git a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java index 77177b4..8c09d33 100644 --- a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java +++ b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java @@ -18,13 +18,10 @@ package org.apache.atlas.falcon.hook; -import com.google.common.util.concurrent.ThreadFactoryBuilder; -import org.apache.atlas.AtlasConstants; import org.apache.atlas.falcon.bridge.FalconBridge; import org.apache.atlas.falcon.event.FalconEvent; import org.apache.atlas.falcon.publisher.FalconEventPublisher; import org.apache.atlas.hook.AtlasHook; -import org.apache.atlas.kafka.NotificationProvider; import org.apache.atlas.model.notification.HookNotification; import org.apache.atlas.v1.model.instance.Referenceable; import org.apache.atlas.v1.model.notification.HookNotificationV1.EntityCreateRequest; @@ -32,17 +29,12 @@ import org.apache.falcon.FalconException; import org.apache.falcon.entity.store.ConfigurationStore; import org.apache.falcon.entity.v0.feed.Feed; import org.apache.falcon.entity.v0.process.Process; -import org.apache.hadoop.util.ShutdownHookManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; /** * Falcon hook sends lineage information to the Atlas Service. @@ -50,27 +42,6 @@ import java.util.concurrent.TimeUnit; public class FalconHook extends AtlasHook implements FalconEventPublisher { private static final Logger LOG = LoggerFactory.getLogger(FalconHook.class); -public static final String CONF_PREFIX = "atlas.hook.falcon."; -private static final String MIN_THREADS = CONF_PREFIX + "minThreads"; -private static final String MAX_THREADS = CONF_PREFIX + "maxThreads"; -private static final String KEEP_ALIVE_TIME = CONF_PREFIX + "keepAliveTime"; -public static final String QUEUE_SIZE = CONF_PREFIX + "queueSize"; -public static final String CONF_SYNC = CONF_PREFIX + "synchronous"; - -public static final String HOOK_NUM_RETRIES = CONF_PREFIX + "numRetries"; - -// wait time determines how long we wait before we exit the jvm on -// shutdown. Pending requests after that will not be sent. -private static final int WAIT_TIME = 3; -private static ExecutorService executor; - -private static final int minThreadsDefault = 5; -private static final int maxThreadsDefault = 5; -private static final long keepAliveTimeDefault = 10; -private static final int queueSizeDefault = 1; - -private static boolean sync; - private static ConfigurationStore STORE; private enum Operation { @@ -80,45 +51,11 @@ public class FalconHook extends AtlasHook implements FalconEventPublisher { static { try { -// initialize the async facility to process hook calls. We don't -// want to do this inline since it adds plenty of overhead for the query. -int minThreads = atlasProperties.getInt(MIN_THREADS, minThreadsDefault); -int maxThreads = atlasProperties
atlas git commit: ATLAS-2546: Fix for Hive Hook IT failure.
Repository: atlas Updated Branches: refs/heads/branch-0.8 e6c118756 -> 6641a17b1 ATLAS-2546: Fix for Hive Hook IT failure. Signed-off-by: Ashutosh Mestry (cherry picked from commit 71965e31a2d50fcddb04e36fd473cc199baa875f) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/6641a17b Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/6641a17b Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/6641a17b Branch: refs/heads/branch-0.8 Commit: 6641a17b102370b366ab90cc333c2e91dcfb8482 Parents: e6c1187 Author: Péter Gergő Barna Authored: Wed Apr 11 17:07:53 2018 -0700 Committer: Madhan Neethiraj Committed: Wed Aug 15 23:33:38 2018 -0700 -- .../hive/bridge/HiveMetastoreBridgeIT.java | 20 1 file changed, 8 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/6641a17b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java -- diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java index afdc7be..4ae6468 100644 --- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java +++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java @@ -94,28 +94,24 @@ public class HiveMetastoreBridgeIT extends HiveITBase { assertEquals(outputs.get(0).getGuid(), tableId); } - -@Test +//TODO enable this test +//@Test public void testCreateTableHiveProcessNameAttribute() throws Exception { //test if \n is trimmed from name attribute of the process entity String tableName = tableName(); -String tableName2 = tableName(); -String name = String.format("create table %s (id string)", tableName2); -String query = String.format("create table %s (id string);%n%n%s;", tableName, name); +String processNameQuery = String.format("create table %s (id string)", tableName); +//add \n at the beginning of the query +String query = String.format("%n%n%s", processNameQuery); + runCommand(query); String dbId = assertDatabaseIsRegistered(DEFAULT_DB); String tableId = assertTableIsRegistered(DEFAULT_DB, tableName); -String tableId2 = assertTableIsRegistered(DEFAULT_DB, tableName2); -//verify lineage is created +//verify lineage is created and the name attribute is the query without \n String processId = assertEntityIsRegistered(HiveDataTypes.HIVE_PROCESS.getName(), AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, getTableProcessQualifiedName(DEFAULT_DB, tableName), null); AtlasEntity processsEntity = atlasClientV2.getEntityByGuid(processId).getEntity(); -String processId2 = assertEntityIsRegistered(HiveDataTypes.HIVE_PROCESS.getName(), AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, getTableProcessQualifiedName(DEFAULT_DB, tableName2), null); -AtlasEntity processsEntity2 = atlasClientV2.getEntityByGuid(processId2).getEntity(); - -assertEquals(processsEntity2.getAttribute("name"), name); +assertEquals(processsEntity.getAttribute("name"), processNameQuery); } - }
atlas git commit: ATLAS-2826: fix for failure in authorizing save-search operation.
Repository: atlas Updated Branches: refs/heads/master 24830e6bc -> 5332f2e59 ATLAS-2826: fix for failure in authorizing save-search operation. Also, skipping add-relationship authorization if either end has legacy attribute - since this would be covered in authorization of entity-update Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/5332f2e5 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/5332f2e5 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/5332f2e5 Branch: refs/heads/master Commit: 5332f2e591d45c5e37492e7b4a441a0578446069 Parents: 24830e6 Author: Madhan Neethiraj Authored: Thu Aug 16 03:24:41 2018 -0700 Committer: Madhan Neethiraj Committed: Thu Aug 16 04:41:26 2018 -0700 -- .../atlas/authorize/AtlasAccessRequest.java | 33 +++- .../authorize/AtlasEntityAccessRequest.java | 4 +-- .../AtlasRelationshipAccessRequest.java | 18 +++ .../org/apache/atlas/type/AtlasEntityType.java | 20 ++-- .../atlas/type/AtlasRelationshipType.java | 15 ++--- .../graph/v2/AtlasRelationshipStoreV2.java | 31 +- 6 files changed, 77 insertions(+), 44 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/5332f2e5/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java -- diff --git a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java index 8cdd676..b031f4c 100644 --- a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java +++ b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java @@ -21,18 +21,23 @@ import org.apache.atlas.model.instance.AtlasClassification; import org.apache.atlas.model.instance.AtlasEntityHeader; import org.apache.atlas.type.AtlasClassificationType; import org.apache.atlas.type.AtlasEntityType; +import org.apache.atlas.type.AtlasStructType.AtlasAttribute; import org.apache.atlas.type.AtlasTypeRegistry; +import org.apache.commons.collections.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Collections; import java.util.Date; import java.util.HashSet; +import java.util.Map; import java.util.Set; public class AtlasAccessRequest { private static Logger LOG = LoggerFactory.getLogger(AtlasAccessRequest.class); +private static final String DEFAULT_ENTITY_ID_ATTRIBUTE = "qualifiedName"; + private final AtlasPrivilege action; private final Date accessTime; private String user= null; @@ -118,17 +123,31 @@ public class AtlasAccessRequest { } public String getEntityId(AtlasEntityHeader entity) { -final String ret; +return getEntityId(entity, null); +} -if (entity == null) { -ret = null; -} else { -String qualifiedName = (String) entity.getAttribute("qualifiedName"); +public String getEntityId(AtlasEntityHeader entity, AtlasTypeRegistry typeRegistry) { +Object ret = null; + +if (entity != null) { +AtlasEntityType entityType = typeRegistry == null ? null : typeRegistry.getEntityTypeByName(entity.getTypeName()); +Map uniqAttributes = entityType == null ? null : entityType.getUniqAttributes(); -ret = qualifiedName; +if (MapUtils.isEmpty(uniqAttributes)) { +ret = entity.getAttribute(DEFAULT_ENTITY_ID_ATTRIBUTE); +} else { +for (AtlasAttribute uniqAttribute : uniqAttributes.values()) { +ret = entity.getAttribute(uniqAttribute.getName()); + +if (ret != null) { +break; +} +} + +} } -return ret; +return ret == null ? "" : ret.toString(); } public Set getClassificationNames(AtlasEntityHeader entity) { http://git-wip-us.apache.org/repos/asf/atlas/blob/5332f2e5/authorization/src/main/java/org/apache/atlas/authorize/AtlasEntityAccessRequest.java -- diff --git a/authorization/src/main/java/org/apache/atlas/authorize/AtlasEntityAccessRequest.java b/authorization/src/main/java/org/apache/atlas/authorize/AtlasEntityAccessRequest.java index d87c830..07ff678 100644 --- a/authorization/src/main/java/org/apache/atlas/authorize/AtlasEntityAccessRequest.java +++ b/authorization/src/main/java/org/apache/atlas/authorize/AtlasEntityAccessRequest.java @@ -65,7 +65,7 @@ public class
atlas git commit: ATLAS-2826: fix for failure in authorizing save-search operation.
Repository: atlas Updated Branches: refs/heads/branch-1.0 56ac0161e -> 028a623a7 ATLAS-2826: fix for failure in authorizing save-search operation. Also, skipping add-relationship authorization if either end has legacy attribute - since this would be covered in authorization of entity-update (cherry picked from commit 5332f2e591d45c5e37492e7b4a441a0578446069) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/028a623a Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/028a623a Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/028a623a Branch: refs/heads/branch-1.0 Commit: 028a623a7ef1477e870602476887b1073993114c Parents: 56ac016 Author: Madhan Neethiraj Authored: Thu Aug 16 03:24:41 2018 -0700 Committer: Madhan Neethiraj Committed: Thu Aug 16 04:55:48 2018 -0700 -- .../atlas/authorize/AtlasAccessRequest.java | 33 +++- .../authorize/AtlasEntityAccessRequest.java | 4 +-- .../AtlasRelationshipAccessRequest.java | 18 +++ .../org/apache/atlas/type/AtlasEntityType.java | 20 ++-- .../atlas/type/AtlasRelationshipType.java | 15 ++--- .../graph/v2/AtlasRelationshipStoreV2.java | 31 +- 6 files changed, 77 insertions(+), 44 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/028a623a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java -- diff --git a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java index 8cdd676..b031f4c 100644 --- a/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java +++ b/authorization/src/main/java/org/apache/atlas/authorize/AtlasAccessRequest.java @@ -21,18 +21,23 @@ import org.apache.atlas.model.instance.AtlasClassification; import org.apache.atlas.model.instance.AtlasEntityHeader; import org.apache.atlas.type.AtlasClassificationType; import org.apache.atlas.type.AtlasEntityType; +import org.apache.atlas.type.AtlasStructType.AtlasAttribute; import org.apache.atlas.type.AtlasTypeRegistry; +import org.apache.commons.collections.MapUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.Collections; import java.util.Date; import java.util.HashSet; +import java.util.Map; import java.util.Set; public class AtlasAccessRequest { private static Logger LOG = LoggerFactory.getLogger(AtlasAccessRequest.class); +private static final String DEFAULT_ENTITY_ID_ATTRIBUTE = "qualifiedName"; + private final AtlasPrivilege action; private final Date accessTime; private String user= null; @@ -118,17 +123,31 @@ public class AtlasAccessRequest { } public String getEntityId(AtlasEntityHeader entity) { -final String ret; +return getEntityId(entity, null); +} -if (entity == null) { -ret = null; -} else { -String qualifiedName = (String) entity.getAttribute("qualifiedName"); +public String getEntityId(AtlasEntityHeader entity, AtlasTypeRegistry typeRegistry) { +Object ret = null; + +if (entity != null) { +AtlasEntityType entityType = typeRegistry == null ? null : typeRegistry.getEntityTypeByName(entity.getTypeName()); +Map uniqAttributes = entityType == null ? null : entityType.getUniqAttributes(); -ret = qualifiedName; +if (MapUtils.isEmpty(uniqAttributes)) { +ret = entity.getAttribute(DEFAULT_ENTITY_ID_ATTRIBUTE); +} else { +for (AtlasAttribute uniqAttribute : uniqAttributes.values()) { +ret = entity.getAttribute(uniqAttribute.getName()); + +if (ret != null) { +break; +} +} + +} } -return ret; +return ret == null ? "" : ret.toString(); } public Set getClassificationNames(AtlasEntityHeader entity) { http://git-wip-us.apache.org/repos/asf/atlas/blob/028a623a/authorization/src/main/java/org/apache/atlas/authorize/AtlasEntityAccessRequest.java -- diff --git a/authorization/src/main/java/org/apache/atlas/authorize/AtlasEntityAccessRequest.java b/authorization/src/main/java/org/apache/atlas/authorize/AtlasEntityAccessRequest.java index d87c830..07ff678 100644 --- a/authorization/src/main/java/org/apache/atlas/authorize/AtlasEntityAccessRequest.java +++ b/authorization/src/main/java/org/apache/atlas/author
atlas git commit: ATLAS-2355/ATLAS-2362: Fix IT failures (branch-0.8) (picked from master branch fix in ecf8095ff92252f252e14292bb5d82d7b6aa1951) (picked from master branch fix in 0345cd41a80f45e6b733
Repository: atlas Updated Branches: refs/heads/branch-0.8 3021027c9 -> 9da91296f ATLAS-2355/ATLAS-2362: Fix IT failures (branch-0.8) (picked from master branch fix in ecf8095ff92252f252e14292bb5d82d7b6aa1951) (picked from master branch fix in 0345cd41a80f45e6b7330749b79a0e4c379768b3) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/9da91296 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/9da91296 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/9da91296 Branch: refs/heads/branch-0.8 Commit: 9da91296f4e5637c35d78649f16ed23ebecf8b09 Parents: 3021027 Author: Madhan Neethiraj Authored: Wed Aug 15 23:52:11 2018 -0700 Committer: Madhan Neethiraj Committed: Thu Aug 16 12:07:53 2018 -0700 -- .../atlas/storm/hook/StormAtlasHookIT.java | 2 +- .../atlas/web/integration/BasicSearchIT.java| 4 +- .../web/integration/EntityJerseyResourceIT.java | 45 +- .../json/search-parameters/entity-filters.json | 148 ++- 4 files changed, 156 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/9da91296/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 e0800b8..4bb807b 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 +@Test(enabled = false) public class StormAtlasHookIT { public static final Logger LOG = LoggerFactory.getLogger(StormAtlasHookIT.class); http://git-wip-us.apache.org/repos/asf/atlas/blob/9da91296/webapp/src/test/java/org/apache/atlas/web/integration/BasicSearchIT.java -- diff --git a/webapp/src/test/java/org/apache/atlas/web/integration/BasicSearchIT.java b/webapp/src/test/java/org/apache/atlas/web/integration/BasicSearchIT.java index 5806a10..095b7b9 100644 --- a/webapp/src/test/java/org/apache/atlas/web/integration/BasicSearchIT.java +++ b/webapp/src/test/java/org/apache/atlas/web/integration/BasicSearchIT.java @@ -123,8 +123,8 @@ public class BasicSearchIT extends BaseResourceIT { AtlasSearchResult searchResult = atlasClientV2.facetedSearch(testExpectation.searchParameters); if (testExpectation.expectedCount > 0) { -assertNotNull(searchResult.getEntities()); -assertEquals(searchResult.getEntities().size(), testExpectation.expectedCount); +assertNotNull(searchResult.getEntities(), "jsonFile: " + jsonFile + ", description: " + testExpectation.testDescription); +assertEquals(searchResult.getEntities().size(), testExpectation.expectedCount, "jsonFile: " + jsonFile + ", description: " + testExpectation.testDescription + "; result=" + searchResult.getEntities()); } } } catch (IOException | AtlasServiceException e) { http://git-wip-us.apache.org/repos/asf/atlas/blob/9da91296/webapp/src/test/java/org/apache/atlas/web/integration/EntityJerseyResourceIT.java -- 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 f2a7801..ccd67b4 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 @@ -60,8 +60,11 @@ import javax.ws.rs.core.Response; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Objects; +import java.util.Set; import java.util.UUID; import static org.testng.Assert.assertEquals; @@ -874,10 +877,16 @@ public class EntityJerseyResourceIT extends BaseResourceIT { assertEquals(entityResult.getUpdateEntities().size(), 1); assertEquals(entityResult.getUpdateEntities().get(0), guid); -Referenceable entity = atlasClientV1.getEntity(guid); -List refs = (List) entity.get("columns"); +Referenceable entity = atlasClientV1.get
atlas git commit: ATLAS-2823: updated hooks to support asynchronous notifications
Repository: atlas Updated Branches: refs/heads/branch-0.8 9da91296f -> 9bdbb3184 ATLAS-2823: updated hooks to support asynchronous notifications (cherry picked from commit 52ef9e7f3962da2bf77a15ab1a1bcef8d47b2877) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/9bdbb318 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/9bdbb318 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/9bdbb318 Branch: refs/heads/branch-0.8 Commit: 9bdbb31842c93412ebfe27d98bd8dcbabe7d80f4 Parents: 9da9129 Author: Madhan Neethiraj Authored: Tue Aug 14 16:18:19 2018 -0700 Committer: Madhan Neethiraj Committed: Thu Aug 16 18:27:39 2018 -0700 -- .../apache/atlas/falcon/hook/FalconHook.java| 85 +- .../atlas/hbase/bridge/HBaseAtlasHook.java | 274 +++ .../org/apache/atlas/hive/hook/HiveHook.java| 12 +- .../org/apache/atlas/sqoop/hook/SqoopHook.java | 14 +- .../apache/atlas/storm/hook/StormAtlasHook.java | 138 +- .../java/org/apache/atlas/hook/AtlasHook.java | 193 - .../org/apache/atlas/hook/AtlasHookTest.java| 12 +- 7 files changed, 250 insertions(+), 478 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/9bdbb318/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java -- diff --git a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java index 188b754..6876595 100644 --- a/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java +++ b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/hook/FalconHook.java @@ -18,30 +18,22 @@ package org.apache.atlas.falcon.hook; -import com.google.common.util.concurrent.ThreadFactoryBuilder; -import org.apache.atlas.AtlasConstants; import org.apache.atlas.falcon.bridge.FalconBridge; import org.apache.atlas.falcon.event.FalconEvent; import org.apache.atlas.falcon.publisher.FalconEventPublisher; import org.apache.atlas.hook.AtlasHook; -import org.apache.atlas.kafka.NotificationProvider; import org.apache.atlas.notification.hook.HookNotification; import org.apache.atlas.typesystem.Referenceable; import org.apache.falcon.FalconException; import org.apache.falcon.entity.store.ConfigurationStore; import org.apache.falcon.entity.v0.feed.Feed; import org.apache.falcon.entity.v0.process.Process; -import org.apache.hadoop.util.ShutdownHookManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; /** * Falcon hook sends lineage information to the Atlas Service. @@ -49,27 +41,6 @@ import java.util.concurrent.TimeUnit; public class FalconHook extends AtlasHook implements FalconEventPublisher { private static final Logger LOG = LoggerFactory.getLogger(FalconHook.class); -public static final String CONF_PREFIX = "atlas.hook.falcon."; -private static final String MIN_THREADS = CONF_PREFIX + "minThreads"; -private static final String MAX_THREADS = CONF_PREFIX + "maxThreads"; -private static final String KEEP_ALIVE_TIME = CONF_PREFIX + "keepAliveTime"; -public static final String QUEUE_SIZE = CONF_PREFIX + "queueSize"; -public static final String CONF_SYNC = CONF_PREFIX + "synchronous"; - -public static final String HOOK_NUM_RETRIES = CONF_PREFIX + "numRetries"; - -// wait time determines how long we wait before we exit the jvm on -// shutdown. Pending requests after that will not be sent. -private static final int WAIT_TIME = 3; -private static ExecutorService executor; - -private static final int minThreadsDefault = 5; -private static final int maxThreadsDefault = 5; -private static final long keepAliveTimeDefault = 10; -private static final int queueSizeDefault = 1; - -private static boolean sync; - private static ConfigurationStore STORE; private enum Operation { @@ -79,45 +50,11 @@ public class FalconHook extends AtlasHook implements FalconEventPublisher { static { try { -// initialize the async facility to process hook calls. We don't -// want to do this inline since it adds plenty of overhead for the query. -int minThreads = atlasProperties.getInt(MIN_THREADS, minThreadsDefault); -int maxThreads = atlasProperties.getInt(MAX_THREADS, maxT
atlas git commit: ATLAS-2836: Remove redundant encoding of vertex property keys - #2
Repository: atlas Updated Branches: refs/heads/branch-1.0 bcf904d8d -> 0e632a4ed ATLAS-2836: Remove redundant encoding of vertex property keys - #2 Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/0e632a4e Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/0e632a4e Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/0e632a4e Branch: refs/heads/branch-1.0 Commit: 0e632a4ed01da9a22137cab0c63bf2c714e4ea0f Parents: bcf904d Author: Madhan Neethiraj Authored: Sat Aug 25 10:00:39 2018 -0700 Committer: Madhan Neethiraj Committed: Sat Aug 25 10:00:39 2018 -0700 -- .../store/graph/v2/EntityGraphMapper.java| 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/0e632a4e/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java index 52e992c..9496946 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java @@ -35,7 +35,6 @@ import org.apache.atlas.model.instance.EntityMutationResponse; import org.apache.atlas.model.instance.EntityMutations.EntityOperation; import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef; import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef.Cardinality; -import org.apache.atlas.repository.Constants; import org.apache.atlas.repository.RepositoryException; import org.apache.atlas.repository.converters.AtlasInstanceConverter; import org.apache.atlas.repository.graph.GraphHelper; @@ -77,18 +76,32 @@ import static org.apache.atlas.model.instance.EntityMutations.EntityOperation.DE import static org.apache.atlas.model.instance.EntityMutations.EntityOperation.PARTIAL_UPDATE; import static org.apache.atlas.model.instance.EntityMutations.EntityOperation.UPDATE; import static org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef.Cardinality.SET; +import static org.apache.atlas.repository.Constants.ATTRIBUTE_INDEX_PROPERTY_KEY; import static org.apache.atlas.repository.Constants.ATTRIBUTE_KEY_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.CLASSIFICATION_ENTITY_GUID; +import static org.apache.atlas.repository.Constants.CLASSIFICATION_ENTITY_STATUS; import static org.apache.atlas.repository.Constants.CLASSIFICATION_LABEL; +import static org.apache.atlas.repository.Constants.CLASSIFICATION_VALIDITY_PERIODS_KEY; +import static org.apache.atlas.repository.Constants.CLASSIFICATION_VERTEX_PROPAGATE_KEY; import static org.apache.atlas.repository.Constants.CLASSIFICATION_VERTEX_REMOVE_PROPAGATIONS_KEY; +import static org.apache.atlas.repository.Constants.CREATED_BY_KEY; +import static org.apache.atlas.repository.Constants.ENTITY_TYPE_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.GUID_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.HOME_ID_KEY; +import static org.apache.atlas.repository.Constants.IS_PROXY_KEY; +import static org.apache.atlas.repository.Constants.MODIFICATION_TIMESTAMP_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.MODIFIED_BY_KEY; +import static org.apache.atlas.repository.Constants.RELATIONSHIP_GUID_PROPERTY_KEY; import static org.apache.atlas.repository.Constants.STATE_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.SUPER_TYPES_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.TIMESTAMP_PROPERTY_KEY; import static org.apache.atlas.repository.Constants.TRAIT_NAMES_PROPERTY_KEY; -import static org.apache.atlas.repository.Constants.ATTRIBUTE_INDEX_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.VERSION_PROPERTY_KEY; import static org.apache.atlas.repository.graph.GraphHelper.getCollectionElementsUsingRelationship; import static org.apache.atlas.repository.graph.GraphHelper.getClassificationEdge; import static org.apache.atlas.repository.graph.GraphHelper.getClassificationVertex; import static org.apache.atlas.repository.graph.GraphHelper.getDefaultRemovePropagations; import static org.apache.atlas.repository.graph.GraphHelper.getMapElementsProperty; -import static org.apache.atlas.repository.graph.GraphHelper.getPropagatedTraitNames; import static org.apache.atlas.repository.graph.GraphHelper.getStatus; import static org.apache.atlas.repository.graph.GraphHelper.getTraitLabel; import sta
atlas git commit: ATLAS-2836: Remove redundant encoding of vertex property keys - #2
Repository: atlas Updated Branches: refs/heads/master 0ed9f0e25 -> 9c45d2e8e ATLAS-2836: Remove redundant encoding of vertex property keys - #2 Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/9c45d2e8 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/9c45d2e8 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/9c45d2e8 Branch: refs/heads/master Commit: 9c45d2e8e88b8845330632ad2a164448c13840fd Parents: 0ed9f0e Author: Madhan Neethiraj Authored: Sun Aug 26 14:43:11 2018 -0700 Committer: Madhan Neethiraj Committed: Sun Aug 26 16:20:06 2018 -0700 -- .../atlas/repository/graph/GraphHelper.java | 108 --- .../store/graph/v2/EntityGraphMapper.java | 2 +- .../store/graph/v2/EntityGraphRetriever.java| 41 --- .../migration/MigrationBaseAsserts.java | 16 +-- .../atlas/repository/migration/PathTest.java| 5 +- 5 files changed, 33 insertions(+), 139 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/9c45d2e8/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java index 19069ba..7885da3 100755 --- a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java +++ b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java @@ -646,83 +646,6 @@ public final class GraphHelper { + edge.getInVertex() + "]"; } -public static void setProperty(T element, String propertyName, Object value) { -String actualPropertyName = AtlasGraphUtilsV2.encodePropertyKey(propertyName); - -String elementStr = null; - -if (LOG.isDebugEnabled()) { -elementStr = string(element); - -LOG.debug("Setting property {} = \"{}\" to {}", actualPropertyName, value, elementStr); -} - -Object existValue = element.getProperty(actualPropertyName, Object.class); -if(value == null || (value instanceof Collection && ((Collection) value).isEmpty())) { -if(existValue != null) { -if (LOG.isDebugEnabled()) { -LOG.debug("Removing property - {} value from {}", actualPropertyName, elementStr); -} - -element.removeProperty(actualPropertyName); -} -} else { -if (!value.equals(existValue)) { -element.setProperty(actualPropertyName, value); - -if (LOG.isDebugEnabled()) { -LOG.debug("Set property {} = \"{}\" to {}", actualPropertyName, value, elementStr); -} -} -} -} - -/** - * Gets the value of a property that is stored in the graph as a single property value. If - * a multi-property such as {@link Constants#TRAIT_NAMES_PROPERTY_KEY} or {@link Constants#SUPER_TYPES_PROPERTY_KEY} - * is used, an exception will be thrown. - * - * @param element - * @param propertyName - * @param clazz - * @return - */ -public static T getSingleValuedProperty(AtlasElement element, String propertyName, Class clazz) { -String actualPropertyName = AtlasGraphUtilsV2.encodePropertyKey(propertyName); - -if (LOG.isTraceEnabled()) { -LOG.trace("Reading property {} from {}", actualPropertyName, string(element)); -} - -return element.getProperty(actualPropertyName, clazz); -} - - -public static Object getProperty(AtlasVertex vertex, String propertyName) { -String actualPropertyName = AtlasGraphUtilsV2.encodePropertyKey(propertyName); - -if (LOG.isTraceEnabled()) { -LOG.trace("Reading property {} from {}", actualPropertyName, string(vertex)); -} - - if(AtlasGraphProvider.getGraphInstance().isMultiProperty(actualPropertyName)) { -return vertex.getPropertyValues(actualPropertyName, String.class); -} -else { -return vertex.getProperty(actualPropertyName, Object.class); -} -} - -public static Object getProperty(AtlasEdge edge, String propertyName) { -String actualPropertyName = AtlasGraphUtilsV2.encodePropertyKey(propertyName); - -if (LOG.isTraceEnabled()) { -LOG.trace("Reading property {} from {}", actualPropertyName, string(edge)); -} - -return edge.getProperty(actualPropertyName, Object.class); -} - private static String string(T element) { if (e
atlas git commit: ATLAS-2836: Remove redundant encoding of vertex property keys - #2
Repository: atlas Updated Branches: refs/heads/branch-1.0 905cdc226 -> 3483b71c7 ATLAS-2836: Remove redundant encoding of vertex property keys - #2 (cherry picked from commit 9c45d2e8e88b8845330632ad2a164448c13840fd) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/3483b71c Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/3483b71c Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/3483b71c Branch: refs/heads/branch-1.0 Commit: 3483b71c7f13164ea8fbaf7e16050f503f2e460e Parents: 905cdc2 Author: Madhan Neethiraj Authored: Sun Aug 26 14:43:11 2018 -0700 Committer: Madhan Neethiraj Committed: Sun Aug 26 19:10:45 2018 -0700 -- .../atlas/repository/graph/GraphHelper.java | 108 --- .../store/graph/v2/EntityGraphMapper.java | 2 +- .../store/graph/v2/EntityGraphRetriever.java| 41 --- .../migration/MigrationBaseAsserts.java | 16 +-- .../atlas/repository/migration/PathTest.java| 5 +- 5 files changed, 33 insertions(+), 139 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/3483b71c/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java index 19069ba..7885da3 100755 --- a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java +++ b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java @@ -646,83 +646,6 @@ public final class GraphHelper { + edge.getInVertex() + "]"; } -public static void setProperty(T element, String propertyName, Object value) { -String actualPropertyName = AtlasGraphUtilsV2.encodePropertyKey(propertyName); - -String elementStr = null; - -if (LOG.isDebugEnabled()) { -elementStr = string(element); - -LOG.debug("Setting property {} = \"{}\" to {}", actualPropertyName, value, elementStr); -} - -Object existValue = element.getProperty(actualPropertyName, Object.class); -if(value == null || (value instanceof Collection && ((Collection) value).isEmpty())) { -if(existValue != null) { -if (LOG.isDebugEnabled()) { -LOG.debug("Removing property - {} value from {}", actualPropertyName, elementStr); -} - -element.removeProperty(actualPropertyName); -} -} else { -if (!value.equals(existValue)) { -element.setProperty(actualPropertyName, value); - -if (LOG.isDebugEnabled()) { -LOG.debug("Set property {} = \"{}\" to {}", actualPropertyName, value, elementStr); -} -} -} -} - -/** - * Gets the value of a property that is stored in the graph as a single property value. If - * a multi-property such as {@link Constants#TRAIT_NAMES_PROPERTY_KEY} or {@link Constants#SUPER_TYPES_PROPERTY_KEY} - * is used, an exception will be thrown. - * - * @param element - * @param propertyName - * @param clazz - * @return - */ -public static T getSingleValuedProperty(AtlasElement element, String propertyName, Class clazz) { -String actualPropertyName = AtlasGraphUtilsV2.encodePropertyKey(propertyName); - -if (LOG.isTraceEnabled()) { -LOG.trace("Reading property {} from {}", actualPropertyName, string(element)); -} - -return element.getProperty(actualPropertyName, clazz); -} - - -public static Object getProperty(AtlasVertex vertex, String propertyName) { -String actualPropertyName = AtlasGraphUtilsV2.encodePropertyKey(propertyName); - -if (LOG.isTraceEnabled()) { -LOG.trace("Reading property {} from {}", actualPropertyName, string(vertex)); -} - - if(AtlasGraphProvider.getGraphInstance().isMultiProperty(actualPropertyName)) { -return vertex.getPropertyValues(actualPropertyName, String.class); -} -else { -return vertex.getProperty(actualPropertyName, Object.class); -} -} - -public static Object getProperty(AtlasEdge edge, String propertyName) { -String actualPropertyName = AtlasGraphUtilsV2.encodePropertyKey(propertyName); - -if (LOG.isTraceEnabled()) { -LOG.trace("Reading property {} from {}", actualPropertyName, string(edge)); -} - -return edge.getProperty(actualPropertyName, Ob
[2/2] atlas git commit: ATLAS-2836: Remove redundant encoding of vertex property keys ATLAS-2838: Replace GraphHelper.encodeProperty() with AtlasGraphUtilsV1.encodeProperty()
ATLAS-2836: Remove redundant encoding of vertex property keys ATLAS-2838: Replace GraphHelper.encodeProperty() with AtlasGraphUtilsV1.encodeProperty() (cherry picked from commit b6a664df305d18918ea84ec1351307fcefeec53c) (cherry picked from commit 0ed9f0e25d2b064bb7728b2d8481968ba4375ba2) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/250d9321 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/250d9321 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/250d9321 Branch: refs/heads/branch-0.8 Commit: 250d932172291fe8c9a9e07afb634042f67b09e5 Parents: 325859a Author: Madhan Neethiraj Authored: Sun Aug 26 13:29:00 2018 -0700 Committer: Madhan Neethiraj Committed: Sun Aug 26 23:08:26 2018 -0700 -- .../org/apache/atlas/repository/Constants.java | 42 ++-- .../org/apache/atlas/type/AtlasStructType.java | 8 + .../graph/DefaultGraphPersistenceStrategy.java | 7 +- .../graph/GraphBackedDiscoveryService.java | 5 +- .../atlas/repository/graph/DeleteHandler.java | 15 +- .../graph/GraphBackedMetadataRepository.java| 15 +- .../graph/GraphBackedSearchIndexer.java | 7 +- .../atlas/repository/graph/GraphHelper.java | 205 +++ .../graph/GraphToTypedInstanceMapper.java | 35 ++-- .../repository/graph/SoftDeleteHandler.java | 14 +- .../graph/TypedInstanceToGraphMapper.java | 19 +- .../graph/v1/AtlasEntityChangeNotifier.java | 6 +- .../store/graph/v1/AtlasGraphUtilsV1.java | 29 ++- .../store/graph/v1/AtlasStructDefStoreV1.java | 2 +- .../store/graph/v1/DeleteHandlerV1.java | 14 +- .../store/graph/v1/EntityGraphMapper.java | 58 +++--- .../store/graph/v1/EntityGraphRetriever.java| 50 ++--- .../store/graph/v1/SoftDeleteHandlerV1.java | 14 +- .../typestore/GraphBackedTypeStore.java | 24 +-- .../typestore/TypePersistenceVisitor.java | 14 +- ...hBackedMetadataRepositoryDeleteTestBase.java | 9 +- .../GraphBackedMetadataRepositoryTest.java | 15 +- .../GraphBackedRepositorySoftDeleteTest.java| 3 +- .../atlas/repository/graph/GraphHelperTest.java | 5 +- .../graph/v1/AtlasDeleteHandlerV1Test.java | 8 +- .../store/graph/v1/SoftDeleteHandlerV1Test.java | 2 +- 26 files changed, 257 insertions(+), 368 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/250d9321/common/src/main/java/org/apache/atlas/repository/Constants.java -- diff --git a/common/src/main/java/org/apache/atlas/repository/Constants.java b/common/src/main/java/org/apache/atlas/repository/Constants.java index 56f341d..2733583 100644 --- a/common/src/main/java/org/apache/atlas/repository/Constants.java +++ b/common/src/main/java/org/apache/atlas/repository/Constants.java @@ -18,6 +18,8 @@ package org.apache.atlas.repository; +import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.encodePropertyKey; + /** * Repository Constants. * @@ -29,49 +31,45 @@ public final class Constants { */ public static final String INTERNAL_PROPERTY_KEY_PREFIX = "__"; -public static final String GUID_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "guid"; +public static final String GUID_PROPERTY_KEY = encodePropertyKey(INTERNAL_PROPERTY_KEY_PREFIX + "guid"); /** * Entity type name property key. */ -public static final String ENTITY_TYPE_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "typeName"; +public static final String ENTITY_TYPE_PROPERTY_KEY = encodePropertyKey(INTERNAL_PROPERTY_KEY_PREFIX + "typeName"); public static final String TYPE_NAME_INTERNAL = INTERNAL_PROPERTY_KEY_PREFIX + "internal"; /** * Entity type's super types property key. */ -public static final String SUPER_TYPES_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "superTypeNames"; +public static final String SUPER_TYPES_PROPERTY_KEY = encodePropertyKey(INTERNAL_PROPERTY_KEY_PREFIX + "superTypeNames"); /** * Full-text for the entity for enabling full-text search. */ //weird issue in TitanDB if __ added to this property key. Not adding it for now -public static final String ENTITY_TEXT_PROPERTY_KEY = "entityText"; +public static final String ENTITY_TEXT_PROPERTY_KEY = encodePropertyKey("entityText"); /** * Properties for type store graph. */ -public static final String TYPE_CATEGORY_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "type.category"; -public static final String VERTEX_TYPE_PROPERTY_KEY = INTERNAL_PROPERTY_KEY_PREFIX + "type"; -public
[1/2] atlas git commit: ATLAS-2836: Remove redundant encoding of vertex property keys ATLAS-2838: Replace GraphHelper.encodeProperty() with AtlasGraphUtilsV1.encodeProperty()
Repository: atlas Updated Branches: refs/heads/branch-0.8 325859ab8 -> 250d93217 http://git-wip-us.apache.org/repos/asf/atlas/blob/250d9321/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java index 49c9e0c..89f1909 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/SoftDeleteHandlerV1.java @@ -22,7 +22,6 @@ import org.apache.atlas.RequestContextV1; import org.apache.atlas.annotation.ConditionalOnAtlasProperty; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.model.instance.AtlasEntity; -import org.apache.atlas.repository.graph.GraphHelper; import org.apache.atlas.repository.graphdb.AtlasEdge; import org.apache.atlas.repository.graphdb.AtlasVertex; import org.apache.atlas.type.AtlasTypeRegistry; @@ -50,10 +49,10 @@ public class SoftDeleteHandlerV1 extends DeleteHandlerV1 { } else { AtlasEntity.Status state = AtlasGraphUtilsV1.getState(instanceVertex); if (state != AtlasEntity.Status.DELETED) { -GraphHelper.setProperty(instanceVertex, STATE_PROPERTY_KEY, AtlasEntity.Status.DELETED.name()); -GraphHelper.setProperty(instanceVertex, MODIFICATION_TIMESTAMP_PROPERTY_KEY, +AtlasGraphUtilsV1.setEncodedProperty(instanceVertex, STATE_PROPERTY_KEY, AtlasEntity.Status.DELETED.name()); +AtlasGraphUtilsV1.setEncodedProperty(instanceVertex, MODIFICATION_TIMESTAMP_PROPERTY_KEY, RequestContextV1.get().getRequestTime()); -GraphHelper.setProperty(instanceVertex, MODIFIED_BY_KEY, RequestContextV1.get().getUser()); +AtlasGraphUtilsV1.setEncodedProperty(instanceVertex, MODIFIED_BY_KEY, RequestContextV1.get().getUser()); } } } @@ -65,10 +64,9 @@ public class SoftDeleteHandlerV1 extends DeleteHandlerV1 { } else { AtlasEntity.Status state = AtlasGraphUtilsV1.getState(edge); if (state != AtlasEntity.Status.DELETED) { -GraphHelper.setProperty(edge, STATE_PROPERTY_KEY, AtlasEntity.Status.DELETED.name()); -GraphHelper -.setProperty(edge, MODIFICATION_TIMESTAMP_PROPERTY_KEY, RequestContextV1.get().getRequestTime()); -GraphHelper.setProperty(edge, MODIFIED_BY_KEY, RequestContextV1.get().getUser()); +AtlasGraphUtilsV1.setEncodedProperty(edge, STATE_PROPERTY_KEY, AtlasEntity.Status.DELETED.name()); +AtlasGraphUtilsV1.setEncodedProperty(edge, MODIFICATION_TIMESTAMP_PROPERTY_KEY, RequestContextV1.get().getRequestTime()); +AtlasGraphUtilsV1.setEncodedProperty(edge, MODIFIED_BY_KEY, RequestContextV1.get().getUser()); } } } http://git-wip-us.apache.org/repos/asf/atlas/blob/250d9321/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 1525d7b..9e6ad18 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 @@ -31,6 +31,7 @@ import org.apache.atlas.repository.graphdb.AtlasEdge; import org.apache.atlas.repository.graphdb.AtlasEdgeDirection; 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.typesystem.TypesDef; import org.apache.atlas.typesystem.types.*; import org.apache.atlas.typesystem.types.DataTypes.TypeCategory; @@ -50,7 +51,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import static org.apache.atlas.repository.graph.GraphHelper.setProperty; @Singleton @Component @@ -251,9 +251,9 @@ public class GraphBackedTypeStore implements ITypeStore { while (vertices.hasNext()) { AtlasVertex vertex = vertices.next(); -DataTypes.TypeCategory typeCategory = GraphHelper.getSingleValuedProperty(vertex, Constants.TYPE_CATEGORY_PROPERTY_KEY, TypeCategory.class); -String typeName = GraphHelper.getSingleValuedProperty(vertex, Constants.TYPENAME_PROPERTY_KEY, String.class); -String typeDescription =
atlas git commit: ATLAS-2842: fixed incorrect AtlasObjectId.equals()
Repository: atlas Updated Branches: refs/heads/branch-0.8 df4f87d09 -> 4dcb2c7bf ATLAS-2842: fixed incorrect AtlasObjectId.equals() Signed-off-by: Madhan Neethiraj Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4dcb2c7b Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4dcb2c7b Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4dcb2c7b Branch: refs/heads/branch-0.8 Commit: 4dcb2c7bf00afd7cc1c82fec0ecc9456f200f1e1 Parents: df4f87d Author: Daniel Kelencz Authored: Mon Aug 27 07:32:12 2018 -0700 Committer: Madhan Neethiraj Committed: Mon Aug 27 07:39:45 2018 -0700 -- .../atlas/model/instance/AtlasObjectId.java | 12 +-- .../atlas/model/instance/TestAtlasObjectId.java | 107 +++ 2 files changed, 113 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/4dcb2c7b/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java b/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java index 5f0e093..479bca5 100644 --- a/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java +++ b/intg/src/main/java/org/apache/atlas/model/instance/AtlasObjectId.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlSeeAlso; import org.apache.atlas.model.PList; import org.apache.atlas.model.SearchFilter.SortType; import org.apache.atlas.model.typedef.AtlasBaseTypeDef; +import org.apache.commons.lang.StringUtils; import org.codehaus.jackson.annotate.JsonAutoDetect; import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONLY; import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE; @@ -164,13 +165,12 @@ public class AtlasObjectId implements Serializable { AtlasObjectId that = (AtlasObjectId) o; -// if guid is null, equality should be based on typeName/uniqueAttributes -if (guid != null && Objects.equals(guid, that.guid)) { -return true; +// if guid is empty/null, equality should be based on typeName/uniqueAttributes +if (StringUtils.isEmpty(guid) && StringUtils.isEmpty(that.guid)) { +return Objects.equals(typeName, that.typeName) && Objects.equals(uniqueAttributes, that.uniqueAttributes); +} else { +return Objects.equals(guid, that.guid); } - -return Objects.equals(typeName, that.typeName) && - Objects.equals(uniqueAttributes, that.uniqueAttributes); } @Override http://git-wip-us.apache.org/repos/asf/atlas/blob/4dcb2c7b/intg/src/test/java/org/apache/atlas/model/instance/TestAtlasObjectId.java -- diff --git a/intg/src/test/java/org/apache/atlas/model/instance/TestAtlasObjectId.java b/intg/src/test/java/org/apache/atlas/model/instance/TestAtlasObjectId.java new file mode 100644 index 000..e333263 --- /dev/null +++ b/intg/src/test/java/org/apache/atlas/model/instance/TestAtlasObjectId.java @@ -0,0 +1,107 @@ +/** + * 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.model.instance; + +import org.testng.annotations.Test; + +import java.util.HashMap; +import java.util.Map; + +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotEquals; + +public class TestAtlasObjectId { + +@Test +public void testEqualsDifferentIdShouldNotEqual() +{ +AtlasObjectId one = new AtlasObjectId("one"); +AtlasObjectId different = new AtlasObjectId("different"); + +assertNotEquals(one, different); +} + +@Test +public void testEqualsSameIdShouldEqual() +{ +AtlasObjectId one = new AtlasObjectId("one"); +AtlasObjectId same = new AtlasObjectId("one"); + +assertEqua
atlas git commit: ATLAS-2823: updated hooks to support asynchronous notifications - #2
Repository: atlas Updated Branches: refs/heads/master 4b2324f36 -> a7cd9ac38 ATLAS-2823: updated hooks to support asynchronous notifications - #2 Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/a7cd9ac3 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/a7cd9ac3 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/a7cd9ac3 Branch: refs/heads/master Commit: a7cd9ac38dd5dcd105a7d5a28c50e851ee0d29a0 Parents: 4b2324f Author: Madhan Neethiraj Authored: Wed Aug 22 04:27:25 2018 -0700 Committer: Madhan Neethiraj Committed: Wed Aug 22 04:27:25 2018 -0700 -- notification/src/main/java/org/apache/atlas/hook/AtlasHook.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/a7cd9ac3/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java -- diff --git a/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java b/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java index 406f679..31874af 100644 --- a/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java +++ b/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java @@ -113,13 +113,13 @@ public abstract class AtlasHook { if (isAsync) { int minThreads = atlasProperties.getInt(ATLAS_NOTIFICATION_ASYNCHRONOUS_MIN_THREADS, 1); -int maxThreads = atlasProperties.getInt(ATLAS_NOTIFICATION_ASYNCHRONOUS_MAX_THREADS, 5); +int maxThreads = atlasProperties.getInt(ATLAS_NOTIFICATION_ASYNCHRONOUS_MAX_THREADS, 1); long keepAliveTimeMs = atlasProperties.getLong(ATLAS_NOTIFICATION_ASYNCHRONOUS_KEEP_ALIVE_TIME_MS, 1); int queueSize = atlasProperties.getInt(ATLAS_NOTIFICATION_ASYNCHRONOUS_QUEUE_SIZE, 1); executor = new ThreadPoolExecutor(minThreads, maxThreads, keepAliveTimeMs, TimeUnit.MILLISECONDS, new LinkedBlockingDeque<>(queueSize), - new ThreadFactoryBuilder().setNameFormat("Atlas Notifier %d").build()); + new ThreadFactoryBuilder().setNameFormat("Atlas Notifier %d").setDaemon(true).build()); ShutdownHookManager.get().addShutdownHook(new Thread() { @Override
atlas git commit: ATLAS-2823: updated hooks to support asynchronous notifications - #2
Repository: atlas Updated Branches: refs/heads/branch-0.8 d1f491112 -> b432547b8 ATLAS-2823: updated hooks to support asynchronous notifications - #2 Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/b432547b Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/b432547b Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/b432547b Branch: refs/heads/branch-0.8 Commit: b432547b8c7fa498dbecf41a36661029620f1691 Parents: d1f4911 Author: Madhan Neethiraj Authored: Wed Aug 22 04:15:53 2018 -0700 Committer: Madhan Neethiraj Committed: Wed Aug 22 04:15:53 2018 -0700 -- notification/src/main/java/org/apache/atlas/hook/AtlasHook.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/b432547b/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java -- diff --git a/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java b/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java index 8d24035..d4b0715 100644 --- a/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java +++ b/notification/src/main/java/org/apache/atlas/hook/AtlasHook.java @@ -119,13 +119,13 @@ public abstract class AtlasHook { if (isAsync) { int minThreads = atlasProperties.getInt(ATLAS_NOTIFICATION_ASYNCHRONOUS_MIN_THREADS, 1); -int maxThreads = atlasProperties.getInt(ATLAS_NOTIFICATION_ASYNCHRONOUS_MAX_THREADS, 5); +int maxThreads = atlasProperties.getInt(ATLAS_NOTIFICATION_ASYNCHRONOUS_MAX_THREADS, 1); long keepAliveTimeMs = atlasProperties.getLong(ATLAS_NOTIFICATION_ASYNCHRONOUS_KEEP_ALIVE_TIME_MS, 1); int queueSize = atlasProperties.getInt(ATLAS_NOTIFICATION_ASYNCHRONOUS_QUEUE_SIZE, 1); executor = new ThreadPoolExecutor(minThreads, maxThreads, keepAliveTimeMs, TimeUnit.MILLISECONDS, new LinkedBlockingDeque<>(queueSize), - new ThreadFactoryBuilder().setNameFormat("Atlas Notifier %d").build()); + new ThreadFactoryBuilder().setNameFormat("Atlas Notifier %d").setDaemon(true).build()); ShutdownHookManager.get().addShutdownHook(new Thread() { @Override
atlas git commit: ATLAS-2794: updated AtlasClient to explicitly specify JacksonJaxbJsonProvider
Repository: atlas Updated Branches: refs/heads/branch-0.8 10edb040a -> c5c4742b7 ATLAS-2794: updated AtlasClient to explicitly specify JacksonJaxbJsonProvider (cherry picked from commit 9097d695c5509b874c86e0eae159cecf2a812de8) (cherry picked from commit 50c3adf1519cb3d4d01ea86c2e90e1bba4df3c46) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/c5c4742b Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/c5c4742b Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/c5c4742b Branch: refs/heads/branch-0.8 Commit: c5c4742b72d6f7a5e26135f54bd67a2141890595 Parents: 10edb04 Author: Madhan Neethiraj Authored: Thu Jul 26 21:51:24 2018 -0700 Committer: Madhan Neethiraj Committed: Fri Aug 31 11:36:32 2018 -0700 -- client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/c5c4742b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java -- diff --git a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java index 96271b7..d6f767e 100644 --- a/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java +++ b/client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java @@ -17,6 +17,7 @@ */ package org.apache.atlas; +import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider; import com.google.common.annotations.VisibleForTesting; import com.sun.jersey.api.client.Client; import com.sun.jersey.api.client.ClientHandlerException; @@ -262,6 +263,7 @@ public abstract class AtlasBaseClient { // Enable POJO mapping feature config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE); config.getClasses().add(MultiPartWriter.class); +config.getClasses().add(JacksonJaxbJsonProvider.class); int readTimeout = configuration.getInt("atlas.client.readTimeoutMSecs", 6); int connectTimeout = configuration.getInt("atlas.client.connectTimeoutMSecs", 6);
atlas git commit: ATLAS-2856: added utility methods to RequestContext, to find number of active requests and earliest active request-time
Repository: atlas Updated Branches: refs/heads/branch-0.8 c5c4742b7 -> f2e714550 ATLAS-2856: added utility methods to RequestContext, to find number of active requests and earliest active request-time Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/f2e71455 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/f2e71455 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/f2e71455 Branch: refs/heads/branch-0.8 Commit: f2e714550a1bb30f7a7b4fbea5688225b628a4bc Parents: c5c4742 Author: Madhan Neethiraj Authored: Fri Aug 31 16:04:14 2018 -0700 Committer: Madhan Neethiraj Committed: Fri Aug 31 21:34:40 2018 -0700 -- .../store/graph/v1/AtlasEntityStoreV1Test.java | 4 + .../java/org/apache/atlas/RequestContext.java | 94 .../java/org/apache/atlas/RequestContextV1.java | 31 ++- 3 files changed, 91 insertions(+), 38 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/f2e71455/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java -- diff --git a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java index 35d1a74..089ff08 100644 --- a/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java +++ b/repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1Test.java @@ -20,6 +20,7 @@ package org.apache.atlas.repository.store.graph.v1; import com.google.common.collect.ImmutableSet; import org.apache.atlas.AtlasErrorCode; import org.apache.atlas.AtlasException; +import org.apache.atlas.RequestContext; import org.apache.atlas.TestModules; import org.apache.atlas.RequestContextV1; import org.apache.atlas.TestUtils; @@ -147,6 +148,9 @@ public class AtlasEntityStoreV1Test { entityStore = new AtlasEntityStoreV1(deleteHandler, typeRegistry, mockChangeNotifier, graphMapper); RequestContextV1.clear(); RequestContextV1.get().setUser(TestUtilsV2.TEST_USER); + +LOG.debug("RequestContextV1: activeCount={}, earliestActiveRequestTime={}", RequestContextV1.getActiveRequestsCount(), RequestContextV1.earliestActiveRequestTime()); +LOG.debug("RequestContext: activeCount={}, earliestActiveRequestTime={}", RequestContext.getActiveRequestsCount(), RequestContext.earliestActiveRequestTime()); } @Test http://git-wip-us.apache.org/repos/asf/atlas/blob/f2e71455/server-api/src/main/java/org/apache/atlas/RequestContext.java -- diff --git a/server-api/src/main/java/org/apache/atlas/RequestContext.java b/server-api/src/main/java/org/apache/atlas/RequestContext.java index 3b2b575..eb3995a 100644 --- a/server-api/src/main/java/org/apache/atlas/RequestContext.java +++ b/server-api/src/main/java/org/apache/atlas/RequestContext.java @@ -21,6 +21,7 @@ package org.apache.atlas; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; @@ -29,9 +30,6 @@ import java.util.Set; import org.apache.atlas.metrics.Metrics; import org.apache.atlas.model.instance.AtlasEntity.AtlasEntityWithExtInfo; import org.apache.atlas.typesystem.ITypedReferenceableInstance; -import org.apache.atlas.typesystem.persistence.Id; -import org.apache.atlas.typesystem.types.ClassType; -import org.apache.atlas.typesystem.types.TypeSystem; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,19 +38,18 @@ public class RequestContext { private static final Logger LOG = LoggerFactory.getLogger(RequestContext.class); private static final ThreadLocal CURRENT_CONTEXT = new ThreadLocal<>(); +private static final Set ACTIVE_REQUESTS = new HashSet<>(); -private Set createdEntityIds = new LinkedHashSet<>(); -private Set updatedEntityIds = new LinkedHashSet<>(); -private Set deletedEntityIds = new LinkedHashSet<>(); -private List deletedEntities = new ArrayList<>(); -private Map entityCacheV1 = new HashMap<>(); -private Map entityCacheV2 = new HashMap<>(); +private final Set createdEntityIds = new LinkedHashSet<>(); +private final Set updatedEntityIds = new LinkedHashSet<>(); +private final Set deletedEntityIds = new LinkedHashSet<>(); +private final List deletedEntities = new ArrayLis
atlas git commit: ATLAS-2827: fix to handle failure in saving indexable string property of large size - #3
Repository: atlas Updated Branches: refs/heads/master 4c6f1d167 -> eae976187 ATLAS-2827: fix to handle failure in saving indexable string property of large size - #3 Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/eae97618 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/eae97618 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/eae97618 Branch: refs/heads/master Commit: eae9761871af9aeecc0fdc2248b7c8555407d0a6 Parents: 4c6f1d1 Author: Madhan Neethiraj Authored: Thu Sep 6 19:23:30 2018 -0700 Committer: Madhan Neethiraj Committed: Thu Sep 6 23:44:49 2018 -0700 -- .../store/graph/v2/AtlasEntityStoreV2.java | 5 +++ .../store/graph/v2/EntityGraphMapper.java | 4 ++- .../store/graph/v2/InstanceGraphMapper.java | 32 - .../java/org/apache/atlas/RequestContext.java | 36 .../notification/NotificationHookConsumer.java | 2 ++ 5 files changed, 46 insertions(+), 33 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/eae97618/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 6e2a03f..bddbf71 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 @@ -715,6 +715,7 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { EntityGraphDiscoverygraphDiscoverer = new AtlasEntityGraphDiscoveryV2(typeRegistry, entityStream); EntityGraphDiscoveryContext discoveryContext = graphDiscoverer.discoverEntities(); EntityMutationContext context = new EntityMutationContext(discoveryContext); +RequestContext requestContext = RequestContext.get(); for (String guid : discoveryContext.getReferencedGuids()) { AtlasVertex vertex = discoveryContext.getResolvedEntityVertex(guid); @@ -734,6 +735,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { if (!StringUtils.equals(guidVertex, guid)) { // if entity was found by unique attribute entity.setGuid(guidVertex); + +requestContext.recordEntityGuidUpdate(entity, guid); } context.addUpdated(guid, entity, entityType, vertex); @@ -756,6 +759,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { entity.setGuid(generatedGuid); +requestContext.recordEntityGuidUpdate(entity, guid); + context.addCreated(guid, entity, entityType, vertex); } http://git-wip-us.apache.org/repos/asf/atlas/blob/eae97618/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java index 4cd9909..d1e95f0 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java @@ -640,11 +640,13 @@ public class EntityGraphMapper { } if (trimmedLength < value.length()) { -LOG.warn("Indexed-String-Attribute: {} length is {} characters, trimming to {}", ctx.getAttribute().getQualifiedName(), value.length(), trimmedLength); +LOG.warn("Length of indexed attribute {} is {} characters, longer than safe-limit {}; trimming to {} - attempt #{}", ctx.getAttribute().getQualifiedName(), value.length(), INDEXED_STR_SAFE_LEN, trimmedLength, requestContext.getAttemptCount()); String checksumSuffix = ":" + DigestUtils.shaHex(value); // Storing SHA checksum in case verification is needed after retrieval ret = value.substring(0, trimmedLength - checksumSuffix.length()) + checksumSuffix; +} else { +LOG.warn("Length of indexed attribute {} is {} characters, longer than safe-limit {}", ctx.getAttribute().getQualifiedName(), value.length(), INDEXED_STR_SAFE_LEN); } } } http://git-w
atlas git commit: ATLAS-2827: fix to handle failure in saving indexable string property of large size - #3
Repository: atlas Updated Branches: refs/heads/branch-1.0 a19b3906b -> 9e76ed2eb ATLAS-2827: fix to handle failure in saving indexable string property of large size - #3 (cherry picked from commit eae9761871af9aeecc0fdc2248b7c8555407d0a6) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/9e76ed2e Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/9e76ed2e Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/9e76ed2e Branch: refs/heads/branch-1.0 Commit: 9e76ed2eb80ec5aea45099a5d388734f66586351 Parents: a19b390 Author: Madhan Neethiraj Authored: Thu Sep 6 19:23:30 2018 -0700 Committer: Madhan Neethiraj Committed: Fri Sep 7 00:11:37 2018 -0700 -- .../store/graph/v2/AtlasEntityStoreV2.java | 5 +++ .../store/graph/v2/EntityGraphMapper.java | 4 ++- .../store/graph/v2/InstanceGraphMapper.java | 32 - .../java/org/apache/atlas/RequestContext.java | 36 .../notification/NotificationHookConsumer.java | 2 ++ 5 files changed, 46 insertions(+), 33 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/9e76ed2e/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 6e2a03f..bddbf71 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 @@ -715,6 +715,7 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { EntityGraphDiscoverygraphDiscoverer = new AtlasEntityGraphDiscoveryV2(typeRegistry, entityStream); EntityGraphDiscoveryContext discoveryContext = graphDiscoverer.discoverEntities(); EntityMutationContext context = new EntityMutationContext(discoveryContext); +RequestContext requestContext = RequestContext.get(); for (String guid : discoveryContext.getReferencedGuids()) { AtlasVertex vertex = discoveryContext.getResolvedEntityVertex(guid); @@ -734,6 +735,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { if (!StringUtils.equals(guidVertex, guid)) { // if entity was found by unique attribute entity.setGuid(guidVertex); + +requestContext.recordEntityGuidUpdate(entity, guid); } context.addUpdated(guid, entity, entityType, vertex); @@ -756,6 +759,8 @@ public class AtlasEntityStoreV2 implements AtlasEntityStore { entity.setGuid(generatedGuid); +requestContext.recordEntityGuidUpdate(entity, guid); + context.addCreated(guid, entity, entityType, vertex); } http://git-wip-us.apache.org/repos/asf/atlas/blob/9e76ed2e/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java index e0bfdc4..d0c75db 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java @@ -674,11 +674,13 @@ public class EntityGraphMapper { } if (trimmedLength < value.length()) { -LOG.warn("Indexed-String-Attribute: {} length is {} characters, trimming to {}", ctx.getAttribute().getQualifiedName(), value.length(), trimmedLength); +LOG.warn("Length of indexed attribute {} is {} characters, longer than safe-limit {}; trimming to {} - attempt #{}", ctx.getAttribute().getQualifiedName(), value.length(), INDEXED_STR_SAFE_LEN, trimmedLength, requestContext.getAttemptCount()); String checksumSuffix = ":" + DigestUtils.shaHex(value); // Storing SHA checksum in case verification is needed after retrieval ret = value.substring(0, trimmedLength - checksumSuffix.length()) + checksumSuffix; +} else { +LOG.warn("Length of indexed attribute {} is {} characters, longer than safe-limit {}", ctx.getAttribute().getQualifie
atlas git commit: ATLAS-2827: fix to handle failure in saving indexable string property of large size - #2
Repository: atlas Updated Branches: refs/heads/master f31a7c631 -> 4c6f1d167 ATLAS-2827: fix to handle failure in saving indexable string property of large size - #2 Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4c6f1d16 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4c6f1d16 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4c6f1d16 Branch: refs/heads/master Commit: 4c6f1d167e4b41dab62f2f0fa9e153e6ceac8621 Parents: f31a7c6 Author: Madhan Neethiraj Authored: Thu Sep 6 02:40:32 2018 -0700 Committer: Madhan Neethiraj Committed: Thu Sep 6 12:59:29 2018 -0700 -- .../org/apache/atlas/AtlasConfiguration.java| 2 ++ .../store/graph/v2/EntityGraphMapper.java | 36 +++- .../java/org/apache/atlas/RequestContext.java | 19 +++ .../notification/NotificationHookConsumer.java | 3 ++ 4 files changed, 52 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/4c6f1d16/intg/src/main/java/org/apache/atlas/AtlasConfiguration.java -- diff --git a/intg/src/main/java/org/apache/atlas/AtlasConfiguration.java b/intg/src/main/java/org/apache/atlas/AtlasConfiguration.java index bd2bf7f..ace8a0f 100644 --- a/intg/src/main/java/org/apache/atlas/AtlasConfiguration.java +++ b/intg/src/main/java/org/apache/atlas/AtlasConfiguration.java @@ -38,6 +38,8 @@ public enum AtlasConfiguration { NOTIFICATION_SPLIT_MESSAGE_SEGMENTS_WAIT_TIME_SECONDS("atlas.notification.split.message.segments.wait.time.seconds", 15 * 60), NOTIFICATION_SPLIT_MESSAGE_BUFFER_PURGE_INTERVAL_SECONDS("atlas.notification.split.message.buffer.purge.interval.seconds", 5 * 60), + GRAPHSTORE_INDEXED_STRING_SAFE_LENGTH("atlas.graphstore.indexed.string.safe.length", Short.MAX_VALUE), // based on org.apache.hadoop.hbase.client.Mutation.checkRow() + //search configuration SEARCH_MAX_LIMIT("atlas.search.maxlimit", 1), SEARCH_DEFAULT_LIMIT("atlas.search.defaultlimit", 100); http://git-wip-us.apache.org/repos/asf/atlas/blob/4c6f1d16/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java index 0d9cb05..4cd9909 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java @@ -18,6 +18,7 @@ package org.apache.atlas.repository.store.graph.v2; +import org.apache.atlas.AtlasConfiguration; import org.apache.atlas.AtlasErrorCode; import org.apache.atlas.RequestContext; import org.apache.atlas.exception.AtlasBaseException; @@ -35,7 +36,6 @@ import org.apache.atlas.model.instance.EntityMutationResponse; import org.apache.atlas.model.instance.EntityMutations.EntityOperation; import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef; import org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef.Cardinality; -import org.apache.atlas.repository.Constants; import org.apache.atlas.repository.RepositoryException; import org.apache.atlas.repository.converters.AtlasInstanceConverter; import org.apache.atlas.repository.graph.GraphHelper; @@ -87,7 +87,8 @@ import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.AtlasRelation @Component public class EntityGraphMapper { private static final Logger LOG = LoggerFactory.getLogger(EntityGraphMapper.class); -private static final int INDEXED_STR_MAX_ALLOWED_LEN = 33482223; + +private static final int INDEXED_STR_SAFE_LEN = AtlasConfiguration.GRAPHSTORE_INDEXED_STRING_SAFE_LENGTH.getInt(); private final GraphHelper graphHelper = GraphHelper.getInstance(); private final AtlasGraphgraph; @@ -619,13 +620,32 @@ public class EntityGraphMapper { // Janus bug, when an indexed string attribute has a value longer than a certain length then the reverse indexed key generated by JanusGraph // exceeds the HBase row length's hard limit (Short.MAX). This trimming and hashing procedure is to circumvent that limitation if (ret != null && isIndexableStrAttr) { -String value = (String) ctx.getValue(); +String value = ret.toString(); + +if (value.length() > INDEXED_STR_SAFE_LEN) { +RequestContext requestContext = RequestContext.get(); + +final int trimmedLeng
atlas git commit: ATLAS-2827: fix to handle failure in saving indexable string property of large size - #3
Repository: atlas Updated Branches: refs/heads/branch-0.8 a7bcd029f -> fd629982f ATLAS-2827: fix to handle failure in saving indexable string property of large size - #3 (cherry picked from commit eae9761871af9aeecc0fdc2248b7c8555407d0a6) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/fd629982 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/fd629982 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/fd629982 Branch: refs/heads/branch-0.8 Commit: fd629982f9fb5ebc157d2f03cb24562806ae87bd Parents: a7bcd02 Author: Madhan Neethiraj Authored: Thu Sep 6 19:33:52 2018 -0700 Committer: Madhan Neethiraj Committed: Fri Sep 7 00:29:02 2018 -0700 -- .../store/graph/v1/AtlasEntityStoreV1.java | 5 +++ .../store/graph/v1/EntityGraphMapper.java | 4 ++- .../java/org/apache/atlas/RequestContextV1.java | 38 .../notification/NotificationHookConsumer.java | 2 ++ 4 files changed, 48 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/fd629982/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 2bfef78..449a958 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 @@ -583,6 +583,7 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore { EntityGraphDiscoverygraphDiscoverer = new AtlasEntityGraphDiscoveryV1(typeRegistry, entityStream); EntityGraphDiscoveryContext discoveryContext = graphDiscoverer.discoverEntities(); EntityMutationContext context = new EntityMutationContext(discoveryContext); +RequestContextV1requestContext = RequestContextV1.get(); for (String guid : discoveryContext.getReferencedGuids()) { AtlasVertex vertex = discoveryContext.getResolvedEntityVertex(guid); @@ -604,6 +605,8 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore { if (!StringUtils.equals(guidVertex, guid)) { // if entity was found by unique attribute entity.setGuid(guidVertex); + +requestContext.recordEntityGuidUpdate(entity, guid); } context.addUpdated(guid, entity, entityType, vertex); @@ -625,6 +628,8 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore { entity.setGuid(generatedGuid); +requestContext.recordEntityGuidUpdate(entity, guid); + context.addCreated(guid, entity, entityType, vertex); } http://git-wip-us.apache.org/repos/asf/atlas/blob/fd629982/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java index d38fbb3..448d167 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java @@ -459,11 +459,13 @@ public class EntityGraphMapper { } if (trimmedLength < value.length()) { -LOG.warn("Indexed-String-Attribute: {} length is {} characters, trimming to {}", ctx.getAttribute().getQualifiedName(), value.length(), trimmedLength); +LOG.warn("Length of indexed attribute {} is {} characters, longer than safe-limit {}; trimming to {} - attempt #{}", ctx.getAttribute().getQualifiedName(), value.length(), INDEXED_STR_SAFE_LEN, trimmedLength, requestContext.getAttemptCount()); String checksumSuffix = ":" + DigestUtils.shaHex(value); // Storing SHA checksum in case verification is needed after retrieval ret = value.substring(0, trimmedLength - checksumSuffix.length()) + checksumSuffix; +} else { +LOG.warn("Length of indexed attribute {} is {} characters, longer than safe-limit {}", ctx.getAttribute().getQualifiedName(), value.length(), INDEXED_STR_SAFE_LEN); } } } htt
atlas git commit: ATLAS-2773: UI : excluded internal types from all typedefs API calls
Repository: atlas Updated Branches: refs/heads/branch-1.0 fb32d155a -> f2766b98c ATLAS-2773: UI : excluded internal types from all typedefs API calls Signed-off-by: Sarath Subramanian (cherry picked from commit a2c26bfc2dd46e7fe231eabaed8976a916ab) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/f2766b98 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/f2766b98 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/f2766b98 Branch: refs/heads/branch-1.0 Commit: f2766b98c6235807e462fe0c330d68f717c11508 Parents: fb32d15 Author: Abhishek Kadam Authored: Wed Jul 4 13:13:41 2018 -0700 Committer: Madhan Neethiraj Committed: Wed Jul 4 19:51:34 2018 -0700 -- dashboardv2/public/js/utils/UrlLinks.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/f2766b98/dashboardv2/public/js/utils/UrlLinks.js -- diff --git a/dashboardv2/public/js/utils/UrlLinks.js b/dashboardv2/public/js/utils/UrlLinks.js index 1437871..a53bb77 100644 --- a/dashboardv2/public/js/utils/UrlLinks.js +++ b/dashboardv2/public/js/utils/UrlLinks.js @@ -45,7 +45,7 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require if (name) { return defApiUrl.def + '/name/' + name + '?type=' + type; } else { -return defApiUrl.defs + '?type=' + type; +return defApiUrl.defs + '?excludeInternalTypesAndReferences=true=' + type; } }, entitiesApiUrl: function(guid, name) { @@ -78,7 +78,7 @@ define(['require', 'utils/Enums', 'utils/Utils', 'underscore'], function(require } }, typesApiUrl: function() { -return this.typedefsUrl().defs + '/headers' +return this.typedefsUrl().defs + '/headers?excludeInternalTypesAndReferences=true' }, lineageApiUrl: function(guid) { var lineageUrl = this.baseUrlV2 + '/lineage';
atlas git commit: ATLAS-2775: Enhance basic search to search on entities with any classifications or no classifications
Repository: atlas Updated Branches: refs/heads/branch-1.0 3d69ad2f4 -> fb32d155a ATLAS-2775: Enhance basic search to search on entities with any classifications or no classifications (cherry picked from commit 15388229741b19c4567527da11bbb1daf2f9399f) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/fb32d155 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/fb32d155 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/fb32d155 Branch: refs/heads/branch-1.0 Commit: fb32d155a2a6c196a0bb8ca65b20aa4754f70bfb Parents: 3d69ad2 Author: Sarath Subramanian Authored: Tue Jul 3 14:44:37 2018 -0700 Committer: Madhan Neethiraj Committed: Tue Jul 3 15:03:08 2018 -0700 -- .../atlas/model/discovery/SearchParameters.java | 4 ++ .../ClassificationSearchProcessor.java | 39 ++-- .../atlas/discovery/EntitySearchProcessor.java | 32 +++- .../discovery/FullTextSearchProcessor.java | 8 +++- .../apache/atlas/discovery/SearchContext.java | 16 ++-- 5 files changed, 73 insertions(+), 26 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/fb32d155/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java b/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java index 39ebf23..aac6b5a 100644 --- a/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java +++ b/intg/src/main/java/org/apache/atlas/model/discovery/SearchParameters.java @@ -55,6 +55,10 @@ public class SearchParameters implements Serializable { private FilterCriteria tagFilters; private Setattributes; +public static final String WILDCARD_CLASSIFICATIONS = "*"; +public static final String ALL_CLASSIFICATIONS = "_CLASSIFIED"; +public static final String NO_CLASSIFICATIONS = "_NOT_CLASSIFIED"; + /** * @return The type of query */ http://git-wip-us.apache.org/repos/asf/atlas/blob/fb32d155/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java -- diff --git a/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java b/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java index 588ad3e..c00bfb6 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java +++ b/repository/src/main/java/org/apache/atlas/discovery/ClassificationSearchProcessor.java @@ -50,6 +50,12 @@ import java.util.List; import java.util.Map; import java.util.Set; +import static org.apache.atlas.discovery.SearchContext.MATCH_ALL_CLASSIFIED; +import static org.apache.atlas.discovery.SearchContext.MATCH_ALL_NOT_CLASSIFIED; +import static org.apache.atlas.discovery.SearchContext.MATCH_ALL_WILDCARD_CLASSIFICATION; +import static org.apache.atlas.repository.Constants.PROPAGATED_TRAIT_NAMES_PROPERTY_KEY; +import static org.apache.atlas.repository.Constants.TRAIT_NAMES_PROPERTY_KEY; +import static org.apache.atlas.repository.graphdb.AtlasGraphQuery.ComparisionOperator.EQUAL; import static org.apache.atlas.repository.graphdb.AtlasGraphQuery.ComparisionOperator.NOT_EQUAL; @@ -88,7 +94,9 @@ public class ClassificationSearchProcessor extends SearchProcessor { processSearchAttributes(classificationType, filterCriteria, indexAttributes, graphAttributes, allAttributes); // for classification search, if any attribute can't be handled by index query - switch to all filter by Graph query -boolean useIndexSearch = classificationType != SearchContext.MATCH_ALL_CLASSIFICATION && +boolean useIndexSearch = classificationType != MATCH_ALL_WILDCARD_CLASSIFICATION && + classificationType != MATCH_ALL_CLASSIFIED && + classificationType != MATCH_ALL_NOT_CLASSIFIED && typeAndSubTypesQryStr.length() <= MAX_QUERY_STR_LENGTH_TAGS && CollectionUtils.isEmpty(graphAttributes) && canApplyIndexFilter(classificationType, filterCriteria, false); @@ -149,25 +157,32 @@ public class ClassificationSearchProcessor extends SearchProcessor { LOG.debug("gremlinTagFilterQuery={}", gremlinTagFilterQuery); } } else { -tagGraphQueryWithAttributes = null; -List orConditions = new LinkedList<>(); +
[2/2] atlas git commit: ATLAS-2489: Lineage info to include relationship guid
ATLAS-2489: Lineage info to include relationship guid Change-Id: Ie26d1ad07b6ec66beb42830ad154a9dd81e7933f Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/b32e547e Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/b32e547e Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/b32e547e Branch: refs/heads/master Commit: b32e547e4ae5825bcbe31aefa5e87cd9622a7054 Parents: 5ebd707 Author: apoorvnaik <apoorvn...@apache.org> Authored: Fri Mar 9 00:26:37 2018 -0800 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Sun Mar 11 14:46:06 2018 -0700 -- .../atlas/model/lineage/AtlasLineageInfo.java | 18 +++- .../atlas/discovery/EntityLineageService.java | 90 .../atlas/util/AtlasGremlin3QueryProvider.java | 8 +- 3 files changed, 73 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/b32e547e/intg/src/main/java/org/apache/atlas/model/lineage/AtlasLineageInfo.java -- diff --git a/intg/src/main/java/org/apache/atlas/model/lineage/AtlasLineageInfo.java b/intg/src/main/java/org/apache/atlas/model/lineage/AtlasLineageInfo.java index a2e1b5e..27186ca 100644 --- a/intg/src/main/java/org/apache/atlas/model/lineage/AtlasLineageInfo.java +++ b/intg/src/main/java/org/apache/atlas/model/lineage/AtlasLineageInfo.java @@ -145,12 +145,14 @@ public class AtlasLineageInfo implements Serializable { public static class LineageRelation { private String fromEntityId; private String toEntityId; +private String relationshipId; public LineageRelation() { } -public LineageRelation(String fromEntityId, String toEntityId) { +public LineageRelation(String fromEntityId, String toEntityId, final String relationshipId) { this.fromEntityId = fromEntityId; this.toEntityId = toEntityId; +this.relationshipId = relationshipId; } public String getFromEntityId() { @@ -169,18 +171,27 @@ public class AtlasLineageInfo implements Serializable { this.toEntityId = toEntityId; } +public String getRelationshipId() { +return relationshipId; +} + +public void setRelationshipId(final String relationshipId) { +this.relationshipId = relationshipId; +} + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LineageRelation that = (LineageRelation) o; return Objects.equals(fromEntityId, that.fromEntityId) && -Objects.equals(toEntityId, that.toEntityId); +Objects.equals(toEntityId, that.toEntityId) && +Objects.equals(relationshipId, that.relationshipId); } @Override public int hashCode() { -return Objects.hash(fromEntityId, toEntityId); +return Objects.hash(fromEntityId, toEntityId, relationshipId); } @Override @@ -188,6 +199,7 @@ public class AtlasLineageInfo implements Serializable { return "LineageRelation{" + "fromEntityId='" + fromEntityId + '\'' + ", toEntityId='" + toEntityId + '\'' + +", relationshipId='" + relationshipId + '\'' + '}'; } } http://git-wip-us.apache.org/repos/asf/atlas/blob/b32e547e/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 ec4125d..633ad7c 100644 --- a/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java +++ b/repository/src/main/java/org/apache/atlas/discovery/EntityLineageService.java @@ -33,6 +33,8 @@ 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; import org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1; @@ -46,13 +48,14 @@ impor
atlas git commit: ATLAS-2493 : Update moment version to 2.21.0
Repository: atlas Updated Branches: refs/heads/master b32e547e4 -> ebe99f1d2 ATLAS-2493 : Update moment version to 2.21.0 Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/ebe99f1d Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/ebe99f1d Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/ebe99f1d Branch: refs/heads/master Commit: ebe99f1d210f3cf4fb95d99dbb77ed09fdca782e Parents: b32e547 Author: kevalbhatt <kbh...@apache.org> Authored: Sat Mar 10 18:04:02 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Sun Mar 11 15:52:38 2018 -0700 -- dashboardv2/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/ebe99f1d/dashboardv2/package.json -- diff --git a/dashboardv2/package.json b/dashboardv2/package.json index f8c3d3f..77f8cb1 100644 --- a/dashboardv2/package.json +++ b/dashboardv2/package.json @@ -37,7 +37,7 @@ "jquery-asBreadcrumbs": "0.2.2", "jquery-placeholder": "2.3.1", "jquery-sparkline": "2.4.0", -"moment": "2.18.1", +"moment": "2.21.0", "moment-timezone": "^0.5.14", "nvd3": "1.8.5", "platform": "1.3.4",
atlas git commit: ATLAS-2487: UI updates to render entity relationships
Repository: atlas Updated Branches: refs/heads/master 0120003a0 -> 2735f96fc ATLAS-2487: UI updates to render entity relationships Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/2735f96f Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/2735f96f Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/2735f96f Branch: refs/heads/master Commit: 2735f96fc70f06eba4672538376c6df8f0dc30dd Parents: 0120003 Author: kevalbhatt <kbh...@apache.org> Authored: Sat Mar 10 21:58:30 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Mon Mar 12 11:26:28 2018 -0700 -- dashboardv2/public/css/bootstrap-sidebar.css| 52 +-- dashboardv2/public/css/scss/common.scss | 19 + dashboardv2/public/css/scss/form.scss | 2 +- dashboardv2/public/css/scss/nav.scss| 4 + dashboardv2/public/css/scss/override.scss | 3 + dashboardv2/public/css/scss/relationship.scss | 66 dashboardv2/public/css/scss/style.scss | 1 + dashboardv2/public/css/scss/tab.scss| 15 + dashboardv2/public/css/scss/theme.scss | 12 +- .../js/templates/common/TableLayout_tmpl.html | 2 +- .../detail_page/DetailPageLayoutView_tmpl.html | 142 .../templates/graph/LineageLayoutView_tmpl.html | 7 +- .../graph/RelationshipLayoutView_tmpl.html | 33 ++ .../schema/SchemaTableLayoutView_tmpl.html | 2 +- .../search/SearchResultLayoutView_tmpl.html | 10 +- .../public/js/templates/site/Header.html| 8 +- .../tag/TagDetailTableLayoutView_tmpl.html | 2 +- dashboardv2/public/js/utils/Enums.js| 53 +-- .../views/detail_page/DetailPageLayoutView.js | 73 ++-- .../public/js/views/graph/LineageLayoutView.js | 10 +- .../js/views/graph/RelationshipLayoutView.js| 351 +++ .../js/views/profile/ProfileTableLayoutView.js | 2 +- dashboardv2/public/js/views/site/Header.js | 30 +- 23 files changed, 721 insertions(+), 178 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/2735f96f/dashboardv2/public/css/bootstrap-sidebar.css -- diff --git a/dashboardv2/public/css/bootstrap-sidebar.css b/dashboardv2/public/css/bootstrap-sidebar.css index fd4f21f..f0c1feb 100644 --- a/dashboardv2/public/css/bootstrap-sidebar.css +++ b/dashboardv2/public/css/bootstrap-sidebar.css @@ -4,14 +4,15 @@ * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE) */ + /* Toggle Styles */ #wrapper { padding-left: 0; --webkit-transition: all 0.5s ease; --moz-transition: all 0.5s ease; --o-transition: all 0.5s ease; -transition: all 0.5s ease; +-webkit-transition: all 0.3s ease; +-moz-transition: all 0.3s ease; +-o-transition: all 0.3s ease; +transition: all 0.3s ease; } #wrapper.toggled { @@ -27,14 +28,15 @@ margin-left: -350px; overflow-y: auto; background: #323544; --webkit-transition: all 0.5s ease; --moz-transition: all 0.5s ease; --o-transition: all 0.5s ease; -transition: all 0.5s ease; +-moz-transition: left 0.3s; +-o-transition: left 0.3s; +-webkit-transition: left 0.3s; +transition: left 0.3s; } #wrapper.toggled #sidebar-wrapper { -width: 350px;} +width: 350px; +} #page-content-wrapper { width: 100%; @@ -46,67 +48,76 @@ margin-right: -350px; } + /* Sidebar Styles */ + .sidebar-nav { margin: 0; padding: 0; list-style: none; } -.sidebar-nav > li { +.sidebar-nav>li { line-height: 50px; padding: 0 20px; border-bottom: 1px #1c1e2a solid; } -.sidebar-nav > li a { + +.sidebar-nav>li a { display: block; text-decoration: none; color: #fff; } -.sidebar-nav > li a:hover { +.sidebar-nav>li a:hover { text-decoration: none; color: #fff; } -.sidebar-nav > li a:active, -.sidebar-nav > li a:focus { +.sidebar-nav>li a:active, +.sidebar-nav>li a:focus { text-decoration: none; } -.sidebar-nav > .sidebar-brand { +.sidebar-nav>.sidebar-brand { font-size: 18px; -line-height: 60px; +line-height: 50px; } -.sidebar-nav > .sidebar-brand a { +.sidebar-nav>.sidebar-brand a { color: #ddd; letter-spacing: 1px; } -.sidebar-nav > .sidebar-brand a:hover { +.sidebar-nav>.sidebar-brand a:hover { color: #fff; background: none; } + /* Extended Elements */ + .sidebar-input .input-group { margin: 10px 0px; } + .sidebar-input .form-control, .sidebar-input .input-group-addon { background-color: transparent; border-radius: 0px; }
atlas git commit: ATLAS-2499: removed unused properties from atlas-application.properties file
Repository: atlas Updated Branches: refs/heads/master c8b96d339 -> 3b074d9ce ATLAS-2499: removed unused properties from atlas-application.properties file Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/3b074d9c Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/3b074d9c Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/3b074d9c Branch: refs/heads/master Commit: 3b074d9ceb20d512edb04569d9ae54215b94134d Parents: c8b96d3 Author: Madhan Neethiraj <mad...@apache.org> Authored: Tue Mar 13 23:36:51 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Mar 14 00:22:51 2018 -0700 -- .../src/test/resources/atlas-application.properties | 4 .../src/test/resources/atlas-application.properties | 4 .../src/test/resources/atlas-application.properties | 4 .../src/test/resources/atlas-application.properties | 4 .../src/test/resources/atlas-application.properties | 4 .../src/test/resources/atlas-application.properties | 4 distro/src/conf/atlas-application.properties| 16 ++-- .../src/test/resources/atlas-application.properties | 4 .../src/test/resources/atlas-application.properties | 4 9 files changed, 6 insertions(+), 42 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/3b074d9c/addons/falcon-bridge/src/test/resources/atlas-application.properties -- diff --git a/addons/falcon-bridge/src/test/resources/atlas-application.properties b/addons/falcon-bridge/src/test/resources/atlas-application.properties index d9fd0cc..91fd8b0 100644 --- a/addons/falcon-bridge/src/test/resources/atlas-application.properties +++ b/addons/falcon-bridge/src/test/resources/atlas-application.properties @@ -57,10 +57,6 @@ atlas.graph.index.search.solr.zookeeper-url=${solr.zk.address} atlas.graph.index.search.solr.embedded=true atlas.graph.index.search.max-result-set-size=150 -# Hive Lineage Configs # -## Schema -atlas.lineage.schema.query.hive_table=hive_table where __guid='%s'\, columns -atlas.lineage.schema.query.hive_table_v1=hive_table_v1 where __guid='%s'\, columns # Notification Configs # atlas.notification.embedded=true http://git-wip-us.apache.org/repos/asf/atlas/blob/3b074d9c/addons/hbase-bridge/src/test/resources/atlas-application.properties -- diff --git a/addons/hbase-bridge/src/test/resources/atlas-application.properties b/addons/hbase-bridge/src/test/resources/atlas-application.properties index d9fd0cc..91fd8b0 100644 --- a/addons/hbase-bridge/src/test/resources/atlas-application.properties +++ b/addons/hbase-bridge/src/test/resources/atlas-application.properties @@ -57,10 +57,6 @@ atlas.graph.index.search.solr.zookeeper-url=${solr.zk.address} atlas.graph.index.search.solr.embedded=true atlas.graph.index.search.max-result-set-size=150 -# Hive Lineage Configs # -## Schema -atlas.lineage.schema.query.hive_table=hive_table where __guid='%s'\, columns -atlas.lineage.schema.query.hive_table_v1=hive_table_v1 where __guid='%s'\, columns # Notification Configs # atlas.notification.embedded=true http://git-wip-us.apache.org/repos/asf/atlas/blob/3b074d9c/addons/hive-bridge/src/test/resources/atlas-application.properties -- diff --git a/addons/hive-bridge/src/test/resources/atlas-application.properties b/addons/hive-bridge/src/test/resources/atlas-application.properties index d9fd0cc..91fd8b0 100644 --- a/addons/hive-bridge/src/test/resources/atlas-application.properties +++ b/addons/hive-bridge/src/test/resources/atlas-application.properties @@ -57,10 +57,6 @@ atlas.graph.index.search.solr.zookeeper-url=${solr.zk.address} atlas.graph.index.search.solr.embedded=true atlas.graph.index.search.max-result-set-size=150 -# Hive Lineage Configs # -## Schema -atlas.lineage.schema.query.hive_table=hive_table where __guid='%s'\, columns -atlas.lineage.schema.query.hive_table_v1=hive_table_v1 where __guid='%s'\, columns # Notification Configs # atlas.notification.embedded=true http://git-wip-us.apache.org/repos/asf/atlas/blob/3b074d9c/addons/sqoop-bridge/src/test/resources/atlas-application.properties -- diff --git a/addons/sqoop-bridge/src/test/resources/atlas-application.properties b/addons/sqoop-bridge/src/test/resources/atlas-application.properties index d9fd0cc..91fd8b0 100644 --- a/addons/sqoop-bridge/src/test/resources/atlas-application.properties +++ b/addons/sqoop-bridge/src/test/
atlas git commit: ATLAS-2495: updated Kafka version to 1.0.0
Repository: atlas Updated Branches: refs/heads/master ac2c1a779 -> 60789da3b ATLAS-2495: updated Kafka version to 1.0.0 Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/60789da3 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/60789da3 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/60789da3 Branch: refs/heads/master Commit: 60789da3b95366a256ae1020241bb9a9ec0817de Parents: ac2c1a7 Author: Madhan Neethiraj <mad...@apache.org> Authored: Sun Mar 11 17:34:08 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Tue Mar 13 17:40:40 2018 -0700 -- .../src/test/resources/atlas-application.properties | 1 + .../src/test/resources/atlas-application.properties | 1 + .../src/test/resources/atlas-application.properties | 1 + .../src/test/resources/atlas-application.properties | 1 + .../src/test/resources/atlas-application.properties | 1 + .../src/test/resources/atlas-application.properties | 1 + .../src/test/resources/atlas-application.properties | 1 + .../src/test/resources/atlas-application.properties | 1 + intg/src/test/resources/atlas-application.properties | 1 + .../org/apache/atlas/kafka/EmbeddedKafkaServer.java | 15 +-- .../atlas/kafka/KafkaNotificationMockTest.java | 3 ++- pom.xml | 2 +- .../apache/atlas/web/integration/BaseResourceIT.java | 2 -- .../src/test/resources/atlas-application.properties | 1 + 14 files changed, 26 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/60789da3/addons/falcon-bridge/src/test/resources/atlas-application.properties -- diff --git a/addons/falcon-bridge/src/test/resources/atlas-application.properties b/addons/falcon-bridge/src/test/resources/atlas-application.properties index d1c3f71..d9fd0cc 100644 --- a/addons/falcon-bridge/src/test/resources/atlas-application.properties +++ b/addons/falcon-bridge/src/test/resources/atlas-application.properties @@ -79,6 +79,7 @@ atlas.kafka.entities.group.id=atlas_entities atlas.kafka.enable.auto.commit=false atlas.kafka.auto.offset.reset=earliest atlas.kafka.session.timeout.ms=3 +atlas.kafka.offsets.topic.replication.factor=1 http://git-wip-us.apache.org/repos/asf/atlas/blob/60789da3/addons/hbase-bridge/src/test/resources/atlas-application.properties -- diff --git a/addons/hbase-bridge/src/test/resources/atlas-application.properties b/addons/hbase-bridge/src/test/resources/atlas-application.properties index d1c3f71..d9fd0cc 100644 --- a/addons/hbase-bridge/src/test/resources/atlas-application.properties +++ b/addons/hbase-bridge/src/test/resources/atlas-application.properties @@ -79,6 +79,7 @@ atlas.kafka.entities.group.id=atlas_entities atlas.kafka.enable.auto.commit=false atlas.kafka.auto.offset.reset=earliest atlas.kafka.session.timeout.ms=3 +atlas.kafka.offsets.topic.replication.factor=1 http://git-wip-us.apache.org/repos/asf/atlas/blob/60789da3/addons/hive-bridge/src/test/resources/atlas-application.properties -- diff --git a/addons/hive-bridge/src/test/resources/atlas-application.properties b/addons/hive-bridge/src/test/resources/atlas-application.properties index d1c3f71..d9fd0cc 100644 --- a/addons/hive-bridge/src/test/resources/atlas-application.properties +++ b/addons/hive-bridge/src/test/resources/atlas-application.properties @@ -79,6 +79,7 @@ atlas.kafka.entities.group.id=atlas_entities atlas.kafka.enable.auto.commit=false atlas.kafka.auto.offset.reset=earliest atlas.kafka.session.timeout.ms=3 +atlas.kafka.offsets.topic.replication.factor=1 http://git-wip-us.apache.org/repos/asf/atlas/blob/60789da3/addons/sqoop-bridge/src/test/resources/atlas-application.properties -- diff --git a/addons/sqoop-bridge/src/test/resources/atlas-application.properties b/addons/sqoop-bridge/src/test/resources/atlas-application.properties index d1c3f71..d9fd0cc 100644 --- a/addons/sqoop-bridge/src/test/resources/atlas-application.properties +++ b/addons/sqoop-bridge/src/test/resources/atlas-application.properties @@ -79,6 +79,7 @@ atlas.kafka.entities.group.id=atlas_entities atlas.kafka.enable.auto.commit=false atlas.kafka.auto.offset.reset=earliest atlas.kafka.session.timeout.ms=3 +atlas.kafka.offsets.topic.replication.factor=1 http://git-wip-us.apache.org/repos/asf/atlas/blob/60789da3/addons/storm-bridge/src/test/resources/atlas-application.properties -- diff --git
[1/2] atlas git commit: ATLAS-2481: entity-classification edges - labelled as 'classifiedAs', with additional properties
Repository: atlas Updated Branches: refs/heads/master 02f382a27 -> ec00aed1e http://git-wip-us.apache.org/repos/asf/atlas/blob/ec00aed1/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 73ed6b4..3885157 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 @@ -63,7 +63,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -72,6 +71,7 @@ import java.util.Set; import static org.apache.atlas.model.typedef.AtlasBaseTypeDef.*; import static org.apache.atlas.repository.Constants.*; import static org.apache.atlas.repository.graph.GraphHelper.EDGE_LABEL_PREFIX; +import static org.apache.atlas.repository.graph.GraphHelper.addListProperty; import static org.apache.atlas.repository.graph.GraphHelper.edgeExists; import static org.apache.atlas.repository.graph.GraphHelper.getAdjacentEdgesByLabel; import static org.apache.atlas.repository.graph.GraphHelper.getAllTraitNames; @@ -80,12 +80,9 @@ import static org.apache.atlas.repository.graph.GraphHelper.getGuid; import static org.apache.atlas.repository.graph.GraphHelper.getIncomingEdgesByLabel; import static org.apache.atlas.repository.graph.GraphHelper.getOutGoingEdgesByLabel; import static org.apache.atlas.repository.graph.GraphHelper.getPropagateTags; -import static org.apache.atlas.repository.graph.GraphHelper.getPropagatedEdgeLabel; -import static org.apache.atlas.repository.graph.GraphHelper.getPropagatedTraitNames; import static org.apache.atlas.repository.graph.GraphHelper.getRelationshipGuid; -import static org.apache.atlas.repository.graph.GraphHelper.getTraitLabel; -import static org.apache.atlas.repository.graph.GraphHelper.getTraitNames; import static org.apache.atlas.repository.graph.GraphHelper.getTypeName; +import static org.apache.atlas.repository.graph.GraphHelper.isPropagationEnabled; import static org.apache.atlas.repository.graph.GraphHelper.removePropagatedTraitNameFromVertex; import static org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1.getIdFromVertex; import static org.apache.atlas.type.AtlasStructType.AtlasAttribute.AtlasRelationshipEdgeDirection; @@ -181,7 +178,7 @@ public final class EntityGraphRetriever { public AtlasEntityHeader toAtlasEntityHeaderWithClassifications(AtlasVertex entityVertex, Set attributes) throws AtlasBaseException { AtlasEntityHeader ret = toAtlasEntityHeader(entityVertex, attributes); -ret.setClassifications(getClassifications(entityVertex)); +ret.setClassifications(getAllClassifications(entityVertex)); return ret; } @@ -446,120 +443,18 @@ public final class EntityGraphRetriever { } } -public boolean isPropagationEnabled(AtlasVertex classificationVertex) { -boolean ret = false; - -if (classificationVertex != null) { -Boolean enabled = AtlasGraphUtilsV1.getProperty(classificationVertex, CLASSIFICATION_PROPAGATE_KEY, Boolean.class); - -ret = enabled == null ? true : enabled; -} - -return ret; -} - -public List getClassifications(String guid) throws AtlasBaseException { -AtlasVertex instanceVertex = AtlasGraphUtilsV1.findByGuid(guid); - -if (instanceVertex == null) { -throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND, guid); -} - -return getClassifications(instanceVertex); -} - -public List getClassifications(AtlasVertex instanceVertex) throws AtlasBaseException { -final List classifications = getClassifications(instanceVertex, null); -final List propagatedClassifications = getPropagatedClassifications(instanceVertex, null); - -classifications.addAll(propagatedClassifications); - -return classifications; -} - -public AtlasClassification getClassification(String guid, String classificationName) throws AtlasBaseException { -AtlasVertex instanceVertex = AtlasGraphUtilsV1.findByGuid(guid); - -if (instanceVertex == null) { -throw new AtlasBaseException(AtlasErrorCode.INSTANCE_GUID_NOT_FOUND, guid); -} - -List classifications = null; - -try { -classifications = getClassifications(instanceVertex, classificationName); -} catch (AtlasBaseException excp) { -// ignore and look for propagated classifications -
[2/5] atlas git commit: ATLAS-2460: implementation of migration-import to migrate Atlas data in Titan to JanusGraph
http://git-wip-us.apache.org/repos/asf/atlas/blob/3ded3ee2/repository/src/test/resources/stocks-2-0.8-extended-tag.json -- diff --git a/repository/src/test/resources/stocks-2-0.8-extended-tag.json b/repository/src/test/resources/stocks-2-0.8-extended-tag.json new file mode 100644 index 000..7e39675 --- /dev/null +++ b/repository/src/test/resources/stocks-2-0.8-extended-tag.json @@ -0,0 +1,5156 @@ +{ +"mode": "EXTENDED", +"vertices": [ +{ +"__type.file_action.READ_EXECUTE": { +"type": "integer", +"value": 5 +}, +"__type.name": { +"type": "string", +"value": "file_action" +}, +"__type.file_action.NONE": { +"type": "integer", +"value": 0 +}, +"__type.file_action.ALL": { +"type": "integer", +"value": 7 +}, +"__type.file_action.READ_WRITE": { +"type": "integer", +"value": 6 +}, +"__modifiedBy": { +"type": "string", +"value": "root" +}, +"__type.options": { +"type": "string", +"value": "null" +}, +"__guid": { +"type": "string", +"value": "4b603377-2536-4c9f-99a0-4edce410d861" +}, +"__type.file_action.WRITE_EXECUTE": { +"type": "integer", +"value": 3 +}, +"__version": { +"type": "long", +"value": 1 +}, +"__type.file_action.EXECUTE": { +"type": "integer", +"value": 1 +}, +"__type.category": { +"type": "string", +"value": "ENUM" +}, +"__type.version": { +"type": "string", +"value": "1.0" +}, +"__type.file_action": { +"type": "list", +"value": [ +{ +"type": "string", +"value": "NONE" +}, +{ +"type": "string", +"value": "EXECUTE" +}, +{ +"type": "string", +"value": "WRITE" +}, +{ +"type": "string", +"value": "WRITE_EXECUTE" +}, +{ +"type": "string", +"value": "READ" +}, +{ +"type": "string", +"value": "READ_EXECUTE" +}, +{ +"type": "string", +"value": "READ_WRITE" +}, +{ +"type": "string", +"value": "ALL" +} +] +}, +"__createdBy": { +"type": "string", +"value": "root" +}, +"__modificationTimestamp": { +"type": "long", +"value": 1521133638426 +}, +"__type": { +"type": "string", +"value": "typeSystem" +}, +"__type.file_action.READ": { +"type": "integer", +"value": 4 +}, +"__type.description": { +"type": "string", +"value": "file_action" +}, +"__timestamp": { +"type": "long", +"value": 1521133638426 +}, +"__type.file_action.WRITE": { +"type": "integer", +"value": 2 +}, +"_id": 16392, +"_type": "vertex" +}, +{ +"__type.name": { +"type": "string", +"value": "hive_table" +}, +"__modifiedBy": { +"type": "string", +"value": "root" +}, +"__type.hive_table.tableType": { +"type": "string", +"value": "{\"multiplicity\":\"{\\\"lower\\\":0,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"string\",\"name\":\"tableType\",\"isUnique\":false}" +}, +"__type.hive_table.retention": { +"type": "string", +"value":
[1/5] atlas git commit: ATLAS-2460: implementation of migration-import to migrate Atlas data in Titan to JanusGraph
Repository: atlas Updated Branches: refs/heads/master 7f5a665e4 -> 3ded3ee2f http://git-wip-us.apache.org/repos/asf/atlas/blob/3ded3ee2/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java -- diff --git a/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java b/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java index 6681a37..5f0cf52 100644 --- a/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java +++ b/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java @@ -87,6 +87,18 @@ public class ActiveServerFilter implements Filter { HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; LOG.error("Instance in transition. Service may not be ready to return a result"); httpServletResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); +} if(serviceState.isInstanceInMigration()) { +HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; +LOG.error("Instance in migration. Service may not be ready to return a result"); + httpServletResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); +} if (serviceState.isInstanceInMigration()) { +HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; +LOG.error("Instance in migration. Service may not be ready to return a result"); + httpServletResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); +} else if (serviceState.isInstanceInMigration()) { +HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; +LOG.error("Instance in migration. Service may not be ready to return a result"); + httpServletResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } else { HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; String activeServerAddress = activeInstanceState.getActiveServerAddress(); http://git-wip-us.apache.org/repos/asf/atlas/blob/3ded3ee2/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 1b3f2c8..b648bc1 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 @@ -28,15 +28,9 @@ import org.apache.atlas.authorize.AtlasPrivilege; import org.apache.atlas.authorize.AtlasAuthorizationUtils; import org.apache.atlas.discovery.SearchContext; import org.apache.atlas.exception.AtlasBaseException; -import org.apache.atlas.model.impexp.AtlasExportRequest; -import org.apache.atlas.model.impexp.AtlasExportResult; -import org.apache.atlas.model.impexp.AtlasImportRequest; -import org.apache.atlas.model.impexp.AtlasImportResult; +import org.apache.atlas.model.impexp.*; import org.apache.atlas.model.metrics.AtlasMetrics; -import org.apache.atlas.repository.impexp.ExportService; -import org.apache.atlas.repository.impexp.ImportService; -import org.apache.atlas.repository.impexp.ZipSink; -import org.apache.atlas.repository.impexp.ZipSource; +import org.apache.atlas.repository.impexp.*; import org.apache.atlas.services.MetricsService; import org.apache.atlas.type.AtlasType; import org.apache.atlas.type.AtlasTypeRegistry; @@ -75,17 +69,12 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.io.IOException; import java.io.InputStream; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.locks.ReentrantLock; /** - * Jersey Resource for admin operations. + * Jersey Resource for admin operations */ @Path("admin") @Singleton @@ -93,32 +82,32 @@ import java.util.concurrent.locks.ReentrantLock; public class AdminResource { private static final Logger LOG = LoggerFactory.getLogger(AdminResource.class); +private static final String isCSRF_ENABLED = "atlas.rest-csrf.enabled"; +private static final String BROWSER_USER_AGENT_PARAM = "atlas.rest-csrf.browser-useragents-regex"; +private static final String CUSTOM_METHODS_TO_IGNORE_PARAM = "atlas.rest-csrf.methods-to-ignore"; +private static final String CUSTOM_HEADER_PARAM= "atlas.rest-csrf.custom-header"; +private static final String isEntityUpdateAllowed = "atlas.entity.update.allowed"; +private static final String isEntityCreateAllowed =
[3/5] atlas git commit: ATLAS-2460: implementation of migration-import to migrate Atlas data in Titan to JanusGraph
http://git-wip-us.apache.org/repos/asf/atlas/blob/3ded3ee2/repository/src/test/resources/parts_db/atlas-migration-data.json -- diff --git a/repository/src/test/resources/parts_db/atlas-migration-data.json b/repository/src/test/resources/parts_db/atlas-migration-data.json new file mode 100644 index 000..1414ea1 --- /dev/null +++ b/repository/src/test/resources/parts_db/atlas-migration-data.json @@ -0,0 +1 @@ +{"mode":"EXTENDED","vertices":[{"__type.name":{"type":"string","value":"hive_order"},"__modifiedBy":{"type":"string","value":"root"},"__type.hive_order.order":{"type":"string","value":"{\"multiplicity\":\"{\\\"lower\\\":1,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"int\",\"name\":\"order\",\"isUnique\":false}"},"__type.options":{"type":"string","value":"null"},"__guid":{"type":"string","value":"2acd11e7-9cbd-4d47-9ded-831dabf80206"},"__version":{"type":"long","value":1},"__type.hive_order":{"type":"list","value":[{"type":"string","value":"order"},{"type":"string","value":"col"}]},"__type.hive_order.col":{"type":"string","value":"{\"multiplicity\":\"{\\\"lower\\\":1,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"string\",\"name\":\"col\",\"isUnique\":false}"},"__type.category":{"type":"string","value":"STRUCT"},"__t ype.version":{"type":"string","value":"1.0"},"__createdBy":{"type":"string","value":"root"},"__modificationTimestamp":{"type":"long","value":1522695099005},"__type":{"type":"string","value":"typeSystem"},"__type.description":{"type":"string","value":"hive_order"},"__timestamp":{"type":"long","value":1522695099005},"_id":16448,"_type":"vertex"},{"__type.hive_storagedesc.outputFormat":{"type":"string","value":"{\"multiplicity\":\"{\\\"lower\\\":0,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"string\",\"name\":\"outputFormat\",\"isUnique\":false}"},"__type.hive_storagedesc.bucketCols":{"type":"string","value":"{\"multiplicity\":\"{\\\"lower\\\":0,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"array\",\"name\":\"bucketCols\",\"isUnique\":false}"},"__type.name":{"type":"string","value":"hive_storagedesc"},"__type. hive_storagedesc.parameters":{"type":"string","value":"{\"multiplicity\":\"{\\\"lower\\\":0,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"map\",\"name\":\"parameters\",\"isUnique\":false}"},"__modifiedBy":{"type":"string","value":"root"},"__type.options":{"type":"string","value":"null"},"__type.hive_storagedesc.numBuckets":{"type":"string","value":"{\"multiplicity\":\"{\\\"lower\\\":0,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"int\",\"name\":\"numBuckets\",\"isUnique\":false}"},"__type.hive_storagedesc.sortCols":{"type":"string","value":"{\"multiplicity\":\"{\\\"lower\\\":0,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"array\",\"name\":\"sortCols\",\"isUnique\":false}"},"__guid":{"type":"string","value" :"8b3f3741-3ba9-49f1-b545-43f12fa6fe29"},"__type.hive_storagedesc":{"type":"list","value":[{"type":"string","value":"table"},{"type":"string","value":"location"},{"type":"string","value":"inputFormat"},{"type":"string","value":"outputFormat"},{"type":"string","value":"compressed"},{"type":"string","value":"numBuckets"},{"type":"string","value":"serdeInfo"},{"type":"string","value":"bucketCols"},{"type":"string","value":"sortCols"},{"type":"string","value":"parameters"},{"type":"string","value":"storedAsSubDirectories"}]},"__version":{"type":"long","value":1},"__type.hive_storagedesc.inputFormat":{"type":"string","value":"{\"multiplicity\":\"{\\\"lower\\\":0,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"string\",\"name\":\"inputFormat\",\"isUnique\":false}"},"__type.category":{"type":"string","value":"CLASS"},"__type.version":{"type":"string","value":"1.0"},"__createdBy":{"type":"string","value":"roo
atlas git commit: ATLAS-2530 trim query string before using it as name attribute for Hive process and column lineage
Repository: atlas Updated Branches: refs/heads/master da8581e90 -> e86fc944e ATLAS-2530 trim query string before using it as name attribute for Hive process and column lineage Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/e86fc944 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/e86fc944 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/e86fc944 Branch: refs/heads/master Commit: e86fc944edff263c38b17741a68b9966050030af Parents: da8581e Author: Peter Gergo Barna <pba...@hortonworks.com> Authored: Wed Apr 4 18:06:03 2018 +0200 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Apr 5 15:14:31 2018 -0700 -- .../atlas/hive/hook/events/BaseHiveEvent.java | 2 +- .../hive/bridge/HiveMetastoreBridgeIT.java | 25 2 files changed, 26 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/e86fc944/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java index a309eed..08c561f 100644 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java @@ -512,7 +512,7 @@ public abstract class BaseHiveEvent { String queryStr= hookContext.getQueryPlan().getQueryStr(); if (queryStr != null) { -queryStr = queryStr.toLowerCase(); +queryStr = queryStr.toLowerCase().trim(); } ret.setAttribute(ATTRIBUTE_QUALIFIED_NAME, getQualifiedName(inputs, outputs)); http://git-wip-us.apache.org/repos/asf/atlas/blob/e86fc944/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java -- diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java index a5b1f4d..afdc7be 100644 --- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java +++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java @@ -93,4 +93,29 @@ public class HiveMetastoreBridgeIT extends HiveITBase { assertEquals(outputs.size(), 1); assertEquals(outputs.get(0).getGuid(), tableId); } + + +@Test +public void testCreateTableHiveProcessNameAttribute() throws Exception { + //test if \n is trimmed from name attribute of the process entity +String tableName = tableName(); +String tableName2 = tableName(); +String name = String.format("create table %s (id string)", tableName2); +String query = String.format("create table %s (id string);%n%n%s;", tableName, name); +runCommand(query); + +String dbId = assertDatabaseIsRegistered(DEFAULT_DB); +String tableId = assertTableIsRegistered(DEFAULT_DB, tableName); +String tableId2 = assertTableIsRegistered(DEFAULT_DB, tableName2); + +//verify lineage is created +String processId = assertEntityIsRegistered(HiveDataTypes.HIVE_PROCESS.getName(), AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, getTableProcessQualifiedName(DEFAULT_DB, tableName), null); +AtlasEntity processsEntity = atlasClientV2.getEntityByGuid(processId).getEntity(); + +String processId2 = assertEntityIsRegistered(HiveDataTypes.HIVE_PROCESS.getName(), AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, getTableProcessQualifiedName(DEFAULT_DB, tableName2), null); +AtlasEntity processsEntity2 = atlasClientV2.getEntityByGuid(processId2).getEntity(); + +assertEquals(processsEntity2.getAttribute("name"), name); +} + }
atlas git commit: ATLAS-2530 trim query string before using it as name attribute for Hive process and column lineage
Repository: atlas Updated Branches: refs/heads/branch-0.8 f54b50bcf -> 4cfeb4185 ATLAS-2530 trim query string before using it as name attribute for Hive process and column lineage Signed-off-by: Madhan Neethiraj <mad...@apache.org> (cherry picked from commit e86fc944edff263c38b17741a68b9966050030af) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4cfeb418 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4cfeb418 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4cfeb418 Branch: refs/heads/branch-0.8 Commit: 4cfeb418571ea1c1ad10be7726a144b3d57d0b70 Parents: f54b50b Author: Peter Gergo Barna <pba...@hortonworks.com> Authored: Wed Apr 4 18:06:03 2018 +0200 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Apr 5 15:30:30 2018 -0700 -- .../atlas/hive/hook/events/BaseHiveEvent.java | 2 +- .../hive/bridge/HiveMetastoreBridgeIT.java | 25 2 files changed, 26 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/4cfeb418/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java index 196970b..127025a 100644 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java @@ -505,7 +505,7 @@ public abstract class BaseHiveEvent { String queryStr= hookContext.getQueryPlan().getQueryStr(); if (queryStr != null) { -queryStr = queryStr.toLowerCase(); +queryStr = queryStr.toLowerCase().trim(); } ret.setAttribute(ATTRIBUTE_QUALIFIED_NAME, getQualifiedName(inputs, outputs)); http://git-wip-us.apache.org/repos/asf/atlas/blob/4cfeb418/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java -- diff --git a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java index a5b1f4d..afdc7be 100644 --- a/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java +++ b/addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java @@ -93,4 +93,29 @@ public class HiveMetastoreBridgeIT extends HiveITBase { assertEquals(outputs.size(), 1); assertEquals(outputs.get(0).getGuid(), tableId); } + + +@Test +public void testCreateTableHiveProcessNameAttribute() throws Exception { + //test if \n is trimmed from name attribute of the process entity +String tableName = tableName(); +String tableName2 = tableName(); +String name = String.format("create table %s (id string)", tableName2); +String query = String.format("create table %s (id string);%n%n%s;", tableName, name); +runCommand(query); + +String dbId = assertDatabaseIsRegistered(DEFAULT_DB); +String tableId = assertTableIsRegistered(DEFAULT_DB, tableName); +String tableId2 = assertTableIsRegistered(DEFAULT_DB, tableName2); + +//verify lineage is created +String processId = assertEntityIsRegistered(HiveDataTypes.HIVE_PROCESS.getName(), AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, getTableProcessQualifiedName(DEFAULT_DB, tableName), null); +AtlasEntity processsEntity = atlasClientV2.getEntityByGuid(processId).getEntity(); + +String processId2 = assertEntityIsRegistered(HiveDataTypes.HIVE_PROCESS.getName(), AtlasClient.REFERENCEABLE_ATTRIBUTE_NAME, getTableProcessQualifiedName(DEFAULT_DB, tableName2), null); +AtlasEntity processsEntity2 = atlasClientV2.getEntityByGuid(processId2).getEntity(); + +assertEquals(processsEntity2.getAttribute("name"), name); +} + }
[2/2] atlas git commit: ATLAS-2460: fix for regression in handling HA mode
ATLAS-2460: fix for regression in handling HA mode Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/5bccaa64 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/5bccaa64 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/5bccaa64 Branch: refs/heads/master Commit: 5bccaa64da045bc576d47a1d89ef7c1766128f5f Parents: 519314f Author: Ashutosh Mestry <ames...@hortonworks.com> Authored: Thu Apr 5 13:30:47 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Apr 5 21:33:54 2018 -0700 -- .../org/apache/atlas/web/filters/ActiveServerFilter.java | 8 .../main/java/org/apache/atlas/web/service/ServiceState.java | 6 +- 2 files changed, 1 insertion(+), 13 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/5bccaa64/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java -- diff --git a/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java b/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java index 5f0cf52..4d452e4 100644 --- a/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java +++ b/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java @@ -87,14 +87,6 @@ public class ActiveServerFilter implements Filter { HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; LOG.error("Instance in transition. Service may not be ready to return a result"); httpServletResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); -} if(serviceState.isInstanceInMigration()) { -HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; -LOG.error("Instance in migration. Service may not be ready to return a result"); - httpServletResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); -} if (serviceState.isInstanceInMigration()) { -HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; -LOG.error("Instance in migration. Service may not be ready to return a result"); - httpServletResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } else if (serviceState.isInstanceInMigration()) { HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse; LOG.error("Instance in migration. Service may not be ready to return a result"); http://git-wip-us.apache.org/repos/asf/atlas/blob/5bccaa64/webapp/src/main/java/org/apache/atlas/web/service/ServiceState.java -- diff --git a/webapp/src/main/java/org/apache/atlas/web/service/ServiceState.java b/webapp/src/main/java/org/apache/atlas/web/service/ServiceState.java index 6b88ac3..113b2b2 100644 --- a/webapp/src/main/java/org/apache/atlas/web/service/ServiceState.java +++ b/webapp/src/main/java/org/apache/atlas/web/service/ServiceState.java @@ -61,11 +61,7 @@ public class ServiceState { public ServiceState(Configuration configuration) { this.configuration = configuration; - if(StringUtils.isNotEmpty(configuration.getString(ATLAS_MIGRATION_MODE_FILENAME))) { -state = ServiceStateValue.MIGRATING; -} else { -state = !HAConfiguration.isHAEnabled(configuration) ? ServiceStateValue.ACTIVE : ServiceStateValue.PASSIVE; -} +state = !HAConfiguration.isHAEnabled(configuration) ? ServiceStateValue.ACTIVE : ServiceStateValue.PASSIVE; if(!StringUtils.isEmpty(configuration.getString(ATLAS_MIGRATION_MODE_FILENAME, ""))) { state = ServiceStateValue.MIGRATING;
atlas git commit: ATLAS-2536: fix NPE in Hive hook
Repository: atlas Updated Branches: refs/heads/branch-0.8 4cfeb4185 -> 6e81a6bca ATLAS-2536: fix NPE in Hive hook (cherry picked from commit 519314f0a1911cfd5fc46196e5f031a83c5bb09e) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/6e81a6bc Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/6e81a6bc Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/6e81a6bc Branch: refs/heads/branch-0.8 Commit: 6e81a6bcadde7c8f3ad0c60dd9016022902dbefa Parents: 4cfeb41 Author: Madhan Neethiraj <mad...@apache.org> Authored: Thu Apr 5 16:55:56 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Apr 5 21:47:27 2018 -0700 -- .../org/apache/atlas/hive/hook/events/BaseHiveEvent.java | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/6e81a6bc/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java index 127025a..9109a0f 100644 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java @@ -611,9 +611,13 @@ public abstract class BaseHiveEvent { protected String getQualifiedName(BaseColumnInfo column) { String dbName= column.getTabAlias().getTable().getDbName(); String tableName = column.getTabAlias().getTable().getTableName(); -String colName = column.getColumn().getName(); +String colName = column.getColumn() != null ? column.getColumn().getName() : null; -return getQualifiedName(dbName, tableName, colName); +if (colName == null) { +return (dbName + QNAME_SEP_ENTITY_NAME + tableName + QNAME_SEP_CLUSTER_NAME).toLowerCase() + getClusterName(); +} else { +return (dbName + QNAME_SEP_ENTITY_NAME + tableName + QNAME_SEP_ENTITY_NAME + colName + QNAME_SEP_CLUSTER_NAME).toLowerCase() + getClusterName(); +} } protected String getQualifiedName(String dbName, String tableName, String colName) {
[1/2] atlas git commit: ATLAS-2536: fix NPE in Hive hook
Repository: atlas Updated Branches: refs/heads/master e86fc944e -> 5bccaa64d ATLAS-2536: fix NPE in Hive hook Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/519314f0 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/519314f0 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/519314f0 Branch: refs/heads/master Commit: 519314f0a1911cfd5fc46196e5f031a83c5bb09e Parents: e86fc94 Author: Madhan Neethiraj <mad...@apache.org> Authored: Thu Apr 5 16:55:56 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Apr 5 16:55:56 2018 -0700 -- .../org/apache/atlas/hive/hook/events/BaseHiveEvent.java | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/519314f0/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java index 08c561f..ca13812 100644 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/BaseHiveEvent.java @@ -618,9 +618,13 @@ public abstract class BaseHiveEvent { protected String getQualifiedName(BaseColumnInfo column) { String dbName= column.getTabAlias().getTable().getDbName(); String tableName = column.getTabAlias().getTable().getTableName(); -String colName = column.getColumn().getName(); +String colName = column.getColumn() != null ? column.getColumn().getName() : null; -return getQualifiedName(dbName, tableName, colName); +if (colName == null) { +return (dbName + QNAME_SEP_ENTITY_NAME + tableName + QNAME_SEP_CLUSTER_NAME).toLowerCase() + getClusterName(); +} else { +return (dbName + QNAME_SEP_ENTITY_NAME + tableName + QNAME_SEP_ENTITY_NAME + colName + QNAME_SEP_CLUSTER_NAME).toLowerCase() + getClusterName(); +} } protected String getQualifiedName(String dbName, String tableName, String colName) {
atlas git commit: ATLAS-2545: updated Storm hook to use V2 notifications
Repository: atlas Updated Branches: refs/heads/master 75415862c -> 54c31d5c8 ATLAS-2545: updated Storm hook to use V2 notifications Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/54c31d5c Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/54c31d5c Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/54c31d5c Branch: refs/heads/master Commit: 54c31d5c8e601757e19e26d3c30f2414532e2f8f Parents: 7541586 Author: rdsolani <rdsol...@gmail.com> Authored: Mon Apr 9 16:57:36 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Tue Apr 10 13:48:27 2018 -0700 -- addons/storm-bridge/pom.xml | 44 +++ .../apache/atlas/storm/hook/StormAtlasHook.java | 394 +-- pom.xml | 6 + 3 files changed, 247 insertions(+), 197 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/54c31d5c/addons/storm-bridge/pom.xml -- diff --git a/addons/storm-bridge/pom.xml b/addons/storm-bridge/pom.xml index 3446dcb..484902c 100644 --- a/addons/storm-bridge/pom.xml +++ b/addons/storm-bridge/pom.xml @@ -254,6 +254,11 @@ commons-configuration ${commons-conf.version} + + org.apache.commons + commons-configuration2 + ${commons-conf2.version} + commons-logging commons-logging @@ -295,6 +300,40 @@ ${hadoop.version} + org.apache.hadoop + hadoop-auth + ${hadoop.version} + + + + com.fasterxml.jackson.core + jackson-databind + ${jackson.version} + + + + com.fasterxml.jackson.core + jackson-core + ${jackson.version} + + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson.version} + + + org.codehaus.woodstox +stax2-api + ${codehaus.woodstox.stax2-api.version} + + + org.apache.hadoop + hadoop-hdfs-client + ${hadoop.hdfs-client.version} + + + log4j log4j ${log4j.version} @@ -309,6 +348,11 @@ jsr311-api ${jsr.version} + + com.fasterxml.woodstox + woodstox-core + ${woodstox-core.version} + http://git-wip-us.apache.org/repos/asf/atlas/blob/54c31d5c/addons/storm-bridge/src/main/java/org/apache/atlas/storm/hook/StormAtlasHook.java -- diff --git a/addons/storm-bridge/src/main/java/org/ap
[2/3] atlas git commit: ATLAS-2460: migration-import implementation (#2 - UT refactoring)
http://git-wip-us.apache.org/repos/asf/atlas/blob/9368c8a0/repository/src/test/resources/stocks_db/atlas-migration-data.json -- diff --git a/repository/src/test/resources/stocks_db/atlas-migration-data.json b/repository/src/test/resources/stocks_db/atlas-migration-data.json new file mode 100644 index 000..7e39675 --- /dev/null +++ b/repository/src/test/resources/stocks_db/atlas-migration-data.json @@ -0,0 +1,5156 @@ +{ +"mode": "EXTENDED", +"vertices": [ +{ +"__type.file_action.READ_EXECUTE": { +"type": "integer", +"value": 5 +}, +"__type.name": { +"type": "string", +"value": "file_action" +}, +"__type.file_action.NONE": { +"type": "integer", +"value": 0 +}, +"__type.file_action.ALL": { +"type": "integer", +"value": 7 +}, +"__type.file_action.READ_WRITE": { +"type": "integer", +"value": 6 +}, +"__modifiedBy": { +"type": "string", +"value": "root" +}, +"__type.options": { +"type": "string", +"value": "null" +}, +"__guid": { +"type": "string", +"value": "4b603377-2536-4c9f-99a0-4edce410d861" +}, +"__type.file_action.WRITE_EXECUTE": { +"type": "integer", +"value": 3 +}, +"__version": { +"type": "long", +"value": 1 +}, +"__type.file_action.EXECUTE": { +"type": "integer", +"value": 1 +}, +"__type.category": { +"type": "string", +"value": "ENUM" +}, +"__type.version": { +"type": "string", +"value": "1.0" +}, +"__type.file_action": { +"type": "list", +"value": [ +{ +"type": "string", +"value": "NONE" +}, +{ +"type": "string", +"value": "EXECUTE" +}, +{ +"type": "string", +"value": "WRITE" +}, +{ +"type": "string", +"value": "WRITE_EXECUTE" +}, +{ +"type": "string", +"value": "READ" +}, +{ +"type": "string", +"value": "READ_EXECUTE" +}, +{ +"type": "string", +"value": "READ_WRITE" +}, +{ +"type": "string", +"value": "ALL" +} +] +}, +"__createdBy": { +"type": "string", +"value": "root" +}, +"__modificationTimestamp": { +"type": "long", +"value": 1521133638426 +}, +"__type": { +"type": "string", +"value": "typeSystem" +}, +"__type.file_action.READ": { +"type": "integer", +"value": 4 +}, +"__type.description": { +"type": "string", +"value": "file_action" +}, +"__timestamp": { +"type": "long", +"value": 1521133638426 +}, +"__type.file_action.WRITE": { +"type": "integer", +"value": 2 +}, +"_id": 16392, +"_type": "vertex" +}, +{ +"__type.name": { +"type": "string", +"value": "hive_table" +}, +"__modifiedBy": { +"type": "string", +"value": "root" +}, +"__type.hive_table.tableType": { +"type": "string", +"value": "{\"multiplicity\":\"{\\\"lower\\\":0,\\\"upper\\\":1,\\\"isUnique\\\":false}\",\"isIndexable\":false,\"isComposite\":false,\"reverseAttributeName\":null,\"dataType\":\"string\",\"name\":\"tableType\",\"isUnique\":false}" +}, +"__type.hive_table.retention": { +"type": "string", +"value":
[1/3] atlas git commit: ATLAS-2460: migration-import implementation (#2 - UT refactoring)
Repository: atlas Updated Branches: refs/heads/master 3ded3ee2f -> 9368c8a05 http://git-wip-us.apache.org/repos/asf/atlas/blob/9368c8a0/repository/src/test/resources/stocks_db/atlas-migration-typesdef.json -- diff --git a/repository/src/test/resources/stocks_db/atlas-migration-typesdef.json b/repository/src/test/resources/stocks_db/atlas-migration-typesdef.json new file mode 100644 index 000..a5da534 --- /dev/null +++ b/repository/src/test/resources/stocks_db/atlas-migration-typesdef.json @@ -0,0 +1,2014 @@ +{ +"enumDefs": [ +{ +"category": "ENUM", +"guid": "c5042efe-57ed-4cde-b50a-60a88547c2c5", +"createdBy": "root", +"updatedBy": "root", +"createTime": 1522693756399, +"updateTime": 1522693756399, +"version": 1, +"name": "hive_principal_type", +"description": "hive_principal_type", +"typeVersion": "1.0", +"elementDefs": [ +{ +"value": "USER", +"ordinal": 1 +}, +{ +"value": "ROLE", +"ordinal": 2 +}, +{ +"value": "GROUP", +"ordinal": 3 +} +] +}, +{ +"category": "ENUM", +"guid": "20318c55-e09d-4edb-9df1-2858eaf969da", +"createdBy": "root", +"updatedBy": "root", +"createTime": 1522693754514, +"updateTime": 1522693754514, +"version": 1, +"name": "file_action", +"description": "file_action", +"typeVersion": "1.0", +"elementDefs": [ +{ +"value": "NONE", +"ordinal": 0 +}, +{ +"value": "EXECUTE", +"ordinal": 1 +}, +{ +"value": "WRITE", +"ordinal": 2 +}, +{ +"value": "WRITE_EXECUTE", +"ordinal": 3 +}, +{ +"value": "READ", +"ordinal": 4 +}, +{ +"value": "READ_EXECUTE", +"ordinal": 5 +}, +{ +"value": "READ_WRITE", +"ordinal": 6 +}, +{ +"value": "ALL", +"ordinal": 7 +} +] +} +], +"structDefs": [ +{ +"category": "STRUCT", +"guid": "42d9a0d1-8aba-406a-9437-9c2155d8fe02", +"createdBy": "root", +"updatedBy": "root", +"createTime": 1522693757121, +"updateTime": 1522693757121, +"version": 1, +"name": "hive_order", +"description": "hive_order", +"typeVersion": "1.0", +"attributeDefs": [ +{ +"name": "order", +"typeName": "int", +"isOptional": false, +"cardinality": "SINGLE", +"valuesMinCount": 1, +"valuesMaxCount": 1, +"isUnique": false, +"isIndexable": false +}, +{ +"name": "col", +"typeName": "string", +"isOptional": false, +"cardinality": "SINGLE", +"valuesMinCount": 1, +"valuesMaxCount": 1, +"isUnique": false, +"isIndexable": false +} +] +}, +{ +"category": "STRUCT", +"guid": "30385625-7482-429b-a6e4-2345718b1ca5", +"createdBy": "root", +"updatedBy": "root", +"createTime": 1522693757146, +"updateTime": 1522693757146, +"version": 1, +"name": "hive_serde", +"description": "hive_serde", +"typeVersion": "1.0", +"attributeDefs": [ +{ +"name": "name", +"typeName": "string", +"isOptional": true, +"cardinality": "SINGLE", +"valuesMinCount": 0, +"valuesMaxCount": 1, +"isUnique": false, +"isIndexable": false +}, +{ +"name": "serializationLib", +"typeName": "string", +"isOptional": true, +
[1/2] atlas git commit: ATLAS-2544: initialize Atlas Authorizer after type-store initialization
Repository: atlas Updated Branches: refs/heads/master 96a348a9a -> 79eed8c23 ATLAS-2544: initialize Atlas Authorizer after type-store initialization Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/0adfa8f4 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/0adfa8f4 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/0adfa8f4 Branch: refs/heads/master Commit: 0adfa8f459453b789e55071db2da1758aebd4c0e Parents: 96a348a Author: nixonrodrigues <ni...@apache.org> Authored: Thu Apr 12 10:33:31 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Apr 12 10:33:31 2018 -0700 -- .../store/bootstrap/AtlasTypeDefStoreInitializer.java | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/0adfa8f4/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 40b7d11..c56157d 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 @@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize; import org.apache.atlas.AtlasErrorCode; import org.apache.atlas.AtlasException; +import org.apache.atlas.authorize.AtlasAuthorizerFactory; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.ha.HAConfiguration; import org.apache.atlas.listener.ActiveStateChangeHandler; @@ -94,6 +95,12 @@ public class AtlasTypeDefStoreInitializer implements ActiveStateChangeHandler { if (!HAConfiguration.isHAEnabled(conf) || isMigrationEnabled) { atlasTypeDefStore.init(); loadBootstrapTypeDefs(); + +try { +AtlasAuthorizerFactory.getAtlasAuthorizer(); +} catch (Throwable t) { +LOG.error("AtlasTypeDefStoreInitializer.init(): Unable to obtain AtlasAuthorizer", t); +} } else { LOG.info("AtlasTypeDefStoreInitializer.init(): deferring type loading until instance activation"); } @@ -753,4 +760,4 @@ public class AtlasTypeDefStoreInitializer implements ActiveStateChangeHandler { } } } -} \ No newline at end of file +}
atlas git commit: ATLAS-2538: UI - removed exclude-sub-type checkbox from classification search result page
Repository: atlas Updated Branches: refs/heads/master 79eed8c23 -> b7f623663 ATLAS-2538: UI - removed exclude-sub-type checkbox from classification search result page Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/b7f62366 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/b7f62366 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/b7f62366 Branch: refs/heads/master Commit: b7f623663b2d9299956d1a699b16ea38f965d0ff Parents: 79eed8c Author: pratik24mac <pratik2...@gmail.com> Authored: Fri Apr 6 18:07:52 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Thu Apr 12 12:33:15 2018 -0700 -- dashboardv2/public/js/modules/Helpers.js | 7 +-- .../search/SearchResultLayoutView_tmpl.html | 18 ++ .../js/views/search/SearchResultLayoutView.js | 8 ++-- 3 files changed, 21 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/b7f62366/dashboardv2/public/js/modules/Helpers.js -- diff --git a/dashboardv2/public/js/modules/Helpers.js b/dashboardv2/public/js/modules/Helpers.js index 3897d58..7393a79 100644 --- a/dashboardv2/public/js/modules/Helpers.js +++ b/dashboardv2/public/js/modules/Helpers.js @@ -55,7 +55,7 @@ define(['require', Handlebars.registerHelper('toHumanDate', function(val) { if (!val) return ""; -return val;//localization.formatDate(val, 'f'); +return val; //localization.formatDate(val, 'f'); }); Handlebars.registerHelper('tt', function(str) { //return localization.tt(str); @@ -67,6 +67,9 @@ define(['require', case '==': return (v1 == v2) ? options.fn(this) : options.inverse(this); break; +case '!==': +return (v1 !== v2) ? options.fn(this) : options.inverse(this); +break; case '===': return (v1 === v2) ? options.fn(this) : options.inverse(this); break; @@ -90,4 +93,4 @@ define(['require', }); return HHelpers; -}); +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/b7f62366/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html -- diff --git a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html index fb9481a..b7302cd 100644 --- a/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html +++ b/dashboardv2/public/js/templates/search/SearchResultLayoutView_tmpl.html @@ -31,28 +31,30 @@ - - + + Show historical entities - - + + Exclude sub-classifications +{{#ifCond fromView '!==' "classification"}} - - + + Exclude sub-types +{{/ifCond}} Assign Tag -{{searchType}} -{{#if entityCreate}} +{{searchType}} {{#if entityCreate}} Search Atlas for existing entities or create new entity http://git-wip-us.apache.org/repos/asf/atlas/blob/b7f62366/dashboardv2/public/js/views/search/SearchResultLayoutView.js -- diff --git a/dashboardv2/public/js/views/search/SearchResultLayoutView.js b/dashboardv2/public/js/views/search/SearchResultLayoutView.js index dc4f49a..6835f03 100644 --- a/dashboardv2/public/js/views/search/SearchResultLayoutView.js +++ b/dashboardv2/public/js/views/search/SearchResultLayoutView.js @@ -72,7 +72,8 @@ define(['require', templateHelpers: function() { return { entityCreate: Globals.entityCreate, -searchType: this.searchType +searchType: this.searchType, +fromView: this.fromView };
atlas git commit: ATLAS-2554: package migration-exporter in Atlas server
Repository: atlas Updated Branches: refs/heads/branch-0.8 49d2a2723 -> 27fad9f4a ATLAS-2554: package migration-exporter in Atlas server Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/27fad9f4 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/27fad9f4 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/27fad9f4 Branch: refs/heads/branch-0.8 Commit: 27fad9f4a0cb60b05dc18718e6281a61bf7c5913 Parents: 49d2a27 Author: Ashutosh Mestry <ames...@hortonworks.com> Authored: Fri Apr 13 16:05:10 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Apr 13 16:44:51 2018 -0700 -- distro/pom.xml | 1 - .../src/main/assemblies/migration-exporter.xml | 60 .../src/main/assemblies/standalone-package.xml | 32 +++ .../main/resources/atlas_migration_export.py| 2 +- 4 files changed, 33 insertions(+), 62 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/27fad9f4/distro/pom.xml -- diff --git a/distro/pom.xml b/distro/pom.xml index 096181e..68b967d 100644 --- a/distro/pom.xml +++ b/distro/pom.xml @@ -106,7 +106,6 @@ atlas.graph.index.search.solr.zookeeper-session-timeout=6 src/main/assemblies/standalone-package.xml src/main/assemblies/src-package.xml - src/main/assemblies/migration-exporter.xml apache-atlas-${project.version} gnu http://git-wip-us.apache.org/repos/asf/atlas/blob/27fad9f4/distro/src/main/assemblies/migration-exporter.xml -- diff --git a/distro/src/main/assemblies/migration-exporter.xml b/distro/src/main/assemblies/migration-exporter.xml deleted file mode 100644 index be0a9d5..000 --- a/distro/src/main/assemblies/migration-exporter.xml +++ /dev/null @@ -1,60 +0,0 @@ - - -migration-exporter - -dir -zip - - -atlas-migration-exporter - - - - -README* - - - - ../tools/atlas-migration-exporter/src/main/resources -. - -*.py -migrationContext.xml -atlas-log4j.xml -README - -0755 -0755 - - -../tools/atlas-migration-exporter/target -. - -atlas-migration-*.jar - - -*-test-sources.jar -*-sources.jar - - - - http://git-wip-us.apache.org/repos/asf/atlas/blob/27fad9f4/distro/src/main/assemblies/standalone-package.xml -- diff --git a/distro/src/main/assemblies/standalone-package.xml b/distro/src/main/assemblies/standalone-package.xml index 1881082..3a7fed1 100755 --- a/distro/src/main/assemblies/standalone-package.xml +++ b/distro/src/main/assemblies/standalone-package.xml @@ -172,6 +172,38 @@ ../notification/target/dependency/hook hook + + + + +README* + +tools/migration-exporter + + + ../tools/atlas-migration-exporter/src/main/resources + +*.py +migrationContext.xml +atlas-log4j.xml +README + +0755 +0755 +tools/migration-exporter + + +../tools/atlas-migration-exporter/target + +atlas-migration-*.jar + + +*-test-sources.jar +*-sources.jar + +tools/migration-exporter + + http://git-wip-us.apache.org/repos/asf/atlas/blob/27fad9f4/tools/atlas-migration-exporter/src/main/resources/atlas_migration_export.py -- diff --git a/tools/atlas-migration-exporter/src/main/resources/atlas_migration_export.py b/tools/atlas-migration-exporter/src/main/resources/atlas_migration_export.py index ab7c8e5..591043f 100755 --- a/tools/atlas-migration-exporter/src/main/resources/atlas_migration_export.py +++ b/tools/atlas-migration-exporter/src/main/resources/atlas_migration_export.py @@ -71,7 +71,7 @@ def main():
[1/2] atlas git commit: ATLAS-2527: delete obsolete models
Repository: atlas Updated Branches: refs/heads/master 0dcd68906 -> 6812a7d57 http://git-wip-us.apache.org/repos/asf/atlas/blob/6812a7d5/addons/models/0300-Area3-SubjectArea/0320-CategoryHierarchy.json -- diff --git a/addons/models/0300-Area3-SubjectArea/0320-CategoryHierarchy.json b/addons/models/0300-Area3-SubjectArea/0320-CategoryHierarchy.json deleted file mode 100644 index 1063797..000 --- a/addons/models/0300-Area3-SubjectArea/0320-CategoryHierarchy.json +++ /dev/null @@ -1,140 +0,0 @@ -{ - "enumDefs": [], - "structDefs": [], - "classificationDefs": [ -{ - "name": "SubjectArea", - "superTypes": [], - "description": "SubjectArea is a classification for a category that indicates that the category represents a subject area.", - "entityTypes": [ -"GlossaryCategory" - ], - "typeVersion": "1.0", - "attributeDefs": [] -} - ], - "entityDefs": [ -{ - "name": "GlossaryCategory", - "superTypes": [ -"Referenceable" - ], - "description": "The vocabulary (the terms) for the glossary is organized into a hierarchy of categories. These categories effectively provide a folder structure for the glossary. Just like a GlossaryTerm, a GlossaryCategory is owned by a glossary.", - "typeVersion": "1.0", - "attributeDefs": [ -{ - "name": "displayName", - "typeName": "string", - "cardinality": "SINGLE", - "isIndexable": true, - "isOptional": true, - "isUnique": false -}, -{ - "name": "shortDescription", - "typeName": "string", - "cardinality": "SINGLE", - "isIndexable": true, - "isOptional": true -}, -{ - "name": "longDescription", - "typeName": "string", - "cardinality": "SINGLE", - "isIndexable": true, - "isOptional": true -} - ] -} - ], - "relationshipDefs": [ -{ - "name": "CategoryAnchor", - "typeVersion": "1.0", - "description": "CategoryAnchor links each category to exactly one Glossary object. This means that this is its home glossary. If the Glossary object is deleted then so are all of the categories linked to it.", - "endDef1": { -"name": "categories", -"type": "Glossary", -"cardinality": "SET", -"isContainer": true - }, - "endDef2": { -"name": "anchor", -"type": "GlossaryCategory", -"cardinality": "SINGLE" - }, - "relationshipCategory": "COMPOSITION", - "propagateTags": "NONE" -}, -{ - "name": "CategoryHierarchyLink", - "typeVersion": "1.0", - "description": "CategoryHierarchyLink is a relationship used to organize categories into a hierarchy to, for example, create a structure for a taxonomy. A category may have none or one super-categories. This super-category may be in a different glossary.", - "endDef1": { -"name": "childrenCategories", -"type": "GlossaryCategory", -"cardinality": "SET", -"isContainer": true - }, - "endDef2": { -"name": "parentCategory", -"type": "GlossaryCategory", -"cardinality": "SINGLE" - }, - "relationshipCategory": "AGGREGATION", - "propagateTags": "NONE" -}, -{ - "name": "LibraryCategoryReference", - "typeVersion": "1.0", - "description": "LibraryCategoryReference provides reference information for how this category corresponds to a category in an external glossary.", - "endDef1": { -"name": "localCategories", -"type": "ExternalGlossaryLink", -"cardinality": "SET" - }, - "endDef2": { -"name": "externalGlossaryLinks", -"type": "GlossaryCategory", -"cardinality": "SET" - }, - "relationshipCategory": "ASSOCIATION", - "propagateTags": "NONE", - "attributeDefs": [ -{ - "name": "steward", - "description": "The steward is the person responsible for assessing the relationship and deciding if it should be approved or not", - "typeName": "string", - "cardinality": "SINGLE", - "isIndexable": true, - "isOptional": true, - "isUnique": false -}, -{ - "name": "description", - "typeName": "string", - "cardinality": "SINGLE", - "isIndexable": true, - "isOptional": true, - "isUnique": false -}, -{ - "name": "identifier", - "typeName": "string", - "cardinality": "SINGLE", - "isIndexable": true, - "isOptional": true, - "isUnique": false -}, -{ - "name": "lastVerified", - "typeName": "date", - "cardinality": "SINGLE", - "isIndexable": true, -
[2/2] atlas git commit: ATLAS-2527: delete obsolete models
ATLAS-2527: delete obsolete models Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/6812a7d5 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/6812a7d5 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/6812a7d5 Branch: refs/heads/master Commit: 6812a7d577556d6b73bfc2d275bc3736d07ecd0d Parents: 0dcd689 Author: Mandy Chessell <mandy_chess...@uk.ibm.com> Authored: Fri Mar 30 13:45:10 2018 +0100 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Mon Apr 9 15:45:39 2018 -0700 -- .../-Area0/0015-LinkedMediaTypes_model.json | 234 -- .../0017-ExternalIdentifiers_model.json | 139 -- .../-Area0/0020-PropertyFacets_model.json | 77 .../models/-Area0/0025-Locations_model.json | 135 -- .../0030-HostsAndPlatforms_model.json | 123 - .../-Area0/0035-ComplexHosts_model.json | 61 --- .../models/-Area0/0040-Servers_model.json | 278 --- .../-Area0/0045-ServerAndAssets_model.json | 70 --- .../0070-NetworksAndGateways_model.json | 56 --- .../0090-CloudPlatformsAndServices.json | 67 --- .../0100-Area1-Collaboration/0110-Actors.json | 252 -- .../0120-Collections.json | 171 --- .../0100-Area1-Collaboration/0130-Projects.json | 208 - .../0100-Area1-Collaboration/0135-Meetings.json | 205 - .../0140-Communities.json | 110 - .../0100-Area1-Collaboration/0150-Feedback.json | 286 .../0100-Area1-Collaboration/0160-Notes.json| 101 .../0300-Area3-SubjectArea/0310-Glossary.json | 129 -- .../0320-CategoryHierarchy.json | 140 -- .../0300-Area3-SubjectArea/0330-Terms.json | 201 .../0300-Area3-SubjectArea/0340-Dictionary.json | 75 --- .../0350-RelatedTerms.json | 456 --- .../0300-Area3-SubjectArea/0360-Contexts.json | 91 .../0370-SemanticAssignment.json| 148 -- .../0380-SpineObjects.json | 184 .../0390-GlossaryProjects.json | 17 - 26 files changed, 4014 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/6812a7d5/addons/models/-Area0/0015-LinkedMediaTypes_model.json -- diff --git a/addons/models/-Area0/0015-LinkedMediaTypes_model.json b/addons/models/-Area0/0015-LinkedMediaTypes_model.json deleted file mode 100644 index a2c9284..000 --- a/addons/models/-Area0/0015-LinkedMediaTypes_model.json +++ /dev/null @@ -1,234 +0,0 @@ -{ - "enumDefs": [ -{ - "name": "MediaUsage", - "description":"The media usage types", - "typeVersion": "1.0", - "elementDefs": [ -{ - "ordinal": 0, - "value": "ICON" -}, -{ - "ordinal": 1, - "value": "THUMBNAIL" -}, -{ - "ordinal": 2, - "value": "ILLUSTRATION" -}, -{ - "ordinal": 3, - "value": "USAGE_GUIDANCE" -}, -{ - "ordinal": 99, - "value": "OTHER" -} - ] -}, -{ - "name": "MediaType", - "description": "The media type", - "typeVersion": "1.0", - "elementDefs": [ -{ - "ordinal": 1, - "value": "IMAGE" -}, -{ - "ordinal": 2, - "value": "VIDEO" -}, -{ - "ordinal": 3, - "value": "SOUND" -}, -{ - "ordinal": 4, - "value": "DOCUMENT" -}, -{ - "ordinal": 99, - "value": "OTHER" -} - ] -} - ], - "structDefs": [], - "classificationDefs": [], - "entityDefs": [ -{ - "name": "EmbeddedMedia", - "description":"EmbeddedMedia is media embedded in a metadata object. Media such as images allow an icon, thumbnail and larger images to be associated with a metadata element. They are intended to be displayed with the metadata content. This media enriches the description of the object and may include, for example, design
[3/5] atlas git commit: ATLAS-2534: Atlas Glossary - REST API
http://git-wip-us.apache.org/repos/asf/atlas/blob/75415862/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java -- diff --git a/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java b/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java new file mode 100644 index 000..91abf5e --- /dev/null +++ b/repository/src/main/java/org/apache/atlas/glossary/GlossaryService.java @@ -0,0 +1,1159 @@ +/** + * 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.glossary; + +import org.apache.atlas.AtlasErrorCode; +import org.apache.atlas.SortOrder; +import org.apache.atlas.exception.AtlasBaseException; +import org.apache.atlas.model.glossary.AtlasGlossary; +import org.apache.atlas.model.glossary.AtlasGlossaryCategory; +import org.apache.atlas.model.glossary.AtlasGlossaryTerm; +import org.apache.atlas.model.glossary.relations.AtlasRelatedCategoryHeader; +import org.apache.atlas.model.glossary.relations.AtlasRelatedTermHeader; +import org.apache.atlas.model.glossary.relations.AtlasTermCategorizationHeader; +import org.apache.atlas.model.instance.AtlasEntityHeader; +import org.apache.atlas.model.instance.AtlasObjectId; +import org.apache.atlas.model.instance.AtlasRelationship; +import org.apache.atlas.repository.ogm.DataAccess; +import org.apache.atlas.repository.store.graph.AtlasRelationshipStore; +import org.apache.atlas.repository.store.graph.v1.AtlasGraphUtilsV1; +import org.apache.commons.collections.CollectionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import javax.inject.Inject; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.stream.Collectors; + +@Service +public class GlossaryService { +private static final Logger LOG = LoggerFactory.getLogger(GlossaryService.class); +private static final boolean DEBUG_ENABLED = LOG.isDebugEnabled(); + +private static final String ATLAS_GLOSSARY_PREFIX = "__AtlasGlossary"; +// Relation name constants +private static final String TERM_ANCHOR = ATLAS_GLOSSARY_PREFIX + "TermAnchor"; +private static final String CATEGORY_ANCHOR = ATLAS_GLOSSARY_PREFIX + "CategoryAnchor"; +private static final String CATEGORY_HIERARCHY= ATLAS_GLOSSARY_PREFIX + "CategoryHierarchyLink"; +private static final String TERM_CATEGORIZATION = ATLAS_GLOSSARY_PREFIX + "TermCategorization"; +private static final String TERM_ASSIGNMENT = ATLAS_GLOSSARY_PREFIX + "SemanticAssignment"; + +private final DataAccess dataAccess; +private final AtlasRelationshipStore relationshipStore; + +@Inject +public GlossaryService(DataAccess dataAccess, final AtlasRelationshipStore relationshipStore) { +this.dataAccess = dataAccess; +this.relationshipStore = relationshipStore; +} + + +/** + * List all glossaries + * + * @param limit page size - no paging by default + * @param offsetoffset for pagination + * @param sortOrder ASC (default) or DESC + * @return List of all glossaries + * @throws AtlasBaseException + */ +public List getGlossaries(int limit, int offset, SortOrder sortOrder) throws AtlasBaseException { +if (DEBUG_ENABLED) { +LOG.debug("==> GlossaryService.getGlossaries({}, {}, {})", limit, offset, sortOrder); +} + +List glossaryGuids= AtlasGraphUtilsV1.findEntityGUIDsByType(ATLAS_GLOSSARY_PREFIX, sortOrder); +PaginationHelper paginationHelper = new PaginationHelper<>(glossaryGuids, offset, limit); + +List ret; +ListguidsToLoad = paginationHelper.getPaginatedList(); +if (CollectionUtils.isNotEmpty(guidsToLoad)) { +ret = guidsToLoad.stream().map(GlossaryService::getGlossarySkeleton).collect(Collectors.toList()); +Iterable glossaries = dataAccess.load(ret); +ret.clear(); + +
[2/5] atlas git commit: ATLAS-2534: Atlas Glossary - REST API
http://git-wip-us.apache.org/repos/asf/atlas/blob/75415862/repository/src/main/java/org/apache/atlas/repository/ogm/glossary/AtlasGlossaryCategoryDTO.java -- diff --git a/repository/src/main/java/org/apache/atlas/repository/ogm/glossary/AtlasGlossaryCategoryDTO.java b/repository/src/main/java/org/apache/atlas/repository/ogm/glossary/AtlasGlossaryCategoryDTO.java new file mode 100644 index 000..b26ee76 --- /dev/null +++ b/repository/src/main/java/org/apache/atlas/repository/ogm/glossary/AtlasGlossaryCategoryDTO.java @@ -0,0 +1,159 @@ +/** + * 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.repository.ogm.glossary; + +import org.apache.atlas.exception.AtlasBaseException; +import org.apache.atlas.model.glossary.AtlasGlossaryCategory; +import org.apache.atlas.model.instance.AtlasEntity; +import org.apache.atlas.model.instance.AtlasRelatedObjectId; +import org.apache.atlas.model.instance.AtlasRelationship; +import org.apache.atlas.type.AtlasTypeRegistry; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import javax.inject.Inject; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@Component +public class AtlasGlossaryCategoryDTO extends AbstractGlossaryDTO { +private static final Logger LOG = LoggerFactory.getLogger(AtlasGlossaryCategoryDTO.class); + +@Inject +protected AtlasGlossaryCategoryDTO(final AtlasTypeRegistry typeRegistry) { +super(typeRegistry, AtlasGlossaryCategory.class, true); +} + +@Override +public AtlasGlossaryCategory from(final AtlasEntity entity) { +if (LOG.isDebugEnabled()) { +LOG.debug("==> AtlasGlossaryCategoryDTO.from()", entity); +} +Objects.requireNonNull(entity, "entity"); + +AtlasGlossaryCategory ret = new AtlasGlossaryCategory(); + +ret.setGuid(entity.getGuid()); +ret.setQualifiedName((String) entity.getAttribute("qualifiedName")); +ret.setDisplayName((String) entity.getAttribute("displayName")); +ret.setShortDescription((String) entity.getAttribute("shortDescription")); +ret.setLongDescription((String) entity.getAttribute("longDescription")); + +Object anchor = entity.getRelationshipAttribute("anchor"); +if (anchor instanceof AtlasRelatedObjectId) { +LOG.debug("Processing anchor"); +if (((AtlasRelatedObjectId) anchor).getRelationshipStatus() == AtlasRelationship.Status.ACTIVE) { +ret.setAnchor(constructGlossaryId((AtlasRelatedObjectId) anchor)); +} +} + +Object parentCategory = entity.getRelationshipAttribute("parentCategory"); +if (parentCategory instanceof AtlasRelatedObjectId) { +LOG.debug("Processing parentCategory"); +if (((AtlasRelatedObjectId) parentCategory).getRelationshipStatus() == AtlasRelationship.Status.ACTIVE) { + ret.setParentCategory(constructRelatedCategoryId((AtlasRelatedObjectId) parentCategory)); +} +} + +Object childrenCategories = entity.getRelationshipAttribute("childrenCategories"); +if (childrenCategories instanceof Collection) { +LOG.debug("Processing childrenCategories"); +for (Object child : (Collection) childrenCategories) { +if (child instanceof AtlasRelatedObjectId) { +if (((AtlasRelatedObjectId) child).getRelationshipStatus() == AtlasRelationship.Status.ACTIVE) { + ret.addChild(constructRelatedCategoryId((AtlasRelatedObjectId) child)); +} +} +} +} + +Object terms = entity.getRelationshipAttribute("terms"); +if (terms instanceof Collection) { +LOG.debug("Processing terms"); +for (Object term : (Collection) terms) { +if (term instanceof AtlasRelatedObjectId) { +if (((AtlasRelatedObjectId) term).getRelationshipStatus() == AtlasRelationship.Status.ACTIVE) { +
[5/5] atlas git commit: ATLAS-2534: Atlas Glossary - REST API
ATLAS-2534: Atlas Glossary - REST API Change-Id: I47210446be9e38c274bae0ee4a688187ba6e4fd0 Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/75415862 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/75415862 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/75415862 Branch: refs/heads/master Commit: 75415862cc2708ee866d2d29ca603a4e6306f408 Parents: 6812a7d Author: apoorvnaik <apoorvn...@apache.org> Authored: Wed Mar 14 21:03:37 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Mon Apr 9 23:06:36 2018 -0700 -- .../models/-Area0/0011-glossary_model.json | 880 + .../repository/graphdb/AtlasGraphQuery.java | 11 + .../query/NativeTinkerpopGraphQuery.java|8 + .../tinkerpop/query/TinkerpopGraphQuery.java| 11 +- .../tinkerpop/query/expr/OrderByPredicate.java | 41 + .../graphdb/janus/AtlasJanusGraph.java | 41 +- .../janus/query/NativeJanusGraphQuery.java |8 + .../titan0/query/NativeTitan0GraphQuery.java| 13 +- .../java/org/apache/atlas/AtlasErrorCode.java |6 +- .../atlas/model/AtlasBaseModelObject.java | 37 +- .../atlas/model/annotation/AtlasJSON.java | 36 + .../atlas/model/glossary/AtlasGlossary.java | 222 .../model/glossary/AtlasGlossaryBaseObject.java | 129 ++ .../model/glossary/AtlasGlossaryCategory.java | 174 +++ .../atlas/model/glossary/AtlasGlossaryTerm.java | 453 +++ .../enums/AtlasTermAssignmentStatus.java| 39 + .../enums/AtlasTermRelationshipStatus.java | 37 + .../glossary/relations/AtlasGlossaryHeader.java | 79 ++ .../relations/AtlasRelatedCategoryHeader.java | 93 ++ .../relations/AtlasRelatedTermHeader.java | 139 +++ .../relations/AtlasTermAssignmentHeader.java| 162 +++ .../AtlasTermCategorizationHeader.java | 107 ++ .../atlas/model/instance/AtlasEntity.java | 31 +- .../atlas/model/instance/AtlasEntityHeader.java | 95 +- .../atlas/model/instance/AtlasRelationship.java |3 - .../atlas/type/AtlasRelationshipType.java |2 - .../apache/atlas/glossary/GlossaryService.java | 1159 ++ .../ogm/AbstractDataTransferObject.java | 20 +- .../repository/ogm/AtlasSavedSearchDTO.java | 105 -- .../repository/ogm/AtlasUserProfileDTO.java | 115 -- .../atlas/repository/ogm/DTORegistry.java | 21 +- .../apache/atlas/repository/ogm/DataAccess.java | 196 ++- .../ogm/glossary/AbstractGlossaryDTO.java | 163 +++ .../ogm/glossary/AtlasGlossaryCategoryDTO.java | 159 +++ .../ogm/glossary/AtlasGlossaryDTO.java | 155 +++ .../ogm/glossary/AtlasGlossaryTermDTO.java | 250 .../ogm/profiles/AtlasSavedSearchDTO.java | 110 ++ .../ogm/profiles/AtlasUserProfileDTO.java | 120 ++ .../graph/v1/AtlasEntityChangeNotifier.java |6 +- .../store/graph/v1/AtlasGraphUtilsV1.java | 20 +- .../store/graph/v1/EntityGraphRetriever.java|9 + .../userprofile/UserProfileService.java |4 +- .../test/java/org/apache/atlas/TestModules.java | 25 +- .../atlas/glossary/GlossaryServiceTest.java | 641 ++ .../atlas/glossary/PaginationHelperTest.java| 64 + .../impexp/ZipFileResourceTestUtils.java| 42 +- .../userprofile/UserProfileServiceTest.java | 10 +- .../EntityNotificationListenerV2.java | 35 +- .../org/apache/atlas/web/rest/GlossaryREST.java | 839 + 49 files changed, 6735 insertions(+), 390 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/75415862/addons/models/-Area0/0011-glossary_model.json -- diff --git a/addons/models/-Area0/0011-glossary_model.json b/addons/models/-Area0/0011-glossary_model.json new file mode 100644 index 000..ae7e5c7 --- /dev/null +++ b/addons/models/-Area0/0011-glossary_model.json @@ -0,0 +1,880 @@ +{ + "enumDefs": [ +{ + "name": "__AtlasGlossaryTermRelationshipStatus", + "description": "TermRelationshipStatus defines how reliable the relationship is between two glossary terms", + "typeVersion": "1.0", + "elementDefs": [ +{ + "ordinal": 0, + "value": "DRAFT", + "description": "DRAFT means the relationship is under development." +}, +{ + "ordinal": 1, + "value": "ACTIVE", + "description": "ACTIVE means the relationship i
[1/5] atlas git commit: ATLAS-2534: Atlas Glossary - REST API
Repository: atlas Updated Branches: refs/heads/master 6812a7d57 -> 75415862c http://git-wip-us.apache.org/repos/asf/atlas/blob/75415862/webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java -- diff --git a/webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java b/webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java index 01a95cf..ac097b6 100644 --- a/webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java +++ b/webapp/src/main/java/org/apache/atlas/notification/EntityNotificationListenerV2.java @@ -17,9 +17,7 @@ */ package org.apache.atlas.notification; -import org.apache.atlas.ApplicationProperties; import org.apache.atlas.AtlasErrorCode; -import org.apache.atlas.AtlasException; import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.listener.EntityChangeListenerV2; import org.apache.atlas.model.instance.AtlasClassification; @@ -46,26 +44,23 @@ import java.util.Set; import static org.apache.atlas.notification.NotificationEntityChangeListener.ATLAS_ENTITY_NOTIFICATION_PROPERTY; import static org.apache.atlas.notification.NotificationInterface.NotificationType.ENTITIES; -import static org.apache.atlas.v1.model.notification.EntityNotificationV2.OperationType.CLASSIFICATION_ADD; -import static org.apache.atlas.v1.model.notification.EntityNotificationV2.OperationType.CLASSIFICATION_DELETE; -import static org.apache.atlas.v1.model.notification.EntityNotificationV2.OperationType.CLASSIFICATION_UPDATE; import static org.apache.atlas.repository.graph.GraphHelper.isInternalType; -import static org.apache.atlas.v1.model.notification.EntityNotificationV2.OperationType.ENTITY_CREATE; -import static org.apache.atlas.v1.model.notification.EntityNotificationV2.OperationType.ENTITY_DELETE; -import static org.apache.atlas.v1.model.notification.EntityNotificationV2.OperationType.ENTITY_UPDATE; +import static org.apache.atlas.v1.model.notification.EntityNotificationV2.OperationType.*; @Component public class EntityNotificationListenerV2 implements EntityChangeListenerV2 { private final AtlasTypeRegistry typeRegistry; private final NotificationInterface notificationInterface; +private final Configuration configuration; private final MapnotificationAttributesCache = new HashMap<>(); -private static Configuration APPLICATION_PROPERTIES = null; - @Inject -public EntityNotificationListenerV2(AtlasTypeRegistry typeRegistry, NotificationInterface notificationInterface) { +public EntityNotificationListenerV2(AtlasTypeRegistry typeRegistry, +NotificationInterface notificationInterface, +Configuration configuration) { this.typeRegistry = typeRegistry; this.notificationInterface = notificationInterface; +this.configuration = configuration; } @Override @@ -186,13 +181,11 @@ public class EntityNotificationListenerV2 implements EntityChangeListenerV2 { private List getNotificationAttributes(String entityType) { List ret = null; -initApplicationProperties(); - if (notificationAttributesCache.containsKey(entityType)) { ret = notificationAttributesCache.get(entityType); -} else if (APPLICATION_PROPERTIES != null) { -String[] notificationAttributes = APPLICATION_PROPERTIES.getStringArray(ATLAS_ENTITY_NOTIFICATION_PROPERTY + "." + - entityType + "." + "attributes.include"); +} else if (configuration != null) { +String attributesToIncludeKey = ATLAS_ENTITY_NOTIFICATION_PROPERTY + "." + entityType + "." + "attributes.include"; +String[] notificationAttributes = configuration.getStringArray(attributesToIncludeKey); if (notificationAttributes != null) { ret = Arrays.asList(notificationAttributes); @@ -203,14 +196,4 @@ public class EntityNotificationListenerV2 implements EntityChangeListenerV2 { return ret; } - -private void initApplicationProperties() { -if (APPLICATION_PROPERTIES == null) { -try { -APPLICATION_PROPERTIES = ApplicationProperties.get(); -} catch (AtlasException ex) { -// ignore -} -} -} } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/atlas/blob/75415862/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java -- diff --git a/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java b/webapp/src/main/java/org/apache/atlas/web/rest/GlossaryREST.java new file
atlas git commit: ATLAS-2542: import-Hbase doesn't update entity already present in Atlas
Repository: atlas Updated Branches: refs/heads/master 37d7b8b8f -> dc71d3d42 ATLAS-2542: import-Hbase doesn't update entity already present in Atlas Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/dc71d3d4 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/dc71d3d4 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/dc71d3d4 Branch: refs/heads/master Commit: dc71d3d42fec60c5bd763054591a6c25a1d01862 Parents: 37d7b8b Author: rmani <rm...@hortonworks.com> Authored: Sun Apr 8 20:16:54 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Sun Apr 8 23:44:07 2018 -0700 -- .../apache/atlas/hbase/bridge/HBaseBridge.java | 28 1 file changed, 28 insertions(+) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/dc71d3d4/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseBridge.java -- diff --git a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseBridge.java b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseBridge.java index a546ff7..af67e78 100644 --- a/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseBridge.java +++ b/addons/hbase-bridge/src/main/java/org/apache/atlas/hbase/bridge/HBaseBridge.java @@ -52,6 +52,7 @@ import java.io.File; import java.io.FileReader; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; @@ -449,6 +450,7 @@ public class HBaseBridge { try { ret = findEntityInAtlas(HBaseDataTypes.HBASE_NAMESPACE.getName(), nsQualifiedName); +clearRelationshipAttributes(ret); } catch (Exception e) { ret = null; // entity doesn't exist in Atlas } @@ -461,6 +463,7 @@ public class HBaseBridge { try { ret = findEntityInAtlas(HBaseDataTypes.HBASE_TABLE.getName(), tableQualifiedName); +clearRelationshipAttributes(ret); } catch (Exception e) { ret = null; // entity doesn't exist in Atlas } @@ -473,6 +476,7 @@ public class HBaseBridge { try { ret = findEntityInAtlas(HBaseDataTypes.HBASE_COLUMN_FAMILY.getName(), columnFamilyQualifiedName); +clearRelationshipAttributes(ret); } catch (Exception e) { ret = null; // entity doesn't exist in Atlas } @@ -658,4 +662,28 @@ public class HBaseBridge { System.out.println("namespace1:tbl2"); System.out.println("namespace2:tbl1"); } + +private void clearRelationshipAttributes(AtlasEntityWithExtInfo entity) { +if (entity != null) { +clearRelationshipAttributes(entity.getEntity()); + +if (entity.getReferredEntities() != null) { + clearRelationshipAttributes(entity.getReferredEntities().values()); +} +} +} + +private void clearRelationshipAttributes(Collection entities) { +if (entities != null) { +for (AtlasEntity entity : entities) { +clearRelationshipAttributes(entity); +} +} +} + +private void clearRelationshipAttributes(AtlasEntity entity) { +if (entity != null && entity.getRelationshipAttributes() != null) { +entity.getRelationshipAttributes().clear(); +} +} }
atlas git commit: ATLAS-2557: updated groups lookup for logged in user with an option to include groups from Hadoop config
Repository: atlas Updated Branches: refs/heads/master b1907a332 -> 7515915f6 ATLAS-2557: updated groups lookup for logged in user with an option to include groups from Hadoop config Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/7515915f Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/7515915f Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/7515915f Branch: refs/heads/master Commit: 7515915f6b52cdfd0f7e5e32a17f6f6cfae6b37d Parents: b1907a3 Author: nixonrodrigues <ni...@apache.org> Authored: Fri Apr 13 01:24:35 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Apr 13 09:04:56 2018 -0700 -- .../apache/atlas/utils/AuthenticationUtil.java | 14 ++ .../AtlasAbstractAuthenticationProvider.java| 51 ++-- 2 files changed, 51 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/7515915f/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java -- diff --git a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java index 09d8085..af32afc 100644 --- a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java +++ b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java @@ -47,6 +47,20 @@ public final class AuthenticationUtil { return atlasConf.getBoolean("atlas.authentication.method.kerberos", false); } +public static boolean includeHadoopGroups(){ +boolean includeHadoopGroups = false; + +try { +Configuration configuration = ApplicationProperties.get(); + +includeHadoopGroups = configuration.getBoolean("atlas.authentication.ugi-groups.include-hadoop-groups", includeHadoopGroups); +} catch (AtlasException e) { +LOG.error("AuthenticationUtil::includeHadoopGroups(). Error while loading atlas application properties ", e); +} + +return includeHadoopGroups; +} + public static String[] getBasicAuthenticationInput() { String username = null; String password = null; http://git-wip-us.apache.org/repos/asf/atlas/blob/7515915f/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java -- diff --git a/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java b/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java index f77cb01..d4f9a0f 100644 --- a/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java +++ b/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java @@ -19,6 +19,7 @@ package org.apache.atlas.web.security; +import org.apache.commons.collections.CollectionUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.Groups; import org.apache.hadoop.security.UserGroupInformation; @@ -33,7 +34,11 @@ import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; + +import org.apache.atlas.utils.AuthenticationUtil; public abstract class AtlasAbstractAuthenticationProvider implements AuthenticationProvider { private static final Logger LOG = LoggerFactory.getLogger(AtlasAbstractAuthenticationProvider.class); @@ -94,33 +99,51 @@ public abstract class AtlasAbstractAuthenticationProvider implements Authenticat } public static List getAuthoritiesFromUGI(String userName) { -List grantedAuths = new ArrayList(); +Set userGroups = new HashSet<>(); +UserGroupInformation ugi= UserGroupInformation.createRemoteUser(userName); -UserGroupInformation ugi = UserGroupInformation.createRemoteUser(userName); if (ugi != null) { -String[] userGroups = ugi.getGroupNames(); -if (userGroups != null) { -for (String group : userGroups) { -grantedAuths.add(new SimpleGrantedAuthority(group)); +String[] groups = ugi.getGroupNames(); + +if(LOG.isDebugEnabled()) { +LOG.debug("UserGroupInformation userGroups=" + groups); +} + +if (groups != null) { +for (String group : groups) { +userGroups.add(group); } }
atlas git commit: ATLAS-2557: updated groups lookup for logged in user with an option to include groups from Hadoop config
Repository: atlas Updated Branches: refs/heads/branch-0.8 e50509255 -> 394a19fbd ATLAS-2557: updated groups lookup for logged in user with an option to include groups from Hadoop config Signed-off-by: Madhan Neethiraj <mad...@apache.org> (cherry picked from commit 7515915f6b52cdfd0f7e5e32a17f6f6cfae6b37d) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/394a19fb Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/394a19fb Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/394a19fb Branch: refs/heads/branch-0.8 Commit: 394a19fbda54a86671bde0dcdd390c470557ff3f Parents: e505092 Author: nixonrodrigues <ni...@apache.org> Authored: Fri Apr 13 01:24:35 2018 +0530 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Apr 13 09:05:53 2018 -0700 -- .../apache/atlas/utils/AuthenticationUtil.java | 14 ++ .../AtlasAbstractAuthenticationProvider.java| 51 ++-- 2 files changed, 51 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/394a19fb/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java -- diff --git a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java index 09d8085..af32afc 100644 --- a/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java +++ b/intg/src/main/java/org/apache/atlas/utils/AuthenticationUtil.java @@ -47,6 +47,20 @@ public final class AuthenticationUtil { return atlasConf.getBoolean("atlas.authentication.method.kerberos", false); } +public static boolean includeHadoopGroups(){ +boolean includeHadoopGroups = false; + +try { +Configuration configuration = ApplicationProperties.get(); + +includeHadoopGroups = configuration.getBoolean("atlas.authentication.ugi-groups.include-hadoop-groups", includeHadoopGroups); +} catch (AtlasException e) { +LOG.error("AuthenticationUtil::includeHadoopGroups(). Error while loading atlas application properties ", e); +} + +return includeHadoopGroups; +} + public static String[] getBasicAuthenticationInput() { String username = null; String password = null; http://git-wip-us.apache.org/repos/asf/atlas/blob/394a19fb/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java -- diff --git a/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java b/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java index f77cb01..d4f9a0f 100644 --- a/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java +++ b/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java @@ -19,6 +19,7 @@ package org.apache.atlas.web.security; +import org.apache.commons.collections.CollectionUtils; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.security.Groups; import org.apache.hadoop.security.UserGroupInformation; @@ -33,7 +34,11 @@ import org.springframework.security.core.userdetails.User; import org.springframework.security.core.userdetails.UserDetails; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; + +import org.apache.atlas.utils.AuthenticationUtil; public abstract class AtlasAbstractAuthenticationProvider implements AuthenticationProvider { private static final Logger LOG = LoggerFactory.getLogger(AtlasAbstractAuthenticationProvider.class); @@ -94,33 +99,51 @@ public abstract class AtlasAbstractAuthenticationProvider implements Authenticat } public static List getAuthoritiesFromUGI(String userName) { -List grantedAuths = new ArrayList(); +Set userGroups = new HashSet<>(); +UserGroupInformation ugi= UserGroupInformation.createRemoteUser(userName); -UserGroupInformation ugi = UserGroupInformation.createRemoteUser(userName); if (ugi != null) { -String[] userGroups = ugi.getGroupNames(); -if (userGroups != null) { -for (String group : userGroups) { -grantedAuths.add(new SimpleGrantedAuthority(group)); +String[] groups = ugi.getGroupNames(); + +if(LOG.isDebugEnabled()) { +LOG.debug("UserGroupInformation userGroups=" + groups); +} + +if (groups != null) { +for
atlas git commit: ATLAS-2535: import-hive doesn't update entity already present in Atlas
Repository: atlas Updated Branches: refs/heads/master a1fd40682 -> 37d7b8b8f ATLAS-2535: import-hive doesn't update entity already present in Atlas Signed-off-by: Madhan Neethiraj <mad...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/37d7b8b8 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/37d7b8b8 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/37d7b8b8 Branch: refs/heads/master Commit: 37d7b8b8f72b906cb2c133f9b3d843009c92e408 Parents: a1fd406 Author: rmani <rm...@hortonworks.com> Authored: Thu Apr 5 17:37:50 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Fri Apr 6 10:06:23 2018 -0700 -- .../atlas/hive/bridge/HiveMetaStoreBridge.java | 61 1 file changed, 51 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/37d7b8b8/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java index 65cdd99..da44ff2 100755 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java @@ -67,6 +67,7 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.util.ArrayList; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; @@ -235,10 +236,6 @@ public class HiveMetaStoreBridge { return hiveClient; } -public AtlasClientV2 getAtlasClient() { -return atlasClientV2; -} - public boolean isConvertHdfsPathToLowerCase() { return convertHdfsPathToLowerCase; } @@ -458,6 +455,8 @@ public class HiveMetaStoreBridge { } } +clearRelationshipAttributes(ret); + return ret; } @@ -494,6 +493,8 @@ public class HiveMetaStoreBridge { } } +clearRelationshipAttributes(ret); + return ret; } @@ -589,10 +590,6 @@ public class HiveMetaStoreBridge { tableEntity.setAttribute(ATTRIBUTE_PARTITION_KEYS, BaseHiveEvent.getObjectIds(partKeys)); tableEntity.setAttribute(ATTRIBUTE_COLUMNS, BaseHiveEvent.getObjectIds(columns)); -if (MapUtils.isNotEmpty(table.getReferredEntities())) { -table.getReferredEntities().clear(); -} - table.addReferredEntity(database); table.addReferredEntity(sdEntity); @@ -608,6 +605,8 @@ public class HiveMetaStoreBridge { } } +table.setEntity(tableEntity); + return table; } @@ -758,10 +757,10 @@ public class HiveMetaStoreBridge { } private AtlasEntityWithExtInfo findEntity(final String typeName, final String qualifiedName) throws AtlasServiceException { -AtlasClientV2 atlasClientV2 = getAtlasClient(); +AtlasEntityWithExtInfo ret = null; try { -return atlasClientV2.getEntityByAttribute(typeName, Collections.singletonMap(ATTRIBUTE_QUALIFIED_NAME, qualifiedName)); +ret = atlasClientV2.getEntityByAttribute(typeName, Collections.singletonMap(ATTRIBUTE_QUALIFIED_NAME, qualifiedName)); } catch (AtlasServiceException e) { if(e.getStatus() == ClientResponse.Status.NOT_FOUND) { return null; @@ -769,6 +768,10 @@ public class HiveMetaStoreBridge { throw e; } + +clearRelationshipAttributes(ret); + +return ret; } private String getCreateTableString(Table table, String location){ @@ -879,4 +882,42 @@ public class HiveMetaStoreBridge { public static long getTableCreatedTime(Table table) { return table.getTTable().getCreateTime() * MILLIS_CONVERT_FACTOR; } + +private void clearRelationshipAttributes(AtlasEntitiesWithExtInfo entities) { +if (entities != null) { +if (entities.getEntities() != null) { +for (AtlasEntity entity : entities.getEntities()) { +clearRelationshipAttributes(entity);; +} +} + +if (entities.getReferredEntities() != null) { + clearRelationshipAttributes(entities.getReferredEntities().values()); +} +} +} + +private void clearRelationshipAttributes(AtlasEntityWithExtInfo entity) { +if (entity != null) { +clearRelationshipAttributes(entity.getEntity()); + +if (entity.getRefer
atlas git commit: ATLAS-2581: V2 Hive hook notifications - incorrect location for sd after moving table to a different database
Repository: atlas Updated Branches: refs/heads/master cabc1e550 -> 6c49542b8 ATLAS-2581: V2 Hive hook notifications - incorrect location for sd after moving table to a different database Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/6c49542b Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/6c49542b Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/6c49542b Branch: refs/heads/master Commit: 6c49542b8e95b248c4a4062f13e499e2ebea93bf Parents: cabc1e5 Author: Madhan Neethiraj <mad...@apache.org> Authored: Tue Apr 17 15:10:42 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Wed Apr 18 09:43:44 2018 -0700 -- .../hive/hook/events/AlterTableRename.java | 53 +--- .../atlas/util/AtlasGremlin3QueryProvider.java | 2 +- 2 files changed, 35 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/6c49542b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java index eac095c..35b0586 100644 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java @@ -72,6 +72,8 @@ public class AlterTableRename extends BaseHiveEvent { continue; } +newTable = getHive().getTable(newTable.getDbName(), newTable.getTableName()); + break; } } @@ -88,27 +90,27 @@ public class AlterTableRename extends BaseHiveEvent { // first update with oldTable info, so that the table will be created if it is not present in Atlas ret.add(new EntityUpdateRequestV2(getUserName(), new AtlasEntitiesWithExtInfo(oldTableEntity))); +AtlasEntityWithExtInfo renamedTableEntity = toTableEntity(newTable); + // update qualifiedName for all columns, partitionKeys, storageDesc -String newTableQualifiedName = getQualifiedName(newTable); +String renamedTableQualifiedName = (String) renamedTableEntity.getEntity().getAttribute(ATTRIBUTE_QUALIFIED_NAME); -renameColumns((List) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_COLUMNS), oldTableEntity, newTableQualifiedName, ret); -renameColumns((List) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_PARTITION_KEYS), oldTableEntity, newTableQualifiedName, ret); -renameStorageDesc((AtlasObjectId) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_STORAGEDESC), oldTableEntity, newTableQualifiedName, ret); +renameColumns((List) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_COLUMNS), oldTableEntity, renamedTableQualifiedName, ret); +renameColumns((List) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_PARTITION_KEYS), oldTableEntity, renamedTableQualifiedName, ret); +renameStorageDesc(oldTableEntity, renamedTableEntity, ret); -// update qualifiedName and other attributes (like params - which include lastModifiedTime, lastModifiedBy) of the table -AtlasEntityWithExtInfo newTableEntity = toTableEntity(newTable); +// remove columns, partitionKeys and storageDesc - as they have already been updated above +removeAttribute(renamedTableEntity, ATTRIBUTE_COLUMNS); +removeAttribute(renamedTableEntity, ATTRIBUTE_PARTITION_KEYS); +removeAttribute(renamedTableEntity, ATTRIBUTE_STORAGEDESC); // set previous name as the alias -newTableEntity.getEntity().setAttribute(ATTRIBUTE_ALIASES, Collections.singletonList(oldTable.getTableName())); - -// remove columns, partitionKeys and storageDesc - as they have already been updated above -removeAttribute(newTableEntity, ATTRIBUTE_COLUMNS); -removeAttribute(newTableEntity, ATTRIBUTE_PARTITION_KEYS); -removeAttribute(newTableEntity, ATTRIBUTE_STORAGEDESC); +renamedTableEntity.getEntity().setAttribute(ATTRIBUTE_ALIASES, Collections.singletonList(oldTable.getTableName())); AtlasObjectId oldTableId = new AtlasObjectId(oldTableEntity.getEntity().getTypeName(), ATTRIBUTE_QUALIFIED_NAME, oldTableEntity.getEntity().getAttribute(ATTRIBUTE_QUALIFIED_NAME)); -ret.add(new EntityPartialUpdateRequestV2(getUserName(), oldTableId, newTableEntity)); +// update qualifiedName and other attributes (like params - which include lastModifiedTime, lastModifiedBy) of the table +ret.add(new EntityPartial
atlas git commit: ATLAS-2581: V2 Hive hook notifications - incorrect location for sd after moving table to a different database
Repository: atlas Updated Branches: refs/heads/branch-0.8 27fad9f4a -> 1a02dfe56 ATLAS-2581: V2 Hive hook notifications - incorrect location for sd after moving table to a different database (cherry picked from commit fab76a4ea7b75167898577dfe02827b25df7a27a) Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/1a02dfe5 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/1a02dfe5 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/1a02dfe5 Branch: refs/heads/branch-0.8 Commit: 1a02dfe5642863ffe54a3903fdd499adc19099c4 Parents: 27fad9f Author: Madhan Neethiraj <mad...@apache.org> Authored: Tue Apr 17 15:10:42 2018 -0700 Committer: Madhan Neethiraj <mad...@apache.org> Committed: Tue Apr 17 18:43:38 2018 -0700 -- .../hive/hook/events/AlterTableRename.java | 53 +--- .../atlas/util/AtlasGremlin2QueryProvider.java | 2 +- 2 files changed, 35 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/atlas/blob/1a02dfe5/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java -- diff --git a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java index d5b9fc3..6ced340 100644 --- a/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java +++ b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/hook/events/AlterTableRename.java @@ -72,6 +72,8 @@ public class AlterTableRename extends BaseHiveEvent { continue; } +newTable = getHive().getTable(newTable.getDbName(), newTable.getTableName()); + break; } } @@ -88,27 +90,27 @@ public class AlterTableRename extends BaseHiveEvent { // first update with oldTable info, so that the table will be created if it is not present in Atlas ret.add(new EntityUpdateRequestV2(getUserName(), new AtlasEntitiesWithExtInfo(oldTableEntity))); +AtlasEntityWithExtInfo renamedTableEntity = toTableEntity(newTable); + // update qualifiedName for all columns, partitionKeys, storageDesc -String newTableQualifiedName = getQualifiedName(newTable); +String renamedTableQualifiedName = (String) renamedTableEntity.getEntity().getAttribute(ATTRIBUTE_QUALIFIED_NAME); -renameColumns((List) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_COLUMNS), oldTableEntity, newTableQualifiedName, ret); -renameColumns((List) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_PARTITION_KEYS), oldTableEntity, newTableQualifiedName, ret); -renameStorageDesc((AtlasObjectId) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_STORAGEDESC), oldTableEntity, newTableQualifiedName, ret); +renameColumns((List) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_COLUMNS), oldTableEntity, renamedTableQualifiedName, ret); +renameColumns((List) oldTableEntity.getEntity().getAttribute(ATTRIBUTE_PARTITION_KEYS), oldTableEntity, renamedTableQualifiedName, ret); +renameStorageDesc(oldTableEntity, renamedTableEntity, ret); -// update qualifiedName and other attributes (like params - which include lastModifiedTime, lastModifiedBy) of the table -AtlasEntityWithExtInfo newTableEntity = toTableEntity(newTable); +// remove columns, partitionKeys and storageDesc - as they have already been updated above +removeAttribute(renamedTableEntity, ATTRIBUTE_COLUMNS); +removeAttribute(renamedTableEntity, ATTRIBUTE_PARTITION_KEYS); +removeAttribute(renamedTableEntity, ATTRIBUTE_STORAGEDESC); // set previous name as the alias -newTableEntity.getEntity().setAttribute(ATTRIBUTE_ALIASES, Collections.singletonList(oldTable.getTableName())); - -// remove columns, partitionKeys and storageDesc - as they have already been updated above -removeAttribute(newTableEntity, ATTRIBUTE_COLUMNS); -removeAttribute(newTableEntity, ATTRIBUTE_PARTITION_KEYS); -removeAttribute(newTableEntity, ATTRIBUTE_STORAGEDESC); +renamedTableEntity.getEntity().setAttribute(ATTRIBUTE_ALIASES, Collections.singletonList(oldTable.getTableName())); AtlasObjectId oldTableId = new AtlasObjectId(oldTableEntity.getEntity().getTypeName(), ATTRIBUTE_QUALIFIED_NAME, oldTableEntity.getEntity().getAttribute(ATTRIBUTE_QUALIFIED_NAME)); -ret.add(new EntityPartialUpdateRequestV2(getUserName(), oldTableId, newTableEntity)); +// update qualifiedName and other attributes (like params - which include l