|Modifier and Type||Method and Description|
Ratio-based discard policy that considers the capacity vs. usage of the aggregation buffer.
public static DecodeBufferPolicy ratio(float bufferUsageRatio)
The ratio is calculated with
bufferUsageRatio/(1+bufferUsageRatio) which gives 50% for a value of
2 and so on.
bufferUsageRatio- the buffer usage ratio. Must be between
2^31-1, typically a value between 1 and 10 representing 50% to 90%.
public static DecodeBufferPolicy always()
discards read bytesafter each decoding phase. This strategy hast the most memory efficiency but also leads to more CPU pressure.
public static DecodeBufferPolicy alwaysSome()
discards some read bytesafter each decoding phase. This strategy might discard some, all, or none of read bytes depending on its internal implementation to reduce overall memory bandwidth consumption at the cost of potentially additional memory consumption.
Copyright © 2021 lettuce.io. All rights reserved.