weed_server

package
v0.0.0-...-f1e43fe Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: Apache-2.0 Imports: 68 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSizeLimit = 1024 * 1024 * 2

Variables

View Source
var (
	OS_UID = uint32(os.Getuid())
	OS_GID = uint32(os.Getgid())
)

Functions

func NewWebDavFileSystem

func NewWebDavFileSystem(option *WebDavOption) (webdav.FileSystem, error)

Types

type ClusterStatusResult

type ClusterStatusResult struct {
	IsLeader bool     `json:"IsLeader,omitempty"`
	Leader   string   `json:"Leader,omitempty"`
	Peers    []string `json:"Peers,omitempty"`
}

type FileInfo

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

func (*FileInfo) IsDir

func (fi *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (fi *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (fi *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (fi *FileInfo) Name() string

func (*FileInfo) Size

func (fi *FileInfo) Size() int64

func (*FileInfo) Sys

func (fi *FileInfo) Sys() interface{}

type FilerOption

type FilerOption struct {
	Masters            []string
	Collection         string
	DefaultReplication string
	RedirectOnRead     bool
	DisableDirListing  bool
	MaxMB              int
	DirListingLimit    int
	DataCenter         string
	DefaultLevelDbDir  string
	DisableHttp        bool
	Port               int
}

type FilerPostResult

type FilerPostResult struct {
	Name  string `json:"name,omitempty"`
	Size  uint32 `json:"size,omitempty"`
	Error string `json:"error,omitempty"`
	Fid   string `json:"fid,omitempty"`
	Url   string `json:"url,omitempty"`
}

type FilerServer

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

func NewFilerServer

func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption) (fs *FilerServer, err error)

func (*FilerServer) AssignVolume

func (fs *FilerServer) AssignVolume(ctx context.Context, req *filer_pb.AssignVolumeRequest) (resp *filer_pb.AssignVolumeResponse, err error)

func (*FilerServer) CreateEntry

func (fs *FilerServer) CreateEntry(ctx context.Context, req *filer_pb.CreateEntryRequest) (resp *filer_pb.CreateEntryResponse, err error)

func (*FilerServer) DeleteCollection

func (*FilerServer) DeleteEntry

func (fs *FilerServer) DeleteEntry(ctx context.Context, req *filer_pb.DeleteEntryRequest) (resp *filer_pb.DeleteEntryResponse, err error)

func (*FilerServer) DeleteHandler

func (fs *FilerServer) DeleteHandler(w http.ResponseWriter, r *http.Request)

curl -X DELETE http://localhost:8888/path/to curl -X DELETE http://localhost:8888/path/to?recursive=true

func (*FilerServer) GetFilerConfiguration

func (*FilerServer) GetOrHeadHandler

func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, isGetMethod bool)

func (*FilerServer) ListEntries

func (*FilerServer) LookupVolume

func (*FilerServer) PostHandler

func (fs *FilerServer) PostHandler(w http.ResponseWriter, r *http.Request)

func (*FilerServer) Statistics

func (fs *FilerServer) Statistics(ctx context.Context, req *filer_pb.StatisticsRequest) (resp *filer_pb.StatisticsResponse, err error)

func (*FilerServer) UpdateEntry

type MasterOption

type MasterOption struct {
	Port                    int
	MetaFolder              string
	VolumeSizeLimitMB       uint
	VolumePreallocate       bool
	PulseSeconds            int
	DefaultReplicaPlacement string
	GarbageThreshold        float64
	WhiteList               []string
	DisableHttp             bool
	MetricsAddress          string
	MetricsIntervalSec      int
}

type MasterServer

type MasterServer struct {
	Topo *topology.Topology
	// contains filtered or unexported fields
}

func NewMasterServer

func NewMasterServer(r *mux.Router, option *MasterOption) *MasterServer

func (*MasterServer) Assign

func (*MasterServer) CollectionList

func (*MasterServer) HasWritableVolume

func (ms *MasterServer) HasWritableVolume(option *topology.VolumeGrowOption) bool

func (*MasterServer) KeepConnected

func (ms *MasterServer) KeepConnected(stream master_pb.Seaweed_KeepConnectedServer) error

KeepConnected keep a stream gRPC call to the master. Used by clients to know the master is up. And clients gets the up-to-date list of volume locations

func (*MasterServer) LookupEcVolume

func (*MasterServer) LookupVolume

func (*MasterServer) SendHeartbeat

func (ms *MasterServer) SendHeartbeat(stream master_pb.Seaweed_SendHeartbeatServer) error

func (*MasterServer) SetRaftServer

func (ms *MasterServer) SetRaftServer(raftServer *RaftServer)

func (*MasterServer) Statistics

func (*MasterServer) VolumeList

type MoveEvents

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

type RaftServer

type RaftServer struct {
	*raft.GrpcServer
	// contains filtered or unexported fields
}

func NewRaftServer

func NewRaftServer(grpcDialOption grpc.DialOption, peers []string, serverAddr string, dataDir string, topo *topology.Topology, pulseSeconds int) *RaftServer

func (*RaftServer) Peers

func (s *RaftServer) Peers() (members []string)

func (*RaftServer) StatusHandler

func (s *RaftServer) StatusHandler(w http.ResponseWriter, r *http.Request)

type VolumeServer

type VolumeServer struct {
	SeedMasterNodes []string

	FixJpgOrientation bool
	ReadRedirect      bool

	MetricsAddress     string
	MetricsIntervalSec int
	// contains filtered or unexported fields
}

func NewVolumeServer

func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string,
	port int, publicUrl string,
	folders []string, maxCounts []int,
	needleMapKind storage.NeedleMapType,
	masterNodes []string, pulseSeconds int,
	dataCenter string, rack string,
	whiteList []string,
	fixJpgOrientation bool,
	readRedirect bool,
	compactionMBPerSecond int,
) *VolumeServer

