summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntje Fuhrmann2013-05-13 06:46:02 (EDT)
committer Stephan Born2013-09-06 07:18:35 (EDT)
commitd1d8967b2b17c1911830877449f663b1f38fac0d (patch)
treee4c51af78bfb39aacb6a93fe3866928d0ac46491
parent970b7b3704ee2fde98ed0ccb463001f0a7e08cff (diff)
downloadorg.eclipse.stardust.engine-d1d8967b2b17c1911830877449f663b1f38fac0d.zip
org.eclipse.stardust.engine-d1d8967b2b17c1911830877449f663b1f38fac0d.tar.gz
org.eclipse.stardust.engine-d1d8967b2b17c1911830877449f663b1f38fac0d.tar.bz2
Jira-ID: CRNT-25928
Carnot.Engine.Tuning.Query.UserPrefetchNParallelInstances has no effect git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/engine@64799 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Antje Fuhrmann <antje.fuhrmann@sungard.com>
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/ProcessQueryPostprocessor.java29
-rw-r--r--stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java17
2 files changed, 36 insertions, 10 deletions
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/ProcessQueryPostprocessor.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/ProcessQueryPostprocessor.java
index 4839f8e..9bc772b 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/ProcessQueryPostprocessor.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/api/query/ProcessQueryPostprocessor.java
@@ -598,11 +598,29 @@ public class ProcessQueryPostprocessor
private static void prefetchStartingUsers(Iterator piItr, int timeout)
{
- Set piSet = new HashSet();
+ Set<Long> piSet = new HashSet<Long>();
while (piItr.hasNext())
{
piSet.add(new Long(((ProcessInstanceBean) piItr.next()).getStartingUserOID()));
}
+
+ int instancesBatchSize = Parameters.instance().getInteger(
+ KernelTweakingProperties.USER_PREFETCH_N_PARALLEL_INSTANCES,
+ Parameters.instance().getInteger(
+ KernelTweakingProperties.DESCRIPTOR_PREFETCH_BATCH_SIZE,
+ PREFETCH_BATCH_SIZE));
+ Set<Long> prefetchStartingUsers = new HashSet<Long>();
+ for (Long startingUserOid : piSet)
+ {
+ if (startingUserOid > 0)
+ {
+ prefetchStartingUsers.add(startingUserOid);
+ }
+ if (prefetchStartingUsers.size() == instancesBatchSize)
+ {
+ break;
+ }
+ }
// This term reference will be used for later modification of its value expression
ComparisonTerm termTemplate = Predicates.inList(UserBean.FR__OID, new ArrayList());
@@ -611,15 +629,10 @@ public class ProcessQueryPostprocessor
if (trace.isDebugEnabled())
{
- trace.debug("Prefetching " + piSet.size() + " user(s)");
+ trace.debug("Prefetching " + prefetchStartingUsers.size() + " user(s)");
}
- int instancesBatchSize = Parameters.instance().getInteger(
- KernelTweakingProperties.USER_PREFETCH_N_PARALLEL_INSTANCES,
- Parameters.instance().getInteger(
- KernelTweakingProperties.DESCRIPTOR_PREFETCH_BATCH_SIZE,
- PREFETCH_BATCH_SIZE));
- performPrefetch(UserBean.class, queryExtension, termTemplate, piSet, true, timeout,
+ performPrefetch(UserBean.class, queryExtension, termTemplate, prefetchStartingUsers, true, timeout,
instancesBatchSize);
}
diff --git a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java
index 40c488e..b866911 100644
--- a/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java
+++ b/stardust-engine-core/src/main/java/org/eclipse/stardust/engine/core/runtime/beans/ProcessInstanceBean.java
@@ -584,9 +584,22 @@ public class ProcessInstanceBean extends AttributedIdentifiablePersistentBean
*/
public long getStartingUserOID()
{
- fetchLink(FIELD__STARTING_USER);
+ fetch();
+
+ if (null != startingUser)
+ {
+ return startingUser.getOID();
+ }
+ else if (isPersistent())
+ {
+ DefaultPersistenceController controller = (DefaultPersistenceController) getPersistenceController();
- return startingUser == null ? 0 : startingUser.getOID();
+ return ((Long) controller.getLinkFk(FIELD__STARTING_USER)).longValue();
+ }
+ else
+ {
+ return 0;
+ }
}
/**