Storage Files and Directories
This is the manual for older MicroStream versions (Version < 5.0).
The new documentation (Version >= 5.0) is located at:
Using a Storage Live File Provider (one.microstream.storage.types.StorageLiveFileProvider) allows to specify the location and naming rules for all storage related files.
available properties are:
  • BaseDirectory The Microstream storages location base directory. Contains channel directories and type dictionary file.
  • DeletionDirectory If configured, the storage will not delete files. Instead of deleting a file it will be moved to this directory.
  • TruncationDirectory If configured, files that will get truncated are copied into this directory.
  • ChannelDirectoryPrefix Channel directory prefix string
  • StorageFilePrefix Storage file prefix string
  • StorageFileSuffix storage file extension
  • TransactionsFilePrefix transactions file prefix
  • TransactionsFileSuffix transaction file extension
  • TypeDictionaryFileName filename of the type dictionary
1
StorageFileNameProvider fileNameProvider = StorageFileNameProvider.Builder()
2
.setChannelDirectoryPrefix("canal_")
3
.setDataFilePrefix ("canal_")
4
.setDataFileSuffix (".bin")
5
.setTransactionsFilePrefix("events_")
6
.setTransactionsFileSuffix(".bin")
7
.setTypeDictionaryFileName("typeDictionary.txt")
8
.createFileNameProvider ()
9
;
10
11
NioFileSystem fileSystem = NioFileSystem.New();
12
StorageLiveFileProvider fileProvider = Storage
13
.FileProviderBuilder (fileSystem)
14
.setDirectory (fileSystem.ensureDirectoryPath(WORKINGDIR))
15
.setDeletionDirectory (fileSystem.ensureDirectoryPath(DELETIONDIR))
16
.setTruncationDirectory(fileSystem.ensureDirectoryPath(TRUNCATIONDIR))
17
.setFileNameProvider (fileNameProvider)
18
.createFileProvider ()
19
;
Copied!
Last modified 4mo ago
Export as PDF
Copy link