rnewson commented on code in PR #4291:
URL: https://github.com/apache/couchdb/pull/4291#discussion_r1173593844


##########
src/nouveau/src/nouveau_util.erl:
##########
@@ -0,0 +1,97 @@
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%%     http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+
+%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
+
+-module(nouveau_util).
+
+-include("nouveau.hrl").
+-include_lib("couch/include/couch_db.hrl").
+
+-export([
+    index_name/1,
+    design_doc_to_indexes/2,
+    design_doc_to_index/3,
+    nouveau_url/0
+]).
+
+index_name(Path) when is_binary(Path) ->
+    <<(node_prefix())/binary, "/", Path/binary>>;
+index_name(#index{} = Index) ->
+    <<(node_prefix())/binary, "/", (Index#index.dbname)/binary, "/", 
(Index#index.sig)/binary>>.
+
+node_prefix() ->
+    atom_to_binary(node(), utf8).

Review Comment:
   that's a fine prefix. the purpose is to allow a nouveau server to host 
indexes for multiple nodes. in the nonode@ situation it just means there's one 
node, its name doesn't really matter.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to