MicroStream Reference Manual
MicroStream HomeAPI Docs
4.0
4.0
  • Preface
  • System Requirements
  • License
  • Changelog
  • Installation
  • Data-Store
    • Overview
    • Getting Started
    • Root Instances
    • Configuration
      • Properties
      • Storage Files and Directories
      • Using Channels
      • Housekeeping
      • Backup
      • Lock File
    • Storage Targets
      • Local File System
      • SQL Databases
        • Oracle
        • MySQL
        • SQLite
      • Blob Stores
        • Oracle Cloud
        • Oracle NoSQL
        • Coherence
    • Storing Data
      • Convenience Methods and Explicit Storing (Transactions)
      • Lazy and Eager Storing
      • Transient Fields
      • Best Practice
    • Loading Data
      • Lazy Loading
        • Touched Timestamp, Null-Safe Variant
        • Clearing Lazy References
    • Deleting Data
    • Queries
    • Application Life-Cycle
    • Legacy Type Mapping
      • User Interaction
    • Backup Strategies
    • Import / Export
    • Housekeeping
    • Customizing
      • Custom Type Handler
      • Custom Legacy Type Handler
      • Custom Class Loader
      • Custom Storing Behavior
      • Optional Storage Manager Reference in Entities
    • REST Interface
      • Setup
      • REST API
      • Client GUI
    • FAQ
      • Data Model
      • Data Management
      • File Storage
      • Java Features
      • Miscellaneous
    • Addendum
      • Supported Java Features
      • Specialized Type Handlers
      • Examples and Demo Projects
  • Cache
    • Overview
    • Getting Started
    • Configuration
      • Properties
      • Storage
    • Use Cases
      • Hibernate Second Level Cache
      • Spring Cache
  • Basic Concepts
    • Layered Entities
      • Configuration
      • Defining Entities
      • Creating Entities
      • Updating Entities
      • Versioning
      • Logging
      • Multiple Layers
    • Wrapping
      • Configuration
      • Usage
Powered by GitBook
On this page
Export as PDF
  1. Data-Store
  2. Configuration

Storage Files and Directories

PreviousPropertiesNextUsing Channels

Last updated 3 years ago

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

StorageFileNameProvider fileNameProvider = StorageFileNameProvider.Builder()
	.setChannelDirectoryPrefix("canal_")
	.setDataFilePrefix        ("canal_")
	.setDataFileSuffix        (".bin")
	.setTransactionsFilePrefix("events_")
	.setTransactionsFileSuffix(".bin")
	.setTypeDictionaryFileName("typeDictionary.txt")
	.createFileNameProvider   ()
;

NioFileSystem           fileSystem   = NioFileSystem.New();
StorageLiveFileProvider fileProvider = Storage
	.FileProviderBuilder   (fileSystem)
	.setDirectory          (fileSystem.ensureDirectoryPath(WORKINGDIR))
	.setDeletionDirectory  (fileSystem.ensureDirectoryPath(DELETIONDIR))
	.setTruncationDirectory(fileSystem.ensureDirectoryPath(TRUNCATIONDIR))
	.setFileNameProvider   (fileNameProvider)
	.createFileProvider    ()
;
https://docs.microstream.one/