garrensmith commented on a change in pull request #2662: Use `couch_rate` 
application for `couch_view`
URL: https://github.com/apache/couchdb/pull/2662#discussion_r392902083
 
 

 ##########
 File path: src/couch_rate/src/couch_rate_ets.erl
 ##########
 @@ -0,0 +1,147 @@
+% 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.
+
+-module(couch_rate_ets).
+
+-include("couch_rate.hrl").
+
+-export([
+    create_tables/0,
+    new/3,
+    from_map/3,
+    budget/1,
+    delay/1,
+    wait/1,
+    in/2,
+    success/2,
+    failure/1,
+    is_congestion/1,
+    min_latency/1,
+    format/1,
+    to_map/1,
+    module/1,
+    state/1,
+    table_name/1,
+    table_names/0
+]).
+
+
+-define(SHARDS_N, 16).
+
+-compile({parse_transform, lookup_pt}).
+
+%% The following directive would generate following code
 
 Review comment:
   I'm not sure about this. Its definitely clever but I find it really 
difficult to follow. From what I understand its just creating a bunch of table 
names.
   I kind of prefer this design 
https://github.com/apache/couchdb/blob/prototype/fdb-layer/src/fabric/src/fabric2_index.erl#L88
 Its a lot easier to follow. 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to