221V 1 год назад
Родитель
Сommit
f111fdda6c

+ 7 - 5
src/kvs.erl

@@ -1,12 +1,14 @@
 -module(kvs).
 -copyright('Synrc Research Center s.r.o.').
 -compile([export_all, nowarn_export_all]).
+
 %-include_lib("stdlib/include/qlc.hrl").
--include("config.hrl").
--include("metainfo.hrl").
--include("kvs.hrl").
--include("user.hrl").
--include("api.hrl").
+
+-include_lib("kvs/include/config.hrl").
+-include_lib("kvs/include/metainfo.hrl").
+-include_lib("kvs/include/kvs.hrl").
+-include_lib("kvs/include/user.hrl").
+-include_lib("kvs/include/api.hrl").
 
 % Public Main Backend is given in sys.config and
 % could be obtained with application:get_env(kvs,dba,store_mnesia).

+ 7 - 4
src/kvs_acl.erl

@@ -1,10 +1,13 @@
 -module(kvs_acl).
 -copyright('Synrc Research Center s.r.o.').
+
 -compile([export_all, nowarn_export_all]).
--include("kvs.hrl").
--include("metainfo.hrl").
--include("acl.hrl").
--include("user.hrl").
+
+-include_lib("kvs/include/kvs.hrl").
+-include_lib("kvs/include/metainfo.hrl").
+-include_lib("kvs/include/acl.hrl").
+-include_lib("kvs/include/user.hrl").
+
 
 metainfo() ->
     #schema{name=kvs,tables=[

+ 9 - 6
src/kvs_feed.erl

@@ -1,12 +1,15 @@
 -module(kvs_feed).
 -copyright('Synrc Research Center, s.r.o.').
+
 -compile([export_all, nowarn_export_all]).
--include("kvs.hrl").
--include("config.hrl").
--include("entry.hrl").
--include("comment.hrl").
--include("feed.hrl").
--include("metainfo.hrl").
+
+-include_lib("kvs/include/kvs.hrl").
+-include_lib("kvs/include/config.hrl").
+-include_lib("kvs/include/entry.hrl").
+-include_lib("kvs/include/comment.hrl").
+-include_lib("kvs/include/feed.hrl").
+-include_lib("kvs/include/metainfo.hrl").
+
 
 metainfo() ->  #schema{name=kvs,tables= core() ++ feeds() }.
 

+ 5 - 2
src/kvs_subscription.erl

@@ -1,9 +1,12 @@
 -module(kvs_subscription).
 -copyright('Synrc Research Center s.r.o.').
--include("subscription.hrl").
--include("metainfo.hrl").
+
+-include_lib("kvs/include/subscription.hrl").
+-include_lib("kvs/include/metainfo.hrl").
+
 -compile([export_all, nowarn_export_all]).
 
+
 metainfo() ->
     #schema{name=kvs,tables=[
         #table{name=subscription,fields=record_info(fields,subscription),keys=[id,whom,who]}

+ 6 - 3
src/kvs_user.erl

@@ -1,10 +1,13 @@
 -module(kvs_user).
 -copyright('Synrc Research Center s.r.o.').
--include("user.hrl").
--include("group.hrl").
--include("metainfo.hrl").
+
+-include_lib("kvs/include/user.hrl").
+-include_lib("kvs/include/group.hrl").
+-include_lib("kvs/include/metainfo.hrl").
+
 -compile([export_all, nowarn_export_all]).
 
+
 metainfo() ->
     #schema{name=kvs,tables=[
 %        #table{name=user2,container=feed,fields=record_info(fields,user2)},

+ 5 - 2
src/store/store_fs.erl

@@ -1,10 +1,13 @@
 -module(store_fs).
 -copyright('Synrc Research Center s.r.o.').
--include("config.hrl").
--include("metainfo.hrl").
+
+-include_lib("kvs/include/config.hrl").
+-include_lib("kvs/include/metainfo.hrl").
 -include_lib("stdlib/include/qlc.hrl").
+
 -compile([export_all, nowarn_export_all]).
 
+
 start()    -> ok.
 stop()     -> ok.
 destroy()  -> ok.

+ 7 - 2
src/store/store_kai.erl

@@ -1,12 +1,17 @@
 -module(store_kai).
 -author('Maxim Sokhatsky').
 -copyright('Synrc Research Center s.r.o.').
--include("config.hrl").
--include("metainfo.hrl").
+
+-include_lib("kvs/include/config.hrl").
+-include_lib("kvs/include/metainfo.hrl").
 -include_lib("stdlib/include/qlc.hrl").
+
 -compile([export_all, nowarn_export_all]).
+
+
 -record(data, { key, bucket, last_modified, vector_clocks, checksum, flags, value }).
 
+
 start() -> kai:start(), ok.
 stop() -> kai_store:stop(), ok.
 version() -> {version,"KVS KAI"}.

+ 6 - 3
src/store/store_mnesia.erl

@@ -1,11 +1,14 @@
 -module(store_mnesia).
 -copyright('Synrc Research Center s.r.o.').
--include("config.hrl").
--include("kvs.hrl").
--include("metainfo.hrl").
+
+-include_lib("kvs/include/config.hrl").
+-include_lib("kvs/include/kvs.hrl").
+-include_lib("kvs/include/metainfo.hrl").
 -include_lib("stdlib/include/qlc.hrl").
+
 -compile([export_all, nowarn_export_all]).
 
+
 start()    -> mnesia:start().
 stop()     -> mnesia:stop().
 destroy()  -> [mnesia:delete_table(T)||{_,T}<-kvs:dir()], mnesia:delete_schema([node()]), ok.

+ 5 - 1
src/store/store_mongo.erl

@@ -2,10 +2,14 @@
 -author("Vitaly Shutko").
 -author("Oleg Zinchenko").
 -copyright('Synrc Research Center s.r.o.').
--include("metainfo.hrl").
+
+-include_lib("kvs/include/metainfo.hrl").
+
 -compile([export_all, nowarn_export_all]).
+
 -define(POOL_NAME,mongo_pool).
 
+
 start() -> ok.
 stop() -> stopped.
 version() -> {version,"KVS MONGO"}.

+ 6 - 3
src/store/store_redis.erl

@@ -1,11 +1,14 @@
 -module(store_redis).
 -author('Andrey Martemyanov').
 -copyright('Synrc Research Center s.r.o.').
--include("config.hrl").
--include("kvs.hrl").
--include("metainfo.hrl").
+
+-include_lib("kvs/include/config.hrl").
+-include_lib("kvs/include/kvs.hrl").
+-include_lib("kvs/include/metainfo.hrl").
+
 -compile([export_all, nowarn_export_all]).
 
+
 start() -> erase(eredis_pid), {ok,C}=eredis:start_link(), erlang:put(eredis_pid,C), ok.
 stop() -> P=erase(eredis_pid), eredis:stop(P), ok.
 c() -> case get(eredis_pid) of

+ 11 - 8
src/store/store_riak.erl

@@ -1,16 +1,19 @@
 -module(store_riak).
 -author('Maxim Sokhatsky <maxim@synrc.com>').
 -copyright('Synrc Research Center s.r.o.').
--include("config.hrl").
--include("user.hrl").
--include("subscription.hrl").
--include("group.hrl").
--include("comment.hrl").
--include("entry.hrl").
--include("feed.hrl").
--include("acl.hrl").
+
+-include_lib("kvs/include/config.hrl").
+-include_lib("kvs/include/user.hrl").
+-include_lib("kvs/include/subscription.hrl").
+-include_lib("kvs/include/group.hrl").
+-include_lib("kvs/include/comment.hrl").
+-include_lib("kvs/include/entry.hrl").
+-include_lib("kvs/include/feed.hrl").
+-include_lib("kvs/include/acl.hrl").
+
 -compile([export_all, nowarn_export_all]).
 
+
 start() -> ok.
 stop() -> ok.
 version() -> {version,"KVS RIAK 2.0.2"}.

+ 4 - 0
src/store/store_sql.erl

@@ -1,12 +1,16 @@
 -module(store_sql).
 -author('Daniil Churikov').
 -author('Max Davidenko').
+
 -compile([export_all, nowarn_export_all]).
+
 -include_lib("kvs/include/sql.hrl").
 -include_lib("kvs/include/metainfo.hrl").
 
+
 -define(SETTINGS, #sql_settings{placeholder = fun (_, Pos, _) -> PosBin = integer_to_binary(Pos), <<"$", PosBin/binary>> end}).
 
+
 start() -> ok.
 stop() -> ok.
 

+ 2 - 0
test/kvs_SUITE.erl

@@ -2,8 +2,10 @@
 
 -include_lib("common_test/include/ct.hrl").
 -include_lib("kvs/include/entry.hrl").
+
 -compile([export_all, nowarn_export_all]).
 
+
 suite() -> [{timetrap,{seconds,30}}].
 all() -> [{group, feed},{group,acl}].
 groups() -> [{feed,[entry,comment,user]},