Package mondrian.test

Class ConcurrentValidatingQueryRunner

  • All Implemented Interfaces:
    java.lang.Runnable

    public class ConcurrentValidatingQueryRunner
    extends java.lang.Thread
    Utility class to run set of MDX queries in multiple threads and validate the results. Queries are run against the FoodMart database.
    Author:
    Thiyagu, Ajit
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()
      Runs a number of queries until time expires.
      (package private) static java.util.List<java.lang.Throwable> runTest​(int numThreads, int runTimeInSeconds, boolean randomQueries, boolean randomCacheFlush, boolean printReport, FoodMartTestCase.QueryAndResult[] queriesAndResults)
      Creates and runs concurrent threads of tests with random cache flush.
      (package private) static java.util.List<java.lang.Throwable> runTest​(int numThreads, int runTimeInSeconds, boolean randomQueries, boolean printReport, FoodMartTestCase.QueryAndResult[] queriesAndResults)
      Creates and runs concurrent threads of tests without flushing cache.
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ConcurrentValidatingQueryRunner

        public ConcurrentValidatingQueryRunner​(int numSeconds,
                                               boolean useRandomQuery,
                                               FoodMartTestCase.QueryAndResult[] queriesAndResults)
        Runs concurrent queries without flushing cache. This constructor provides backward compatibilty for usage in ConcurrentMdxTest.
        Parameters:
        numSeconds - Running time
        useRandomQuery - If set to true, the runner will pick a random query from the set. If set to false, the runner will circle through queries sequentially
        queriesAndResults - The array of pairs of query and expected result
      • ConcurrentValidatingQueryRunner

        public ConcurrentValidatingQueryRunner​(int numSeconds,
                                               boolean useRandomQuery,
                                               boolean randomCacheFlush,
                                               FoodMartTestCase.QueryAndResult[] queriesAndResults)
        Runs concurrent queries with random cache flush.
        Parameters:
        numSeconds - Running time
        useRandomQuery - If set to true, the runner will pick a random query from the set. If set to false, the runner will circle through queries sequentially
        randomCacheFlush - If set to true, the runner will do a coin toss before running the query. If the result of the experiment is favorable, runner will flush a random region of aggregation cache
        queriesAndResults - The array of pairs of query and expected result
    • Method Detail

      • run

        public void run()
        Runs a number of queries until time expires. For each iteration, if cache is to be flushed, do it before running the query.
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • runTest

        static java.util.List<java.lang.Throwable> runTest​(int numThreads,
                                                           int runTimeInSeconds,
                                                           boolean randomQueries,
                                                           boolean printReport,
                                                           FoodMartTestCase.QueryAndResult[] queriesAndResults)
        Creates and runs concurrent threads of tests without flushing cache. This method provides backward compatibilty for usage in ConcurrentMdxTest.
        Parameters:
        numThreads - Number of concurrent threads
        runTimeInSeconds - Running Time
        randomQueries - Whether to pick queries in random or in sequence
        printReport - Whether to print report
        queriesAndResults - Array of pairs of query and expected result
        Returns:
        The list of failures
      • runTest

        static java.util.List<java.lang.Throwable> runTest​(int numThreads,
                                                           int runTimeInSeconds,
                                                           boolean randomQueries,
                                                           boolean randomCacheFlush,
                                                           boolean printReport,
                                                           FoodMartTestCase.QueryAndResult[] queriesAndResults)
        Creates and runs concurrent threads of tests with random cache flush.
        Parameters:
        numThreads - Number of concurrent threads
        runTimeInSeconds - Running Time
        randomQueries - Whether to pick queries in random or in sequence
        randomCacheFlush - Whether to flush cache before running queries
        printReport - Whether to print report
        queriesAndResults - Array of pairs of query and expected result
        Returns:
        The list of failures