Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Mondrian caching

  1. #1

    Default Mondrian caching

    I read about Mondrian cache control here

    http://mondrian.pentaho.org/document...he_control.php

    I copied the paragraph which are related to my questions below:

    "Mondrian cannot deduce when the database is being modified, so we introduce an API so that the container can tell Mondrian which parts of the cache are out of date. Mondrian's implementation must ensure that the changing database state does not yield inconsistent query results."

    "Until now, control of the cache has been very crude: applications would typically call

    mondrian.rolap.RolapSchema.clearCache();

    to flush the cache which maps connect string URLs to in-memory datasets."

    after reading it, I am still not sure how/where in the so called application/container should I write code (like the simple example given in the page ) to implement it? Do I have to write code to implement it? Is there any way I can declaratively(via a property file for example) control how the cache is done? Such as every 5 mins to flush cache etc?

  2. #2
    Join Date
    May 2006
    Posts
    104

    Default

    I recall seeing in the 1.6.0 PCI under "Admin" that you can schedule "cache clearing". Other than that, there are two xactions there that deal with clearing the two type of Mondrian caches - clear_mondrian_schema_cache.xaction and clear_mondrian_data_cache.xaction.
    Ralph

  3. #3
    Join Date
    Jul 2007
    Posts
    11

    Default

    Quote Originally Posted by mbyanfei View Post
    I read about Mondrian cache control here

    http://mondrian.pentaho.org/document...he_control.php

    I copied the paragraph which are related to my questions below:

    "Mondrian cannot deduce when the database is being modified, so we introduce an API so that the container can tell Mondrian which parts of the cache are out of date. Mondrian's implementation must ensure that the changing database state does not yield inconsistent query results."

    "Until now, control of the cache has been very crude: applications would typically call

    mondrian.rolap.RolapSchema.clearCache();

    to flush the cache which maps connect string URLs to in-memory datasets."

    after reading it, I am still not sure how/where in the so called application/container should I write code (like the simple example given in the page ) to implement it? Do I have to write code to implement it? Is there any way I can declaratively(via a property file for example) control how the cache is done? Such as every 5 mins to flush cache etc?
    You can find a solution on this thread http://forums.pentaho.org/showthread.php?t=56424
    Starting from it I've automatize, by a cron job, the loading the BI database. The last action executed by that cron job runs the compiled java program below in order to flush the Mondrian cache. Everything run on a Linux 64bits env everyday on the night:

    Code:
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.io.DataInputStream;
    import java.net.URL;
    import java.net.URLConnection;
    
    class PentahoFlushCache
    {
      public static void main(String args[])
      {
        try
        {
          URL urlflush = new URL("http://127.0.0.1:8080/pentaho/FlushCache.jsp");
          URLConnection connection = urlflush.openConnection();
          DataInputStream dis = new DataInputStream(connection.getInputStream());
          dis.close();
        }
        catch (MalformedURLException me)
        {
          System.out.println("MalformedURLException: " + me);
        }
        catch (IOException ioe)
        {
          System.out.println("IOException: " + ioe);
        }
        System.out.println("- FLUSH OK -") ;
      }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.