Using Channels
This is the manual for older MicroStream versions (Version < 5.0).
The new documentation (Version >= 5.0) is located at:
Channels are the IO threads used by the MicroStream storage engine. A single channel represents the unity of a thread, a storage directory and cached data. Increasing the number of channels means to run more IO threads.
The channel count is an important configuration value that impacts to IO performance.
- Channel countThe number of channels that MicroStream will use. Must be
- Channel directory prefixThe channel directory will be prefix+channelNumber e.g. "ch_0" if prefix is "ch_"
- Data file prefix default is "channel_"
- Data file suffix deflaut id ".dat"
They can be set By
storage.embedded.configuration API:
Java
Xml
ini
EmbeddedStorageManager storageManager = Configuration.Default()
.setChannelCount(4)
.setChannelDirectoryPrefix("channel_")
.setDataFilePrefix("channel_")
.setDataFileSuffix(".bin")
.createEmbeddedStorageFoundation()
.createEmbeddedStorageManager();
<properties>
<property name="channelCount" value="4" />
<property name="channelDirectoryPrefix" value="channel_" />
<property name="dataFilePrefix value="channel_" />
<property name="dataFileSuffix" value=".dat" />
</properties>
channelCount = 4
channelDirectoryPrefix = prefix
dataFilePrefix = channel_
dataFileSuffix = .dat
Or by setting a
StorageFileProvider
using theEmbeddedStorageFoundation
factoryNioFileSystem fileSystem = NioFileSystem.New();
EmbeddedStorageManager storage = EmbeddedStorage.Foundation(
Storage.ConfigurationBuilder()
.setChannelCountProvider(Storage.ChannelCountProvider(4))
.setStorageFileProvider(
StorageLiveFileProvider.Builder()
.setDirectory(fileSystem.ensureDirectoryPath("storage"))
.createFileProvider()
)
.createConfiguration()
)
.start();
Last modified 2yr ago