Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-1598

[C++/Tutorials] MIsmatch code comment and actual code about Object ID

    XMLWordPrintableJSON

    Details

      Description

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

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

      #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());
      }
      

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kenhys Kentaro Hayashi
                Reporter:
                kenhys Kentaro Hayashi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: