-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
978451e
commit 7559711
Showing
13 changed files
with
178 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. _api_context: | ||
|
||
.. currentmodule:: pysparkling | ||
|
||
Context | ||
------- | ||
|
||
A :class:`Context` describes the setup. Instantiating a Context with the default | ||
arguments using ``Context()`` is the most lightweight setup. All data is just | ||
in the local thread and is never serialized or deserialized. | ||
|
||
If you want to process the data in parallel, you can use the ``multiprocessing`` | ||
module. Given the limitations of the default ``pickle`` serializer, you can | ||
specify to serialize all methods with ``cloudpickle`` instead. For example, | ||
a common instantiation with ``multiprocessing`` looks like this: | ||
|
||
.. code-block:: python | ||
c = Context( | ||
multiprocessing.Pool(4), | ||
serializer=cloudpickle.dumps, | ||
deserializer=pickle.loads, | ||
) | ||
This assumes that your data is serializable with ``pickle`` which is generally | ||
faster. You can also specify a custom serializer/deserializer for data. | ||
|
||
.. autoclass:: pysparkling.Context | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.. _api_fileio: | ||
|
||
|
||
fileio | ||
------ | ||
|
||
.. currentmodule:: pysparkling | ||
|
||
The functionality provided by this module is used in :func:`Context.textFile` | ||
for reading and in :func:`RDD.saveAsTextFile` for writing. | ||
|
||
.. currentmodule:: pysparkling.fileio | ||
|
||
You can use this submodule for writing files directly with :func:`File.dump`, | ||
:func:`File.load` and :func:`File.exists` to read, write and check | ||
for existance of a file. All methods transparently handle various schemas | ||
(for example ``http://``, ``s3://`` and ``file://``) and | ||
compression/decompression of ``.gz`` and ``.bz2`` files (among others). | ||
|
||
|
||
.. autoclass:: pysparkling.fileio.File | ||
:members: | ||
|
||
.. autoclass:: pysparkling.fileio.TextFile | ||
:members: | ||
|
||
.. autoclass:: pysparkling.fileio.fs.FileSystem | ||
:members: | ||
|
||
.. autoclass:: pysparkling.fileio.fs.S3 | ||
:members: | ||
|
||
.. autoclass:: pysparkling.fileio.fs.GS | ||
:members: | ||
|
||
.. autoclass:: pysparkling.fileio.fs.Hdfs | ||
:members: | ||
|
||
.. autoclass:: pysparkling.fileio.fs.Http | ||
:members: | ||
|
||
.. autoclass:: pysparkling.fileio.fs.Local | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.. _api_rdd: | ||
|
||
RDD | ||
--- | ||
|
||
.. autoclass:: pysparkling.RDD | ||
:members: | ||
|
||
.. autoclass:: pysparkling.StatCounter | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
|
||
|
||
class File(object): | ||
"""file object | ||
"""File object. | ||
:param file_name: Any file name. | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters