Package one.microstream.storage.types
Interface StorageChannelCountProvider
- All Superinterfaces:
BinaryChannelCountProvider
- All Known Implementing Classes:
StorageChannelCountProvider.Default
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface StorageChannelCountProvider extends BinaryChannelCountProvider
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
StorageChannelCountProvider.Default
static interface
StorageChannelCountProvider.Defaults
static interface
StorageChannelCountProvider.Validation
-
Method Summary
Modifier and Type Method Description int
getChannelCount()
static StorageChannelCountProvider
New()
Pseudo-constructor method to create a newStorageChannelCountProvider
instance using default values defined byStorageChannelCountProvider.Defaults
.static StorageChannelCountProvider
New(int channelCount)
Pseudo-constructor method to create a newStorageChannelCountProvider
instance using the passed value.static int
validateChannelCount(int channelCount)
-
Method Details
-
getChannelCount
int getChannelCount()- Specified by:
getChannelCount
in interfaceBinaryChannelCountProvider
-
validateChannelCount
- Throws:
IllegalArgumentException
-
New
Pseudo-constructor method to create a newStorageChannelCountProvider
instance using default values defined byStorageChannelCountProvider.Defaults
.For explanations and customizing values, see
New(int)
.- Returns:
- a new
StorageChannelCountProvider
instance. - See Also:
New(int)
,StorageChannelCountProvider.Defaults
-
New
Pseudo-constructor method to create a newStorageChannelCountProvider
instance using the passed value.A "channel" is the combination of exclusive storage
Thread
maintaining an entity registry, data cache, and the like and a storage directory containing storage data files exclusively used by that thread.
The more channels there are, the more parallel loading and storing operations will be executed and the faster the application will become, provided a hardware that can effectively execute that many threads.Since channels use bitwise modulo hashing, the number of channels must always be a 2^n number with n greater than or equal 0.
(Meaning 1, 2, 4, 8, 16, etc.)- Parameters:
channelCount
- the number of channels. Must be a 2^n number with n greater than or equal 0.- Returns:
- a new
StorageChannelCountProvider
instance. - Throws:
IllegalArgumentException
- if the passed value is higher than the value returned byStorageChannelCountProvider.Defaults#maximumChannelCount()
- See Also:
New()
,StorageChannelCountProvider.Defaults
-