Using Channels
This is the manual for older MicroStream versions (Version < 5.0).
The new documentation (Version >= 5.0) is located at:

Channel Usage

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 Configuration

For the channel configuration the following configuration properties are available:
  • Channel count
    The number of channels that MicroStream will use. Must be
    2n2^n
  • Channel directory prefix
    The 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"
Channel file size configuration is done by the the Storage Data File Evaluator.
They can be set By storage.embedded.configuration API:
Java
Xml
ini
1
EmbeddedStorageManager storageManager = Configuration.Default()
2
.setChannelCount(4)
3
.setChannelDirectoryPrefix("channel_")
4
.setDataFilePrefix("channel_")
5
.setDataFileSuffix(".bin")
6
.createEmbeddedStorageFoundation()
7
.createEmbeddedStorageManager();
Copied!
1
<properties>
2
<property name="channelCount" value="4" />
3
<property name="channelDirectoryPrefix" value="channel_" />
4
<property name="dataFilePrefix value="channel_" />
5
<property name="dataFileSuffix" value=".dat" />
6
</properties>
Copied!
1
channelCount = 4
2
channelDirectoryPrefix = prefix
3
dataFilePrefix = channel_
4
dataFileSuffix = .dat
Copied!
See also: Configuration
Or by setting a StorageFileProvider using theEmbeddedStorageFoundationfactory
1
NioFileSystem fileSystem = NioFileSystem.New();
2
EmbeddedStorageManager storage = EmbeddedStorage.Foundation(
3
Storage.ConfigurationBuilder()
4
.setChannelCountProvider(Storage.ChannelCountProvider(4))
5
.setStorageFileProvider(
6
StorageLiveFileProvider.Builder()
7
.setDirectory(fileSystem.ensureDirectoryPath("storage"))
8
.createFileProvider()
9
)
10
.createConfiguration()
11
)
12
.start();
Copied!
Export as PDF
Copy link