Skip to content

Commit

Permalink
Fixes default configuration file.
Browse files Browse the repository at this point in the history
  • Loading branch information
ppanopticon committed Dec 21, 2023
1 parent f14f7f0 commit 82929ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
7 changes: 1 addition & 6 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
{
"root": "./cottontaildb",
"statistics" : {
"threshold" : 1.0,
"probability" : 0.5,
"randomGeneratorName": "L32X64MixRandom"
}
"root": "/cottontaildb-data"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.util.random.RandomGenerator
* Config for Cottontail DB's management of statistics.
*
* @author Florian Burkhardt
* @version 1.0.0
* @version 1.0.1
*/
@Serializable
data class StatisticsConfig(
Expand All @@ -24,28 +24,29 @@ data class StatisticsConfig(
/** The minimum sample size. The statistics manager makes sure, that at least this many sample are gathered, regardless of the [sampleProbability]. */
val minimumSampleSize: Long = 100_000L,

/** Defines the false positive probability used by the BloomFilter when detecting the numberOfDistinctElements.
/**
* Defines the false positive probability used by the BloomFilter when detecting the numberOfDistinctElements.
*
* The false positive probability is represented by a float value between 0 and 1, and it determines the desired maximum probability of false positives that the filter will generate.
* The lower the false positive probability, the larger the size of the Bloom filter and the more expensive it is to use and maintain.*/
* The lower the false positive probability, the larger the size of the Bloom filter and the more expensive it is to use and maintain.
*/
val falsePositiveProbability: Double = 0.01, // Default is 1%. Typical value between 1% to 10%

/** The random number generator to use. */
val randomGeneratorName: String = "L32X64MixRandom",
)
{
) {
init {
require(this.threshold in 0.0f .. 1.0f) { "The threshold must lie between 0.0 and 1.0 but is ${this.threshold}."}
require(this.sampleProbability in 0.0f .. 1.0f) { "The probability must lie between 0.0 and 1.0 but is ${this.sampleProbability}."}
require(this.falsePositiveProbability in 0.0f .. 1.0f) { "The falsePositiveProbability must lie between 0.0 and 1.0 but is ${this.falsePositiveProbability}."}
}


/**
* Creates and returns a new [RandomGenerator] instance.
*
* @return [RandomGenerator]
*/
fun randomGenerator() = RandomGenerator.of(this.randomGeneratorName)
fun randomGenerator(): RandomGenerator = RandomGenerator.of(this.randomGeneratorName)
}


Expand Down

0 comments on commit 82929ae

Please sign in to comment.