You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2019/11/21 00:32:51 UTC

[helix] 02/05: Remove unnecessary boxing for boolean values.

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

jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git

View the commit online:
https://github.com/apache/helix/commit/1d1eae0f4c6ea7d7fe2366983349dcf5f35e85d5

commit 1d1eae0f4c6ea7d7fe2366983349dcf5f35e85d5
Author: Huizhi Lu <ih...@gmail.com>
AuthorDate: Wed Sep 18 17:09:06 2019 -0700

    Remove unnecessary boxing for boolean values.
---
 .../org/apache/helix/common/caches/BasicClusterDataCache.java    | 9 ++++-----
 .../main/java/org/apache/helix/spectator/RoutingDataCache.java   | 3 +--
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/helix-core/src/main/java/org/apache/helix/common/caches/BasicClusterDataCache.java b/helix-core/src/main/java/org/apache/helix/common/caches/BasicClusterDataCache.java
index 5389493..1260a2b 100644
--- a/helix-core/src/main/java/org/apache/helix/common/caches/BasicClusterDataCache.java
+++ b/helix-core/src/main/java/org/apache/helix/common/caches/BasicClusterDataCache.java
@@ -107,13 +107,13 @@ public class BasicClusterDataCache implements ControlContextProvider {
     long startTime = System.currentTimeMillis();
 
     if (_propertyDataChangedMap.get(HelixConstants.ChangeType.EXTERNAL_VIEW)) {
-      _propertyDataChangedMap.put(HelixConstants.ChangeType.EXTERNAL_VIEW, Boolean.valueOf(false));
+      _propertyDataChangedMap.put(HelixConstants.ChangeType.EXTERNAL_VIEW, false);
       _externalViewCache.refresh(accessor);
     }
 
     if (_propertyDataChangedMap.get(HelixConstants.ChangeType.LIVE_INSTANCE)) {
       long start = System.currentTimeMillis();
-      _propertyDataChangedMap.put(HelixConstants.ChangeType.LIVE_INSTANCE, Boolean.valueOf(false));
+      _propertyDataChangedMap.put(HelixConstants.ChangeType.LIVE_INSTANCE, false);
       _propertyDataChangedMap.put(HelixConstants.ChangeType.CURRENT_STATE, true);
       _liveInstancePropertyCache.refresh(accessor);
       LOG.info("Reload LiveInstances: " + _liveInstancePropertyCache.getPropertyMap().keySet()
@@ -122,8 +122,7 @@ public class BasicClusterDataCache implements ControlContextProvider {
 
     if (_propertyDataChangedMap.get(HelixConstants.ChangeType.INSTANCE_CONFIG)) {
       long start = System.currentTimeMillis();
-      _propertyDataChangedMap.put(HelixConstants.ChangeType.INSTANCE_CONFIG,
-          Boolean.valueOf(false));
+      _propertyDataChangedMap.put(HelixConstants.ChangeType.INSTANCE_CONFIG, false);
       _instanceConfigPropertyCache.refresh(accessor);
       LOG.info("Reload InstanceConfig: " + _instanceConfigPropertyCache.getPropertyMap().keySet()
           + ". Takes " + (System.currentTimeMillis() - start) + " ms");
@@ -184,7 +183,7 @@ public class BasicClusterDataCache implements ControlContextProvider {
    * @param changeType
    */
   public void notifyDataChange(HelixConstants.ChangeType changeType) {
-    _propertyDataChangedMap.put(changeType, Boolean.valueOf(true));
+    _propertyDataChangedMap.put(changeType, true);
   }
 
   /**
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 fad3c92..b5fdd72 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
@@ -69,8 +69,7 @@ class RoutingDataCache extends BasicClusterDataCache {
     if (_sourceDataType.equals(PropertyType.TARGETEXTERNALVIEW) && _propertyDataChangedMap
         .get(HelixConstants.ChangeType.TARGET_EXTERNAL_VIEW)) {
       long start = System.currentTimeMillis();
-      _propertyDataChangedMap
-          .put(HelixConstants.ChangeType.TARGET_EXTERNAL_VIEW, Boolean.valueOf(false));
+      _propertyDataChangedMap.put(HelixConstants.ChangeType.TARGET_EXTERNAL_VIEW, false);
       _targetExternalViewCache.refresh(accessor);
       LOG.info("Reload " + _targetExternalViewCache.getExternalViewMap().keySet().size()
           + " TargetExternalViews. Takes " + (System.currentTimeMillis() - start) + " ms");