It seems the client Create signature changed (see below tutorial error).  
However, I’ve looked into client_tests and I see it passes ok all 9 tests. So 
I’m trying to modify the example to create an object. I still have some issues 
compiling, see below, maybe you can provide some help as I just started looking 
into apache arrow/plasma.

I’m using create.cc <http://create.cc/>, however trying to compile fails with:
g++ create.cc `pkg-config --cflags --libs plasma arrow` --std=c++11 -o create
In file included from /usr/local/include/plasma/plasma.h:40:0,
                 from create.cc:15:
/usr/local/include/plasma/common_generated.h:7:37: fatal error: 
flatbuffers/flatbuffers.h: No such file or directory
 #include "flatbuffers/flatbuffers.h”

Before, I managed to make && make install after 
cmake .. -DCMAKE_BUILD_TYPE=Release -DARROW_PLASMA=on
and run
/release/plasma_store -m 1000000000 -s /tmp/plasma
Allowing the Plasma store to use up to 1GB of memory.
Starting object store with directory /dev/shm and huge page support disabled

++++ create object example modified ++++
create.cc
#include <assert.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>

#include <random>

#include "plasma/client.h"
#include "plasma/common.h"
#include "plasma/plasma.h"
#include "plasma/protocol.h"

using namespace plasma;

int main(int argc, char** argv) {
  // Start up and connect a Plasma client.
  PlasmaClient client;
  ARROW_CHECK_OK(client.Connect("/tmp/plasma", "", 
PLASMA_DEFAULT_RELEASE_DELAY));

   ObjectID object_id = ObjectID::from_random();
   std::vector<uint8_t> data(100, 0);
  uint8_t metadata[] = {1};
  int64_t metadata_size = sizeof(metadata);

    std::shared_ptr<Buffer> data_buffer;
    ARROW_CHECK_OK(client.Create(object_id, data.size(), &metadata[0], 
metadata_size,
                                 &data_buffer));
    for (size_t i = 0; i < data.size(); i++) {
      data_buffer->mutable_data()[i] = data[i];
    }

  // Seal the object.
  ARROW_CHECK_OK(client.Seal(object_id));
  // Disconnect the client.
  ARROW_CHECK_OK(client.Disconnect());
}

+++++++++ tutorial error +++++++
with https://arrow.apache.org/docs/cpp/md_tutorials_plasma.html 
<https://arrow.apache.org/docs/cpp/md_tutorials_plasma.html> create.cc
g++ create2.cc `pkg-config --cflags --libs plasma` --std=c++11 -o create
In file included from /usr/local/include/plasma/common.h:32:0,
                 from /usr/local/include/plasma/client.h:30,
                 from create2.cc:1:
create2.cc: In function ‘int main(int, char**)’:
create2.cc:12:104: error: no matching function for call to 
‘plasma::PlasmaClient::Create(plasma::ObjectID&, int64_t&, uint8_t*, 
std::basic_string<char>::size_type, uint8_t**)’
   ARROW_CHECK_OK(client.Create(object_id, data_size, (uint8_t*) 
metadata.data(), metadata.size(), &data));
                                                                                
                        ^
create2.cc:12:104: note: candidate is:
In file included from create2.cc:1:0:
/usr/local/include/plasma/client.h:92:10: note: arrow::Status 
plasma::PlasmaClient::Create(const ObjectID&, int64_t, const uint8_t*, int64_t, 
std::shared_ptr<arrow::Buffer>*, int)
   Status Create(const ObjectID& object_id, int64_t data_size, const uint8_t* 
metadata,
          ^
/usr/local/include/plasma/client.h:92:10: note:   no known conversion for 
argument 5 from ‘uint8_t** {aka unsigned char**}’ to 
‘std::shared_ptr<arrow::Buffer>*’

Thanks,
Ovidiu

> On 02 May 2018, at 14:08, Uwe L. Korn <uw...@xhochy.com> wrote:
> 
> Hello Ovidiu,
> 
> we actually would like to keep the tutorial in line with the API we have in 
> master. Can you post the errors you're getting?
> 
> This would help us in understanding what is outdated in the steps.
> 
> Uwe
> 
> On Wed, May 2, 2018, at 11:53 AM, Ovidiu-Cristian MARCU wrote:
>> Hi,
>> 
>> Trying to follow the steps in 
>> https://arrow.apache.org/docs/cpp/md_tutorials_plasma.html 
>> <https://arrow.apache.org/docs/cpp/md_tutorials_plasma.html> with master 
>> branch does not work.
>> Could you please provide the arrow version that is compatible with this 
>> tutorial?
>> 
>> Thanks,
>> Ovidiu

Reply via email to