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 BE3B2200BF2 for ; Mon, 2 Jan 2017 12:36:51 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BCBBD160B30; Mon, 2 Jan 2017 11:36:51 +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 121B3160B21 for ; Mon, 2 Jan 2017 12:36:50 +0100 (CET) Received: (qmail 69650 invoked by uid 500); 2 Jan 2017 11:36:50 -0000 Mailing-List: contact dev-help@datafu.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@datafu.incubator.apache.org Delivered-To: mailing list dev@datafu.incubator.apache.org Received: (qmail 69634 invoked by uid 99); 2 Jan 2017 11:36:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jan 2017 11:36:49 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 98BB0C1980 for ; Mon, 2 Jan 2017 11:36:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.817 X-Spam-Level: X-Spam-Status: No, score=-3.817 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id d4T7Dn9YkE5X for ; Mon, 2 Jan 2017 11:36:47 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id 279E05FACC for ; Mon, 2 Jan 2017 11:36:47 +0000 (UTC) Received: (qmail 69431 invoked by uid 99); 2 Jan 2017 11:36:27 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jan 2017 11:36:27 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 4CA683108D5; Mon, 2 Jan 2017 11:36:27 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1907381743735746023==" MIME-Version: 1.0 Subject: Re: Review Request 55110: DATAFU-106 Test files are currently created in the subdirectory folder (e.g. datafu-pig/input*). For better organization, they should be created in a subdirectory. From: Piyush Sharma To: DataFu , Piyush Sharma , Eyal Allweil Date: Mon, 02 Jan 2017 11:36:27 -0000 Message-ID: <20170102113627.5941.90322@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Piyush Sharma X-ReviewGroup: DataFu X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/55110/ X-Sender: Piyush Sharma References: <20170102092943.5940.12327@reviews.apache.org> In-Reply-To: <20170102092943.5940.12327@reviews.apache.org> X-ReviewBoard-Diff-For: datafu-pig/src/test/java/datafu/test/pig/test_filesSubdir/TestFilesSubdirTest.java Reply-To: Piyush Sharma X-ReviewRequest-Repository: datafu archived-at: Mon, 02 Jan 2017 11:36:51 -0000 --===============1907381743735746023== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Jan. 2, 2017, 9:29 a.m., Eyal Allweil wrote: > > Hi Piyush, > > > > Thank you for your patch! It looks to me that it works fine - I ran our tests on Ubuntu, both from Eclipse and from the command line. > > > > I have two comments, one "real" and one just a typo: > > > > 1) From [this question](http://stackoverflow.com/a/840229/150992), it appears that changing the *user.dir* property in this way can be unpredictable - that it won't affect FileOutputStreams, for example. So although this works for our current tests (the FileOutputStream used in datafu.pig.linkanalysis.PageRank uses *File.createTempFile* instead of the working dir, so it's fine) I worry that this might not work in the future. Maybe add a comment about this in the *beforeClass* method? > > > > 2) "Location" is spelled as "loaction" in PigTests.java > > > > Cheers, > > Eyal Hi Eyal, Thank you for reviewing it. 1) I've actually tried doing it without changing user.dir. The pigtests don't actually work that way (for eg: LOAD 'input'... searches for the file in the working directory and it apparently deciphers it to be the same as that of the jvm). Hence, this was the only possible way to solve the issue that I could think of. I also went through that stackoverflow question whilst creating the patch to resolve my suspicions about the same. Actually, as even the accepted answer says it does affect the subsequent file creations, which happens via a call to writeLinesToFile defined in the PigTests.java which always creates a new file, deleting the existing one if necessary, and then writes to it. Now since writeLinesToFile also implicitly uses FileOutputStream (via a FileWriter object) to write to files just created in the new user.dir, it seemed like changing the working directory did actually affect the FileOutPutStreams, atleast as far as our project goes it did. Moreover the afterMethod resets the user.dir so hopefully there aren't any consequences at all. I can add some comment like "//Only some classes reflect the changes in working directory" or something like "//Developers are requested to just work with absoluteFiles and absolutePaths to avoid IOExceptions and such" but I feel it throws up a red flag unnecessarily, so should I ? 2) I will surely correct the typo, thank you. Cheerio, Piyush - Piyush ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/55110/#review160317 ----------------------------------------------------------- On Dec. 31, 2016, 10:47 a.m., Piyush Sharma wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/55110/ > ----------------------------------------------------------- > > (Updated Dec. 31, 2016, 10:47 a.m.) > > > Review request for DataFu. > > > Repository: datafu > > > Description > ------- > > DATAFU-106: Test files are currently created in the subdirectory folder (e.g. datafu-pig/input*). For better organization, they should be created in a subdirectory. This also makes it easier to exclude them all with gitignore. > (issue: https://issues.apache.org/jira/browse/DATAFU-106) > > > Diffs > ----- > > datafu-pig/src/test/java/datafu/test/pig/PigTests.java d1d6fcc > datafu-pig/src/test/java/datafu/test/pig/test_filesSubdir/TestFilesSubdirTest.java PRE-CREATION > > Diff: https://reviews.apache.org/r/55110/diff/ > > > Testing > ------- > > unit tests passed. > > > Thanks, > > Piyush Sharma > > --===============1907381743735746023==--