-
public class PoolParamsConfig parameters for pools (BasePool. Supplied via a provider.
maxSizeSoftCap This represents a soft cap on the size of the pool. When the pool size hits this limit, the pool tries to trim its free space until either the pool size is below the soft cap, or the free space is zero. Note that allocations will not fail because we have exceeded the soft cap
maxSizeHardCap The hard cap represents a hard cap on the size of the pool. When the pool size exceeds this cap, allocations will start failing with a
bucketSizes The pool can be configured with a set of 'sizes' - a bucket is created for each such size. Additionally, each bucket can have a a max-length specified, which is the sum of the used and free items in that bucket. As with the MaxSize parameter above, the maxLength here is a soft cap, in that it will not cause an exception on get; it simply controls the release path When the bucket sizes are specified upfront, the pool may still get requests for non standard sizes. Such cases are treated as plain alloc/free calls i.e. the values are not maintained in the pool. If this parameter is null, then the pool will create buckets on demand
minBucketSize This represents the minimum size of the buckets in the pool. This assures that all buckets can hold any element larger or equal to this size.
maxBucketSize This represents the maximum size of the buckets in the pool. This restricts all buckets to only accept elements smaller or equal to this size. If this size is exceeded, an exception will be thrown.
-
-
Field Summary
Fields Modifier and Type Field Description public final static intIGNORE_THREADSpublic final intmaxSizeHardCappublic final intmaxSizeSoftCappublic final SparseIntArraybucketSizespublic final intminBucketSizepublic final intmaxBucketSizepublic booleanfixBucketsReinitializationpublic final intmaxNumThreads
-
Constructor Summary
Constructors Constructor Description PoolParams(int maxSize, SparseIntArray bucketSizes)Set up pool params PoolParams(int maxSizeSoftCap, int maxSizeHardCap, SparseIntArray bucketSizes)Set up pool params PoolParams(int maxSizeSoftCap, int maxSizeHardCap, SparseIntArray bucketSizes, int minBucketSize, int maxBucketSize, int maxNumThreads)Set up pool params
-
-
-
Constructor Detail
-
PoolParams
PoolParams(int maxSize, SparseIntArray bucketSizes)
Set up pool params- Parameters:
maxSize- soft-cap and hard-cap on size of the poolbucketSizes- (optional) bucket sizes and lengths for the pool
-
PoolParams
PoolParams(int maxSizeSoftCap, int maxSizeHardCap, SparseIntArray bucketSizes)
Set up pool params- Parameters:
maxSizeSoftCap- soft cap on max size of the poolmaxSizeHardCap- hard cap on max size of the poolbucketSizes- (optional) bucket sizes and lengths for the pool
-
PoolParams
PoolParams(int maxSizeSoftCap, int maxSizeHardCap, SparseIntArray bucketSizes, int minBucketSize, int maxBucketSize, int maxNumThreads)
Set up pool params- Parameters:
maxSizeSoftCap- soft cap on max size of the poolmaxSizeHardCap- hard cap on max size of the poolbucketSizes- (optional) bucket sizes and lengths for the poolminBucketSize- min bucket size for the poolmaxBucketSize- max bucket size for the poolmaxNumThreads- the maximum number of threads in the pool, or -1 if the pool doesn't care
-
-