public enum OverflowPolicy extends Enum<OverflowPolicy>
0
remaining capacity.
Overflowing happens when a time-to-live is set and the oldest item in
the ringbuffer (the head) is not old enough to expire.Enum Constant and Description |
---|
FAIL
Using this policy the call will fail immediately and the oldest item will
not be overwritten before it is old enough to retire.
|
OVERWRITE
Using this policy the oldest item is overwritten no matter it is not old
enough to retire.
|
Modifier and Type | Method and Description |
---|---|
static OverflowPolicy |
getById(int id)
Returns the OverflowPolicy for the given ID.
|
int |
getId()
Gets the ID for the given OverflowPolicy.
|
static OverflowPolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static OverflowPolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final OverflowPolicy OVERWRITE
public static final OverflowPolicy FAIL
FAIL
is that the caller can decide what to do
since it doesn't trap the thread due to backoff.
Example: if there is a time-to-live of 30 seconds, the buffer is full
and the oldest item in the ring has been placed a second ago, then there
are 29 seconds remaining for that item. Using this policy you are not
going to overwrite that item for the next 29 seconds.public static OverflowPolicy[] values()
for (OverflowPolicy c : OverflowPolicy.values()) System.out.println(c);
public static OverflowPolicy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getId()
public static OverflowPolicy getById(int id)
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.