[
https://issues.apache.org/jira/browse/HDFS-14860?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16955439#comment-16955439
]
Ayush Saxena commented on HDFS-14860:
-------------------------------------
Thanx [~belugabehr] for the patch. Overall Looks good. Minor doubt with this
change :
{code:java}
233 private void clearPathIds() {
234 final Collection<Long> paths = new ArrayList<>();
235 pathsToBeTraveresed.drainTo(paths);
236 for (Long trackId : paths) {
237 try {
238 namesystem.removeXattr(trackId,
239 HdfsServerConstants.XATTR_SATISFY_STORAGE_POLICY);
240 } catch (IOException e) {
241 LOG.debug("Failed to remove sps xatttr!", e);
258 } 242 }
{code}
Can't we do this. instead creating new arrayList :
{code:java}
private void clearPathIds() {
while (!pathsToBeTraveresed.isEmpty())
try {
namesystem.removeXattr(pathsToBeTraveresed.remove(),
HdfsServerConstants.XATTR_SATISFY_STORAGE_POLICY);
} catch (IOException e) {
LOG.debug("Failed to remove sps xatttr!", e);
}
}
{code}
> Clean Up StoragePolicySatisfyManager.java
> -----------------------------------------
>
> Key: HDFS-14860
> URL: https://issues.apache.org/jira/browse/HDFS-14860
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: namenode
> Affects Versions: 3.2.0
> Reporter: David Mollitor
> Assignee: David Mollitor
> Priority: Minor
> Attachments: HDFS-14860.1.patch, HDFS-14860.2.patch,
> HDFS-14860.3.patch
>
>
> * Remove superfluous debug log guards
> * Use {{java.util.concurrent}} package for internal structure instead of
> external synchronization.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]