Skip to content

Commit

Permalink
MONDRIAN: Fix hang on JDK1.5; forgot to integrate one file.
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 14873]
  • Loading branch information
julianhyde committed Jan 4, 2012
1 parent 3ff4d27 commit b44c224
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
19 changes: 13 additions & 6 deletions src/main/mondrian/olap/Util.java
Expand Up @@ -232,9 +232,9 @@ public static ExecutorService getExecutorService(
/**
* Creates an {@link ExecutorService} object backed by a thread pool
* with a fixed number of threads..
* @param maxNbThreads Maximum number of concurrent
* @param maximumPoolSize Maximum number of concurrent
* threads.
* @param minNbThreads Minimum number of concurrent
* @param corePoolSize Minimum number of concurrent
* threads to maintain in the pool, even if they are
* idle.
* @param keepAliveTime Time, in seconds, for which to
Expand All @@ -246,15 +246,22 @@ public static ExecutorService getExecutorService(
* @return An executor service preconfigured.
*/
public static ExecutorService getExecutorService(
int maxNbThreads,
int minNbThreads,
int maximumPoolSize,
int corePoolSize,
long keepAliveTime,
int queueLength,
final String name)
{
if (Util.PreJdk16) {
// On JDK1.5, if you specify corePoolSize=0, nothing gets executed.
// Bummer.
corePoolSize = Math.max(corePoolSize, 1);
}
return new ThreadPoolExecutor(
minNbThreads, maxNbThreads,
keepAliveTime, TimeUnit.SECONDS,
corePoolSize,
maximumPoolSize,
keepAliveTime,
TimeUnit.SECONDS,
queueLength < 0
? new LinkedBlockingQueue<Runnable>()
: new ArrayBlockingQueue<Runnable>(queueLength),
Expand Down
3 changes: 3 additions & 0 deletions src/main/mondrian/rolap/agg/SegmentCacheManager.java
Expand Up @@ -195,6 +195,9 @@
* region. {@link SegmentHeader#excludedRegions} should be a list of
* {@link SegmentColumn} arrays.</p>
*
* <p>23. All code that calls {@link Future#get} should probably handle
* {@link CancellationException}.</p>
*
*
* @author jhyde
* @version $Id$
Expand Down
3 changes: 2 additions & 1 deletion testsrc/main/mondrian/test/Main.java
Expand Up @@ -4,7 +4,7 @@
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// Copyright (C) 1998-2002 Kana Software, Inc.
// Copyright (C) 2001-2011 Julian Hyde and others
// Copyright (C) 2001-2012 Julian Hyde and others
// All Rights Reserved.
// You must accept the terms of that agreement to use this software.
//
Expand Down Expand Up @@ -242,6 +242,7 @@ public static Test suite() throws Exception {
addTest(suite, HierarchyBugTest.class);
addTest(suite, ScheduleTest.class);
addTest(suite, UtilTestCase.class);
addTest(suite, PartiallyOrderedSetTest.class);
addTest(suite, Olap4jTest.class);
addTest(suite, SortTest.class);
if (isRunOnce()) {
Expand Down

0 comments on commit b44c224

Please sign in to comment.