|
Boost : |
Subject: Re: [boost] [AFIO] Review (or lack of it)
From: Roland Bock (rbock_at_[hidden])
Date: 2015-08-29 13:37:16
On 2015-08-29 16:07, Niall Douglas wrote:
> On 29 Aug 2015 at 9:11, Roland Bock wrote:
>
>> And, just to show you that your claim about unfounded claims is
>> unfounded (come on, seriously!), here is what the simplest API of an
>> STL-based named Blob store could look like IMO.
>>
>> #include <vector>
>> #include <string>
>>
>> class data_store
>> {
>> std::string _store_path;
>>
>> public:
>> data_store(std::string store_path);
>>
>> auto read(std::string name) const
>> -> std::vector<uint8_t>;
>>
>> auto write(std::string name, const std::vector<uint8_t>& blob)
>> -> void;
>> };
>>
>>
>> Please note that this one actually /is/ STL based.
> The above is a poor interface design. Imagine 1Gb sized blobs. The
> interface in the tutorial scales very well to 1Gb sized blobs.
Huh? I thought the purpose of the example was to serve as an
introduction to doing it better with AFIO?
But anyway, that complaint is unfounded. Citing from from that page of
yours, one of the conditions of that "simplest blob store":
https://boostgsoc13.github.io/boost.afio/doc/html/afio/quickstart/workshop/naive.html
Conditions:
...
"The size of the values being read and written is small."
...
That's why I asked you to reread your own conditions before answering.
Of course, I could also do something super simple with streams, too, if
you insist on them:
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
class data_store
{
std::string _store_path;
std::ifstream _ifs;
std::ofstream _ofs;
public:
data_store(std::string store_path);
data_store(const data_store&);
auto getIstream(std::string name) const
-> std::istream&;
auto getOstream(std::string name)
-> std::ostream&;
};
(I would not call this the world's simplest named blob store anymore.
You might feel tempted to call that bad design, too. But please remember
that there is another of your conditions
"Only one thread or process will ever interact with the key-value store
at a time."
But honestly, I would rather forget about the streams in the "simplest"
blob store. I'd rather extend my original code with methods to append
data or to read chunks.
>
> Anyway, it's been made very clear by many reviewers that nobody likes
> the workshop tutorial, so I should imagine that the interface will be
> completely refactored into something less controversial.
But it will stay a named blob store? I am actually interested in that.
>
>> Please remember to read your own conditions before making unfounded
>> claims about how this is much, much worse in oh so many ways than the
>> one you claim to be the simplest one.
>>
>> Still trying to help, although you might believe or see it that way.
> You might find me far more receptive to your help if you had (a) not
> publicly questioned my sanity (b) used my mention of the hours I have
> invested into the development of AFIO as a basis for rejecting it in
> your review (c) accused me of trying to "shape" the review or
> whatever you called it, and then also used that as a basis for
> rejecting my library.
a) I did no such thing! If you read it that way, I am very sorry for the
misunderstanding.
b) It was a combination of things, and I stand by that
c) I stand by that
I offered to explain face to face at CppCon, because mail won't suffice
to work this out.
>
> Your review did contain useful points, for which I am grateful and I
> said so.
I am aware of that. Otherwise I would not continue to communicate :-)
Roland
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk