public class QueryResultSizeLimiter extends Object
MINIMUM_MAX_RESULT_LIMIT
as well as a factor MAX_RESULT_LIMIT_FACTOR
to ensure that the actual result size limit will be a reasonable value. Due to the used hash algorithm the data of
a map is not distributed equally on all partitions in the cluster. Since the decision whether of not the
QueryResultSizeExceededException
is thrown is made on the local number of partition entries, we need a reliable
distribution of data. The goal is to prevent false positives, since those might surprise the user.
So the exception should never been thrown below the configured limit.
The minimum value of 100000 and the factor of 1.149999976158142f were determined by
testing on which limit the exception was thrown with different map key types.Modifier and Type | Field and Description |
---|---|
static float |
MAX_RESULT_LIMIT_FACTOR
Adds a security margin to the configured result size limit to prevent false positives.
|
static float |
MAX_RESULT_LIMIT_FACTOR_FOR_PRECHECK
Adds a security margin to the configured result size limit to prevent false positives in pre-check.
|
static int |
MINIMUM_MAX_RESULT_LIMIT
Defines the minimum value for the result size limit to ensure a sufficient distribution of data in the partitions.
|
Constructor and Description |
---|
QueryResultSizeLimiter(MapServiceContext mapServiceContext,
ILogger logger) |
Modifier and Type | Method and Description |
---|---|
boolean |
isPreCheckEnabled()
Just for testing.
|
boolean |
isQueryResultLimitEnabled()
Just for testing.
|
public static final int MINIMUM_MAX_RESULT_LIMIT
QueryResultSizeLimiter
,
Constant Field Valuespublic static final float MAX_RESULT_LIMIT_FACTOR
QueryResultSizeLimiter
,
Constant Field Valuespublic static final float MAX_RESULT_LIMIT_FACTOR_FOR_PRECHECK
QueryResultSizeLimiter
,
Constant Field Valuespublic QueryResultSizeLimiter(MapServiceContext mapServiceContext, ILogger logger)
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.