FAQ
FSDirectory.renameTo(String, String) has unclear logic around unprotectedRenameTo() call
----------------------------------------------------------------------------------------

Key: HADOOP-5868
URL: https://issues.apache.org/jira/browse/HADOOP-5868
Project: Hadoop Core
Issue Type: Improvement
Components: dfs
Affects Versions: 0.20.0
Reporter: Konstantin Boudnik
Assignee: Konstantin Boudnik
Priority: Minor


Current implementation of renameTo(String, String) has this piece of the code at the end:

...
if (!unprotectedRenameTo(src, dst, now))
return false;
fsImage.getEditLog().logRename(src, dst, now);
return true;
}
The logic of the code isn't very clear from a very sight. A slight modification is recommended to make it more readable.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Search Discussions

  • Konstantin Boudnik (JIRA) at May 19, 2009 at 3:19 am
    [ https://issues.apache.org/jira/browse/HADOOP-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710596#action_12710596 ]

    Konstantin Boudnik commented on HADOOP-5868:
    --------------------------------------------

    Also, it turns out that this file has 150+ javac warnings which could be fixed at the same time.
    FSDirectory.renameTo(String, String) has unclear logic around unprotectedRenameTo() call
    ----------------------------------------------------------------------------------------

    Key: HADOOP-5868
    URL: https://issues.apache.org/jira/browse/HADOOP-5868
    Project: Hadoop Core
    Issue Type: Improvement
    Components: dfs
    Affects Versions: 0.20.0
    Reporter: Konstantin Boudnik
    Assignee: Konstantin Boudnik
    Priority: Minor

    Current implementation of renameTo(String, String) has this piece of the code at the end:
    ...
    if (!unprotectedRenameTo(src, dst, now))
    return false;
    fsImage.getEditLog().logRename(src, dst, now);
    return true;
    }
    The logic of the code isn't very clear from a very sight. A slight modification is recommended to make it more readable.
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Konstantin Boudnik (JIRA) at May 19, 2009 at 3:21 am
    [ https://issues.apache.org/jira/browse/HADOOP-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Konstantin Boudnik updated HADOOP-5868:
    ---------------------------------------

    Attachment: HADOOP-5868.patch

    Here's the patch for the first part of the issue.
    Logic for <true> and <false> branches is grouped to corresponding branches
    FSDirectory.renameTo(String, String) has unclear logic around unprotectedRenameTo() call
    ----------------------------------------------------------------------------------------

    Key: HADOOP-5868
    URL: https://issues.apache.org/jira/browse/HADOOP-5868
    Project: Hadoop Core
    Issue Type: Improvement
    Components: dfs
    Affects Versions: 0.20.0
    Reporter: Konstantin Boudnik
    Assignee: Konstantin Boudnik
    Priority: Minor
    Attachments: HADOOP-5868.patch


    Current implementation of renameTo(String, String) has this piece of the code at the end:
    ...
    if (!unprotectedRenameTo(src, dst, now))
    return false;
    fsImage.getEditLog().logRename(src, dst, now);
    return true;
    }
    The logic of the code isn't very clear from a very sight. A slight modification is recommended to make it more readable.
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Konstantin Boudnik (JIRA) at May 19, 2009 at 3:23 am
    [ https://issues.apache.org/jira/browse/HADOOP-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Work on HADOOP-5868 started by Konstantin Boudnik.
    FSDirectory.renameTo(String, String) has unclear logic around unprotectedRenameTo() call
    ----------------------------------------------------------------------------------------

    Key: HADOOP-5868
    URL: https://issues.apache.org/jira/browse/HADOOP-5868
    Project: Hadoop Core
    Issue Type: Improvement
    Components: dfs
    Affects Versions: 0.20.0
    Reporter: Konstantin Boudnik
    Assignee: Konstantin Boudnik
    Priority: Minor
    Attachments: HADOOP-5868.patch


    Current implementation of renameTo(String, String) has this piece of the code at the end:
    ...
    if (!unprotectedRenameTo(src, dst, now))
    return false;
    fsImage.getEditLog().logRename(src, dst, now);
    return true;
    }
    The logic of the code isn't very clear from a very sight. A slight modification is recommended to make it more readable.
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Konstantin Boudnik (JIRA) at May 19, 2009 at 3:35 am
    [ https://issues.apache.org/jira/browse/HADOOP-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12710598#action_12710598 ]

    Konstantin Boudnik commented on HADOOP-5868:
    --------------------------------------------

    On the second though it seems like a patch which is fixing that many of warnings shouldn't be confused with this style improvements one.
    FSDirectory.renameTo(String, String) has unclear logic around unprotectedRenameTo() call
    ----------------------------------------------------------------------------------------

    Key: HADOOP-5868
    URL: https://issues.apache.org/jira/browse/HADOOP-5868
    Project: Hadoop Core
    Issue Type: Improvement
    Components: dfs
    Affects Versions: 0.20.0
    Reporter: Konstantin Boudnik
    Assignee: Konstantin Boudnik
    Priority: Minor
    Attachments: HADOOP-5868.patch


    Current implementation of renameTo(String, String) has this piece of the code at the end:
    ...
    if (!unprotectedRenameTo(src, dst, now))
    return false;
    fsImage.getEditLog().logRename(src, dst, now);
    return true;
    }
    The logic of the code isn't very clear from a very sight. A slight modification is recommended to make it more readable.
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Konstantin Boudnik (JIRA) at May 19, 2009 at 3:35 am
    [ https://issues.apache.org/jira/browse/HADOOP-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Konstantin Boudnik updated HADOOP-5868:
    ---------------------------------------

    Status: Patch Available (was: In Progress)

    To improve the readability of some methods
    FSDirectory.renameTo(String, String) has unclear logic around unprotectedRenameTo() call
    ----------------------------------------------------------------------------------------

    Key: HADOOP-5868
    URL: https://issues.apache.org/jira/browse/HADOOP-5868
    Project: Hadoop Core
    Issue Type: Improvement
    Components: dfs
    Affects Versions: 0.20.0
    Reporter: Konstantin Boudnik
    Assignee: Konstantin Boudnik
    Priority: Minor
    Attachments: HADOOP-5868.patch


    Current implementation of renameTo(String, String) has this piece of the code at the end:
    ...
    if (!unprotectedRenameTo(src, dst, now))
    return false;
    fsImage.getEditLog().logRename(src, dst, now);
    return true;
    }
    The logic of the code isn't very clear from a very sight. A slight modification is recommended to make it more readable.
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
  • Konstantin Boudnik (JIRA) at May 20, 2009 at 9:22 pm
    [ https://issues.apache.org/jira/browse/HADOOP-5868?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

    Konstantin Boudnik updated HADOOP-5868:
    ---------------------------------------


    It seems like no one is in favor of making this piece clearer :-) Cancelling
    FSDirectory.renameTo(String, String) has unclear logic around unprotectedRenameTo() call
    ----------------------------------------------------------------------------------------

    Key: HADOOP-5868
    URL: https://issues.apache.org/jira/browse/HADOOP-5868
    Project: Hadoop Core
    Issue Type: Improvement
    Affects Versions: 0.20.0
    Reporter: Konstantin Boudnik
    Assignee: Konstantin Boudnik
    Priority: Minor

    Current implementation of renameTo(String, String) has this piece of the code at the end:
    ...
    if (!unprotectedRenameTo(src, dst, now))
    return false;
    fsImage.getEditLog().logRename(src, dst, now);
    return true;
    }
    The logic of the code isn't very clear from a very sight. A slight modification is recommended to make it more readable.
    --
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommon-dev @
categorieshadoop
postedMay 19, '09 at 3:15a
activeMay 20, '09 at 9:22p
posts7
users1
websitehadoop.apache.org...
irc#hadoop

1 user in discussion

Konstantin Boudnik (JIRA): 7 posts

People

Translate

site design / logo © 2022 Grokbase