XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • 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

          Activity

            People

              adoroszlai Attila Doroszlai
              pifta István Fajth
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: