[
https://issues.apache.org/jira/browse/HDFS-16695?focusedWorklogId=796969&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-796969
]
ASF GitHub Bot logged work on HDFS-16695:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 01/Aug/22 17:48
Start Date: 01/Aug/22 17:48
Worklog Time Spent: 10m
Work Description: goiri commented on code in PR #4668:
URL: https://github.com/apache/hadoop/pull/4668#discussion_r934771841
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/EncryptionZoneManager.java:
##########
@@ -636,10 +636,7 @@ private boolean pathResolvesToId(final long zoneId, final
String zonePath)
INodesInPath iip = dir.getINodesInPath(zonePath, DirOp.READ_LINK);
lastINode = iip.getLastINode();
}
- if (lastINode == null || lastINode.getId() != zoneId) {
- return false;
- }
- return true;
+ return lastINode != null && lastINode.getId() == zoneId;
Review Comment:
I'm not sure this is more readable than what we had.
Issue Time Tracking
-------------------
Worklog Id: (was: 796969)
Time Spent: 20m (was: 10m)
> Improve Code with Lambda in org.apahce.hadoop.hdfs.server.namenode package
> --------------------------------------------------------------------------
>
> Key: HDFS-16695
> URL: https://issues.apache.org/jira/browse/HDFS-16695
> Project: Hadoop HDFS
> Issue Type: Improvement
> Reporter: ZanderXu
> Assignee: ZanderXu
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Improve Code with Lambda in org.apahce.hadoop.hdfs.server.namenode package.
> For example:
> Current logic:
> {code:java}
> public ListenableFuture<GetJournaledEditsResponseProto> getJournaledEdits(
> long fromTxnId, int maxTransactions) {
> return parallelExecutor.submit(
> new Callable<GetJournaledEditsResponseProto>() {
> @Override
> public GetJournaledEditsResponseProto call() throws IOException {
> return getProxy().getJournaledEdits(journalId, nameServiceId,
> fromTxnId, maxTransactions);
> }
> });
> }
> {code}
> Improved Code with Lambda:
> {code:java}
> public ListenableFuture<GetJournaledEditsResponseProto> getJournaledEdits(
> long fromTxnId, int maxTransactions) {
> return parallelExecutor.submit(() -> getProxy().getJournaledEdits(
> journalId, nameServiceId, fromTxnId, maxTransactions));
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]