package v1alpha1 // DatabaseCompactionConfig from https://docs.couchdb.org/en/stable/config/compaction.html type DatabaseCompactionConfig struct { // Specifies the copy buffer’s maximum size in bytes: DocBufferSize *int `json:"docBufferSize,omitempty" ini:"doc_buffer_size,omitempty"` // Triggers a checkpoint after the specified amount of bytes were successfully copied to the compacted database: CheckpointAfter *int `json:"checkpointAfter,omitempty" ini:"checkpoint_after,omitempty"` } type ViewCompactionConfig struct { // Specifies maximum copy buffer size in bytes used during compaction: KeyValueBufferSize *int `json:"keyValueBufferSize,omitempty" ini:"keyvalue_buffer_size,omitempty"` } type SmooshConfig struct { // A comma-delimited list of channels that are sent the names of database files when those files are updated. DBChannels []string `json:"dbChannels,omitempty" ini:"db_channels,omitempty" delim:","` // A comma-delimited list of channels that are sent the names of secondary index files when those files are updated ViewChannels []string `json:"viewChannels,omitempty" ini:"view_channels,omitempty" delim:","` // Special channel for compaction cleanup: index_cleanup, from https://docs.couchdb.org/en/stable/maintenance/compaction.html#channel-configuration CleanupChannels []string `json:"cleanupChannels,omitempty" ini:"cleanup_channels,omitempty" delim:","` // Log level of compaction CompactionLogLevel *LogLevel `json:"compactionLogLevel,omitempty" ini:"compaction_log_level,omitempty" delim:","` // Smoosh queue persistence. This allows resuming smoosh operations after a node restart. from: https://docs.couchdb.org/en/stable/whatsnew/3.3.html#id3, https://github.com/apache/couchdb/blob/dce6769edf141c36d408bddcd48082e91ae2f7ab/rel/overlay/etc/default.ini#L793 Persist *bool `json:"persist,omitempty" ini:"persist,omitempty"` // The number of minutes that the (expensive) priority calculation on an individual can be stale for before it is recalculated. Defaults to 5. Staleness *int `json:"staleness,omitempty" ini:"staleness,omitempty"` // If set to true, the compaction daemon will delete the files for indexes that are no longer associated with any design document CleanupIndexFiles *bool `json:"capacity,omitempty" ini:"cleanup_index_files,omitempty"` // These settings control the resource allocation for a given compaction channel. Channels map[string]*SmooshChannelConfig `json:"channels,omitempty" ini:"-"` } type SmooshChannelConfig struct { // The maximum number of items the channel can hold (lowest priority item is removed to make room for new items). Defaults to 9999 Capacity *int `json:"capacity,omitempty" ini:"capacity,omitempty"` // The maximum number of jobs that can run concurrently in this channel. Defaults to 1. Concurrency *int `json:"concurrency,omitempty" ini:"concurrency,omitempty"` //The time period during which this channel is allowed to execute compactions // The value for each of these parameters must obey the format HH:MM with HH in [0..23] and MM in [0..59] From *string `json:"from,omitempty" ini:"from,omitempty"` To *string `json:"to,omitempty" ini:"to,omitempty"` // If set to true, any compaction that is still running after the end of the allowed perio will be suspended, and then resumed during the next window StrictWindow *bool `json:"strictWindow,omitempty" ini:"strict_window,omitempty"` // Each item must have a priority lower than this to be enqueued. Defaults to infinity. MaxPriority *float64 `json:"maxPriority,omitempty" ini:"max_priority,omitempty"` // The item must be no larger than this many bytes in length to be enqueued. Defaults to infinity. MaxSize *float64 `json:"maxSize,omitempty" ini:"max_size,omitempty"` // The item must have a priority at least this high to be enqueued. Defaults to 5.0 for ratio and 16 MB for slack. MinPriority *float64 `json:"minPriority,omitempty" ini:"min_priority,omitempty"` // The minimum number of changes since last compaction before the item will be enqueued. Defaults to 0. Currently only works for databases. MinChanges *float64 `json:"minChanges,omitempty" ini:"min_changes,omitempty"` // The item must be at least this many bytes in length to be enqueued. Defaults to 1mb (1048576 bytes). MinSize *float64 `json:"minSize,omitempty" ini:"min_size,omitempty"` // The method used to calculate priority. Can be ratio (calculated as sizes.file/sizes.active) or slack (calculated as sizes.file - sizes.active). Defaults to ratio. Priority *string `json:"priority,omitempty" ini:"priority,omitempty"` }