ZanderXu created HDFS-16713:
-------------------------------
Summary: Improve Code with Lambda in
org.apahce.hadoop.hdfs.server.namenode sub packages
Key: HDFS-16713
URL: https://issues.apache.org/jira/browse/HDFS-16713
Project: Hadoop HDFS
Issue Type: Improvement
Environment: Improve Code with Lambda in
org.apahce.hadoop.hdfs.server.namenode sub packages.
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}
Reporter: ZanderXu
Assignee: ZanderXu
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]