Hadoop Common
  1. Hadoop Common
  2. HADOOP-8819

Should use && instead of & in a few places in FTPFileSystem,FTPInputStream,S3InputStream,ViewFileSystem,ViewFs

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-alpha, 3.0.0
    • Fix Version/s: 1.2.0, 2.0.3-alpha, 0.23.5
    • Component/s: fs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Should use && instead of & in a few places in FTPFileSystem,FTPInputStream,S3InputStream,ViewFileSystem,ViewFs.

      1. HADOOP-8819.branch-1.patch
        2 kB
        Brandon Li
      2. HADOOP-8819.patch
        4 kB
        Brandon Li

        Activity

        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12545324/HADOOP-8819.patch
        against trunk revision .

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        -1 findbugs. The patch appears to introduce 1 new Findbugs (version 1.3.9) warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        -1 core tests. The patch failed these unit tests in hadoop-common-project/hadoop-common:

        org.apache.hadoop.ha.TestZKFailoverController

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/1475//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/1475//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html
        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/1475//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12545324/HADOOP-8819.patch against trunk revision . +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The javadoc tool did not generate any warning messages. +1 eclipse:eclipse. The patch built with eclipse:eclipse. -1 findbugs. The patch appears to introduce 1 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed these unit tests in hadoop-common-project/hadoop-common: org.apache.hadoop.ha.TestZKFailoverController +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/1475//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HADOOP-Build/1475//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-common.html Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/1475//console This message is automatically generated.
        Hide
        Suresh Srinivas added a comment -

        +1 for the change.

        Show
        Suresh Srinivas added a comment - +1 for the change.
        Hide
        Suresh Srinivas added a comment -

        I will commit after SVN maintenance is done to trunk and 2.0.

        Is there a similar problem in 1.x as well?

        Show
        Suresh Srinivas added a comment - I will commit after SVN maintenance is done to trunk and 2.0. Is there a similar problem in 1.x as well?
        Hide
        Suresh Srinivas added a comment -

        I committed the patch trunk and branch-2. Keeping it open to see if this patch is also needed for 1.x.

        Show
        Suresh Srinivas added a comment - I committed the patch trunk and branch-2. Keeping it open to see if this patch is also needed for 1.x.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #2736 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2736/)
        HADOOP-8819. Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451)

        Result = SUCCESS
        suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #2736 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2736/ ) HADOOP-8819 . Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451) Result = SUCCESS suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #2799 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2799/)
        HADOOP-8819. Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451)

        Result = SUCCESS
        suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #2799 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2799/ ) HADOOP-8819 . Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451) Result = SUCCESS suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Hide
        Aaron T. Myers added a comment -

        Note that the change in FTPFileSystem actually is a behavior change, and perhaps an incompatible one. All of the rest of these changes seem harmless, but that one seems a little suspect.

        Show
        Aaron T. Myers added a comment - Note that the change in FTPFileSystem actually is a behavior change, and perhaps an incompatible one. All of the rest of these changes seem harmless, but that one seems a little suspect.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #2760 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2760/)
        HADOOP-8819. Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451)

        Result = FAILURE
        suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #2760 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2760/ ) HADOOP-8819 . Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451) Result = FAILURE suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Hide
        Suresh Srinivas added a comment -

        Note that the change in FTPFileSystem actually is a behavior change, and perhaps an incompatible one. All of the rest of these changes seem harmless, but that one seems a little suspect.

              if (created) {
                String parentDir = parent.toUri().getPath();
                client.changeWorkingDirectory(parentDir);
                created = created && client.makeDirectory(pathName);
              }
        

        In this code if created is true it enters the if condition and then executes client.makeDirectory(). If created is false that part of the code is not entered.

        Aaron, can you add details on why this would change the behavior?

        Show
        Suresh Srinivas added a comment - Note that the change in FTPFileSystem actually is a behavior change, and perhaps an incompatible one. All of the rest of these changes seem harmless, but that one seems a little suspect. if (created) { String parentDir = parent.toUri().getPath(); client.changeWorkingDirectory(parentDir); created = created && client.makeDirectory(pathName); } In this code if created is true it enters the if condition and then executes client.makeDirectory(). If created is false that part of the code is not entered. Aaron, can you add details on why this would change the behavior?
        Hide
        Aaron T. Myers added a comment -

        Aha! I misread it. You're right - it won't change the behavior at all. Sorry about that.

        That would imply, then, that we could completely get rid of the "created &&", right?

        Show
        Aaron T. Myers added a comment - Aha! I misread it. You're right - it won't change the behavior at all. Sorry about that. That would imply, then, that we could completely get rid of the "created &&", right?
        Hide
        Suresh Srinivas added a comment -

        On the second reading of the code I thought of it - too late

        Show
        Suresh Srinivas added a comment - On the second reading of the code I thought of it - too late
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #1168 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1168/)
        HADOOP-8819. Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451)

        Result = SUCCESS
        suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1168 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1168/ ) HADOOP-8819 . Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451) Result = SUCCESS suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1199 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1199/)
        HADOOP-8819. Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451)

        Result = SUCCESS
        suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451
        Files :

        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
        • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1199 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1199/ ) HADOOP-8819 . Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1386451) Result = SUCCESS suresh : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1386451 Files : /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Hide
        Brandon Li added a comment -

        The same problem exists in branch-1 (except viewfs). Uploaded a branch-1 patch. Removed "created &&" this time.

        Show
        Brandon Li added a comment - The same problem exists in branch-1 (except viewfs). Uploaded a branch-1 patch. Removed "created &&" this time.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12545438/HADOOP-8819.branch-1.patch
        against trunk revision .

        -1 patch. The patch command could not apply the patch.

        Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/1481//console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12545438/HADOOP-8819.branch-1.patch against trunk revision . -1 patch. The patch command could not apply the patch. Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/1481//console This message is automatically generated.
        Hide
        Suresh Srinivas added a comment -

        +1 for the the branch-1 patch.

        Thank you Brandon!

        Show
        Suresh Srinivas added a comment - +1 for the the branch-1 patch. Thank you Brandon!
        Hide
        Robert Joseph Evans added a comment -

        I just pulled this into branch-0.23

        Show
        Robert Joseph Evans added a comment - I just pulled this into branch-0.23
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-0.23-Build #392 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/392/)
        svn merge -c 1386451 FIXES: HADOOP-8819. Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1392465)

        Result = UNSTABLE
        bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1392465
        Files :

        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java
        • /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-0.23-Build #392 (See https://builds.apache.org/job/Hadoop-Hdfs-0.23-Build/392/ ) svn merge -c 1386451 FIXES: HADOOP-8819 . Incorrectly & is used instead of && in some file system implementations. Contributed by Brandon Li. (Revision 1392465) Result = UNSTABLE bobby : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1392465 Files : /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPFileSystem.java /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/ftp/FTPInputStream.java /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/s3/S3InputStream.java /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFileSystem.java /hadoop/common/branches/branch-0.23/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/viewfs/ViewFs.java

          People

          • Assignee:
            Brandon Li
            Reporter:
            Brandon Li
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development