您的位置:首页 > 大数据 > 人工智能

让SaiKu实时展现查询数据

2014-03-25 09:11 316 查看
在默认的情况下,saiku是不能对数据进行实时展现的,只能通过下图的刷新按钮或者重启服务器来刷新数据



这样以来会有很多的麻烦,每天得手动去刷新,这个操作只有管理员可以操作,在刷新以前客户看到的都是缓存中的旧数据,有人说写个shell去定时更新不行吗?这个做法当然可以。除了这个做法,我来说说我的做法,让saiku查询完数据后即时加载,不用数据库连接池,加载完成后立刻清除缓存中的数据,系统下次在加载的时候发现缓存是空的,就会自动去查询新数据,这样以来就可以做到实时展现,具体修改如下:
编辑 saiku/ui/js/saiku/Settings.js
LOCALSTORAGE_EXPIRATION: 10 * 60 * 60 * 1000 /* 10 hours, in ms */
修改后
LOCALSTORAGE_EXPIRATION: 1
编辑 saiku/plugin.spring.xml
<bean id="connectionManager" class="org.saiku.plugin.PentahoSecurityAwareConnectionManager" init-method="init"  destroy-method="destroy"><property name="dataSourceManager" ref="pentahoDsManager" /><property name="userAware" value="false" /><property name="connectionPooling" value="true" /></bean>
修改后
<bean id="connectionManager" class="org.saiku.plugin.PentahoSecurityAwareConnectionManager" init-method="init"  destroy-method="destroy"><property name="dataSourceManager" ref="pentahoDsManager" /><property name="userAware" value="false" /><property name="connectionPooling" value="false" /></bean>


编辑mondrian/mondrian.properties
修改前
# Boolean property that controls whether a RolapStar's aggregate data cache is cleared after each query.
mondrian.rolap.star.disableCaching=false
修改后
# Boolean property that controls whether a RolapStar's aggregate data cache is cleared after each query.
mondrian.rolap.star.disableCaching=true
好了,重新应用服务器,看看效果吧

本文出自 “博客即日起停止更新” 博客,请务必保留此出处http://sucre.blog.51cto.com/1084905/1383588
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: