gfs

package
v0.0.0-...-180b4dd Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MutationWrite = iota
	MutationAppend
	MutationPad
)
View Source
const (
	Success = iota
	UnknownError
	Timeout
	AppendExceedChunkSize
	WriteExceedChunkSize
	ReadEOF
	NotAvailableForCopy
)
View Source
const (
	// chunk
	LeaseExpire        = 3 * time.Second //1 * time.Minute
	DefaultNumReplicas = 3
	MinimumNumReplicas = 2
	MaxChunkSize       = 32 << 20 // 512KB DEBUG ONLY 64 << 20
	MaxAppendSize      = MaxChunkSize / 4
	DeletedFilePrefix  = "__del__"

	// master
	ServerCheckInterval = 400 * time.Millisecond //
	MasterStoreInterval = 30 * time.Hour         // 30 * time.Minute
	ServerTimeout       = 1 * time.Second

	// chunk server
	HeartbeatInterval    = 200 * time.Millisecond
	MutationWaitTimeout  = 4 * time.Second
	ServerStoreInterval  = 40 * time.Hour // 30 * time.Minute
	GarbageCollectionInt = 30 * time.Hour // 1 * time.Day
	DownloadBufferExpire = 2 * time.Minute
	DownloadBufferTick   = 30 * time.Second

	// client
	ClientTryTimeout = 2*LeaseExpire + 3*ServerTimeout
	LeaseBufferTick  = 500 * time.Millisecond
)

system config

Variables

View Source
var (
	Debug int
)

Functions

This section is empty.

Types

type AppendChunkArg

type AppendChunkArg struct {
	DataID      DataBufferID
	Secondaries []ServerAddress
}

type AppendChunkReply

type AppendChunkReply struct {
	Offset    Offset
	ErrorCode ErrorCode
}

type ApplyCopyArg

type ApplyCopyArg struct {
	Handle  ChunkHandle
	Data    []byte
	Version ChunkVersion
}

type ApplyCopyReply

type ApplyCopyReply struct {
	ErrorCode ErrorCode
}

type ApplyMutationArg

type ApplyMutationArg struct {
	Mtype  MutationType
	DataID DataBufferID
	Offset Offset
}

type ApplyMutationReply

type ApplyMutationReply struct {
	ErrorCode ErrorCode
}

type CheckVersionArg

type CheckVersionArg struct {
	Handle  ChunkHandle
	Version ChunkVersion
}

handshake

type CheckVersionReply

type CheckVersionReply struct {
	Stale bool
}

type Checksum

type Checksum int64

type ChunkHandle

type ChunkHandle int64

type ChunkIndex

type ChunkIndex int

type ChunkVersion

type ChunkVersion int64

type CreateChunkArg

type CreateChunkArg struct {
	Handle ChunkHandle
}

type CreateChunkReply

type CreateChunkReply struct {
	ErrorCode ErrorCode
}

type CreateFileArg

type CreateFileArg struct {
	Path Path
}

namespace operation

type CreateFileReply

type CreateFileReply struct{}

type DataBufferID

type DataBufferID struct {
	Handle    ChunkHandle
	TimeStamp int
}

type DeleteFileArg

type DeleteFileArg struct {
	Path Path
}

type DeleteFileReply

type DeleteFileReply struct{}

type Error

type Error struct {
	Code ErrorCode
	Err  string
}

extended error type with error code

func (Error) Error

func (e Error) Error() string

type ErrorCode

type ErrorCode int

type ExtendLeaseArg

type ExtendLeaseArg struct {
	Handle  ChunkHandle
	Address ServerAddress
}

type ExtendLeaseReply

type ExtendLeaseReply struct {
	Expire time.Time
}

type ForwardDataArg

type ForwardDataArg struct {
	DataID     DataBufferID
	Data       []byte
	ChainOrder []ServerAddress
}

chunk IO

type ForwardDataReply

type ForwardDataReply struct {
	ErrorCode ErrorCode
}

type GetChunkHandleArg

type GetChunkHandleArg struct {
	Path  Path
	Index ChunkIndex
}

type GetChunkHandleReply

type GetChunkHandleReply struct {
	Handle ChunkHandle
}

type GetFileInfoArg

type GetFileInfoArg struct {
	Path Path
}

type GetFileInfoReply

type GetFileInfoReply struct {
	IsDir  bool
	Length int64
	Chunks int64
}

type GetPrimaryAndSecondariesArg

type GetPrimaryAndSecondariesArg struct {
	Handle ChunkHandle
}

chunk info

type GetPrimaryAndSecondariesReply

type GetPrimaryAndSecondariesReply struct {
	Primary     ServerAddress
	Expire      time.Time
	Secondaries []ServerAddress
}

type GetReplicasArg

type GetReplicasArg struct {
	Handle ChunkHandle
}

type GetReplicasReply

type GetReplicasReply struct {
	Locations []ServerAddress
}

type HeartbeatArg

type HeartbeatArg struct {
	Address          ServerAddress // chunkserver address
	LeaseExtensions  []ChunkHandle // leases to be extended
	AbandondedChunks []ChunkHandle // unrecoverable chunks
}

handshake

type HeartbeatReply

type HeartbeatReply struct {
	Garbage []ChunkHandle
}

type Lease

type Lease struct {
	Primary     ServerAddress
	Expire      time.Time
	Secondaries []ServerAddress
}

type ListArg

type ListArg struct {
	Path Path
}

type ListReply

type ListReply struct {
	Files []PathInfo
}

type MkdirArg

type MkdirArg struct {
	Path Path
}

type MkdirReply

type MkdirReply struct{}

type MutationType

type MutationType int

type Nouse

type Nouse struct{}

no use argument

type Offset

type Offset int64

type PadChunkArg

type PadChunkArg struct {
	Handle ChunkHandle
}

type PadChunkReply

type PadChunkReply struct {
	ErrorCode ErrorCode
}

type Path

type Path string

type PathInfo

type PathInfo struct {
	Name string

	// if it is a directory
	IsDir bool

	// if it is a file
	Length int64
	Chunks int64
}

type PersistentChunkInfo

type PersistentChunkInfo struct {
	Handle   ChunkHandle
	Length   Offset
	Version  ChunkVersion
	Checksum Checksum
}

type ReadChunkArg

type ReadChunkArg struct {
	Handle ChunkHandle
	Offset Offset
	Length int
}

type ReadChunkReply

type ReadChunkReply struct {
	Data      []byte
	Length    int
	ErrorCode ErrorCode
}

type RenameFileArg

type RenameFileArg struct {
	Source Path
	Target Path
}

type RenameFileReply

type RenameFileReply struct{}

type ReportSelfArg

type ReportSelfArg struct {
}

type ReportSelfReply

type ReportSelfReply struct {
	Chunks []PersistentChunkInfo
}

type SendCopyArg

type SendCopyArg struct {
	Handle  ChunkHandle
	Address ServerAddress
}

re-replication

type SendCopyReply

type SendCopyReply struct {
	ErrorCode ErrorCode
}

type ServerAddress

type ServerAddress string

type WriteChunkArg

type WriteChunkArg struct {
	DataID      DataBufferID
	Offset      Offset
	Secondaries []ServerAddress
}

type WriteChunkReply

type WriteChunkReply struct {
	ErrorCode ErrorCode
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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