You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/04/11 18:05:57 UTC

[GitHub] [incubator-druid] gianm commented on a change in pull request #7447: Coordinator: Allow dropping all segments.

gianm commented on a change in pull request #7447: Coordinator: Allow dropping all segments.
URL: https://github.com/apache/incubator-druid/pull/7447#discussion_r274563782
 
 

 ##########
 File path: server/src/main/java/org/apache/druid/metadata/SQLMetadataSegmentManager.java
 ##########
 @@ -325,7 +332,7 @@ public boolean removeDataSource(final String dataSource)
           ).bind("dataSource", dataSource).execute()
       );
 
-      dataSources.remove(dataSource);
+      Optional.ofNullable(dataSources).ifPresent(m -> m.remove(dataSource));
 
 Review comment:
   It was because `dataSources` can become null after being non-null, if `stop()` is called. Since `stop()` could be called at any time, `dataSources` should only be dereferenced one time per method.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org