func (*VolumeServer) CopyFile

CopyFile client pulls the volume related file from the source server. if req.CompactionRevision != math.MaxUint32, it ensures the compact revision is as expected The copying still stop at req.StopOffset, but you can set it to math.MaxUint64 in order to read all data.

func (*VolumeServer) DeleteHandler

func (vs *VolumeServer) DeleteHandler(w http.ResponseWriter, r *http.Request)

func (*VolumeServer) GetMaster

func (vs *VolumeServer) GetMaster() string

func (*VolumeServer) GetOrHeadHandler

func (vs *VolumeServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request)

func (*VolumeServer) PostHandler

func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request)

func (*VolumeServer) Shutdown

func (vs *VolumeServer) Shutdown()

func (*VolumeServer) VolumeCopy

VolumeCopy copy the .idx .dat files, and mount the volume

func (*VolumeServer) VolumeEcShardsCopy

VolumeEcShardsCopy copy the .ecx and some ec data slices

func (*VolumeServer) VolumeEcShardsDelete

VolumeEcShardsDelete local delete the .ecx and some ec data slices if not needed the shard should not be mounted before calling this.

func (*VolumeServer) VolumeEcShardsGenerate

VolumeEcShardsGenerate generates the .ecx and .ec01 ~ .ec14 files

func (*VolumeServer) VolumeEcShardsRebuild

VolumeEcShardsRebuild generates the any of the missing .ec01 ~ .ec14 files

type WebDavFile

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

func (*WebDavFile) Close

func (f *WebDavFile) Close() error

func (*WebDavFile) Read

func (f *WebDavFile) Read(p []byte) (readSize int, err error)

func (*WebDavFile) Readdir

func (f *WebDavFile) Readdir(count int) (ret []os.FileInfo, err error)

func (*WebDavFile) Seek

func (f *WebDavFile) Seek(offset int64, whence int) (int64, error)

func (*WebDavFile) Stat

func (f *WebDavFile) Stat() (os.FileInfo, error)

func (*WebDavFile) Write

func (f *WebDavFile) Write(buf []byte) (int, error)

type WebDavFileSystem

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

func (*WebDavFileSystem) Mkdir

func (fs *WebDavFileSystem) Mkdir(ctx context.Context, fullDirPath string, perm os.FileMode) error

func (*WebDavFileSystem) OpenFile

func (fs *WebDavFileSystem) OpenFile(ctx context.Context, fullFilePath string, flag int, perm os.FileMode) (webdav.File, error)

func (*WebDavFileSystem) RemoveAll

func (fs *WebDavFileSystem) RemoveAll(ctx context.Context, name string) error

func (*WebDavFileSystem) Rename

func (fs *WebDavFileSystem) Rename(ctx context.Context, oldName, newName string) error

func (*WebDavFileSystem) Stat

func (fs *WebDavFileSystem) Stat(ctx context.Context, name string) (os.FileInfo, error)

func (*WebDavFileSystem) WithFilerClient

func (fs *WebDavFileSystem) WithFilerClient(ctx context.Context, fn func(filer_pb.SeaweedFilerClient) error) error

type WebDavOption

type WebDavOption struct {
	Filer            string
	FilerGrpcAddress string
	DomainName       string
	BucketsPath      string
	GrpcDialOption   grpc.DialOption
	Collection       string
	Uid              uint32
	Gid              uint32
}

type WebDavServer

type WebDavServer struct {
	Handler *webdav.Handler
	// contains filtered or unexported fields
}

func NewWebDavServer

func NewWebDavServer(option *WebDavOption) (ws *WebDavServer, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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