public class RandomEvictionPolicy extends MapEvictionPolicy implements IdentifiedDataSerializable
IMap
Modifier and Type | Field and Description |
---|---|
static RandomEvictionPolicy |
INSTANCE
Random eviction policy instance.
|
Constructor and Description |
---|
RandomEvictionPolicy() |
Modifier and Type | Method and Description |
---|---|
int |
compare(EntryView entryView1,
EntryView entryView2) |
boolean |
equals(Object obj) |
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
int |
hashCode() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final RandomEvictionPolicy INSTANCE
public int compare(EntryView entryView1, EntryView entryView2)
MapEvictionPolicy
If you prefer to evict the 1st entry then return negative number, if the 2nd entry is a better candidate then return a positive number or return 0 if both entries are equally good candidates for eviction
compare
in class MapEvictionPolicy
public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.public boolean equals(Object obj)
equals
in interface Comparator
equals
in class Object
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.