You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by ji...@apache.org on 2020/06/15 19:41:55 UTC
[helix] branch master updated: Fix NPE for RoutingDataCache.refresh
(#1087)
This is an automated email from the ASF dual-hosted git repository.
jiajunwang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/master by this push:
new d95e4cf Fix NPE for RoutingDataCache.refresh (#1087)
d95e4cf is described below
commit d95e4cf08a3cb746a215f9d53e76690d8e06f89c
Author: Ali Reza Zamani Zadeh Najari <an...@linkedin.com>
AuthorDate: Mon Jun 15 12:41:46 2020 -0700
Fix NPE for RoutingDataCache.refresh (#1087)
This commit fixes NPE that is thrown in RoutingDataCache.refresh()
method when CUSTOMIZEDVIEW has not being used as an entry of
sourceDataTypeMap.
---
.../src/main/java/org/apache/helix/spectator/RoutingDataCache.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/helix-core/src/main/java/org/apache/helix/spectator/RoutingDataCache.java b/helix-core/src/main/java/org/apache/helix/spectator/RoutingDataCache.java
index 406080e..c87ee4a 100644
--- a/helix-core/src/main/java/org/apache/helix/spectator/RoutingDataCache.java
+++ b/helix-core/src/main/java/org/apache/helix/spectator/RoutingDataCache.java
@@ -142,7 +142,8 @@ class RoutingDataCache extends BasicClusterDataCache {
if (LOG.isDebugEnabled()) {
LOG.debug("CurrentStates: " + _currentStateCache);
LOG.debug("TargetExternalViews: " + _targetExternalViewCache.getExternalViewMap());
- for (String customizedStateType : _sourceDataTypeMap.get(PropertyType.CUSTOMIZEDVIEW)) {
+ for (String customizedStateType : _sourceDataTypeMap.getOrDefault(PropertyType.CUSTOMIZEDVIEW,
+ Collections.emptyList())) {
LOG.debug("CustomizedViews customizedStateType: " + customizedStateType + " "
+ _customizedViewCaches.get(customizedStateType).getCustomizedViewMap());
}