You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Ajay Kumar (JIRA)" <ji...@apache.org> on 2018/03/09 18:47:00 UTC

[jira] [Comment Edited] (HDFS-13252) Code refactoring: Remove Diff.ListType

    [ https://issues.apache.org/jira/browse/HDFS-13252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16393351#comment-16393351 ] 

Ajay Kumar edited comment on HDFS-13252 at 3/9/18 6:46 PM:
-----------------------------------------------------------

[~szetszwo], thanks for working on this. Patch looks good to me. Seems new function {{Diff#insertCreated}} & {{Diff#insertDeleted}} is doing two things.
* asserting that element to be inserted is not already present
* actual insert
To reflect this does renaming them to something like {{insertCreatedIfNotPresent}} and {{insertDeletedIfNotPresent}} makes more sense?
 Also javadoc for {{Diff#insertCreated}} needs to be updated. 
{code} Insert the given element to the created/deleted list.{code} to something like 
{code} Insert the given element to the created list only if not present already.{code}


was (Author: ajayydv):
[~szetszwo], thanks for working on this. Patch looks good to me. Seems new function {{Diff#insertCreated}} & {{Diff#insertDeleted}} is doing two things.
* asserting that element to be inserted is not already present
* actual insert
To reflect this does renaming them to something like {{insertCreatedIfNotPresent}} and {{insertDeletedIfNotPresent}} makes more sense?
 Also javadoc for {{Diff#insertCreated}} needs to be updated. 
{code} Insert the given element to the created/deleted list.{code} to 
{code} Insert the given element to the created list only if not present already.{code}

> Code refactoring: Remove Diff.ListType
> --------------------------------------
>
>                 Key: HDFS-13252
>                 URL: https://issues.apache.org/jira/browse/HDFS-13252
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: snapshots
>            Reporter: Tsz Wo Nicholas Sze
>            Assignee: Tsz Wo Nicholas Sze
>            Priority: Major
>         Attachments: h13252_20170308.patch
>
>
> In Diff, there are only two lists, created and deleted.  It is easier to trace the code if the methods have the list type in the method name, instead of passing a ListType parameter.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org