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

[GitHub] couchdb-couch pull request: Introduce couch_db:normalize_dbname

GitHub user iilyak opened a pull request:

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

    Introduce couch_db:normalize_dbname

    Move duplicated logic into couch_db:normalize_dbname. We could use this
    helper function anywhere we need to extract dbname from shard path.
    
    COUCHDB-2715
    
    We would need this PR for COUCHDB-2635

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

    $ git pull https://github.com/iilyak/couchdb-couch 2715-normalize-dbname

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

    https://github.com/apache/couchdb-couch/pull/58.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 #58
    
----
commit 04312dc9a7157dcd66ef3d06220a7bb6df6ca595
Author: ILYA Khlopotov <ii...@ca.ibm.com>
Date:   2015-06-15T12:59:24Z

    Introduce couch_db:normalize_dbname
    
    Move duplicated logic into couch_db:normalize_dbname. We could use this
    helper function anywhere we need to extract dbname from shard path.
    
    COUCHDB-2715

----


---
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: Introduce couch_db:normalize_dbname

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/58#discussion_r32417411
  
    --- Diff: src/couch_db.erl ---
    @@ -1469,3 +1470,8 @@ select_gt(V1, _V2) -> V1.
     
     select_lt(V1, V2) when V1 > V2 -> V2;
     select_lt(V1, _V2) -> V1.
    +
    +normalize_dbname(<<"shards/", _/binary>> = Path) ->
    +    lists:last(binary:split(mem3:dbname(Path), <<"/">>, [global]));
    --- End diff --
    
    Side question: isn't lists:reverse+lists:head better than lists:last?


---
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: Introduce couch_db:normalize_dbname

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

    https://github.com/apache/couchdb-couch/pull/58#issuecomment-112064648
  
    +1


---
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: Introduce couch_db:normalize_dbname

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

    https://github.com/apache/couchdb-couch/pull/58#discussion_r32417762
  
    --- Diff: src/couch_db.erl ---
    @@ -1469,3 +1470,8 @@ select_gt(V1, _V2) -> V1.
     
     select_lt(V1, V2) when V1 > V2 -> V2;
     select_lt(V1, _V2) -> V1.
    +
    +normalize_dbname(<<"shards/", _/binary>> = Path) ->
    +    lists:last(binary:split(mem3:dbname(Path), <<"/">>, [global]));
    --- End diff --
    
    for very short lists like this, I doubt it'll matter.


---
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: Introduce couch_db:normalize_dbname

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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.
---