This is an automated email from the ASF dual-hosted git repository.

sammichen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new a75c2f6  HDDS-3588. Fix NPE while getPipelines if absent in 
query2OpenPipelines (#922)
a75c2f6 is described below

commit a75c2f66bd36eca93401fe7d29cc69962f3631e9
Author: maobaolong <[email protected]>
AuthorDate: Tue May 19 12:07:08 2020 +0800

    HDDS-3588. Fix NPE while getPipelines if absent in query2OpenPipelines 
(#922)
---
 .../java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateMap.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateMap.java
 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateMap.java
index 8e0f32d..df61320 100644
--- 
a/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateMap.java
+++ 
b/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelineStateMap.java
@@ -211,7 +211,8 @@ class PipelineStateMap {
 
     if (state == PipelineState.OPEN) {
       return Collections.unmodifiableList(
-          query2OpenPipelines.get(new PipelineQuery(type, factor)));
+          query2OpenPipelines.getOrDefault(
+              new PipelineQuery(type, factor), Collections.EMPTY_LIST));
     }
     return pipelineMap.values().stream().filter(
         pipeline -> pipeline.getType() == type


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to