Class VelocityOptions
- Namespace
- Datafication.Storage.Velocity
- Assembly
- Datafication.Storage.Velocity.dll
Configuration options for VelocityDataBlock storage operations
public class VelocityOptions
- Inheritance
-
objectVelocityOptions
Properties
AppendRollThresholdBytes
Max size for a hot appendable segment before rolling. Default: 256MB
public long AppendRollThresholdBytes { get; set; }
Property Value
- long
AutoCompactionEnabled
Whether automatic compaction is enabled. Default: false
public bool AutoCompactionEnabled { get; set; }
Property Value
- bool
AutoCompactionTrigger
Trigger condition for automatic compaction. Default: SegmentCount
public VelocityCompactionTrigger AutoCompactionTrigger { get; set; }
Property Value
CompactionBatchSize
Batch size for compaction operations (rows processed per batch). Default: 1m
public int CompactionBatchSize { get; set; }
Property Value
- int
CompactionMaxMemoryBytes
Maximum memory usage for compaction operations in bytes. Default: 2GB
public long CompactionMaxMemoryBytes { get; set; }
Property Value
- long
CompressionLevel
Compression level (codec-specific). Default: 1 (fast)
public int CompressionLevel { get; set; }
Property Value
- int
An integer representing the compression level, where higher values typically provide better compression ratios at the cost of increased CPU usage.
Remarks
The meaning of compression levels varies by codec:
| Level | LZ4 | Deflate |
|---|---|---|
| 1 | Fast (L00_FAST) | Fastest |
| 2 | Balanced (L03_HC) | Optimal |
| 3 | High compression (L09_HC) | SmallestSize |
CompressionThresholdBytes
Minimum column size threshold for compression (bytes). Default: 1KB
public int CompressionThresholdBytes { get; set; }
Property Value
- int
The minimum size in bytes that a column's data must reach before compression is considered beneficial.
Remarks
Columns with data smaller than this threshold will not be compressed, as the overhead of compression may exceed the storage savings for small datasets. This helps optimize performance by avoiding unnecessary compression operations.
DefaultCompression
Default compression type for new columns. Default: None
public VelocityCompressionType DefaultCompression { get; set; }
Property Value
- VelocityCompressionType
The compression type to use for columns when auto-compression is disabled. Set to None for no compression, or specify a codec like LZ4 for fast compression.
Remarks
This setting is used when EnableAutoCompression is false, or as a fallback when auto-compression cannot determine a suitable codec.
EnableAutoCompression
Whether to enable automatic compression selection based on data characteristics. Default: false
public bool EnableAutoCompression { get; set; }
Property Value
- bool
trueto enable automatic compression selection;falseto use DefaultCompression for all columns.
Remarks
When enabled, the system analyzes data types and characteristics to select the most appropriate compression codec for each column. For example:
- String columns typically use LZ4 or Deflate compression
- Large fixed-width types (GUID, Decimal) may benefit from compression
- Small types (bool, byte) typically remain uncompressed
EnableAutoMaterialization
Enable automatic WAL materialization based on thresholds. Default: true
public bool EnableAutoMaterialization { get; set; }
Property Value
- bool
EnableBackgroundCompaction
Whether to enable background compaction. Default: false
public bool EnableBackgroundCompaction { get; set; }
Property Value
- bool
EnableDirectFileCopy
Enable direct file copying for unchanged segments during compaction. Default: true
public bool EnableDirectFileCopy { get; set; }
Property Value
- bool
EnableMVCC
Whether to enable MVCC (Multi-Version Concurrency Control). Default: true
public bool EnableMVCC { get; set; }
Property Value
- bool
EnableParallelCompaction
Enable parallel processing during compaction when possible. Default: true
public bool EnableParallelCompaction { get; set; }
Property Value
- bool
EnableStreamingCompaction
Enable streaming compaction mode for large datasets. Default: true
public bool EnableStreamingCompaction { get; set; }
Property Value
- bool
MaxConcurrentCompactionTasks
Maximum number of concurrent compaction tasks. Default: CPU count
public int MaxConcurrentCompactionTasks { get; set; }
Property Value
- int
MaxScanDegreeOfParallelism
Optional override for maximum scan degree-of-parallelism during read/filters. Default: null (auto).
public int? MaxScanDegreeOfParallelism { get; set; }
Property Value
- int?
MaxSegmentSizeBytes
Maximum size for each segment file in bytes. Default: 48GB
public long MaxSegmentSizeBytes { get; set; }
Property Value
- long
MaxSegmentsBeforeCompaction
Maximum number of segments before auto-compaction is triggered. Default: 10
public int MaxSegmentsBeforeCompaction { get; set; }
Property Value
- int
PartitioningMode
Preferred partitioning mode for scanning (auto selects best).
public VelocityScanPartitioningMode PartitioningMode { get; set; }
Property Value
PrimaryKeyColumn
Primary key column name for CRUD operations. Required for updates/deletes.
public string? PrimaryKeyColumn { get; set; }
Property Value
- string
RowGroupTargetBytes
Target size per appended row-group in bytes. Default: 128MB
public long RowGroupTargetBytes { get; set; }
Property Value
- long
RowGroupTargetRows
Target rows per appended row-group (when materializing). Default: 64k
public int RowGroupTargetRows { get; set; }
Property Value
- int
Strategy
Compaction strategy to use. Default: BinPack
public VelocityCompactionStrategy Strategy { get; set; }
Property Value
TargetSegmentSizeBytes
Target size for each segment file in bytes. Default: 32GB
public long TargetSegmentSizeBytes { get; set; }
Property Value
- long
TombstoneFlushThreshold
How often to flush tombstone records to disk. Default: 1000 records
public int TombstoneFlushThreshold { get; set; }
Property Value
- int
WalEnabled
Enable Write-Ahead Log for low-latency single-row updates. Default: true
public bool WalEnabled { get; set; }
Property Value
- bool
WalFsyncPolicy
Fsync policy for WAL appends. Default: Batch
public VelocityWalFsyncPolicy WalFsyncPolicy { get; set; }
Property Value
WalMaxAge
Maximum WAL age before materialization is suggested. Default: 10 minutes
public TimeSpan WalMaxAge { get; set; }
Property Value
- TimeSpan
WalMaxBytes
Maximum WAL size in bytes before materialization is suggested. Default: 128MB
public long WalMaxBytes { get; set; }
Property Value
- long
WalMaxRecords
Maximum WAL record count before materialization is suggested. Default: 100k
public int WalMaxRecords { get; set; }
Property Value
- int
Methods
CreateDefault()
Creates default velocity options
public static VelocityOptions CreateDefault()
Returns
CreateHighThroughput()
Creates velocity options optimized for high-throughput writes with advanced compaction
public static VelocityOptions CreateHighThroughput()
Returns
CreateUpdateOptimized()
Creates velocity options optimized for frequent updates
public static VelocityOptions CreateUpdateOptimized()