public static class Configuration.BufferPoolConfiguration extends Object
Configuration constraints that determine the number of
Buffer
s in a BufferPool
. There is one permanent
BufferPoolConfiguration
instance for each valid buffer size:
1024, 2048, 4096, 8192 and 16384. The Configuration.getBufferPoolMap()
method
provides access to these, where the map key is the buffer size.
Each BufferPoolConfiguration
specifies minimum and maximum
buffer count values, and four parameters used to allocate a buffers
according to available memory. Values of minimumCount
and
maximumCount
are absolute bounds; if the
maximumCount
is zero then no buffers of the specified buffer
size will be allocated.
The memory-based parameters are used as follows:
reservedMemory
size from the
maximum heap size.fraction
.minimumMemory
and maximumMemory
.minimumCount
and maximumCount
.
These parameters may be set through the set
and
get
methods, or by parsing a string property value using
parseBufferCount(int, String, String)
or
parseBufferMemory(int, String, String)
Modifier and Type | Method and Description |
---|---|
int |
computeBufferCount(long availableHeapMemory)
Compute the buffer count determined by the constraints of this
BufferPoolConfiguration given the supplied
availableHeapMemory. |
int |
getBufferSize() |
float |
getFraction() |
int |
getMaximumCount() |
long |
getMaximumMemory() |
int |
getMinimumCount() |
long |
getMinimumMemory() |
long |
getReservedMemory() |
void |
parse(String string)
Parse the String description generated by
toString() . |
void |
parseBufferCount(int bufferSize,
String propertyName,
String propertyValue)
Parse the supplied property value as an integer-valued buffer count.
|
void |
parseBufferMemory(int bufferSize,
String propertyName,
String propertyValue)
Parse the supplied property value as a sequence of values to populate
the
minimumMemory maximumMemory ,
reservedMemory and fraction fields. |
void |
setCount(int count)
Set the minimum and maximum buffer count.
|
void |
setFraction(float fraction) |
void |
setMaximumCount(int maximumCount) |
void |
setMaximumMemory(long maximumMemory) |
void |
setMinimumCount(int minimumCount) |
void |
setMinimumMemory(long minimumMemory) |
void |
setReservedMemory(long reservedMemory) |
String |
toString() |
public int getBufferSize()
public int getMinimumCount()
public void setMinimumCount(int minimumCount)
minimumCount
- the minimumCount to setpublic int getMaximumCount()
public void setMaximumCount(int maximumCount)
maximumCount
- the maximumCount to setpublic void setCount(int count)
count
- public long getMinimumMemory()
public void setMinimumMemory(long minimumMemory)
minimumMemory
- the minimumMemory to setpublic long getMaximumMemory()
public void setMaximumMemory(long maximumMemory)
maximumMemory
- the maximumMemory to setpublic long getReservedMemory()
public void setReservedMemory(long reservedMemory)
reservedMemory
- the reservedMemory to setpublic float getFraction()
public void setFraction(float fraction)
fraction
- the fraction to setpublic int computeBufferCount(long availableHeapMemory)
BufferPoolConfiguration
given the supplied
availableHeapMemory.availableHeapMemory
- available memory, in bytesBuffers
to allocateIllegalArgumentException
- if the allocation is infeasiblepublic void parse(String string)
toString()
. The
string format is
bufferSize,propertyName=value,...
where propertyNames are count
, minCount
,
maxCount
, minMemory
, maxMemory
, reserved
or fraction
public void parseBufferCount(int bufferSize, String propertyName, String propertyValue)
minimumCount
and maximumCount
are set
to this value. The supplied property value must be a valid integer or
an integer followed by "K", "M" or "G" for
1024L,
1048576L, or
1073741824L as a multiplier.bufferSize
- propertyName
- propertyValue
- IllegalArgumentException
- if the propertyValue is not in the form of a valid
Integerpublic void parseBufferMemory(int bufferSize, String propertyName, String propertyValue)
Parse the supplied property value as a sequence of values to populate
the minimumMemory
maximumMemory
,
reservedMemory
and fraction
fields. These
values are separated by commas, and the first three may be specified
as blank for the default value, an integer, or an integer followed by
by "K", "M" or "G" for 1024L,
1048576L, or
1073741824L as a multiplier.
64M,8G,128M,.75
reserves 128M from available memory and then allocates
75% of the remainder up to 8Gb, but not less than 64Mb.
bufferSize
- propertyName
- propertyValue
- Copyright © 2025 Open Identity Platform Community. All rights reserved.