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 EC4EA200B17 for ; Tue, 7 Jun 2016 00:53:57 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E9454160A55; Mon, 6 Jun 2016 22:53:57 +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 3D11B160A24 for ; Tue, 7 Jun 2016 00:53:57 +0200 (CEST) Received: (qmail 41704 invoked by uid 500); 6 Jun 2016 22:53:56 -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 41693 invoked by uid 99); 6 Jun 2016 22:53:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jun 2016 22:53:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C6CF81A0CF6 for ; Mon, 6 Jun 2016 22:53:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.195 X-Spam-Level: X-Spam-Status: No, score=-3.195 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, 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 mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ic5tv1CUT_cY for ; Mon, 6 Jun 2016 22:53:54 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id 37B7B5F3DA for ; Mon, 6 Jun 2016 22:53:53 +0000 (UTC) Received: (qmail 41669 invoked by uid 99); 6 Jun 2016 22:53:52 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Jun 2016 22:53:52 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 505CE2C6DFE; Mon, 6 Jun 2016 22:53:51 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============3823289866291226721==" MIME-Version: 1.0 Subject: Re: Review Request 47658: ATLAS-499: Update reverse references From: David Kantor To: Shwetha GS Cc: atlas , David Kantor Date: Mon, 06 Jun 2016 22:53:51 -0000 Message-ID: <20160606225351.8185.36223@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: David Kantor X-ReviewGroup: atlas X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/47658/ X-Sender: David Kantor References: <20160603232515.1106.12734@reviews.apache.org> In-Reply-To: <20160603232515.1106.12734@reviews.apache.org> X-ReviewBoard-Diff-For: repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateSoftDeleteTest.java X-ReviewBoard-Diff-For: repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateHardDeleteTest.java X-ReviewBoard-Diff-For: repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateTestBase.java Reply-To: David Kantor X-ReviewRequest-Repository: atlas archived-at: Mon, 06 Jun 2016 22:53:58 -0000 --===============3823289866291226721== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On June 3, 2016, 11:25 p.m., Suma Shivaprasad wrote: > > repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java, line 785 > > > > > > do we need the HashSet since contains and all will both O(n) > > David Kantor wrote: > HashSet.contains is O(1). I am using the HashSet to avoid the O(n) performance of ArrayList.contains. For a very small data set, the difference between HashSet.contains and ArrayList.contains is probably negligible. But in my experience doing Java performance analysis on our legacy metadata repository, ArrayList.contains() often ended up being a major hot spot when enforcing uniqueness for high cardinality references. > > Suma Shivaprasad wrote: > I was just saying that adding all the list elemnts to the Hashset is itself O(n) so it might be better to skip creating the hashset. Leave it up to you not a major issue to fix. Thanks very much for clarifying that, I agree and have addressed the comment. - David ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/47658/#review136132 ----------------------------------------------------------- On June 6, 2016, 10:53 p.m., David Kantor wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/47658/ > ----------------------------------------------------------- > > (Updated June 6, 2016, 10:53 p.m.) > > > Review request for atlas and Shwetha GS. > > > Bugs: ATLAS-499 > https://issues.apache.org/jira/browse/ATLAS-499 > > > Repository: atlas > > > Description > ------- > > ATLAS-499: Automatically update inverse references to prevent repository corruption from unbalanced references. > > > Diffs > ----- > > repository/src/main/java/org/apache/atlas/repository/graph/DeleteHandler.java 91f9bd008a6939dfe78656f5c1845637a30ee9eb > repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java 4f6d0118072380342f5ea302d0aaf7902784849a > repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java 4c1f5591f4adead41c3336e64b0bc956836f7edb > repository/src/test/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepositoryDeleteTestBase.java 449e066a167ba4546b118a77c8e3de5fd99f077b > repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateHardDeleteTest.java PRE-CREATION > repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateSoftDeleteTest.java PRE-CREATION > repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateTestBase.java PRE-CREATION > > Diff: https://reviews.apache.org/r/47658/diff/ > > > Testing > ------- > > Ran all unit and integration tests with no regressions. > > > Thanks, > > David Kantor > > --===============3823289866291226721==--