policy

package
v0.0.0-...-34e0b2d Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 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 GlobalAsyncSealPolicy

type GlobalAsyncSealPolicy interface {
	// ShouldSealed checks if the segment should be sealed, and return the reason string.
	ShouldSealed(m stats.StatsManager)
}

GlobalAsyncSealPolicy is the policy to check if a global segment should be sealed or not.

func GetGlobalAsyncSealPolicy

func GetGlobalAsyncSealPolicy() []GlobalAsyncSealPolicy

type SealPolicyResult

type SealPolicyResult struct {
	PolicyName     string
	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