Github user arunmahadevan commented on a diff in the pull request:
https://github.com/apache/storm/pull/2218#discussion_r130273607
--- Diff:
storm-client/src/jvm/org/apache/storm/topology/base/BaseStatefulWindowedBolt.java
---
@@ -151,6 +158,38 @@
return this;
}
+ /**
+ * If set, the stateful windowed bolt would use the backend state for
window persistence and
+ * only keep a sub-set of events in memory as specified by {@link
#withMaxEventsInMemory(long)}.
+ */
+ public BaseStatefulWindowedBolt<T> withPersistence() {
+ persistent = true;
+ return this;
+ }
+
+ /**
+ * The maximum number of window events to keep in memory. This is
meaningful only if
+ * {@link #withPersistence()} is also set. As the number of events in
memory grows close
+ * to the maximum, the events that are less likely to be used again
are evicted and persisted.
+ * The default value for this is {@code 1,000,000}.
+ *
+ * @param maxEventsInMemory the maximum number of window events to
keep in memory
+ */
+ public BaseStatefulWindowedBolt<T> withMaxEventsInMemory(long
maxEventsInMemory) {
--- End diff --
Yes, it would be a good option to provide in future. Will raise a followup
JIRA.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---