Kentaro Hayashi created ARROW-1598:
--------------------------------------

             Summary: [C++/Tutorials] MIsmatch code comment and actual code 
about Object ID
                 Key: ARROW-1598
                 URL: https://issues.apache.org/jira/browse/ARROW-1598
             Project: Apache Arrow
          Issue Type: Bug
          Components: Plasma (C++)
            Reporter: Kentaro Hayashi
            Priority: Minor


In Plasma documentation, there is a mismatch between code comment and actual 
code.

Here is the sample code in "Creating an Object" section:

{code:c++}
#include <plasma/client.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));
  // Create an object with a random ObjectID.
  ObjectID object_id = ObjectID::from_binary("00000000000000000000");
  int64_t data_size = 1000;
  uint8_t *data;
  std::string metadata = "{'author': 'john'}";
  ARROW_CHECK_OK(client.Create(object_id, data_size, (uint8_t*) 
metadata.data(), metadata.size(), &data));
  // Write some data into the object.
  for (int64_t i = 0; i < data_size; i++) {
    data[i] = static_cast<uint8_t>(i % 4);
  }
  // Seal the object.
  ARROW_CHECK_OK(client.Seal(object_id));
  // Disconnect the client.
  ARROW_CHECK_OK(client.Disconnect());
}
{code}

https://github.com/apache/arrow/blame/master/cpp/apidoc/tutorials/plasma.md#L223

It seems that code comment " // Create an object with a random ObjectID." 
description and "ObjectID object_id = 
ObjectID::from_binary("00000000000000000000");" is diverged.





--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to