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

Recon List Key API: Reduce object creation and buffering memory

Log workAgile BoardRank to TopRank to BottomAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      The current ListKeysAPI implementation, pulls a batch of OMKeyInfo objects from the File / Key table and buffers them in an array.

      Then it converts each item in that array to a KeyEntityInfo object, which has JSON annotations allowing the data to be serialized over HTTP.

      This results in two copies of the objects buffered in memory at once.

      Additionally, the OMKeyInfo object is a fairly heavyweight object, and creating it from protobuf also deserialized the block information, which is not needed for the ListKey purposes.

      Further taking the protobuffer bytes from RocksDB creates a KeyInfo object (deserialized proto) and then this object is copied into OmKeyInfo.

      So for each key retrieved, we start with:

      1. A deserialized proto object (KeyInfo)
      2. A copy of the proto fields (OmKeyInfo)
      3. A json annotated object (KeyEntityInfo).

      By deserializing into the 3rd object directly, and having it wrap a keyInfo object and delegate calls to it when appropriate, we avoid needing the heavyweight OmKeyInfo object, and make the KeyEntityInfo object "slimmer". We can also avoid the double buffering, creating only a single list of objects for the batch.

      This PR introduces a KeyEntityInfoProtoWrapper object, rather than changing the existing KeyEntityInfo object. The reason, is that other APIs outside of ListKeys use it. I am not ready to change those APIs now, however after this change gets committed and we are happy with it, it should be possible to apply similar changes to those other API and eventually remove KeyEntityInfo from the system.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            sodonnell Stephen O'Donnell Assign to me
            sodonnell Stephen O'Donnell
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment