1
// Copyright 2023 The CubeFS Authors.
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
7
// http://www.apache.org/licenses/LICENSE-2.0
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.
20
"github.com/cubefs/cubefs/proto"
21
"golang.org/x/time/rate"
25
configListen = proto.ListenPort
26
configMasterAddr = proto.MasterAddr
27
configBatchExpirationGetNumStr = "batchExpirationGetNum"
28
configScanCheckIntervalStr = "scanCheckInterval"
29
configLcScanRoutineNumPerTaskStr = "lcScanRoutineNumPerTask"
30
configLcScanLimitPerSecondStr = "lcScanLimitPerSecond"
32
configSnapshotRoutineNumPerTaskStr = "snapshotRoutineNumPerTask"
33
configLcNodeTaskCountLimit = "lcNodeTaskCountLimit"
36
// Default of configuration value
40
defaultBatchExpirationGetNum = 100
41
maxBatchExpirationGetNum = 10000
42
defaultScanCheckInterval = 60
43
defaultLcScanRoutineNumPerTask = 100
44
defaultLcScanLimitPerSecond = rate.Inf
45
defaultLcScanLimitBurst = 1000
47
maxLcScanRoutineNumPerTask = 5000
48
maxDirChanNum = 1000000
49
defaultReadDirLimit = 1000
51
defaultMasterIntervalToCheckHeartbeat = 6
52
noHeartBeatTimes = 3 // number of times that no heartbeat reported
53
defaultLcNodeTimeOutSec = noHeartBeatTimes * defaultMasterIntervalToCheckHeartbeat
54
defaultIntervalToCheckRegister = 2 * defaultLcNodeTimeOutSec
56
defaultUnboundedChanInitCapacity = 10000
57
defaultLcNodeTaskCountLimit = 1
58
maxLcNodeTaskCountLimit = 20
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
70
snapshotRoutineNumPerTask int
71
lcNodeTaskCountLimit int