public enum IndexCopyBehavior extends Enum<IndexCopyBehavior>
-> Copying on-read means that each index-read operation will copy the result of the query before returning it to the caller. This copying may be expensive, depending on the size of the result, since the result is stored in a map, which means that all entries need to have the hash calculated before being stored in a bucket. Each index-write operation however will be fast, since there will be no copying taking place.
-> Copying on-write means that each index-write operation will completely copy the underlying map to provide the copy-on-write semantics. Depending on the index size, it may be a very expensive operation. Each index-read operation will be very fast, however, since it may just access the map and return it to the caller.
-> Never copying is tricky. It means that the internal data structures of the index are concurrently modified without copy-on-write semantics. Index reads never copy the results of a query to a separate map. It means that the results backed by the underlying index-map can change after the query has been executed. Specifically an entry might have been added / removed from an index, or it might have been remapped. Should be used in cases when a the caller expects "mostly correct" results - specifically, if it's ok if some entries returned in the result set do not match the initial query criteria. The fastest solution for read and writes, since no copying takes place.
It's a tuneable trade-off - the user may decide.
Enum Constant and Description |
---|
COPY_ON_READ
Internal data structures of the index are concurrently modified without copy-on-write semantics.
|
COPY_ON_WRITE
Internal data structures of the index are modified with copy-on-write semantics.
|
NEVER
Internal data structures of the index are concurrently modified without copy-on-write semantics.
|
Modifier and Type | Method and Description |
---|---|
static IndexCopyBehavior |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IndexCopyBehavior[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IndexCopyBehavior COPY_ON_READ
public static final IndexCopyBehavior COPY_ON_WRITE
public static final IndexCopyBehavior NEVER
public static IndexCopyBehavior[] values()
for (IndexCopyBehavior c : IndexCopyBehavior.values()) System.out.println(c);
public static IndexCopyBehavior 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 nullCopyright © 2019 Hazelcast, Inc.. All rights reserved.