github.com/weaviate/weaviate@v1.24.6/adapters/repos/db/vector/hnsw/commit_logger_functional_options.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  package hnsw
    13  
    14  type CommitlogOption func(l *hnswCommitLogger) error
    15  
    16  func WithCommitlogThreshold(size int64) CommitlogOption {
    17  	return func(l *hnswCommitLogger) error {
    18  		l.maxSizeIndividual = size
    19  		return nil
    20  	}
    21  }
    22  
    23  func WithCommitlogThresholdForCombining(size int64) CommitlogOption {
    24  	return func(l *hnswCommitLogger) error {
    25  		l.maxSizeCombining = size
    26  		return nil
    27  	}
    28  }