node

package
v0.0.0-...-e603270 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxConcurrentTask = int32(2)
)

Functions

func FormatDisk

func FormatDisk(dir string) (string, error)

func OpenDiskFS

func OpenDiskFS(dir string, nodeID uint64) (*diskFS, error)

Types

type Config

type Config struct {
	ID           uint64
	ListenURL    string
	Dirs         []string
	WalDir       string
	SmURLs       []string
	EtcdURLs     []string
	TraceSampler float64
}

func NewConfig

func NewConfig() (*Config, error)

type ExtentNode

type ExtentNode struct {
	// contains filtered or unexported fields
}

func NewExtentNode

func NewExtentNode(nodeID uint64, diskDirs []string, walDir string, listenUrl string, smURLs []string, etcdURLs []string) *ExtentNode

func (*ExtentNode) AllocExtent

func (en *ExtentNode) AllocExtent(ctx context.Context, req *pb.AllocExtentRequest) (*pb.AllocExtentResponse, error)

func (*ExtentNode) Append

func (en *ExtentNode) Append(stream pb.ExtentService_AppendServer) error

func (*ExtentNode) AppendWithWal

func (en *ExtentNode) AppendWithWal(ex *extent.Extent, rev int64, blocks [][]byte, mustSync bool) ([]uint32, uint32, error)

1. req.MustSync is false, "nosync append on extent" 2. req.MustSync is true, noWal or block data is big, "sync append" 3. req.MustSync is true, hasWal and block data is small, "sync append on wal" and "nosync append on extent" on the same time.

func (*ExtentNode) CommitLength

func (en *ExtentNode) CommitLength(ctx context.Context, req *pb.CommitLengthRequest) (*pb.CommitLengthResponse, error)

func (*ExtentNode) CopyExtent

func (*ExtentNode) Df

func (en *ExtentNode) Df(ctx context.Context, req *pb.DfRequest) (*pb.DfResponse, error)

func (*ExtentNode) Heartbeat

func (en *ExtentNode) Heartbeat(in *pb.Payload, stream pb.ExtentService_HeartbeatServer) error

internal services

func (*ExtentNode) LoadExtents

func (en *ExtentNode) LoadExtents() error

func (*ExtentNode) ReAvali

func (en *ExtentNode) ReAvali(ctx context.Context, req *pb.ReAvaliRequest) (*pb.ReAvaliResponse, error)

func (*ExtentNode) ReadBlocks

TODO:add new API: STREAM-READER, read one single block

func (*ExtentNode) RemoveExtent

func (en *ExtentNode) RemoveExtent(eod *ExtentOnDisk) error

func (*ExtentNode) RequireRecovery

func (*ExtentNode) ServeGRPC

func (en *ExtentNode) ServeGRPC(traceSampler float64) error

func (*ExtentNode) Shutdown

func (en *ExtentNode) Shutdown()

func (*ExtentNode) SyncFs

func (en *ExtentNode) SyncFs()

type ExtentOnDisk

type ExtentOnDisk struct {
	*extent.Extent
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL