~umgeher/utfs-core

9018f311f484843a664352ccfd552518df7e7d39 — Umgeher Torgersen 4 months ago 80876e5 0.4.0
using utfs_driver_riak_pool module
M src/utfs_core.erl => src/utfs_core.erl +0 -4
@@ 1,7 1,6 @@
-module(utfs_core).

-export([
         internal_connection_riak/0,
         internal_connection_state/0,
         kv_del/2,
         kv_get/2,


@@ 26,9 25,6 @@
         tl_uid/1
        ]).

internal_connection_riak() ->
    utos_actor:call(utfs_core_internal_connection, riak).

internal_connection_state() ->
    utos_actor:call(utfs_core_internal_connection, state).


M src/utfs_core_kv_del.erl => src/utfs_core_kv_del.erl +3 -2
@@ 2,6 2,7 @@

-export([del/2]).

-define(POOL, utfs_core_internal_connection).

del(File, Key) ->
    {ok, Pid} = utfs_core:internal_connection_riak(),
    utfs_driver_riak:kv_del(Pid, File, Key).
    utfs_driver_riak:kv_del(?POOL, File, Key).

M src/utfs_core_kv_get.erl => src/utfs_core_kv_get.erl +3 -2
@@ 2,6 2,7 @@

-export([get/2]).

-define(POOL, utfs_core_internal_connection).

get(File, Key) ->
    {ok, Pid} = utfs_core:internal_connection_riak(),
    utfs_driver_riak:kv_get(Pid, File, Key).
    utfs_driver_riak:kv_get(?POOL, File, Key).

M src/utfs_core_kv_set.erl => src/utfs_core_kv_set.erl +4 -4
@@ 5,10 5,10 @@
         set/3
        ]).

-define(POOL, utfs_core_internal_connection).

set(File, KV) ->
    {ok, Pid} = utfs_core:internal_connection_riak(),
    utfs_driver_riak:kv_set(Pid, File, KV).
    utfs_driver_riak:kv_set(?POOL, File, KV).

set(File, Key, Value) ->
    {ok, Pid} = utfs_core:internal_connection_riak(),
    utfs_driver_riak:kv_set(Pid, File, Key, Value).
    utfs_driver_riak:kv_set(?POOL, File, Key, Value).

M src/utfs_core_si_range.erl => src/utfs_core_si_range.erl +3 -2
@@ 2,6 2,7 @@

-export([range/4]).

-define(POOL, utfs_core_internal_connection).

range(File, Index, Key, Options) ->
    {ok, Pid} = utfs_core:internal_connection_riak(),
    utfs_driver_riak:si_range(Pid, File, Index, Key, Options).
    utfs_driver_riak:si_range(?POOL, File, Index, Key, Options).

M src/utfs_core_si_set.erl => src/utfs_core_si_set.erl +3 -2
@@ 2,6 2,7 @@

-export([set/4]).

-define(POOL, utfs_core_internal_connection).

set(File, Key, Index, Value) ->
    {ok, Pid} = utfs_core:internal_connection_riak(),
    utfs_driver_riak:si_set(Pid, File, Key, Index, Value).
    utfs_driver_riak:si_set(?POOL, File, Key, Index, Value).

M src/utfs_core_sup.erl => src/utfs_core_sup.erl +2 -1
@@ 15,8 15,9 @@ init([]) ->
    SupFlags = #{strategy => one_for_one,
                 intensity => 10,
                 period => 1},
    {ok, Settings} = utfs_core:settings_riak(),
    ChildSpecs = [
                  {connection, {utfs_core_internal_connection, start_link, []},
                  {connection, {utfs_driver_riak_pool, start_link, [{local, utfs_core_internal_connection}, none, Settings]},
                   permanent, 5000, worker, [utfs_core_internal_connection]}
                 ],
    {ok, {SupFlags, ChildSpecs}}.