cubefs

Форк
0
65 строк · 2.5 Кб
1
// Copyright 2022 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 blobnode
16

17
import (
18
	"time"
19

20
	"github.com/cubefs/cubefs/blobstore/common/proto"
21
)
22

23
type DiskHeartBeatInfo struct {
24
	DiskID       proto.DiskID `json:"disk_id"`
25
	Used         int64        `json:"used"`           // disk used space
26
	Free         int64        `json:"free"`           // remaining free space on the disk
27
	Size         int64        `json:"size"`           // total physical disk space
28
	MaxChunkCnt  int64        `json:"max_chunk_cnt"`  // note: maintained by clustermgr
29
	FreeChunkCnt int64        `json:"free_chunk_cnt"` // note: maintained by clustermgr
30
	UsedChunkCnt int64        `json:"used_chunk_cnt"` // current number of chunks on the disk
31
}
32

33
type DiskInfo struct {
34
	ClusterID    proto.ClusterID  `json:"cluster_id"`
35
	Idc          string           `json:"idc"`
36
	Rack         string           `json:"rack"`
37
	Host         string           `json:"host"`
38
	Path         string           `json:"path"`
39
	Status       proto.DiskStatus `json:"status"` // normal、broken、repairing、repaired、dropped
40
	Readonly     bool             `json:"readonly"`
41
	CreateAt     time.Time        `json:"create_time"`
42
	LastUpdateAt time.Time        `json:"last_update_time"`
43
	DiskHeartBeatInfo
44
}
45

46
type ChunkInfo struct {
47
	Id         ChunkId      `json:"id"`
48
	Vuid       proto.Vuid   `json:"vuid"`
49
	DiskID     proto.DiskID `json:"diskid"`
50
	Total      uint64       `json:"total"`  // ChunkSize
51
	Used       uint64       `json:"used"`   // user data size
52
	Free       uint64       `json:"free"`   // ChunkSize - Used
53
	Size       uint64       `json:"size"`   // Chunk File Size (logic size)
54
	Status     ChunkStatus  `json:"status"` // normal、readOnly
55
	Compacting bool         `json:"compacting"`
56
}
57

58
type ShardInfo struct {
59
	Vuid   proto.Vuid   `json:"vuid"`
60
	Bid    proto.BlobID `json:"bid"`
61
	Size   int64        `json:"size"`
62
	Crc    uint32       `json:"crc"`
63
	Flag   ShardStatus  `json:"flag"` // 1:normal,2:markDelete
64
	Inline bool         `json:"inline"`
65
}
66

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

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

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

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