Browse Source

comments about compex keys

Maxim Sokhatsky 12 years ago
parent
commit
ced8bd6d9d
5 changed files with 8 additions and 6 deletions
  1. 4 4
      include/feeds.hrl
  2. 1 0
      src/kvs_purchase.erl
  3. 1 0
      src/kvs_user.erl
  4. 1 1
      src/store_mnesia.erl
  5. 1 1
      src/store_riak.erl

+ 4 - 4
include/feeds.hrl

@@ -4,10 +4,10 @@
         aclver}).
         aclver}).
 
 
 -record(entry, {
 -record(entry, {
-        id, %% {entry_id, feed_id}
-        entry_id, %% taken from id_seq
-        feed_id, %% owner's feed_id, indexed field
-        from, %% author
+        id, % {entry_id, feed_id} we want to hold in key information about feed
+        entry_id, % these fields 
+        feed_id,  % are for secondary indexes
+        from, % author
         to,
         to,
         description,
         description,
         created, % time
         created, % time

+ 1 - 0
src/kvs_purchase.erl

@@ -1,4 +1,5 @@
 -module(kvs_purchase).
 -module(kvs_purchase).
+-copyright('Synrc Research Center s.r.o.').
 -include_lib("kvs/include/products.hrl").
 -include_lib("kvs/include/products.hrl").
 -include_lib("kvs/include/purchases.hrl").
 -include_lib("kvs/include/purchases.hrl").
 -include_lib("kvs/include/log.hrl").
 -include_lib("kvs/include/log.hrl").

+ 1 - 0
src/kvs_user.erl

@@ -1,4 +1,5 @@
 -module(kvs_user).
 -module(kvs_user).
+-copyright('Synrc Research Center s.r.o.').
 -include_lib("kvs/include/users.hrl").
 -include_lib("kvs/include/users.hrl").
 -include_lib("kvs/include/groups.hrl").
 -include_lib("kvs/include/groups.hrl").
 -include_lib("kvs/include/accounts.hrl").
 -include_lib("kvs/include/accounts.hrl").

+ 1 - 1
src/store_mnesia.erl

@@ -142,7 +142,7 @@ storage_to_mnesia_type(ondisk) -> {disc_only_copies, [node()]}.
 
 
 exec(Q) -> F = fun() -> qlc:e(Q) end, {atomic, Val} = mnesia:transaction(F), Val.
 exec(Q) -> F = fun() -> qlc:e(Q) end, {atomic, Val} = mnesia:transaction(F), Val.
 
 
-%
+% index funs
 
 
 products(UId) -> all_by_index(user_product, #user_product.username, UId).
 products(UId) -> all_by_index(user_product, #user_product.username, UId).
 subscriptions(UId) -> all_by_index(subsciption, #subscription.who, UId).
 subscriptions(UId) -> all_by_index(subsciption, #subscription.who, UId).

+ 1 - 1
src/store_riak.erl

@@ -214,7 +214,7 @@ next_id(CounterId, Default, Incr) ->
         ok -> Value;
         ok -> Value;
         {error, _} -> next_id(CounterId, Incr) end.
         {error, _} -> next_id(CounterId, Incr) end.
 
 
-%%%%%%%%%%%%%%%%
+% index funs
 
 
 products(UId) -> all_by_index(user_product, <<"user_bin">>, list_to_binary(UId)).
 products(UId) -> all_by_index(user_product, <<"user_bin">>, list_to_binary(UId)).
 subscriptions(UId) -> all_by_index(subsciption, <<"subs_who_bin">>, list_to_binary(UId)).
 subscriptions(UId) -> all_by_index(subsciption, <<"subs_who_bin">>, list_to_binary(UId)).