Skip to content

Commit a942da6

Browse files
author
Nathan Marz
committed
update output collector javadocs
1 parent acc5183 commit a942da6

File tree

2 files changed

+35
-17
lines changed

2 files changed

+35
-17
lines changed

src/jvm/backtype/storm/spout/SpoutOutputCollector.java

+16-8
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ public SpoutOutputCollector(ISpoutOutputCollector delegate) {
2323
* When Storm detects that this tuple has been fully processed, or has failed
2424
* to be fully processed, the spout will receive an ack or fail callback respectively
2525
* with the messageId as long as the messageId was not null. If the messageId was null,
26-
* Storm will not track the tuple and no callback will be received.
26+
* Storm will not track the tuple and no callback will be received. The emitted values must be
27+
* immutable.
2728
*
2829
* @return the list of task ids that this tuple was sent to
2930
*/
@@ -36,7 +37,8 @@ public List<Integer> emit(String streamId, List<Object> tuple, Object messageId)
3637
* When Storm detects that this tuple has been fully processed, or has failed
3738
* to be fully processed, the spout will receive an ack or fail callback respectively
3839
* with the messageId as long as the messageId was not null. If the messageId was null,
39-
* Storm will not track the tuple and no callback will be received.
40+
* Storm will not track the tuple and no callback will be received. The emitted values must be
41+
* immutable.
4042
*
4143
* @return the list of task ids that this tuple was sent to
4244
*/
@@ -46,15 +48,17 @@ public List<Integer> emit(List<Object> tuple, Object messageId) {
4648

4749
/**
4850
* Emits a tuple to the default output stream with a null message id. Storm will
49-
* not track this message so ack and fail will never be called for this tuple.
51+
* not track this message so ack and fail will never be called for this tuple. The
52+
* emitted values must be immutable.
5053
*/
5154
public List<Integer> emit(List<Object> tuple) {
5255
return emit(tuple, null);
5356
}
5457

5558
/**
5659
* Emits a tuple to the specified output stream with a null message id. Storm will
57-
* not track this message so ack and fail will never be called for this tuple.
60+
* not track this message so ack and fail will never be called for this tuple. The
61+
* emitted values must be immutable.
5862
*/
5963
public List<Integer> emit(String streamId, List<Object> tuple) {
6064
return emit(streamId, tuple, null);
@@ -63,7 +67,8 @@ public List<Integer> emit(String streamId, List<Object> tuple) {
6367
/**
6468
* Emits a tuple to the specified task on the specified output stream. This output
6569
* stream must have been declared as a direct stream, and the specified task must
66-
* use a direct grouping on this stream to receive the message.
70+
* use a direct grouping on this stream to receive the message. The emitted values must be
71+
* immutable.
6772
*/
6873
public void emitDirect(int taskId, String streamId, List<Object> tuple, Object messageId) {
6974
_delegate.emitDirect(taskId, streamId, tuple, messageId);
@@ -72,7 +77,8 @@ public void emitDirect(int taskId, String streamId, List<Object> tuple, Object m
7277
/**
7378
* Emits a tuple to the specified task on the default output stream. This output
7479
* stream must have been declared as a direct stream, and the specified task must
75-
* use a direct grouping on this stream to receive the message.
80+
* use a direct grouping on this stream to receive the message. The emitted values must be
81+
* immutable.
7682
*/
7783
public void emitDirect(int taskId, List<Object> tuple, Object messageId) {
7884
emitDirect(taskId, Utils.DEFAULT_STREAM_ID, tuple, messageId);
@@ -81,7 +87,8 @@ public void emitDirect(int taskId, List<Object> tuple, Object messageId) {
8187
/**
8288
* Emits a tuple to the specified task on the specified output stream. This output
8389
* stream must have been declared as a direct stream, and the specified task must
84-
* use a direct grouping on this stream to receive the message.
90+
* use a direct grouping on this stream to receive the message. The emitted values must be
91+
* immutable.
8592
*
8693
* <p> Because no message id is specified, Storm will not track this message
8794
* so ack and fail will never be called for this tuple.</p>
@@ -93,7 +100,8 @@ public void emitDirect(int taskId, String streamId, List<Object> tuple) {
93100
/**
94101
* Emits a tuple to the specified task on the default output stream. This output
95102
* stream must have been declared as a direct stream, and the specified task must
96-
* use a direct grouping on this stream to receive the message.
103+
* use a direct grouping on this stream to receive the message. The emitted values must be
104+
* immutable.
97105
*
98106
* <p> Because no message id is specified, Storm will not track this message
99107
* so ack and fail will never be called for this tuple.</p>

src/jvm/backtype/storm/task/OutputCollector.java

+19-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ public OutputCollector(IOutputCollector delegate) {
2020
}
2121

2222
/**
23-
* Emits a new tuple to a specific stream with a single anchor.
23+
* Emits a new tuple to a specific stream with a single anchor. The emitted values must be
24+
* immutable.
2425
*
2526
* @param streamId the stream to emit to
2627
* @param anchor the tuple to anchor to
@@ -34,7 +35,8 @@ public List<Integer> emit(String streamId, Tuple anchor, List<Object> tuple) {
3435
/**
3536
* Emits a new unanchored tuple to the specified stream. Because it's unanchored,
3637
* if a failure happens downstream, this new tuple won't affect whether any
37-
* spout tuples are considered failed or not.
38+
* spout tuples are considered failed or not. The emitted values must be
39+
* immutable.
3840
*
3941
* @param streamId the stream to emit to
4042
* @param tuple the new output tuple from this bolt
@@ -45,7 +47,8 @@ public List<Integer> emit(String streamId, List<Object> tuple) {
4547
}
4648

4749
/**
48-
* Emits a new tuple to the default stream anchored on a group of input tuples.
50+
* Emits a new tuple to the default stream anchored on a group of input tuples. The emitted
51+
* values must be immutable.
4952
*
5053
* @param anchors the tuples to anchor to
5154
* @param tuple the new output tuple from this bolt
@@ -57,7 +60,8 @@ public List<Integer> emit(Collection<Tuple> anchors, List<Object> tuple) {
5760

5861

5962
/**
60-
* Emits a new tuple to the default stream anchored on a single tuple.
63+
* Emits a new tuple to the default stream anchored on a single tuple. The emitted values must be
64+
* immutable.
6165
*
6266
* @param anchor the tuple to anchor to
6367
* @param tuple the new output tuple from this bolt
@@ -70,7 +74,8 @@ public List<Integer> emit(Tuple anchor, List<Object> tuple) {
7074
/**
7175
* Emits a new unanchored tuple to the default stream. Beacuse it's unanchored,
7276
* if a failure happens downstream, this new tuple won't affect whether any
73-
* spout tuples are considered failed or not.
77+
* spout tuples are considered failed or not. The emitted values must be
78+
* immutable.
7479
*
7580
* @param tuple the new output tuple from this bolt
7681
* @return the list of task ids that this new tuple was sent to
@@ -84,7 +89,8 @@ public List<Integer> emit(List<Object> tuple) {
8489
* If the target bolt does not subscribe to this bolt using a direct grouping,
8590
* the tuple will not be sent. If the specified output stream is not declared
8691
* as direct, or the target bolt subscribes with a non-direct grouping,
87-
* an error will occur at runtime.
92+
* an error will occur at runtime. The emitted values must be
93+
* immutable.
8894
*
8995
* @param taskId the taskId to send the new tuple to
9096
* @param streamId the stream to send the tuple on. It must be declared as a direct stream in the topology definition.
@@ -102,6 +108,7 @@ public void emitDirect(int taskId, String streamId, Tuple anchor, List<Object> t
102108
* as direct, or the target bolt subscribes with a non-direct grouping,
103109
* an error will occur at runtime. Note that this method does not use anchors,
104110
* so downstream failures won't affect the failure status of any spout tuples.
111+
* The emitted values must be immutable.
105112
*
106113
* @param taskId the taskId to send the new tuple to
107114
* @param streamId the stream to send the tuple on. It must be declared as a direct stream in the topology definition.
@@ -116,7 +123,8 @@ public void emitDirect(int taskId, String streamId, List<Object> tuple) {
116123
* If the target bolt does not subscribe to this bolt using a direct grouping,
117124
* the tuple will not be sent. If the specified output stream is not declared
118125
* as direct, or the target bolt subscribes with a non-direct grouping,
119-
* an error will occur at runtime.
126+
* an error will occur at runtime. The emitted values must be
127+
* immutable.
120128
*
121129
* <p>The default stream must be declared as direct in the topology definition.
122130
* See OutputDeclarer#declare for how this is done when defining topologies
@@ -135,7 +143,8 @@ public void emitDirect(int taskId, Collection<Tuple> anchors, List<Object> tuple
135143
* If the target bolt does not subscribe to this bolt using a direct grouping,
136144
* the tuple will not be sent. If the specified output stream is not declared
137145
* as direct, or the target bolt subscribes with a non-direct grouping,
138-
* an error will occur at runtime.
146+
* an error will occur at runtime. The emitted values must be
147+
* immutable.
139148
*
140149
* <p>The default stream must be declared as direct in the topology definition.
141150
* See OutputDeclarer#declare for how this is done when defining topologies
@@ -155,7 +164,8 @@ public void emitDirect(int taskId, Tuple anchor, List<Object> tuple) {
155164
* If the target bolt does not subscribe to this bolt using a direct grouping,
156165
* the tuple will not be sent. If the specified output stream is not declared
157166
* as direct, or the target bolt subscribes with a non-direct grouping,
158-
* an error will occur at runtime.
167+
* an error will occur at runtime. The emitted values must be
168+
* immutable.
159169
*
160170
* <p>The default stream must be declared as direct in the topology definition.
161171
* See OutputDeclarer#declare for how this is done when defining topologies

0 commit comments

Comments
 (0)