From 765c756131b5773383b66a802dae4a174bd28372 Mon Sep 17 00:00:00 2001 From: Vlad Velicu Date: Mon, 1 Jul 2024 20:06:42 +0100 Subject: [PATCH 1/3] update Defaults and exported symbols --- Objective-C/CBLDefaults.h | 15 ++++++++++++--- Objective-C/CBLDefaults.m | 10 ++++++++-- Objective-C/Exports/CBL_EE.txt | 4 ++++ Objective-C/Exports/Generated/CBL_EE.exp | 5 +++++ Swift/Defaults.swift | 22 +++++++++++++--------- 5 files changed, 42 insertions(+), 14 deletions(-) diff --git a/Objective-C/CBLDefaults.h b/Objective-C/CBLDefaults.h index ccf4739de..fbb9f7a44 100644 --- a/Objective-C/CBLDefaults.h +++ b/Objective-C/CBLDefaults.h @@ -33,9 +33,6 @@ /** [NO] Plaintext is not used, and instead binary encoding is used in log files */ extern const BOOL kCBLDefaultLogFileUsePlaintext; -/** [NO] Plaintext is not used, and instead binary encoding is used in log files */ -extern const BOOL kCBLDefaultLogFileUsePlainText __deprecated_msg("Use kCBLDefaultLogFileUsePlaintext instead."); - /** [524288] 512 KiB for the size of a log file */ extern const uint64_t kCBLDefaultLogFileMaxSize; @@ -86,12 +83,24 @@ extern const BOOL kCBLDefaultReplicatorAcceptParentCookies; #pragma mark - CBLVectorIndexConfiguration +/** [YES] Vectors are not lazily indexed, by default */ +extern const BOOL kCBLDefaultVectorIndexIsLazy; + /** [kCBLSQ8] Vectors are encoded by using 8-bit Scalar Quantizer encoding, by default */ extern const CBLScalarQuantizerType kCBLDefaultVectorIndexEncoding; /** [kCBLDistanceMetricEuclidean] By default, vectors are compared using Euclidean metrics */ extern const CBLDistanceMetric kCBLDefaultVectorIndexDistanceMetric; +/** [0] By default, the value will be determined based on the number of centroids, encoding types, and the encoding parameters. */ +extern const unsigned int kCBLDefaultVectorIndexMinTrainingSize; + +/** [0] By default, the value will be determined based on the number of centroids, encoding types, and the encoding parameters */ +extern const unsigned int kCBLDefaultVectorIndexMaxTrainingSize; + +/** [0] By default, the value will be determined based on the number of centroids. */ +extern const unsigned int kCBLDefaultVectorIndexNumProbes; + #pragma mark - CBLURLEndpointListenerConfiguration /** [0] No port specified, the OS will assign one */ diff --git a/Objective-C/CBLDefaults.m b/Objective-C/CBLDefaults.m index 8373eb6ba..f64c7a2ac 100644 --- a/Objective-C/CBLDefaults.m +++ b/Objective-C/CBLDefaults.m @@ -26,8 +26,6 @@ const BOOL kCBLDefaultLogFileUsePlaintext = NO; -const BOOL kCBLDefaultLogFileUsePlainText = NO; - const uint64_t kCBLDefaultLogFileMaxSize = 524288; const NSInteger kCBLDefaultLogFileMaxRotateCount = 1; @@ -64,10 +62,18 @@ #pragma mark - CBLVectorIndexConfiguration +const BOOL kCBLDefaultVectorIndexIsLazy = YES; + const CBLScalarQuantizerType kCBLDefaultVectorIndexEncoding = kCBLSQ8; const CBLDistanceMetric kCBLDefaultVectorIndexDistanceMetric = kCBLDistanceMetricEuclidean; +const unsigned int kCBLDefaultVectorIndexMinTrainingSize = 0; + +const unsigned int kCBLDefaultVectorIndexMaxTrainingSize = 0; + +const unsigned int kCBLDefaultVectorIndexNumProbes = 0; + #pragma mark - CBLURLEndpointListenerConfiguration const unsigned short kCBLDefaultListenerPort = 0; diff --git a/Objective-C/Exports/CBL_EE.txt b/Objective-C/Exports/CBL_EE.txt index 79ebbef56..15d7b41c6 100644 --- a/Objective-C/Exports/CBL_EE.txt +++ b/Objective-C/Exports/CBL_EE.txt @@ -47,8 +47,12 @@ _kCBLDefaultListenerPort _kCBLDefaultListenerDisableTls _kCBLDefaultListenerReadOnly _kCBLDefaultListenerEnableDeltaSync +_kCBLDefaultVectorIndexIsLazy _kCBLDefaultVectorIndexDistanceMetric _kCBLDefaultVectorIndexEncoding +_kCBLDefaultVectorIndexMinTrainingSize +_kCBLDefaultVectorIndexMaxTrainingSize +_kCBLDefaultVectorIndexNumProbes _kCBLCertAttrCommonName _kCBLCertAttrCountry _kCBLCertAttrEmailAddress diff --git a/Objective-C/Exports/Generated/CBL_EE.exp b/Objective-C/Exports/Generated/CBL_EE.exp index babe2e82d..795be47c5 100644 --- a/Objective-C/Exports/Generated/CBL_EE.exp +++ b/Objective-C/Exports/Generated/CBL_EE.exp @@ -22,6 +22,7 @@ .objc_class_name_CBLDocumentFragment .objc_class_name_CBLDocumentReplication .objc_class_name_CBLEncryptionKey +.objc_class_name_CBLExtension .objc_class_name_CBLFileLogger .objc_class_name_CBLFragment .objc_class_name_CBLFullTextIndex @@ -130,4 +131,8 @@ _kCBLDefaultReplicatorType _kCBLDefaultScopeName _kCBLDefaultVectorIndexDistanceMetric _kCBLDefaultVectorIndexEncoding +_kCBLDefaultVectorIndexIsLazy +_kCBLDefaultVectorIndexMaxTrainingSize +_kCBLDefaultVectorIndexMinTrainingSize +_kCBLDefaultVectorIndexNumProbes _kCBLTypeProperty diff --git a/Swift/Defaults.swift b/Swift/Defaults.swift index 1adefabca..05f947d7b 100644 --- a/Swift/Defaults.swift +++ b/Swift/Defaults.swift @@ -26,10 +26,6 @@ public extension LogFileConfiguration { /// [false] Plaintext is not used, and instead binary encoding is used in log files static let defaultUsePlaintext: Bool = false - - /// [false] Plaintext is not used, and instead binary encoding is used in log files - /// @available(*, deprecated, message: "Use LogFileConfiguration.defaultUsePlaintext instead.") - static let defaultUsePlainText: Bool = false /// [524288] 512 KiB for the size of a log file static let defaultMaxSize: UInt64 = 524288 @@ -68,11 +64,7 @@ public extension ReplicatorConfiguration { /// [300] Max wait time between retry attempts in seconds static let defaultMaxAttemptsWaitTime: TimeInterval = 300 - - /// [300] Max wait time between retry attempts in seconds - /// @available(*, deprecated, message: "Use ReplicatorConfiguration.defaultMaxAttemptsWaitTime instead.") - static let defaultMaxAttemptWaitTime: TimeInterval = 300 - + /// [true] Purge documents when a user loses access static let defaultEnableAutoPurge: Bool = true @@ -88,12 +80,24 @@ public extension ReplicatorConfiguration { public extension VectorIndexConfiguration { + /// [false] Vectors are not lazily indexed, by default + static let defaultIsLazy: Bool = false + /// [ScalarQuantizerType.SQ8] Vectors are encoded by using 8-bit Scalar Quantizer encoding, by default static let defaultEncoding: ScalarQuantizerType = ScalarQuantizerType.SQ8 /// [DistanceMetric.euclidean] By default, vectors are compared using Euclidean metrics static let defaultDistanceMetric: DistanceMetric = DistanceMetric.euclidean + /// [0] By default, the value will be determined based on the number of centroids, encoding types, and the encoding parameters. + static let defaultMinTrainingSize: UInt32 = 0 + + /// [0] By default, the value will be determined based on the number of centroids, encoding types, and the encoding parameters + static let defaultMaxTrainingSize: UInt32 = 0 + + /// [0] By default, the value will be determined based on the number of centroids. + static let defaultNumProbes: UInt32 = 0 + } public extension URLEndpointListenerConfiguration { From 60df6d827f6ac8245db59d34d19adbe54c5d6feb Mon Sep 17 00:00:00 2001 From: Vlad Velicu Date: Mon, 1 Jul 2024 20:57:12 +0100 Subject: [PATCH 2/3] fix isLazy --- Objective-C/CBLDefaults.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objective-C/CBLDefaults.m b/Objective-C/CBLDefaults.m index f64c7a2ac..585d188c3 100644 --- a/Objective-C/CBLDefaults.m +++ b/Objective-C/CBLDefaults.m @@ -62,7 +62,7 @@ #pragma mark - CBLVectorIndexConfiguration -const BOOL kCBLDefaultVectorIndexIsLazy = YES; +const BOOL kCBLDefaultVectorIndexIsLazy = NO; const CBLScalarQuantizerType kCBLDefaultVectorIndexEncoding = kCBLSQ8; From 8c612fe02ec8f7238f38f53490380037879960a1 Mon Sep 17 00:00:00 2001 From: Vlad Velicu Date: Mon, 1 Jul 2024 21:04:18 +0100 Subject: [PATCH 3/3] add back deprecated defaultMaxAttemptWaitTime --- Swift/Defaults.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Swift/Defaults.swift b/Swift/Defaults.swift index 05f947d7b..07ca1f387 100644 --- a/Swift/Defaults.swift +++ b/Swift/Defaults.swift @@ -64,6 +64,10 @@ public extension ReplicatorConfiguration { /// [300] Max wait time between retry attempts in seconds static let defaultMaxAttemptsWaitTime: TimeInterval = 300 + + /// [300] Max wait time between retry attempts in seconds + /// @available(*, deprecated, message: "Use ReplicatorConfiguration.defaultMaxAttemptsWaitTime instead.") + static let defaultMaxAttemptWaitTime: TimeInterval = 300 /// [true] Purge documents when a user loses access static let defaultEnableAutoPurge: Bool = true