Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[apache/helix] -- Updated Java 9 functions with Java-8 complaint functions #2689

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading