Flush Jaspersoft OLAP Cache from Talend/JasperETL

Ernesto Ongaro
Tech Poet )

JaspersoftETL is a Java code generation tool designed to load your operational data into a data warehouse and get it ready for reporting and analysis.  Jaspersoft OLAP takes advantage of aggregate tables and an in-memory cache to speed up queries. If you're running a nightly job to load the DW, it's a good idea to clear the OLAP cache at that time, otherwise your users will not take advantage of new data.

There are several ways to clear the OLAP cache:
  • Login with superuser privileges and display the OLAP Settings page.
  • In the OLAP Settings panel, click Flush OLAP Cache
  •  Using utilities such as cURL and wget, send an HTTP request to this URL: http://server:8080/olap/flush.html?j_username=superuser&j_password=
  • Restart the application server instance. 
  • Call the Java API.
I've created a small component that allows the clearing of cache via the URL method from a JasperETL/Talend job. Essentially it will prompt you for a username and password (and note that only superuser can clear the cache by default) and a server URL. The URL should point to something like http://server:8080/jasperserver-pro/olap/flush.html

You may find the tJasperOLAPCache component on talendforge.org

Another useful thing to do would be to use the tJasperServerExec plugin to re-populate the cache.