Return-Path: X-Original-To: apmail-aurora-reviews-archive@minotaur.apache.org Delivered-To: apmail-aurora-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 95DA617D40 for ; Fri, 11 Sep 2015 00:24:56 +0000 (UTC) Received: (qmail 13923 invoked by uid 500); 11 Sep 2015 00:24:56 -0000 Delivered-To: apmail-aurora-reviews-archive@aurora.apache.org Received: (qmail 13864 invoked by uid 500); 11 Sep 2015 00:24:56 -0000 Mailing-List: contact reviews-help@aurora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@aurora.apache.org Delivered-To: mailing list reviews@aurora.apache.org Received: (qmail 13840 invoked by uid 99); 11 Sep 2015 00:24:56 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Sep 2015 00:24:56 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 6F14D272AE6; Fri, 11 Sep 2015 00:24:55 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============0466877072425994007==" MIME-Version: 1.0 Subject: Re: Review Request 38112: Alter thrift wrapper generator to use default primitive values and empty collections. From: "Maxim Khutornenko" To: "Maxim Khutornenko" , "Kevin Sweeney" Cc: "Bill Farner" , "Aurora" Date: Fri, 11 Sep 2015 00:24:55 -0000 Message-ID: <20150911002455.1695.84807@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Maxim Khutornenko" X-ReviewGroup: Aurora X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/38112/ X-Sender: "Maxim Khutornenko" References: <20150908232628.12750.28338@reviews.apache.org> In-Reply-To: <20150908232628.12750.28338@reviews.apache.org> Reply-To: "Maxim Khutornenko" X-ReviewRequest-Repository: aurora --===============0466877072425994007== 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/38112/#review98503 ----------------------------------------------------------- Ship it! Any plans to get rid of mutable thrift objects in mybatis mappers? src/test/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessorTest.java (line 201) typo - Maxim Khutornenko On Sept. 8, 2015, 11:26 p.m., Bill Farner wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/38112/ > ----------------------------------------------------------- > > (Updated Sept. 8, 2015, 11:26 p.m.) > > > Review request for Aurora, Kevin Sweeney and Maxim Khutornenko. > > > Bugs: AURORA-1476 > https://issues.apache.org/jira/browse/AURORA-1476 > > > Repository: aurora > > > Description > ------- > > Alter thrift wrapper generator to use default primitive values and empty collections. > > Reviewers - please see my self-review commentary in specific parts of the patch. The biggest shift with this change is that an impedance mismatch that existed when inserting/fetching a record from the database is now lifted to the thrift wrapper layer. > > This means the following test is not guaranteed to pass: > ```java > TaskConfig original = new TaskConfig(...); > assertEquals(original, ITaskConfig.build(original).newBuilder()); // won't always pass > ``` > > Most specifically, the wrapped/upwrapped `TaskConfig` will have null collections replaced with empty ones, and will not honor set/unset flags for primitives. The best practice, therefore, should be to treat our wrapper classes as the canonical form, and only deal with the underlying thrift types when absolutely necessary. > > > Diffs > ----- > > src/main/java/org/apache/aurora/scheduler/configuration/ConfigurationManager.java a952797315a3421695748f09b9a6abb552cbb668 > src/main/java/org/apache/aurora/scheduler/quota/QuotaManager.java 8787aeaa6655cfab1e0a6d5719f9e08a89df7631 > src/main/java/org/apache/aurora/scheduler/storage/StorageBackfill.java f1b167bacbfce4f753fc0bbb2b860e3024b9843f > src/main/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterface.java e12ad3e3868472ba84e379986bd1aa97bca42ffe > src/main/python/apache/aurora/tools/java/thrift_wrapper_codegen.py b5f2bc9e54b525a6a782d8873c9112f6496cd3f2 > src/test/java/org/apache/aurora/scheduler/app/SchedulerIT.java b2ec13f40c12e5ee5663f4465734d6a80f3587cd > src/test/java/org/apache/aurora/scheduler/configuration/ConfigurationManagerTest.java f3b62cc957186bc9673060830572bc1cc073ac49 > src/test/java/org/apache/aurora/scheduler/filter/SchedulingFilterImplTest.java 5d8bd1b72927786df95c972df64d68c78f25dad0 > src/test/java/org/apache/aurora/scheduler/http/api/ApiBetaTest.java 08e1284ac1ef08b7649ed83df0a55be04cfeb88f > src/test/java/org/apache/aurora/scheduler/preemptor/PendingTaskProcessorTest.java 9213b88ab4ce5063ca0fb055851ae5632616155e > src/test/java/org/apache/aurora/scheduler/quota/QuotaManagerImplTest.java db60cd21d06d636505202bac7277a13dc24d46e6 > src/test/java/org/apache/aurora/scheduler/storage/AbstractTaskStoreTest.java 295974a9f97e020dce11474d500a1bcd40d9f5d5 > src/test/java/org/apache/aurora/scheduler/storage/StorageBackfillTest.java 7ccc273204d20c84bbb576958e832b6f4a29f607 > src/test/java/org/apache/aurora/scheduler/storage/db/DbAttributeStoreTest.java 0e0a847f46c4d1d833a3c610e8a5f752f368c0d5 > src/test/java/org/apache/aurora/scheduler/storage/db/DbJobUpdateStoreTest.java 3e78c097a7a9252ded8a4a7fc6609ecf5d61c5b5 > src/test/java/org/apache/aurora/scheduler/thrift/Fixtures.java e0110e7ebe631b7b66b2341cedc10490da00a2ab > src/test/java/org/apache/aurora/scheduler/thrift/ReadOnlySchedulerImplTest.java 4d4e752088f7dca99675cc66782ae046bbd516d6 > src/test/java/org/apache/aurora/scheduler/thrift/SchedulerThriftInterfaceTest.java 4685aa157be77502ad0e4e648ad333ee286f3de5 > > Diff: https://reviews.apache.org/r/38112/diff/ > > > Testing > ------- > > End-to-end tests pass > > > Thanks, > > Bill Farner > > --===============0466877072425994007==--