[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plasma tutorial which version?

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 <>, however trying to compile fails with:
g++ `pkg-config --cflags --libs plasma arrow` --std=c++11 -o create
In file included from /usr/local/include/plasma/plasma.h:40:0,
/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 
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 ++++
#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,
    for (size_t i = 0; i < data.size(); i++) {
      data_buffer->mutable_data()[i] = data[i];

  // Seal the object.
  // Disconnect the client.

+++++++++ tutorial error +++++++
with <>
g++ `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 In function ‘int main(int, char**)’: 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.size(), &data));
                                                                                                        ^ note: candidate is:
In file included from
/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>*’


> On 02 May 2018, at 14:08, Uwe L. Korn <uwelk@xxxxxxxxxx> 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 
>> <> with master 
>> branch does not work.
>> Could you please provide the arrow version that is compatible with this 
>> tutorial?
>> Thanks,
>> Ovidiu