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

xyuanlu 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 e0d93e817 [apache/helix] -- Updated Java 9 functions with Java-8 
complaint functions (#2689)
e0d93e817 is described below

commit e0d93e8172dc12bfca02596197c969f6e36fc514
Author: Himanshu Kandwal <[email protected]>
AuthorDate: Wed Nov 22 09:41:16 2023 -0800

    [apache/helix] -- Updated Java 9 functions with Java-8 complaint functions 
(#2689)
    
    We will releasing the Open source Helix on Java 11, but we are updating the 
codebase to be build compatible with Java-8, so that we can internally release 
it on Java-8.
---
 helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java    | 3 ++-
 .../java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java 
b/helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java
index 69aa533fd..1c38a3b66 100644
--- a/helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java
+++ b/helix-core/src/main/java/org/apache/helix/model/ResourceConfig.java
@@ -28,6 +28,7 @@ import java.util.TreeMap;
 
 import com.fasterxml.jackson.core.type.TypeReference;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.collect.ImmutableMap;
 import org.apache.helix.HelixProperty;
 import org.apache.helix.api.config.HelixConfigProperty;
 import org.apache.helix.api.config.RebalanceConfig;
@@ -448,7 +449,7 @@ public class ResourceConfig extends HelixProperty {
             String.format("Capacity Data contains a negative value:%s", 
capacities.toString()));
       }
       newCapacityRecord.put(partition, 
_objectMapper.writeValueAsString(capacities));
-      newDeserializedPartitionCapacityMap.put(partition, 
Map.copyOf(capacities));
+      newDeserializedPartitionCapacityMap.put(partition, 
ImmutableMap.copyOf(capacities));
     }
 
     _record.setMapField(ResourceConfigProperty.PARTITION_CAPACITY_MAP.name(), 
newCapacityRecord);
diff --git 
a/meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java
 
b/meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java
index 45701063c..5b2210b72 100644
--- 
a/meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java
+++ 
b/meta-client/src/main/java/org/apache/helix/metaclient/impl/zk/ZkMetaClientCache.java
@@ -19,6 +19,7 @@ package org.apache.helix.metaclient.impl.zk;
  * under the License.
  */
 
+import com.google.common.collect.ImmutableList;
 import org.apache.helix.metaclient.api.ChildChangeListener;
 import org.apache.helix.metaclient.api.MetaClientCacheInterface;
 import org.apache.helix.metaclient.exception.MetaClientException;
@@ -118,7 +119,7 @@ public class ZkMetaClientCache<T> extends ZkMetaClient<T> 
implements MetaClientC
                 LOG.debug("Children not found in cache for key: {}. This could 
be because the cache is still being populated.", key);
                 return null;
             }
-            return List.copyOf(node.getChildren().keySet());
+            return ImmutableList.copyOf(node.getChildren().keySet());
         }
         return super.getDirectChildrenKeys(key);
     }

Reply via email to