github.com/milvus-io/milvus-sdk-go/v2@v2.4.1/entity/compaction.go (about)

     1  // Licensed to the LF AI & Data foundation under one
     2  // or more contributor license agreements. See the NOTICE file
     3  // distributed with this work for additional information
     4  // regarding copyright ownership. The ASF licenses this file
     5  // to you under the Apache License, Version 2.0 (the
     6  // "License"); you may not use this file except in compliance
     7  // with the License. You may obtain a copy of the License at
     8  //
     9  //     http://www.apache.org/licenses/LICENSE-2.0
    10  //
    11  // Unless required by applicable law or agreed to in writing, software
    12  // distributed under the License is distributed on an "AS IS" BASIS,
    13  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  // See the License for the specific language governing permissions and
    15  // limitations under the License.
    16  
    17  package entity
    18  
    19  // CompactionState is enum of compaction execution state
    20  // should match definition in common.proto
    21  type CompactionState int32
    22  
    23  const (
    24  	//CompcationStateUndefined zero value placeholder
    25  	CompcationStateUndefined CompactionState = 0
    26  	//CompactionStateExecuting compaction in progress
    27  	CompactionStateExecuting CompactionState = 1
    28  	// CompactionStateCompleted compcation done
    29  	CompactionStateCompleted CompactionState = 2
    30  )
    31  
    32  type CompactionPlanType int32
    33  
    34  // See https://wiki.lfaidata.foundation/display/MIL/MEP+16+--+Compaction
    35  const (
    36  	// CompactionPlanUndefined zero value placeholder
    37  	CompactionPlanUndefined CompactionPlanType = 0
    38  	// CompactionPlanApplyDelete apply delete log
    39  	CompactionPlanApplyDelete CompactionPlanType = 1
    40  	// CompactionPlanMergeSegments merge multiple segments
    41  	CompactionPlanMergeSegments CompactionPlanType = 2
    42  )
    43  
    44  // CompactionMergePlan contains compaction plan of merging multple segments
    45  type CompactionPlan struct {
    46  	Source   []int64
    47  	Target   int64
    48  	PlanType CompactionPlanType
    49  }