policy

package
v0.10.3-0...-c917fe4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PolicyName

type PolicyName string
var (
	PolicyNamePartitionNotFound PolicyName = "partition_not_found"
	PolicyNamePartitionRemoved  PolicyName = "partition_removed"
	PolicyNameCollectionRemoved PolicyName = "collection_removed"
	PolicyNameRecover           PolicyName = "recover"
	PolicyNameFenced            PolicyName = "fenced"
	PolicyNameForce             PolicyName = "force"
)

type SealPolicyResult

type SealPolicyResult struct {
	PolicyName     PolicyName
	ShouldBeSealed bool
	ExtraInfo      interface{}
}

SealPolicyResult is the result of the seal policy.

type SegmentAsyncSealPolicy

type SegmentAsyncSealPolicy interface {
	// ShouldBeSealed checks if the segment should be sealed, and return the reason string.
	ShouldBeSealed(stats *stats.SegmentStats) SealPolicyResult
}

SegmentAsyncSealPolicy is the policy to check if a segment should be sealed or not. Those policies are called asynchronously, so the stat is not real time. A policy should be stateless, and only check by segment stats. quick enough to be called.

func GetSegmentAsyncSealPolicy

func GetSegmentAsyncSealPolicy() []SegmentAsyncSealPolicy

GetSegmentAsyncSealPolicy returns the segment async seal policy.

type SegmentLimitation

type SegmentLimitation struct {
	PolicyName  string
	SegmentSize uint64
	ExtraInfo   interface{}
}

SegmentLimitation is the limitation of the segment.

type SegmentLimitationPolicy

type SegmentLimitationPolicy interface {
	// GenerateLimitation generates the limitation of the segment.
	GenerateLimitation() SegmentLimitation
}

SegmentLimitationPolicy is the interface to generate the limitation of the segment.

func GetSegmentLimitationPolicy

func GetSegmentLimitationPolicy() SegmentLimitationPolicy

GetSegmentLimitationPolicy returns the segment limitation policy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL