Documentation
¶
Index ¶
- Constants
- Variables
- type Chunk
- func (cs Chunk) AllowModify() (err error)
- func (cs Chunk) CasDirty(old, new uint32) (swapped bool)
- func (cs Chunk) ChunkInfo(ctx context.Context) (info bnapi.ChunkInfo)
- func (cs Chunk) Close(ctx context.Context)
- func (cs Chunk) CommitCompact(ctx context.Context, ncs core.ChunkAPI) (err error)
- func (cs Chunk) Delete(ctx context.Context, bid proto.BlobID) (err error)
- func (cs Chunk) Destroy(ctx context.Context)
- func (cs Chunk) Disk() core.DiskAPI
- func (cs Chunk) GetStg() core.Storage
- func (cs Chunk) HasEnoughSpace(needSize int64) bool
- func (cs Chunk) HasPendingRequest() bool
- func (cs Chunk) ID() bnapi.ChunkId
- func (cs Chunk) IsClosed() bool
- func (cs Chunk) IsDirty() bool
- func (cs Chunk) ListShards(ctx context.Context, startBid proto.BlobID, cnt int, status bnapi.ShardStatus) (infos []*bnapi.ShardInfo, next proto.BlobID, err error)
- func (cs Chunk) MarkDelete(ctx context.Context, bid proto.BlobID) (err error)
- func (cs Chunk) MarshalJSON() ([]byte, error)
- func (cs Chunk) NeedCompact(ctx context.Context) bool
- func (cs Chunk) NewRangeReader(ctx context.Context, id proto.BlobID, from, to int64) (s *core.Shard, err error)
- func (cs Chunk) NewReader(ctx context.Context, id proto.BlobID) (s *core.Shard, err error)
- func (cs Chunk) PutStg(stg core.Storage)
- func (cs Chunk) RangeRead(ctx context.Context, b *core.Shard) (n int64, err error)
- func (cs Chunk) Read(ctx context.Context, b *core.Shard) (n int64, err error)
- func (cs Chunk) ReadShardMeta(ctx context.Context, bid proto.BlobID) (sm *core.ShardMeta, err error)
- func (cs Chunk) RefreshFstat(ctx context.Context) (err error)
- func (cs Chunk) SetDirty(dirty bool)
- func (cs Chunk) SetStatus(status bnapi.ChunkStatus) (err error)
- func (cs Chunk) StartCompact(ctx context.Context) (newcs core.ChunkAPI, err error)
- func (cs Chunk) Status() (status bnapi.ChunkStatus)
- func (cs Chunk) StopCompact(ctx context.Context, ncs core.ChunkAPI) (err error)
- func (cs Chunk) Sync(ctx context.Context) (err error)
- func (cs Chunk) SyncData(ctx context.Context) (err error)
- func (cs Chunk) UnmarshalJSON(data []byte) (err error)
- func (cs Chunk) Vuid() proto.Vuid
- func (cs Chunk) VuidMeta() (vm *core.VuidMeta)
- func (cs Chunk) Write(ctx context.Context, b *core.Shard) (err error)
- type ChunkStats
- type FileInfo
Constants ¶
View Source
const ( DefaultChunkExpandRate = 2 DefaultMaxChunkFileSize = 8 * (1 << 40) // 8 TiB )
Variables ¶
View Source
var ( ErrCompactCheck = errors.New("chunk compact check not match") ErrCompactStopped = errors.New("chunk compact stopped") )
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk struct {
// contains filtered or unexported fields
}
func NewChunkStorage ¶
func (Chunk) AllowModify ¶
func (cs Chunk) AllowModify() (err error)
func (Chunk) CommitCompact ¶
func (Chunk) HasEnoughSpace ¶
func (Chunk) HasPendingRequest ¶
func (cs Chunk) HasPendingRequest() bool
func (Chunk) ListShards ¶
func (Chunk) MarkDelete ¶
func (Chunk) MarshalJSON ¶
func (Chunk) NeedCompact ¶
func (Chunk) NewRangeReader ¶
func (cs Chunk) NewRangeReader(ctx context.Context, id proto.BlobID, from, to int64) (s *core.Shard, err error)
Fill Shard:
- Offset
- Size
- Crc
- Flag
- Body (Reader)
func (Chunk) RangeRead ¶
Need Shard:
- From (may fix)
- To (may fix)
- Writer (To net)
Fill Shard:
- Offset
- Size
- Crc
- Flag
func (Chunk) ReadShardMeta ¶
func (Chunk) RefreshFstat ¶
func (Chunk) SetStatus ¶
func (cs Chunk) SetStatus(status bnapi.ChunkStatus) (err error)
func (Chunk) StartCompact ¶
func (Chunk) Status ¶
func (cs Chunk) Status() (status bnapi.ChunkStatus)
func (Chunk) StopCompact ¶
func (Chunk) UnmarshalJSON ¶
type ChunkStats ¶
type ChunkStats struct { // counts TotalWriteCnt uint64 `json:"total_write_cnt"` TotalReadCnt uint64 `json:"total_read_cnt"` TotalRangeReadCnt uint64 `json:"total_rangeread_cnt"` TotalReadShardMetaCnt uint64 `json:"total_readmeta_cnt"` TotalMarkDelCnt uint64 `json:"total_markdel_cnt"` TotalDelCnt uint64 `json:"total_del_cnt"` TotalListShardCnt uint64 `json:"total_listshard_cnt"` // in queue WriteInque int64 `json:"write_inque"` ReadInque int64 `json:"read_inque"` RangeReadInque int64 `json:"rangeread_inque"` ReadShardMetaInque int64 `json:"readmeta_inque"` MarkDelInque int64 `json:"markdel_inque"` DelInque int64 `json:"del_inque"` ListShardInque int64 `json:"listshard_inque"` // bytes TotalReadBytes uint64 `json:"total_read_bytes"` TotalRangeReadBytes uint64 `json:"total_rangeread_bytes"` TotalWriteBytes uint64 `json:"total_write_bytes"` // latency TotalWriteDelay uint64 `json:"total_write_delay"` TotalReadDelay uint64 `json:"total_read_delay"` TotalRangeReadDelay uint64 `json:"total_rangeread_delay"` TotalReadShardMetaDelay uint64 `json:"total_readmeta_delay"` TotalMarkDelDelay uint64 `json:"total_markdel_delay"` TotalDelDelay uint64 `json:"total_del_delay"` TotalListShardDelay uint64 `json:"total_listshard_dalay"` }
Chunk Stats
Click to show internal directories.
Click to hide internal directories.