This is an automated email from the ASF dual-hosted git repository.
pcmoritz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 16c79cc ARROW-1951: [Python] Add memcopy threads argument to
PlasmaClient put.
16c79cc is described below
commit 16c79cc94e2440321bcad1ebbef53ea1266b94e8
Author: Robert Nishihara <[email protected]>
AuthorDate: Thu Dec 28 13:34:32 2017 -0800
ARROW-1951: [Python] Add memcopy threads argument to PlasmaClient put.
Author: Robert Nishihara <[email protected]>
Closes #1451 from robertnishihara/numthreads and squashes the following
commits:
5e2c7ee [Robert Nishihara] Fix tests.
55cb8ac [Robert Nishihara] Revert old change
0903726 [Robert Nishihara] Move memcopy_threads from serialization context
to put.
9281de1 [Robert Nishihara] Expose memcopy threads to serialization context.
---
python/pyarrow/plasma.pyx | 7 +++++--
python/pyarrow/tests/test_plasma.py | 6 ++++--
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/python/pyarrow/plasma.pyx b/python/pyarrow/plasma.pyx
index f2e8653..9b3e409 100644
--- a/python/pyarrow/plasma.pyx
+++ b/python/pyarrow/plasma.pyx
@@ -370,7 +370,7 @@ cdef class PlasmaClient:
object_buffers[i].metadata_size))
return result
- def put(self, object value, ObjectID object_id=None,
+ def put(self, object value, ObjectID object_id=None, int memcopy_threads=6,
serialization_context=None):
"""
Store a Python value into the object store.
@@ -382,6 +382,9 @@ cdef class PlasmaClient:
object_id : ObjectID, default None
If this is provided, the specified object ID will be used to refer
to the object.
+ memcopy_threads : int, default 6
+ The number of threads to use to write the serialized object into
+ the object store for large objects.
serialization_context : pyarrow.SerializationContext, default None
Custom serialization and deserialization context.
@@ -394,7 +397,7 @@ cdef class PlasmaClient:
serialized = pyarrow.serialize(value, serialization_context)
buffer = self.create(target_id, serialized.total_bytes)
stream = pyarrow.FixedSizeBufferWriter(buffer)
- stream.set_memcopy_threads(4)
+ stream.set_memcopy_threads(memcopy_threads)
serialized.write_to(stream)
self.seal(target_id)
return target_id
diff --git a/python/pyarrow/tests/test_plasma.py
b/python/pyarrow/tests/test_plasma.py
index b28bd60..decdc73 100644
--- a/python/pyarrow/tests/test_plasma.py
+++ b/python/pyarrow/tests/test_plasma.py
@@ -310,12 +310,14 @@ class TestPlasmaClient(object):
serialization_context = pa.SerializationContext()
serialization_context.register_type(CustomType, 20*b"\x00")
- object_id = self.plasma_client.put(val, None, serialization_context)
+ object_id = self.plasma_client.put(
+ val, None, serialization_context=serialization_context)
with pytest.raises(pa.ArrowSerializationError):
result = self.plasma_client.get(object_id)
- result = self.plasma_client.get(object_id, -1, serialization_context)
+ result = self.plasma_client.get(
+ object_id, -1, serialization_context=serialization_context)
assert result.val == val.val
def test_store_arrow_objects(self):
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].