From 6bcf5ce6acd6a88e93a24cbad8855963b63b8a37 Mon Sep 17 00:00:00 2001 From: Rita Marcinkiewicz Date: Sun, 4 Nov 2018 03:49:49 +0300 Subject: [PATCH 1/4] Update README.md --- README.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9c52aa8..ec0d122 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ KVS: Erlang Abstract Term Database -================================== - -[![Build Status](https://travis-ci.org/synrc/kvs.svg?branch=master)](https://travis-ci.org/synrc/kvs) +=================================![Build Status](https://travis-ci.org/synrc/kvs.svg?branch=master)](https://travis-ci.org/synrc/kvs) Features -------- @@ -56,8 +54,8 @@ Models ------ We have built with KVS a number of applications and came up with schema samples. -We grouped schemas by three category. KVS hides database access behind backend drivers -and provides high-level rich API to stored and extend following data: +We grouped schemas by three categories. KVS hides database access behind backend drivers +and provides high-level rich API to stored and extend the following data: * **Core** — Acl, Users, Subscriptions, Feeds, Entries, Comments * **Banking** — Account, Customer, Transaction, Item, Currency, Program, Card, Cashback @@ -69,7 +67,7 @@ Applications This Framework provides also a **feed** application for sequential consistency and **cr** application for chain replication database on top of **kvs**. All write requests with given object key will be handled by single processes -so you may not worry about concurrent changes of user feed tops. +so you may not worry about concurrent changes in user feed tops. All write operations that are made to data with secondary indexes, i.e. not like linked lists could be potentially handled without feed_server. @@ -90,7 +88,7 @@ Currently **kvs** includes following store backends: Configuring ----------- -First of all you need to tune your backend in the kvs application: +First of all, you need to tune your backend in the kvs application: ```erlang {kvs, [{dba,store_mnesia}]}, @@ -106,7 +104,7 @@ store_kai {version,"KVS KAI PURE XEN"} ``` -Create database for single node: +Create a database for a single node: ```erlang 3> kvs:join(). @@ -114,7 +112,7 @@ Create database for single node: ok ``` -You can also create database by joining to existing cluster: +You can also create a database by joining to existing cluster: ```erlang 3> kvs:join('kvs@synrc.com'). @@ -154,10 +152,9 @@ ok Polymorphic Records ------------------- -The data in KVS represented as plain Erlang records. The first element of the tuple -as usual indicates the name of bucket. And the second element usually corresponds +The data in KVS represented as plain Erlang records. The first element of the tuple, as usual, indicates the name of a bucket. And the second element usually corresponds to the index key field. Additional secondary indexes could be applied for stores -that supports 2i, e.g. kai, mnesia, riak, mongodb. +that support 2i, e.g. kai, mnesia, riak, mongodb. Iterators --------- @@ -250,7 +247,7 @@ of containers: Extending Schema ---------------- -Usually you need only specify custom mnesia indexes and tables tuning. +Usually, you need only specify custom mnesia indexes and tables tuning. Riak, KAI and Redis backends don't need it. Group you table into table packages represented as modules with handle_notice API. @@ -286,14 +283,14 @@ Using KVS in real applications Besides using KVS in production in a number of applications we have built on top of KVS several products. The first product is Chain -Replication Database wit XA protocol. And second is social Feed +Replication Database with XA protocol. And second is social Feed Server for web shops and social sites. ### Chain Replication Database The **kvs** semantic is totally compatible with XA protocol. Adding the object with PUT means only putting to database -while ADD operations provides linking to the chain's container. +while ADD operations provide linking to the chain's container. Also linking operation LINK is provided separately. ```erlang From d690fe2650663345990a614870afb870d235cb7e Mon Sep 17 00:00:00 2001 From: Rita Marcinkiewicz Date: Sun, 4 Nov 2018 04:03:32 +0300 Subject: [PATCH 2/4] Update README.md Sorry, I broke heading fix my previous PR. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ec0d122..a212c4c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ KVS: Erlang Abstract Term Database -=================================![Build Status](https://travis-ci.org/synrc/kvs.svg?branch=master)](https://travis-ci.org/synrc/kvs) +================================= +![Build Status](https://travis-ci.org/synrc/kvs.svg?branch=master)](https://travis-ci.org/synrc/kvs) Features -------- From 794891642eb1ce75620f578fb2a2cc50bedb8249 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Sun, 4 Nov 2018 03:06:25 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a212c4c..6aef9d7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ KVS: Erlang Abstract Term Database ================================= -![Build Status](https://travis-ci.org/synrc/kvs.svg?branch=master)](https://travis-ci.org/synrc/kvs) +[![Build Status](https://travis-ci.org/synrc/kvs.svg?branch=master)](https://travis-ci.org/synrc/kvs) Features -------- From d4bce78d223b9a7354a8a06fa058b03e704c4400 Mon Sep 17 00:00:00 2001 From: Namdak Tonpa Date: Mon, 12 Nov 2018 00:56:35 +0200 Subject: [PATCH 4/4] disable Nonexistent --- src/kvs.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/kvs.erl b/src/kvs.erl index 7375e89..2dfa985 100644 --- a/src/kvs.erl +++ b/src/kvs.erl @@ -351,7 +351,8 @@ lookup(#block{},_) -> []. rotate_new() -> N = [ kvs:rotate(kvs:table(T)) || {T,_} <- fold_tables(), length(proplists:get_value(attributes,info(last_disc(T)),[])) /= length((table(rname(T)))#table.fields) ], - io:format("Nonexistent: ~p~n",[N]), N. + %io:format("Nonexistent: ~p~n",[N]), + N. rotate(#table{name=N}) -> R = name(rname(N)), init(setelement(#table.name,kvs:table(kvs:last_table(N)),R)),