Przeglądaj źródła

HDDS-1293. ExcludeList#getProtoBuf throws ArrayIndexOutOfBoundsException. Contributed by Shashikant Banerjee.

(cherry picked from commit ac4010bb22bd9e29dc5be74570fe3fda6c933032)
Shashikant Banerjee 6 lat temu
rodzic
commit
c53408c3e3

+ 7 - 5
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/container/common/helpers/ExcludeList.java

@@ -23,7 +23,9 @@ import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
 import org.apache.hadoop.hdds.scm.container.ContainerID;
 import org.apache.hadoop.hdds.scm.pipeline.PipelineID;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collection;
 
 /**
  * This class contains set of dns and containers which ozone client provides
@@ -73,12 +75,12 @@ public class ExcludeList {
   public HddsProtos.ExcludeListProto getProtoBuf() {
     HddsProtos.ExcludeListProto.Builder builder =
         HddsProtos.ExcludeListProto.newBuilder();
-    containerIds.parallelStream()
+    containerIds
         .forEach(id -> builder.addContainerIds(id.getId()));
-    datanodes.parallelStream().forEach(dn -> {
+    datanodes.forEach(dn -> {
       builder.addDatanodes(dn.getUuidString());
     });
-    pipelineIds.parallelStream().forEach(pipelineID -> {
+    pipelineIds.forEach(pipelineID -> {
       builder.addPipelineIds(pipelineID.getProtobuf());
     });
     return builder.build();
@@ -87,7 +89,7 @@ public class ExcludeList {
   public static ExcludeList getFromProtoBuf(
       HddsProtos.ExcludeListProto excludeListProto) {
     ExcludeList excludeList = new ExcludeList();
-    excludeListProto.getContainerIdsList().parallelStream().forEach(id -> {
+    excludeListProto.getContainerIdsList().forEach(id -> {
       excludeList.addConatinerId(ContainerID.valueof(id));
     });
     DatanodeDetails.Builder builder = DatanodeDetails.newBuilder();