cubefs

Форк
0
/
const.go 
104 строки · 3.1 Кб
1
// Copyright 2018 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 datanode
16

17
const (
18
	IntervalToUpdateReplica       = 600 // interval to update the replica
19
	IntervalToUpdatePartitionSize = 60  // interval to update the partition size
20
	NumOfFilesToRecoverInParallel = 10  // number of files to be recovered simultaneously
21
)
22

23
// Network protocol
24
const (
25
	NetworkProtocol = "tcp"
26
)
27

28
// Status of load data partition extent header
29
const (
30
	FinishLoadDataPartitionExtentHeader = 1
31
)
32

33
// cmd response
34
const (
35
	ReadFlag  = 1
36
	WriteFlag = 2
37
)
38

39
// Error code
40
const (
41
	RaftNotStarted = "RaftNotStarted"
42
)
43

44
// Action description
45
const (
46
	ActionNotifyFollowerToRepair        = "ActionNotifyFollowerRepair"
47
	ActionStreamRead                    = "ActionStreamRead"
48
	ActionStreamFollowerRead            = "ActionStreamFollowerRead"
49
	ActionCreateExtent                  = "ActionCreateExtent:"
50
	ActionMarkDelete                    = "ActionMarkDelete:"
51
	ActionGetAllExtentWatermarks        = "ActionGetAllExtentWatermarks:"
52
	ActionWrite                         = "ActionWrite:"
53
	ActionRepair                        = "ActionRepair:"
54
	ActionDecommissionPartition         = "ActionDecommissionPartition"
55
	ActionAddDataPartitionRaftMember    = "ActionAddDataPartitionRaftMember"
56
	ActionRemoveDataPartitionRaftMember = "ActionRemoveDataPartitionRaftMember"
57
	ActionDataPartitionTryToLeader      = "ActionDataPartitionTryToLeader"
58

59
	ActionCreateDataPartition        = "ActionCreateDataPartition"
60
	ActionLoadDataPartition          = "ActionLoadDataPartition"
61
	ActionDeleteDataPartition        = "ActionDeleteDataPartition"
62
	ActionStreamReadTinyDeleteRecord = "ActionStreamReadTinyDeleteRecord"
63
	ActionSyncTinyDeleteRecord       = "ActionSyncTinyDeleteRecord"
64
	ActionStreamReadTinyExtentRepair = "ActionStreamReadTinyExtentRepair"
65
	ActionBatchMarkDelete            = "ActionBatchMarkDelete"
66
	ActionUpdateVersion              = "ActionUpdateVersion"
67
	ActionStopDataPartitionRepair    = "ActionStopDataPartitionRepair"
68
)
69

70
// Apply the raft log operation. Currently we only have the random write operation.
71
const (
72
	MinTinyExtentsToRepair = 10 // minimum number of tiny extents to repair
73
)
74

75
// Tiny extent has been put back to store
76
const (
77
	IsReleased = 1
78
)
79

80
const (
81
	MinAvaliTinyExtentCnt = 5
82
)
83

84
// Sector size
85
const (
86
	DiskSectorSize = 512
87
)
88

89
const (
90
	RepairRead = true
91
	StreamRead = false
92
)
93

94
const (
95
	BufferWrite = false
96
)
97

98
const (
99
	EmptyResponse                      = 'E'
100
	TinyExtentRepairReadResponseArgLen = 17
101
	MaxSyncTinyDeleteBufferSize        = 2400000
102
	MaxFullSyncTinyDeleteTime          = 3600 * 24
103
	MinTinyExtentDeleteRecordSyncSize  = 4 * 1024 * 1024
104
)
105

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

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

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

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