cleaner

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	KeyCleanEnable       = "delete_enable"
	KeyCleanInterval     = "delete_interval"
	KeyReserveFileNumber = "reserve_file_number"
	KeyReserveFileSize   = "reserve_file_size"

	MB = 1024 * 1024
)

Variables

View Source
var (
	OptionDeleteEnable = Option{
		KeyName:       KeyCleanEnable,
		Element:       Checkbox,
		ChooseOnly:    true,
		ChooseOptions: []interface{}{"true", "false"},
		Default:       "false",
		DefaultNoUse:  false,
		Description:   "开启日志删除功能(delete_enable)",
		Advance:       false,
		ToolTip:       `删除控制功能,默认不开启,当为true时开启。开启后,对于已经读取完毕的数据,cleaner会负责通知删除`,
	}

	OptionCleanInterval = Option{
		KeyName:       KeyCleanInterval,
		ChooseOnly:    false,
		Default:       "300",
		DefaultNoUse:  false,
		Description:   "执行周期,单位为秒(s)(delete_interval)",
		Advance:       true,
		ToolTip:       `在每个周期检查是否符合删除的条件"`,
		ToolTipActive: true,
	}

	OptionReserveFileNumber = Option{
		KeyName:      KeyReserveFileNumber,
		ChooseOnly:   false,
		Default:      "10",
		DefaultNoUse: false,
		Description:  "最大保留的已读取文件数(reserve_file_number)",
		Advance:      true,
		ToolTip:      `解析失败的数据会默认出现在"pandora_stash"字段,该选项可以禁止记录解析失败的数据`,
	}

	OptionReserveFileSize = Option{
		KeyName:      KeyReserveFileSize,
		ChooseOnly:   false,
		Default:      "2048",
		DefaultNoUse: false,
		Description:  "最大保留已读文件总大小,单位为MB(reserve_file_size)",
		Advance:      true,
		ToolTip:      `当已读文件的总大小超过这个值时,会把最老的那部分删掉,默认保留2GB,单位为MB`,
	}
)

Functions

This section is empty.

Types

type CleanSignal

type CleanSignal struct {
	Logdir   string
	Filename string
	Cleaner  string
	ReadMode string
}

type Cleaner

type Cleaner struct {
	// contains filtered or unexported fields
}

func NewCleaner

func NewCleaner(conf conf.MapConf, meta *reader.Meta, cleanChan chan<- CleanSignal, logdir string) (c *Cleaner, err error)

删除文件时遍历全部 删除时生成filedeleted文件

func (*Cleaner) Clean

func (c *Cleaner) Clean() (err error)

func (*Cleaner) Close

func (c *Cleaner) Close()

func (*Cleaner) LogDir added in v1.4.4

func (c *Cleaner) LogDir() string

func (*Cleaner) Name

func (c *Cleaner) Name() string

func (*Cleaner) Run

func (c *Cleaner) Run()

Jump to

Keyboard shortcuts

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