PDA

View Full Version : Re : [Mondrian] Multithreading, Parallel Batch / Query Execution



Tushar Apshankar
04-25-2007, 09:21 AM
Hi,

To improve performance, we started looking at ReentrantReadWriteLock and
ConcurrentHashMap (from java.util.concurrent) package.
We are also looking at ThreadPoolExecutor and related classes to implment
parallel query / batch execution (most of these classes are also available
in java.util.concurrent as well as backport jar).
Since compatibility with Java 1.4 is essential, we started looking at the
build script retroweave target that uses Retroweaver 1.2.4.

Retroweaver without our changes works fine. We ran into problems while
using the current retroweaver version and build target after our changes.

We have a simple class LockTest to reproduce the problem:
=============================================================================================
package mondrian;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.concurrent.locks.Lock;

public class LockTest {
ConcurrentHashMap<String, String> cache = new
ConcurrentHashMap<String, String>();
ReentrantReadWriteLock lock;
Lock r ;
Lock w ;
public LockTest()
{
cache = new ConcurrentHashMap();
lock = new ReentrantReadWriteLock();
System.out.println("Before lock = " + lock);
w = lock.writeLock();
r = lock.readLock();
System.out.println("After lock = " + lock);
}

public static void main(String[] args) {
LockTest lt = new LockTest();
System.out.println("i am inside main method");
}
}
=============================================================================================
When we retroweave it with retroweaver 1.2.4 (using ANT as well as
retroweaver UI) and run the weaved class using Java 1.4.2, we get
java.lang.NoSuchMethodError. Stack is:

java.lang.NoSuchMethodError:
edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantReadWriteLock.writeLock()
Ledu/emory/mathcs/backport/java/util/concurrent/locks/ReentrantReadWriteLock$WriteLock;
[Loaded java.lang.StackTraceElement from C:\j2sdk1.4.2_14\jre\lib\rt.jar]
at mondrian.LockTest.<init>(LockTest.java:26)
at mondrian.LockTest.main(LockTest.java:34):

We have backport jar in our class path (please note that we are NOT
getting ClassNotFoundExcecption).
Did someone face this issue earlier? Please let us know if we are missing
something here.

We also tried out retroweaver 2.0 without success.

As an alternative, we tried Retrotranslator(
http://retrotranslator.sourceforge.net) and everything worked in first
attempt. We propose to create a new target for Retrotranslator and add the
related libraries. Please let us know your thoughts on this

Thanks and regards,
Tushar, Ajit


_______________________________________________
Mondrian mailing list
Mondrian (AT) pentaho (DOT) org
http://lists.pentaho.org/mailman/listinfo/mondrian