You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gilv <gi...@git.apache.org> on 2015/10/14 13:05:25 UTC

[GitHub] couchdb-couch pull request: COUCHDB-769: Store attachments in the ...

GitHub user gilv opened a pull request:

    https://github.com/apache/couchdb-couch/pull/120

    COUCHDB-769: Store attachments in the external storage. 

    Initial implementation that allows CouchDB to store attachments outside of the database file.
    This implementation supports OpenStack Swift and SoftLayer Object store

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gilv/couchdb-couch store_attachments_external

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch/pull/120.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #120
    
----
commit 84acedbc69dab6c33a2652c489e0ac141cd88264
Author: Gil Vernik <gi...@il.ibm.com>
Date:   2015-10-14T10:49:05Z

    COUCHDB-769: Store attachments in external storage. This is initial implementation, supports OpenStack Swift and SoftLayer Object store

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: COUCHDB-769: Store attachments in the ...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch/pull/120#discussion_r41984693
  
    --- Diff: src/couch_att.erl ---
    @@ -438,17 +438,28 @@ digest_from_json(Props) ->
     
     
     to_json(Att, OutputData, DataToFollow, ShowEncoding) ->
    -    [Name, Data, DiskLen, AttLen, Enc, Type, RevPos, Md5] = fetch(
    +    [AttExternal,AttExternalSize, AttExternalMD5] = couch_att:fetch([att_external,att_external_size,att_external_md5],Att),
    +    [Name, Data, DiskLenTmp, AttLen, Enc, Type, RevPos, Md5] = fetch(
             [name, data, disk_len, att_len, encoding, type, revpos, md5], Att
         ),
    +    case AttExternal of
    +        "external" ->
    +            DiskLen = AttExternalSize,
    +            DigestProp = case AttExternalMD5 of
    +                <<>> -> [];
    +                Digest -> [{<<"digest">>, <<"md5-", Digest/binary>>}]
    +            end;
    +        _ ->
    +            DiskLen = DiskLenTmp,
    +            DigestProp = case base64:encode(Md5) of
    +                <<>> -> [];
    +                Digest -> [{<<"digest">>, <<"md5-", Digest/binary>>}]
    --- End diff --
    
    Can we not repeat ourself in Digest generation?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: COUCHDB-769: Store attachments in the ...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on a diff in the pull request:

    https://github.com/apache/couchdb-couch/pull/120#discussion_r41984725
  
    --- Diff: src/couch_att.erl ---
    @@ -438,17 +438,28 @@ digest_from_json(Props) ->
     
     
     to_json(Att, OutputData, DataToFollow, ShowEncoding) ->
    -    [Name, Data, DiskLen, AttLen, Enc, Type, RevPos, Md5] = fetch(
    +    [AttExternal,AttExternalSize, AttExternalMD5] = couch_att:fetch([att_external,att_external_size,att_external_md5],Att),
    --- End diff --
    
    Why do fetch the same attachment twice?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: COUCHDB-769: Store attachments in the ...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/120#issuecomment-148028567
  
    Please fix style: 80 chars line length, commas/spaces, etc.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: COUCHDB-769: Store attachments in the ...

Posted by gilv <gi...@git.apache.org>.
Github user gilv commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/120#issuecomment-176590594
  
    @kxepal Can you please review the recent code? 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: COUCHDB-769: Store attachments in the ...

Posted by gilv <gi...@git.apache.org>.
Github user gilv commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/120#issuecomment-168609282
  
    @kxepal @rnewson 
    I provided another patch, implementing most of the comments.
    Here is what is not implemented in this patch:
    
    1.  Remark on the AttFun. Not yet implemented. Original remark:  “AttFun could be actually an attachment data or some fold function? Something went wrong if you have to do this.” 
    2.  usage of  couch_util:to_hex
    3.  still no unitests



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---