我们在esper中创建每小时一次的上下文,并使用@hint和output rate limiter.But,在某些事件中,我们仍然会耗尽内存。XMX -12 G
在某些情况下,如果我们有糟糕的压缩,这意味着,例如,我们获得了6 GB的数据,这是非聚合的,因此它是esper的不良压缩。
我还想在esper上限制大小,所以如果我们在每小时上下文之前达到限制,我可以刷新压缩不好的大块数据。
这就像你遇到了每小时的上下文或者输出数据的大小。
我的esper查询
private static final String HOURLY_CONTEXT =
"create context HourlyRollup start(0,*,*,*,*,0) end(59,*,*,*,*,59)";
private static final String HINT = "@Hint('enable_outputlimit_opt') ";
private static final String HOURLY_STATEMENT = HINT+
"context HourlyRollup "
+ "select count(*) as xcount,hourlyFloor(min(from_time)),a,b,c,d,e,f,"
+ "g,h,sum(h),sum(i),j,k,l,"
+ "m,n,y,o,p,q,r "
+ "from io.common.Bean where Dir in (-5,-3,0,1) "
+ "group by a,b,c,d,e,f,g,Direction,h,"
+ "i,j,k,l,m,l,n,o,p output all "+"when terminated";发布于 2019-10-16 12:30:01
确保您的查询是完全聚合的,否则Esper必须保留事件,因为select子句请求事件数据。当查询是完全聚合的时,Esper只保留聚合数据,这就是您想要的。
这不是完全聚合:
select a, b, count(*) from Event group by a这是更好的和完全聚合的:
select a, b, count(*) from Event group by a, b这方面的文档是here。
https://stackoverflow.com/questions/58405063
复制相似问题