Class VelocityOptions
- Namespace
- Datafication.Storage.Velocity
- Assembly
- Datafication.Storage.Velocity.dll
Configuration options for VelocityDataBlock storage operations
public class VelocityOptions
- Inheritance
-
objectVelocityOptions
Properties
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 |
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
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
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
PrimaryKeyColumn
Primary key column name for CRUD operations. Required for updates/deletes.
public string? PrimaryKeyColumn { get; set; }
Property Value
- string
RowGroupTargetRows
Target rows per appended row-group (when materializing). Default: 64k
public int RowGroupTargetRows { get; set; }
Property Value
- int
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
WalMaxBytes
Maximum WAL size in bytes before materialization is suggested. Default: 128MB
public long WalMaxBytes { get; set; }
Property Value
- long
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()