node

package
v0.0.0-...-6aa601a Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2021 License: Apache-2.0 Imports: 33 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
}

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(ctx context.Context, req *pb.AppendRequest) (*pb.AppendResponse, error)

func (*ExtentNode) AppendWithWal

func (en *ExtentNode) AppendWithWal(ex *extent.Extent, rev int64, blocks []*pb.Block, 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

func (en *ExtentNode) ReadBlocks(ctx context.Context, req *pb.ReadBlocksRequest) (*pb.ReadBlocksResponse, error)

func (*ExtentNode) ReadEntries

func (en *ExtentNode) ReadEntries(ctx context.Context, req *pb.ReadEntriesRequest) (*pb.ReadEntriesResponse, error)

func (*ExtentNode) ReplicateBlocks

func (*ExtentNode) RequireRecovery

func (*ExtentNode) ServeGRPC

func (en *ExtentNode) ServeGRPC() error

func (*ExtentNode) Shutdown

func (en *ExtentNode) Shutdown()

func (*ExtentNode) SmartReadBlocks

func (en *ExtentNode) SmartReadBlocks(ctx context.Context, req *pb.ReadBlocksRequest) (*pb.ReadBlocksResponse, error)

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