github.com/weaviate/weaviate@v1.24.6/adapters/repos/db/lsmkv/entities/strategies.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 entities
    13  
    14  const (
    15  	// StrategyReplace allows for idem-potent PUT where the latest takes presence
    16  	StrategyReplace       = "replace"
    17  	StrategySetCollection = "setcollection"
    18  	StrategyMapCollection = "mapcollection"
    19  	StrategyRoaringSet    = "roaringset"
    20  )
    21  
    22  type SegmentStrategy uint16
    23  
    24  const (
    25  	SegmentStrategyReplace SegmentStrategy = iota
    26  	SegmentStrategySetCollection
    27  	SegmentStrategyMapCollection
    28  	SegmentStrategyRoaringSet
    29  )
    30  
    31  func SegmentStrategyFromString(in string) SegmentStrategy {
    32  	switch in {
    33  	case StrategyReplace:
    34  		return SegmentStrategyReplace
    35  	case StrategySetCollection:
    36  		return SegmentStrategySetCollection
    37  	case StrategyMapCollection:
    38  		return SegmentStrategyMapCollection
    39  	case StrategyRoaringSet:
    40  		return SegmentStrategyRoaringSet
    41  	default:
    42  		panic("unsupported strategy")
    43  	}
    44  }