public enum MergePolicy extends Enum<MergePolicy> implements EntryMergePolicy
Modifier and Type | Class and Description |
---|---|
static class |
MergePolicy.UnsupportedMergePolicy |
Enum Constant and Description |
---|
CUSTOM |
NONE |
PREFERRED_ALWAYS |
PREFERRED_NON_NULL |
REMOVE_ALL |
Modifier and Type | Method and Description |
---|---|
static MergePolicy |
fromConfiguration(EntryMergePolicy policy) |
static MergePolicy |
fromString(String str) |
CacheEntry |
merge(CacheEntry preferredEntry,
List otherEntries)
This method is called by
ConflictManager.resolveConflicts() for each conflict discovered to determine
which CacheEntry should be utilised. |
static MergePolicy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MergePolicy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MergePolicy CUSTOM
public static final MergePolicy NONE
public static final MergePolicy PREFERRED_ALWAYS
public static final MergePolicy PREFERRED_NON_NULL
public static final MergePolicy REMOVE_ALL
public static MergePolicy[] values()
for (MergePolicy c : MergePolicy.values()) System.out.println(c);
public static MergePolicy 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 CacheEntry merge(CacheEntry preferredEntry, List otherEntries)
EntryMergePolicy
ConflictManager.resolveConflicts()
for each conflict discovered to determine
which CacheEntry
should be utilised. This merge policy is used when a user explicitly calls ConflictManager.resolveConflicts()
as well as when a partition merge occurs with PartitionHandling.ALLOW_READ_WRITES
set.
In the event of a partition merge, we define the preferred partition as the partition whom's coordinator is coordinating
the current merge.merge
in interface EntryMergePolicy
preferredEntry
- During a partition merge, the preferred entry is the entry that belongs to the preferred partition.
If multiple entries exist in the preferred partition, then the preferred entry is the primary
owner in the preferred partition. If no entry exists in the preferred partition, then the
preferredEntry is null.
During a non-merge call to ConflictManager.resolveConflicts()
, the preferredEntry is
simply the primary owner of an entryotherEntries
- a List
of all other CacheEntry
associated with a given Key.CacheEntry
to be utilised across the cluster, or null if all entries for a key should be
removed.public static MergePolicy fromString(String str)
public static MergePolicy fromConfiguration(EntryMergePolicy policy)
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.