nandakumar131 commented on a change in pull request #1034:
URL: https://github.com/apache/hadoop-ozone/pull/1034#discussion_r437291044
##########
File path:
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmKeyInfo.java
##########
@@ -411,13 +415,19 @@ public static OmKeyInfo getFromProtobuf(KeyInfo keyInfo) {
if (keyInfo == null) {
return null;
}
+
+ List<OmKeyLocationInfoGroup> omKeyLocationInfos = new ArrayList<>();
+ List<KeyLocationList> keyLocationLists = keyInfo.getKeyLocationListList();
+ for (KeyLocationList keyLocationList : keyLocationLists) {
Review comment:
Temporary variable `keyLocationLists` can be removed.
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/pipeline/Pipeline.java
##########
@@ -289,14 +290,20 @@ public boolean isEmpty() {
public static Pipeline getFromProtobuf(HddsProtos.Pipeline pipeline)
throws UnknownPipelineStateException {
Preconditions.checkNotNull(pipeline, "Pipeline is null");
+
+ List<DatanodeDetails> nodes = new ArrayList<>();
+ List<DatanodeDetailsProto> membersList = pipeline.getMembersList();
+ for (DatanodeDetailsProto member : membersList) {
Review comment:
We don't need the temporary variable `memberList`.
It can be replaced with
```
for (DatanodeDetailsProto member : pipeline.getMembersList())
```
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
##########
@@ -132,10 +134,13 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
keyName, IAccessAuthorizer.ACLType.WRITE,
commitKeyRequest.getClientID());
- List<OmKeyLocationInfo> locationInfoList = commitKeyArgs
- .getKeyLocationsList().stream()
- .map(OmKeyLocationInfo::getFromProtobuf)
- .collect(Collectors.toList());
+ List<OmKeyLocationInfo> locationInfoList = new ArrayList<>();
+ List<KeyLocation> keyLocations = commitKeyArgs
+ .getKeyLocationsList();
+
+ for (KeyLocation keyLocation : keyLocations) {
Review comment:
The temporary variable `keyLocations ` can be removed.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]