8000 Remove emit_many from Spout, since it's been deprecated since before … · pystorm/pystorm@004dc27 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 004dc27

Browse files
committed
Remove emit_many from Spout, since it's been deprecated since before pystorm existed.
1 parent 2d8be57 commit 004dc27

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

doc/source/quickstart.rst

-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ an incoming spout or bolt. You are welcome to do whatever processing you would
7676
like in this method and can further emit tuples or not depending on the purpose
7777
of your bolt.
7878

79-
In the ``SentenceSplitterBolt`` above, we have decided to use the
80-
``emit_many()`` method instead of ``emit()`` which is a bit more efficient when
81-
sending a larger number of tuples to Storm.
82-
8379
If your ``process()`` method completes without raising an Exception, pystorm
8480
will automatically ensure any emits you have are anchored to the current tuple
8581
being processed and acknowledged after ``process()`` completes.

pystorm/spout.py

-42
Original file line numberDiff line numberDiff line change
@@ -83,48 +83,6 @@ def emit(self, tup, tup_id=None, stream=None, direct_task=None,
8383
direct_task=direct_task,
8484
need_task_ids=need_task_ids)
8585

86-
def emit_many(self, tuples, stream=None, tup_ids=None, direct_task=None,
87-
need_task_ids=True):
88-
"""Emit multiple tuples.
89-
90-
:param tuples: a ``list`` of multiple Tuple payloads to send to
91-
Storm. All Tuples should contain only
92-
JSON-serializable data.
93-
:type tuples: list
94-
:param stream: the ID of the stream to emit these Tuples to. Specify
95-
``None`` to emit to default stream.
96-
:type stream: str
97-
:param tup_ids: the ID for the Tuple. Leave this blank for an
98-
unreliable emit.
99-
:type tup_ids: list
100-
:param tup_ids: IDs for each of the Tuples in the list. Omit these for
101-
an unreliable emit.
102-
:type anchors: list
103-
:param direct_task: indicates the task to send the Tuple to.
104-
:type direct_task: int
105-
:param need_task_ids: indicate whether or not you'd like the task IDs
106-
the Tuple was emitted (default:
107-
``True``).
108-
:type need_task_ids: bool
109-
110-
.. deprecated:: 2.0.0
111-
Just call :py:meth:`Spout.emit` repeatedly instead.
112-
"""
113-
if not isinstance(tuples, (list, tuple)):
114-
raise TypeError('Tuples should be a list of lists/tuples, '
115-
'received {!r} instead.'.format(type(tuples)))
116-
117-
all_task_ids = []
118-
if tup_ids is None:
119-
tup_ids = itertools.repeat(None)
120-
121-
for tup, tup_id in zip(tuples, tup_ids):
122-
all_task_ids.append(self.emit(tup, stream=stream, tup_id=tup_id,
123-
direct_task=direct_task,
124-
need_task_ids=need_task_ids))
125-
126-
return all_task_ids
127-
12886
def _run(self):
12987
"""The inside of ``run``'s infinite loop.
13088

0 commit comments

Comments
 (0)
0