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_READIf this store supports bulk read operations.EXPIRATIONIf this store supports storing expiration metadata.READ_ONLYIf this store only supports being read from.SEGMENTABLEWhether this store supports being segmented.SHAREABLEWhether this cache can be shared between multiple nodes.TRANSACTIONALIf this store supports being invoked in a transactional context with a prepare and commit or rollback phases.WRITE_ONLYIf this store only supports being written to.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NonBlockingStore.CharacteristicvalueOf(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
Whether this cache can be shared between multiple nodes. An example would be an external system, such as a database. This characteristic is here solely for validation of the store configuration.
-
READ_ONLY
public static final NonBlockingStore.Characteristic READ_ONLY
If this store only supports being read from. Any write based operations will never be invoked on this store. No optional methods map to this characteristic. TheNonBlockingStore.write(int, MarshallableEntry),NonBlockingStore.delete(int, Object),NonBlockingStore.bulkWrite(int, Publisher), andNonBlockingStore.bulkDelete(int, Publisher)methods will not be invoked on a store that has this characteristic.
-
WRITE_ONLY
public static final NonBlockingStore.Characteristic WRITE_ONLY
If this store only supports being written to. Any read based operations will never be invoked on this store. No optional methods map to this characteristic. TheNonBlockingStore.load(int, Object)andNonBlockingStore.containsKey(int, Object)methods will not be invoked on a store that has 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()will not utilize 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 a prepare and commit or rollback phases. Stores of this type may take part of the actual transaction if present.Stores that have this characteristic must override the
NonBlockingStore.prepareWithModifications(Transaction, BatchModification),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
Whether this store supports being segmented. 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. Please see each method to see how they may be affected when this store is not segmentable.
Note that a store may also be configured at runtime to be segmented or not. If this store is configured to not be segmented this store will be treated as if it does not have the SEGMENTABLE characteristic (causing possible parameters to be null or invalid segment numbers). A store implementation may want to block this configuration by throwing an exception in the
NonBlockingStore.start(InitializationContext)method if it does not want to support this.While it is possible that a SEGMENTABLE store can be configured as not segmented, a store that is not SEGMENTABLE will never be allowed to be configured as segmented.
Stores that have this characteristic must override the
NonBlockingStore.addSegments(IntSet)andNonBlockingStore.removeSegments(IntSet)methods. If a store isSHAREABLEand is configured to be shared via configuration these methods will not be invoked though.
-
EXPIRATION
public static final NonBlockingStore.Characteristic EXPIRATION
If this store supports storing expiration metadata. That is this store should never return an expired entry via any methods such asNonBlockingStore.load(int, Object),NonBlockingStore.publishKeys(IntSet, Predicate)orNonBlockingStore.publishEntries(IntSet, Predicate, boolean). It is recommended that a store use the providedTimeServicein theInitializationContextto determine if an entry has expired.The information about an entry and its expiration is included in the
Metadatawhich is accessible from theMarshallableEntrywhich 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
-
-