Skip to content

Commit

Permalink
[apache/helix] -- Updated Java 9 functions with Java-8 complaint func…
Browse files Browse the repository at this point in the history
…tions (#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.
  • Loading branch information
himanshukandwal authored Nov 22, 2023
1 parent 7f2a88d commit e0d93e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

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;
Expand Down Expand Up @@ -448,7 +449,7 @@ public void setPartitionCapacityMap(Map<String, Map<String, Integer>> partitionC
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* 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;
Expand Down Expand Up @@ -118,7 +119,7 @@ public List<String> getDirectChildrenKeys(final String key) {
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);
}
Expand Down

0 comments on commit e0d93e8

Please sign in to comment.