Enum NonBlockingStore.Characteristic
- java.lang.Object
-
- java.lang.Enum<NonBlockingStore.Characteristic>
-
- org.infinispan.persistence.spi.NonBlockingStore.Characteristic
-
- All Implemented Interfaces:
Serializable
,Comparable<NonBlockingStore.Characteristic>
- Enclosing interface:
- NonBlockingStore<K,V>
public static enum NonBlockingStore.Characteristic extends Enum<NonBlockingStore.Characteristic>
Enumeration defining the various characteristics of the underlying store to communicate what features it may or may not support.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BULK_READ
If this store supports bulk read operations.EXPIRATION
If this store uses expiration metadata so that it never returns expired entries via any methods such asNonBlockingStore.load(int, Object)
,NonBlockingStore.publishKeys(IntSet, Predicate)
orNonBlockingStore.publishEntries(IntSet, Predicate, boolean)
.READ_ONLY
If this store supports only being read from.SEGMENTABLE
If this store supports segmentation.SHAREABLE
If this store can be shared across multiple Infinispan nodes; for example, an external system such as a database.TRANSACTIONAL
If this store supports being invoked in a transactional context with prepare and commit or rollback phases.WRITE_ONLY
If this store supports only being written to.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NonBlockingStore.Characteristic
valueOf(String name)
Returns the enum constant of this type with the specified name.static NonBlockingStore.Characteristic[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SHAREABLE
public static final NonBlockingStore.Characteristic SHAREABLE
If this store can be shared across multiple Infinispan nodes; for example, an external system such as a database. This characteristic allows validation of the store configuration.
-
READ_ONLY
public static final NonBlockingStore.Characteristic READ_ONLY
If this store supports only being read from. Write-based operations are never invoked on this store. No optional methods map to this characteristic. TheNonBlockingStore.write(int, MarshallableEntry)
,NonBlockingStore.delete(int, Object)
, andNonBlockingStore.batch(int, Publisher, Publisher)
methods are not invoked on stores with this characteristic.
-
WRITE_ONLY
public static final NonBlockingStore.Characteristic WRITE_ONLY
If this store supports only being written to. Read-based operations are never invoked on this store. No optional methods map to this characteristic. TheNonBlockingStore.load(int, Object)
andNonBlockingStore.containsKey(int, Object)
methods are not invoked on stores with this characteristic.
-
BULK_READ
public static final NonBlockingStore.Characteristic BULK_READ
If this store supports bulk read operations. If a store does not have this characteristic, operations such asCache.size()
andCache.entrySet().stream()
do not use this store.Stores that have this characteristic must override the
NonBlockingStore.publishKeys(IntSet, Predicate)
,NonBlockingStore.publishEntries(IntSet, Predicate, boolean)
andNonBlockingStore.size(IntSet)
methods.This characteristic is ignored if the store also contains
WRITE_ONLY
.
-
TRANSACTIONAL
public static final NonBlockingStore.Characteristic TRANSACTIONAL
If this store supports being invoked in a transactional context with prepare and commit or rollback phases. Stores of this type can participate in the actual transaction, if present.Stores that have this characteristic must override the
NonBlockingStore.prepareWithModifications(Transaction, int, Publisher, Publisher)
,NonBlockingStore.commit(Transaction)
andNonBlockingStore.rollback(Transaction)
methods.This characteristic is ignored if the store also contains
READ_ONLY
.
-
SEGMENTABLE
public static final NonBlockingStore.Characteristic SEGMENTABLE
If this store supports segmentation. All methods in this SPI take as an argument a way to map a given entry to a segment. A segment in Infinispan is an int that acts as a bucket for many keys. Many store implementations may be able to store and load entries in a more performant way if they segment their data accordingly.If this store is not segmentable then invokers of this SPI are not required to calculate these segments before invoking these methods and thus these methods may be invoked with any int value, null or equivalent. Refer to each method to determine their effect when this store is not segmented.
Note that you can also configure stores at runtime to be segmented or not. If the runtime configuration of this store is non-segmented, it is equivalent to the store not having the SEGMENTABLE characteristic, which might cause parameters to be null or invalid segment numbers. Store implementation can block this configuration by throwing an exception in the
NonBlockingStore.start(InitializationContext)
method.While it is possible that a SEGMENTABLE store can be configured as non-segmented, a store that is not SEGMENTABLE can never then later be configured as segmented.
Stores that have this characteristic must override the
NonBlockingStore.addSegments(IntSet)
andNonBlockingStore.removeSegments(IntSet)
methods. However, if a store isSHAREABLE
and is configured to be shared via configuration these methods are not invoked.
-
EXPIRATION
public static final NonBlockingStore.Characteristic EXPIRATION
If this store uses expiration metadata so that it never returns expired entries via any methods such asNonBlockingStore.load(int, Object)
,NonBlockingStore.publishKeys(IntSet, Predicate)
orNonBlockingStore.publishEntries(IntSet, Predicate, boolean)
. Stores should use the providedTimeService
in theInitializationContext
to determine if entries are expired.The information about an entry and its expiration is included in the
Metadata
, accessible from theMarshallableEntry
that is provided.Stores that have this characteristic must override the
NonBlockingStore.purgeExpired()
method.
-
-
Method Detail
-
values
public static NonBlockingStore.Characteristic[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NonBlockingStore.Characteristic c : NonBlockingStore.Characteristic.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NonBlockingStore.Characteristic valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-