You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/02/15 17:56:24 UTC

[GitHub] [couchdb] davisp commented on a change in pull request #2552: Prototype/fdb layer track database size

davisp commented on a change in pull request #2552: Prototype/fdb layer track database size
URL: https://github.com/apache/couchdb/pull/2552#discussion_r379845890
 
 

 ##########
 File path: src/couch/src/couch_att.erl
 ##########
 @@ -179,6 +180,24 @@ merge_stubs([], _, Merged) ->
     {ok, lists:reverse(Merged)}.
 
 
+external_size(Att) ->
+    NameSize = size(fetch(name, Att)),
+    TypeSize = case fetch(type, Att) of
+        undefined -> 0;
+        Type -> size(Type)
+    end,
+    AttSize = fetch(att_len, Att),
+    Md5Size = case fetch(md5, Att) of
+        undefined -> 0;
+        Md5 -> size(Md5)
+    end,
+    HeadersSize = case fetch(headers, Att) of
+        undefined -> 0;
+        Headers -> couch_ejson_size:encoded_size(Headers)
 
 Review comment:
   So I went looking for this and managed to confuse myself quite thoroughly before figuring out what happened. The previous code used headers as a way to test the upgrade between attachment records and proplists. When I rewrote the couch_att module to handle FoundationDB things I accidentally exploded the test code into a whole headers concept that exists nowhere outside of couch_att. So the correct answer here is to remove that and all related tests.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services