Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B2BCA200B84 for ; Tue, 20 Sep 2016 15:11:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B13C1160AC5; Tue, 20 Sep 2016 13:11:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CE14F160AA9 for ; Tue, 20 Sep 2016 15:11:47 +0200 (CEST) Received: (qmail 60062 invoked by uid 500); 20 Sep 2016 13:11:47 -0000 Mailing-List: contact dev-help@atlas.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.incubator.apache.org Delivered-To: mailing list dev@atlas.incubator.apache.org Received: (qmail 60051 invoked by uid 99); 20 Sep 2016 13:11:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2016 13:11:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 5B896C0D72 for ; Tue, 20 Sep 2016 13:11:46 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.445 X-Spam-Level: X-Spam-Status: No, score=-3.445 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id xKc3PP7VYza0 for ; Tue, 20 Sep 2016 13:11:44 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 19E095FE34 for ; Tue, 20 Sep 2016 13:11:42 +0000 (UTC) Received: (qmail 60017 invoked by uid 99); 20 Sep 2016 13:11:42 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Sep 2016 13:11:42 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id E28942711BE; Tue, 20 Sep 2016 13:11:41 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============5070774115633539494==" MIME-Version: 1.0 Subject: Re: Review Request 51939: Framework to apply updates to types in the type-system From: David Radley To: Madhan Neethiraj , Shwetha GS Cc: David Radley , atlas , Sarath Kumar Subramanian Date: Tue, 20 Sep 2016 13:11:41 -0000 Message-ID: <20160920131141.1654.47942@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: David Radley X-ReviewGroup: atlas X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/51939/ X-Sender: David Radley References: <20160919181056.25295.82847@reviews.apache.org> In-Reply-To: <20160919181056.25295.82847@reviews.apache.org> X-ReviewBoard-Diff-For: repository/src/main/java/org/apache/atlas/services/AddAttributePatch.java X-ReviewBoard-Diff-For: repository/src/main/java/org/apache/atlas/services/AtlasTypePatch.java Reply-To: David Radley X-ReviewRequest-Repository: atlas archived-at: Tue, 20 Sep 2016 13:11:48 -0000 --===============5070774115633539494== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/51939/#review149652 ----------------------------------------------------------- It looks like this is a way of updating the versions of types using a local file on the Atlas server. I think we should be SaaS and expose this sort of functionality primarily as a REST API, otherwise this could become a barrier to integration. - David Radley On Sept. 19, 2016, 6:10 p.m., Sarath Kumar Subramanian wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/51939/ > ----------------------------------------------------------- > > (Updated Sept. 19, 2016, 6:10 p.m.) > > > Review request for atlas, Madhan Neethiraj, Shwetha GS, and Suma Shivaprasad. > > > Bugs: ATLAS-1174 > https://issues.apache.org/jira/browse/ATLAS-1174 > > > Repository: atlas > > > Description > ------- > > 1. Introduce "version" attribute to all types in the type-system, this helps to track changes made to the default types (hive, sqoop, falcon and storm types) and user created types. If version is not mentioned during creation of a type, default version "1.0" is assigned (optional attribute). > 2. Using the version attributed for types, introduce a patch framework for type system. This framework applies patches to a type using its version number and can be used during upgrade - add new attributes to an existing types and it will be run during atlas startup. > The sequence of steps: > a. During atlas startup, check $ATLAS_HOME/models/patches directory for any available patch files (json files). If there any patch files handle them. > b. Sample patch json file looks like: > { > "patches": [ > { > "action": "ADD_ATTRIBUTE", > "typeName": "hive_column", > "applyToVersion": "1.0", > "updateToVersion": "2.0", > "actionParams": [ > { "name": "position", "dataTypeName": "int", "multiplicity": "optional", "isComposite": false, "isUnique": false, "isIndexable": false, "reverseAttributeName": null } > ] > } ] > } > c. The framework updates the type in "typeName" for the matching version number and after applying the patch, update the version to the one mentioned in "updateToVersion" > d. The json file can have more than one action (array of actions). > e. There can be multiple patch json files in the directory and are applied in the sort order of the filename. eg: > 001-hive_column_add_position.json > 002-hive_column_add_anotherattribute.json > > > Diffs > ----- > > common/src/main/java/org/apache/atlas/repository/Constants.java d7f9c89 > repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java a94d157 > repository/src/main/java/org/apache/atlas/services/AddAttributePatch.java PRE-CREATION > repository/src/main/java/org/apache/atlas/services/AtlasTypePatch.java PRE-CREATION > repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java 6a937f4 > typesystem/src/main/java/org/apache/atlas/typesystem/types/AbstractDataType.java fad091d > typesystem/src/main/java/org/apache/atlas/typesystem/types/ClassType.java c56987a > typesystem/src/main/java/org/apache/atlas/typesystem/types/EnumType.java bdd0a13 > typesystem/src/main/java/org/apache/atlas/typesystem/types/EnumTypeDefinition.java 6340615 > typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalType.java 7224699 > typesystem/src/main/java/org/apache/atlas/typesystem/types/HierarchicalTypeDefinition.java 9a299f0 > typesystem/src/main/java/org/apache/atlas/typesystem/types/IDataType.java 85ddee7 > typesystem/src/main/java/org/apache/atlas/typesystem/types/StructType.java 6f40c1d > typesystem/src/main/java/org/apache/atlas/typesystem/types/StructTypeDefinition.java f1ce1b7 > typesystem/src/main/java/org/apache/atlas/typesystem/types/TraitType.java f23bf5b > typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java 70ba89b > typesystem/src/main/java/org/apache/atlas/typesystem/types/utils/TypesUtil.java ef8448d > typesystem/src/main/scala/org/apache/atlas/typesystem/json/TypesSerialization.scala 5618938 > > Diff: https://reviews.apache.org/r/51939/diff/ > > > Testing > ------- > > > Thanks, > > Sarath Kumar Subramanian > > --===============5070774115633539494==--