Details
-
Sub-task
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
To avoid using values() all the time when the version is read from proto a minor optimization was suggested in HDDS-6391, this JIRA is to track this.
The suggestion:
private static final Map<Integer, DatanodeVersion> BY_PROTO_VALUE = Arrays.stream(DatanodeVersion.values()) .collect(toMap(DatanodeVersion::toProtoValue, identity())); public static DatanodeVersion fromProtoValue(int value) { return BY_PROTO_VALUE.getOrDefault(value, FUTURE_VERSION); }
Attachments
Issue Links
- links to