Skip to content

Commit

Permalink
CBL-5932: Update default constants and public symbols (#3299)
Browse files Browse the repository at this point in the history
* update Defaults and exported symbols

* fix isLazy
  • Loading branch information
velicuvlad authored Jul 2, 2024
1 parent c22c095 commit 6cff97b
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 10 deletions.
15 changes: 12 additions & 3 deletions Objective-C/CBLDefaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 */
Expand Down
10 changes: 8 additions & 2 deletions Objective-C/CBLDefaults.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@

const BOOL kCBLDefaultLogFileUsePlaintext = NO;

const BOOL kCBLDefaultLogFileUsePlainText = NO;

const uint64_t kCBLDefaultLogFileMaxSize = 524288;

const NSInteger kCBLDefaultLogFileMaxRotateCount = 1;
Expand Down Expand Up @@ -64,10 +62,18 @@

#pragma mark - CBLVectorIndexConfiguration

const BOOL kCBLDefaultVectorIndexIsLazy = NO;

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;
Expand Down
4 changes: 4 additions & 0 deletions Objective-C/Exports/CBL_EE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ _kCBLDefaultListenerPort
_kCBLDefaultListenerDisableTls
_kCBLDefaultListenerReadOnly
_kCBLDefaultListenerEnableDeltaSync
_kCBLDefaultVectorIndexIsLazy
_kCBLDefaultVectorIndexDistanceMetric
_kCBLDefaultVectorIndexEncoding
_kCBLDefaultVectorIndexMinTrainingSize
_kCBLDefaultVectorIndexMaxTrainingSize
_kCBLDefaultVectorIndexNumProbes
_kCBLCertAttrCommonName
_kCBLCertAttrCountry
_kCBLCertAttrEmailAddress
Expand Down
5 changes: 5 additions & 0 deletions Objective-C/Exports/Generated/CBL_EE.exp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -130,4 +131,8 @@ _kCBLDefaultReplicatorType
_kCBLDefaultScopeName
_kCBLDefaultVectorIndexDistanceMetric
_kCBLDefaultVectorIndexEncoding
_kCBLDefaultVectorIndexIsLazy
_kCBLDefaultVectorIndexMaxTrainingSize
_kCBLDefaultVectorIndexMinTrainingSize
_kCBLDefaultVectorIndexNumProbes
_kCBLTypeProperty
18 changes: 13 additions & 5 deletions Swift/Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -72,7 +68,7 @@ public extension ReplicatorConfiguration {
/// [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

Expand All @@ -88,12 +84,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 {
Expand Down

0 comments on commit 6cff97b

Please sign in to comment.