cubefs

Форк
0
/
const.go 
72 строки · 2.4 Кб
1
// Copyright 2023 The CubeFS Authors.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//     http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12
// implied. See the License for the specific language governing
13
// permissions and limitations under the License.
14

15
package lcnode
16

17
import (
18
	"regexp"
19

20
	"github.com/cubefs/cubefs/proto"
21
	"golang.org/x/time/rate"
22
)
23

24
const (
25
	configListen                     = proto.ListenPort
26
	configMasterAddr                 = proto.MasterAddr
27
	configBatchExpirationGetNumStr   = "batchExpirationGetNum"
28
	configScanCheckIntervalStr       = "scanCheckInterval"
29
	configLcScanRoutineNumPerTaskStr = "lcScanRoutineNumPerTask"
30
	configLcScanLimitPerSecondStr    = "lcScanLimitPerSecond"
31

32
	configSnapshotRoutineNumPerTaskStr = "snapshotRoutineNumPerTask"
33
	configLcNodeTaskCountLimit         = "lcNodeTaskCountLimit"
34
)
35

36
// Default of configuration value
37
const (
38
	defaultListen                  = "80"
39
	ModuleName                     = "lcNode"
40
	defaultBatchExpirationGetNum   = 100
41
	maxBatchExpirationGetNum       = 10000
42
	defaultScanCheckInterval       = 60
43
	defaultLcScanRoutineNumPerTask = 100
44
	defaultLcScanLimitPerSecond    = rate.Inf
45
	defaultLcScanLimitBurst        = 1000
46

47
	maxLcScanRoutineNumPerTask = 5000
48
	maxDirChanNum              = 1000000
49
	defaultReadDirLimit        = 1000
50

51
	defaultMasterIntervalToCheckHeartbeat = 6
52
	noHeartBeatTimes                      = 3 // number of times that no heartbeat reported
53
	defaultLcNodeTimeOutSec               = noHeartBeatTimes * defaultMasterIntervalToCheckHeartbeat
54
	defaultIntervalToCheckRegister        = 2 * defaultLcNodeTimeOutSec
55

56
	defaultUnboundedChanInitCapacity = 10000
57
	defaultLcNodeTaskCountLimit      = 1
58
	maxLcNodeTaskCountLimit          = 20
59
)
60

61
var (
62
	// Regular expression used to verify the configuration of the service listening port.
63
	// A valid service listening port configuration is a string containing only numbers.
64
	regexpListen            = regexp.MustCompile(`^(\d)+$`)
65
	batchExpirationGetNum   int
66
	scanCheckInterval       int64
67
	lcScanRoutineNumPerTask int
68
	lcScanLimitPerSecond    rate.Limit
69

70
	snapshotRoutineNumPerTask int
71
	lcNodeTaskCountLimit      int
72
)
73

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.