[
https://issues.apache.org/jira/browse/ARROW-2042?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16346210#comment-16346210
]
ASF GitHub Bot commented on ARROW-2042:
---------------------------------------
wesm closed pull request #1520: ARROW-2042: [Plasma] Revert API change of
plasma::Create to output a MutableBuffer
URL: https://github.com/apache/arrow/pull/1520
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/cpp/src/plasma/client.cc b/cpp/src/plasma/client.cc
index a683da002..6e9b6968a 100644
--- a/cpp/src/plasma/client.cc
+++ b/cpp/src/plasma/client.cc
@@ -54,6 +54,8 @@
namespace plasma {
+using arrow::MutableBuffer;
+
// Number of threads used for memcopy and hash computations.
constexpr int64_t kThreadPoolSize = 8;
constexpr int64_t kBytesInMB = 1 << 20;
@@ -147,7 +149,7 @@ void PlasmaClient::increment_object_count(const ObjectID&
object_id, PlasmaObjec
Status PlasmaClient::Create(const ObjectID& object_id, int64_t data_size,
uint8_t* metadata, int64_t metadata_size,
- std::shared_ptr<MutableBuffer>* data) {
+ std::shared_ptr<Buffer>* data) {
ARROW_LOG(DEBUG) << "called plasma_create on conn " << store_conn_ << " with
size "
<< data_size << " and metadata size " << metadata_size;
RETURN_NOT_OK(SendCreateRequest(store_conn_, object_id, data_size,
metadata_size));
diff --git a/cpp/src/plasma/client.h b/cpp/src/plasma/client.h
index a1e10a9c2..d6372f44a 100644
--- a/cpp/src/plasma/client.h
+++ b/cpp/src/plasma/client.h
@@ -32,7 +32,6 @@
#include "plasma/common.h"
using arrow::Buffer;
-using arrow::MutableBuffer;
using arrow::Status;
namespace plasma {
@@ -116,7 +115,7 @@ class ARROW_EXPORT PlasmaClient {
/// will be written here.
/// \return The return status.
Status Create(const ObjectID& object_id, int64_t data_size, uint8_t*
metadata,
- int64_t metadata_size, std::shared_ptr<MutableBuffer>* data);
+ int64_t metadata_size, std::shared_ptr<Buffer>* data);
/// Get some objects from the Plasma Store. This function will block until
the
/// objects have all been created and sealed in the Plasma Store or the
/// timeout
diff --git a/cpp/src/plasma/test/client_tests.cc
b/cpp/src/plasma/test/client_tests.cc
index 63b56934f..f19c2bfbd 100644
--- a/cpp/src/plasma/test/client_tests.cc
+++ b/cpp/src/plasma/test/client_tests.cc
@@ -70,7 +70,7 @@ TEST_F(TestPlasmaStore, DeleteTest) {
int64_t data_size = 100;
uint8_t metadata[] = {5};
int64_t metadata_size = sizeof(metadata);
- std::shared_ptr<MutableBuffer> data;
+ std::shared_ptr<Buffer> data;
ARROW_CHECK_OK(client_.Create(object_id, data_size, metadata, metadata_size,
&data));
ARROW_CHECK_OK(client_.Seal(object_id));
@@ -96,7 +96,7 @@ TEST_F(TestPlasmaStore, ContainsTest) {
int64_t data_size = 100;
uint8_t metadata[] = {5};
int64_t metadata_size = sizeof(metadata);
- std::shared_ptr<MutableBuffer> data;
+ std::shared_ptr<Buffer> data;
ARROW_CHECK_OK(client_.Create(object_id, data_size, metadata, metadata_size,
&data));
ARROW_CHECK_OK(client_.Seal(object_id));
// Avoid race condition of Plasma Manager waiting for notification.
@@ -119,7 +119,7 @@ TEST_F(TestPlasmaStore, GetTest) {
int64_t data_size = 4;
uint8_t metadata[] = {5};
int64_t metadata_size = sizeof(metadata);
- std::shared_ptr<MutableBuffer> data_buffer;
+ std::shared_ptr<Buffer> data_buffer;
uint8_t* data;
ARROW_CHECK_OK(
client_.Create(object_id, data_size, metadata, metadata_size,
&data_buffer));
@@ -145,7 +145,7 @@ TEST_F(TestPlasmaStore, MultipleGetTest) {
int64_t data_size = 4;
uint8_t metadata[] = {5};
int64_t metadata_size = sizeof(metadata);
- std::shared_ptr<MutableBuffer> data;
+ std::shared_ptr<Buffer> data;
ARROW_CHECK_OK(client_.Create(object_id1, data_size, metadata,
metadata_size, &data));
data->mutable_data()[0] = 1;
ARROW_CHECK_OK(client_.Seal(object_id1));
@@ -172,7 +172,7 @@ TEST_F(TestPlasmaStore, AbortTest) {
int64_t data_size = 4;
uint8_t metadata[] = {5};
int64_t metadata_size = sizeof(metadata);
- std::shared_ptr<MutableBuffer> data;
+ std::shared_ptr<Buffer> data;
uint8_t* data_ptr;
ARROW_CHECK_OK(client_.Create(object_id, data_size, metadata, metadata_size,
&data));
data_ptr = data->mutable_data();
@@ -220,7 +220,7 @@ TEST_F(TestPlasmaStore, MultipleClientTest) {
int64_t data_size = 100;
uint8_t metadata[] = {5};
int64_t metadata_size = sizeof(metadata);
- std::shared_ptr<MutableBuffer> data;
+ std::shared_ptr<Buffer> data;
ARROW_CHECK_OK(client2_.Create(object_id, data_size, metadata,
metadata_size, &data));
ARROW_CHECK_OK(client2_.Seal(object_id));
// Test that the first client can get the object.
@@ -260,7 +260,7 @@ TEST_F(TestPlasmaStore, ManyObjectTest) {
int64_t data_size = 100;
uint8_t metadata[] = {5};
int64_t metadata_size = sizeof(metadata);
- std::shared_ptr<MutableBuffer> data;
+ std::shared_ptr<Buffer> data;
ARROW_CHECK_OK(client_.Create(object_id, data_size, metadata,
metadata_size, &data));
if (i % 3 == 0) {
diff --git a/python/pyarrow/plasma.pyx b/python/pyarrow/plasma.pyx
index 801d09419..32f6d189d 100644
--- a/python/pyarrow/plasma.pyx
+++ b/python/pyarrow/plasma.pyx
@@ -81,7 +81,7 @@ cdef extern from "plasma/client.h" nogil:
CStatus Create(const CUniqueID& object_id, int64_t data_size,
const uint8_t* metadata, int64_t metadata_size,
- const shared_ptr[CMutableBuffer]* data)
+ const shared_ptr[CBuffer]* data)
CStatus Get(const CUniqueID* object_ids, int64_t num_objects,
int64_t timeout_ms, CObjectBuffer* object_buffers)
@@ -297,7 +297,7 @@ cdef class PlasmaClient:
not be created because the plasma store is unable to evict
enough objects to create room for it.
"""
- cdef shared_ptr[CMutableBuffer] data
+ cdef shared_ptr[CBuffer] data
with nogil:
check_status(self.client.get().Create(object_id.data, data_size,
<uint8_t*>(metadata.data()),
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [Plasma] Revert API change of plasma::Create to output a MutableBuffer
> ----------------------------------------------------------------------
>
> Key: ARROW-2042
> URL: https://issues.apache.org/jira/browse/ARROW-2042
> Project: Apache Arrow
> Issue Type: Improvement
> Components: Plasma (C++)
> Reporter: Philipp Moritz
> Assignee: Philipp Moritz
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.9.0
>
>
> Reverts a part of the changes from
> [https://github.com/apache/arrow/pull/1479] concerning the plasma::Create
> API. It should output a shared pointer to a Buffer instead of a shared
> pointer to a MutableBuffer. This is needed for
> [https://github.com/apache/arrow/pull/1445] so we can return a CudaBuffer
> from plasma::Create. It also seems to be more in line with how Buffers are
> intended to be used and avoids API breakage from 0.8.0 to 0.9.0.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)