arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject arrow git commit: ARROW-1366: [Plasma] Define entry point for the plasma store
Date Sat, 19 Aug 2017 18:13:49 GMT
Repository: arrow
Updated Branches:
  refs/heads/master e1bad9fd2 -> 652fd36a7


ARROW-1366: [Plasma] Define entry point for the plasma store

The method for starting the Plasma store is already documented in https://arrow.apache.org/docs/python/plasma.html.
So far it only worked if the store was installed with "make install" from the C++ sources.
This makes it also possible to start it if the pyarrow wheels are installed.

Author: Philipp Moritz <pcmoritz@gmail.com>

Closes #975 from pcmoritz/plasma-store-ep and squashes the following commits:

eddc487a [Philipp Moritz] make plasma store entry point private
4c051409 [Philipp Moritz] define entry point for the plasma store


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/652fd36a
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/652fd36a
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/652fd36a

Branch: refs/heads/master
Commit: 652fd36a7012b5bf484abee9ba1ce22542af6ac0
Parents: e1bad9f
Author: Philipp Moritz <pcmoritz@gmail.com>
Authored: Sat Aug 19 14:13:45 2017 -0400
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Sat Aug 19 14:13:45 2017 -0400

----------------------------------------------------------------------
 python/pyarrow/__init__.py | 16 ++++++++++++++++
 python/setup.py            |  5 +++++
 2 files changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/652fd36a/python/pyarrow/__init__.py
----------------------------------------------------------------------
diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py
index 8d4a214..d0348b4 100644
--- a/python/pyarrow/__init__.py
+++ b/python/pyarrow/__init__.py
@@ -105,6 +105,22 @@ from pyarrow.ipc import (Message, MessageReader,
 
 localfs = LocalFileSystem.get_instance()
 
+# Entry point for starting the plasma store
+
+def _plasma_store_entry_point():
+    """Entry point for starting the plasma store.
+
+    This can be used by invoking e. g. ``plasma_store -s /tmp/plasma -m 1000000000``
+    from the command line and will start the plasma_store executable with the
+    given arguments.
+    """
+    import os
+    import pyarrow
+    import subprocess
+    import sys
+    plasma_store_executable = os.path.join(pyarrow.__path__[0], "plasma_store")
+    process = subprocess.Popen([plasma_store_executable] + sys.argv[1:])
+    process.wait()
 
 # ----------------------------------------------------------------------
 # 0.4.0 deprecations

http://git-wip-us.apache.org/repos/asf/arrow/blob/652fd36a/python/setup.py
----------------------------------------------------------------------
diff --git a/python/setup.py b/python/setup.py
index ebf28cc..4657da0 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -382,6 +382,11 @@ setup(
         'clean': clean,
         'build_ext': build_ext
     },
+    entry_points = {
+        'console_scripts': [
+            'plasma_store = pyarrow:_plasma_store_entry_point'
+        ]
+    },
     use_scm_version={"root": "..", "relative_to": __file__},
     setup_requires=['setuptools_scm', 'cython >= 0.23'],
     install_requires=['numpy >= 1.10', 'six >= 1.0.0'],


Mime
View raw message