private final Timer timer =
Util.newTimer("mondrian.rolap.RolapResultShepherd#timer", true);
public RolapResultShepherd() {
final IntegerProperty property =
MondrianProperties.instance().RolapConnectionShepherdNbThreads;
final int maximumPoolSize = property.get();
executor =
Util.getExecutorService(
// We use the same value for coreSize and maxSize
// because that's the behavior we want. All extra
// tasks will be put on an unbounded queue.
maximumPoolSize,
maximumPoolSize,
1,
"mondrian.rolap.RolapResultShepherd$executor",
new RejectedExecutionHandler() {
public void rejectedExecution(
Runnable r,
ThreadPoolExecutor executor)
{
throw MondrianResource.instance().QueryLimitReached.ex(
maximumPoolSize,
property.getPath());
}
});
final Pair<Long, TimeUnit> interval =
Util.parseInterval(
String.valueOf(