com.hazelcast.map.impl
Class QueryResultSizeLimiter

java.lang.Object
  extended by com.hazelcast.map.impl.QueryResultSizeLimiter

public class QueryResultSizeLimiter
extends Object

Responsible for limiting result size of queries.

This class defines a hard coded minimum 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 if 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 this may 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.


Field Summary
static float MAX_RESULT_LIMIT_FACTOR
          Adds a security margin to the configured result size limit to prevent false positives.
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 Summary
QueryResultSizeLimiter(MapServiceContext mapServiceContext, ILogger log)
           
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINIMUM_MAX_RESULT_LIMIT

public static final int MINIMUM_MAX_RESULT_LIMIT
Defines the minimum value for the result size limit to ensure a sufficient distribution of data in the partitions.

See Also:
QueryResultSizeLimiter, Constant Field Values

MAX_RESULT_LIMIT_FACTOR

public static final float MAX_RESULT_LIMIT_FACTOR
Adds a security margin to the configured result size limit to prevent false positives.

See Also:
QueryResultSizeLimiter, Constant Field Values
Constructor Detail

QueryResultSizeLimiter

public QueryResultSizeLimiter(MapServiceContext mapServiceContext,
                              ILogger log)


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.