Skip to content

Commit 35ff2ce

Browse files
committed
Add missing javadocs
1 parent 5bfdafb commit 35ff2ce

File tree

6 files changed

+18
-2
lines changed

6 files changed

+18
-2
lines changed

src/main/java/org/sourcelab/storm/spout/redis/FailureHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public interface FailureHandler extends Serializable {
1313
/**
1414
* Lifecycle method. Called once the Spout has started.
1515
* @param stormConfig Configuration map passed from the spout.
16+
* @param topologyContext Storm TopologyContext instance.
1617
*/
1718
void open(final Map<String, Object> stormConfig, final TopologyContext topologyContext);
1819

src/main/java/org/sourcelab/storm/spout/redis/client/Client.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public interface Client {
1515

1616
/**
1717
* Retrieve the next batch of messages from Redis Stream.
18+
* @return List of next Messages consumed from Redis Stream.
1819
*/
1920
List<Message> nextMessages();
2021

src/main/java/org/sourcelab/storm/spout/redis/client/LettuceAdapter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public interface LettuceAdapter {
2020

2121
/**
2222
* Get sync Redis Stream Commands instance.
23+
* @return Available synchronous stream commands.
2324
*/
2425
RedisStreamCommands<String, String> getSyncCommands();
2526

src/main/java/org/sourcelab/storm/spout/redis/failhandler/ExponentialBackoffConfig.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ public class ExponentialBackoffConfig implements Serializable {
3939
private final boolean metricsEnabled;
4040

4141
/**
42-
* Constructor. See Builder instance.
42+
* Constructor.
43+
* See {@link Builder} instance.
44+
*
45+
* @param retryLimit How many times to attempt to retry a failed message. Defaults to 10.
46+
* @param initialRetryDelayMs Define minimum retry delay, in milliseconds. Defaults to 2000.
47+
* @param retryDelayMultiplier At what rate to delay messages that continue to fail. Defaults to 2.0.
48+
* @param retryDelayMaxMs Maximum cap on time delay for failed messages. Default to 10 minutes.
49+
* @param metricsEnabled If true, metrics will be published about failed messages.
4350
*/
4451
public ExponentialBackoffConfig(
4552
final int retryLimit,
@@ -119,6 +126,7 @@ public static final class Builder {
119126

120127
/**
121128
* Default multiplier to 2.0.
129+
* This default value gives us an exponential backoff rate.
122130
*/
123131
private double retryDelayMultiplier = 2.0;
124132

src/main/java/org/sourcelab/storm/spout/redis/failhandler/RetryFailedTuples.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@
1717
* A value greater than 0 sets the upper limit on the number of times a message will fail before just being skipped.
1818
* A value equal to 0 says failed messages will NEVER be replayed.
1919
* A value less than 0 says ALWAYS replay failed messages until they are successful.
20+
*
21+
* Recommended to use {@link ExponentialBackoffFailureHandler} instead of this naive implementation.
2022
*/
2123
public class RetryFailedTuples implements FailureHandler, Serializable {
2224
private static final Logger logger = LoggerFactory.getLogger(RetryFailedTuples.class);
2325

2426
/**
2527
* This tracks how many times a specific msgId has been replayed.
26-
* MsgId => Number of times we've replayed it.
28+
* Maps MsgId to the Number of times it has been replayed.
2729
*/
2830
private final Map<String, Long> messageCounter = new HashMap<>();
2931

src/main/java/org/sourcelab/storm/spout/redis/funnel/MemoryFunnel.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,16 @@ public class MemoryFunnel implements SpoutFunnel, ConsumerFunnel {
5353
/**
5454
* Constructor.
5555
* @param config configuration proeprties.
56+
* @param topologyContext Storm TopologyContext instance.
5657
*/
5758
public MemoryFunnel(
5859
final RedisStreamSpoutConfig config,
5960
final Map<String, Object> stormConfig,
6061
final TopologyContext topologyContext
6162
) {
6263
Objects.requireNonNull(config);
64+
Objects.requireNonNull(config);
65+
Objects.requireNonNull(topologyContext);
6366

6467
// These DO need to be concurrent.
6568
inFlightTuples = new ConcurrentHashMap<>(config.getMaxTupleQueueSize());

0 commit comments

Comments
 (0)