Github user cestella commented on a diff in the pull request:
https://github.com/apache/metron/pull/595#discussion_r117610139
--- Diff:
metron-platform/metron-enrichment/src/main/java/org/apache/metron/enrichment/bolt/JoinBolt.java
---
@@ -90,11 +93,24 @@ public void prepare(Map map, TopologyContext
topologyContext, OutputCollector ou
}
};
cache = CacheBuilder.newBuilder().maximumSize(maxCacheSize)
- .expireAfterWrite(maxTimeRetain, TimeUnit.MINUTES)
+ .expireAfterWrite(maxTimeRetain,
TimeUnit.MINUTES).removalListener(new JoinRemoveListener())
.build(loader);
prepare(map, topologyContext);
}
+ class JoinRemoveListener implements RemovalListener<String, Map<String,
V>> {
+
+ @Override
+ public void onRemoval(RemovalNotification<String, Map<String, V>>
removalNotification) {
+ if (removalNotification.getCause() == RemovalCause.SIZE) {
+ LOG.error("Join cache reached max size limit. Increase the
maxCacheSize setting or add more tasks to " + this.getClass().getSimpleName() +
".");
+ }
+ if (removalNotification.getCause() == RemovalCause.EXPIRED) {
+ LOG.error("Message was in the join cache too long which may be
caused by slow enrichments/threatintels. Increase the maxTimeRetain setting.");
--- End diff --
We should also do a `Collector.reportError()` on the message, so it pops up
in the Storm UI.
---
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.
---