Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-11139

Avoid unnecessary object creation in OM request validator

    XMLWordPrintableJSON

Details

    Description

      Conversion is unnecessary:

      Default value can be created lazily (only if not found in map):

        private <K, V> V getAndInitialize(K key, V defaultValue, Map<K, V> from) {
          V inMapValue = from.get(key);
          if (inMapValue == null || !from.containsKey(key)) {
            from.put(key, defaultValue);
            return defaultValue;
          }
          return inMapValue;
        }
      

      Attachments

        Issue Links

          Activity

            People

              adoroszlai Attila Doroszlai
              adoroszlai Attila Doroszlai
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: