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

Wei-Chiu Chuang commented on HDFS-12518:
----------------------------------------

Hi [~xiaochen] thanks for the patch. I gave it an initial review, and overall 
seems good.

A few cosmetic comments:
* move the following code into a helper method and reuse it in the while loop.
{code:title= ReencryptionHandler#throttle}
    synchronized (this) {
              for (ZoneSubmissionTracker zst : submissions.values()) {
                totalTasks += zst.getTasks().size();
              }
            }           
    }
{code}
* rename testCancelFuture(). Now that this method becomes an helper, it would 
be more readable to remove the 'test' prefix, just call it cancelFuture(), or 
cancelReencryption().

Also what about keeping submissions a ConcurrentHashMap? That way you wouldn't 
need to synchronize every access to that object, but just a few of them.

> Re-encryption should handle task cancellation and progress better
> -----------------------------------------------------------------
>
>                 Key: HDFS-12518
>                 URL: https://issues.apache.org/jira/browse/HDFS-12518
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: encryption
>    Affects Versions: 3.0.0-beta1
>            Reporter: Xiao Chen
>            Assignee: Xiao Chen
>         Attachments: HDFS-12518.01.patch
>
>
> Re-encryption should handle task cancellation and progress tracking better in 
> general.
> In a recent internal report, a canceled re-encryption could lead to the 
> progress of the zone being 'Processing' forever. Sending a new cancel command 
> would make it complete, but new re-encryptions for the same zone wouldn't 
> work because the canceled future is not removed.
> This jira proposes to fix that, and enhance the currently handling so new 
> command would start from a clean state.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to