common

package
v0.0.0-...-4e9bc17 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

* Copyright 2023- IBM Inc. All rights reserved * SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

View Source
var StdouterrLogger = GetLogger("main")

Functions

func GetStdLogger

func GetStdLogger(l *LogHandle, lvl logrus.Level) *glog.Logger

func MarkExit

func MarkExit(stateFilePath string) error

func MarkRunning

func MarkRunning(stateFilePath string, selfAddr string, mountPoint string) error

func ParseEndpoint

func ParseEndpoint(ep string) (string, string, error)

func ReadState

func ReadState(stateFilePath string) ([]string, error)

func WaitShutdown

func WaitShutdown(stateFilePath string)

Types

type LogHandle

type LogHandle struct {
	logrus.Logger

	Lvl *logrus.Level
	// contains filtered or unexported fields
}

func GetLogger

func GetLogger(name string) *LogHandle

func GetLoggerFile

func GetLoggerFile(name string, fname string) *LogHandle

func NewLogger

func NewLogger(name string) *LogHandle

func NewLoggerToFile

func NewLoggerToFile(name string, fname string) *LogHandle

func (*LogHandle) Format

func (l *LogHandle) Format(e *logrus.Entry) ([]byte, error)

func (*LogHandle) Log

func (l *LogHandle) Log(args ...interface{})

for aws.Logger

type NodeAddrInet4

type NodeAddrInet4 struct {
	Port int
	Addr [4]byte
}

func (*NodeAddrInet4) IpString

func (n *NodeAddrInet4) IpString() string

func (*NodeAddrInet4) String

func (n *NodeAddrInet4) String() string

type NonBlockingGRPCServer

type NonBlockingGRPCServer interface {
	// Start services at the endpoint
	Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer)
	// Waits for the service to stop
	Wait()
	// Stops the service gracefully
	Stop()
	// Stops the service forcefully
	ForceStop()
}

Defines Non blocking GRPC server interfaces

func NewNonBlockingGRPCServer

func NewNonBlockingGRPCServer() NonBlockingGRPCServer

type ObjcacheCmdlineArgs

type ObjcacheCmdlineArgs struct {
	// used for specifying per worker configurations
	// use ObjcacheConfig (generated from ConfigFile) for static configuration shared among cluster nodes
	// use SecretConfig (generated from SecretFile) for S3 credentials
	ServerId              uint
	ServerIdString        string
	RaftGroupId           string
	PassiveRaftInit       bool
	PassiveRaftInitString string
	ListenIp              string
	ExternalIp            string
	RaftPort              int
	ApiPort               int
	ProfilePort           int
	HeadWorkerIp          string
	HeadWorkerPort        int
	RootDir               string
	LogFile               string
	ClientMode            bool
	ConfigFile            string
	SecretFile            string
	MountPoint            string
	CacheCapacity         string
}

func (*ObjcacheCmdlineArgs) FilllAutoConfig

func (c *ObjcacheCmdlineArgs) FilllAutoConfig()

func (*ObjcacheCmdlineArgs) GetObjcacheConfig

func (c *ObjcacheCmdlineArgs) GetObjcacheConfig() ObjcacheConfig

func (*ObjcacheCmdlineArgs) SetCmdArgs

func (c *ObjcacheCmdlineArgs) SetCmdArgs()

type ObjcacheConfig

type ObjcacheConfig struct {
	MountOptions map[string]string `yaml:"mountOptions"`
	DirMode      uint32            `yaml:"dirMode"`
	FileMode     uint32            `yaml:"fileMode"`
	Uid          uint32            `yaml:"uid"`
	Gid          uint32            `yaml:"gid"`

	Seed int64 `yaml:"seed"`

	DisableLocalWritebackCaching bool   `yaml:"disableLocalWriteBackCaching"`
	MaxRetry                     int    `yaml:"maxRetry"`
	CosPrefetchSize              string `yaml:"cosPrefetchSize"`
	ClientReadAheadSize          string `yaml:"clientReadAheadSize"`
	RemoteCacheSize              string `yaml:"remoteCacheSize"`
	ChunkCacheSize               string `yaml:"chunkCacheSize"`
	UploadParallel               int    `yaml:"uploadParallel" default:"16"`

	ChunkSize      string `yaml:"chunkSize"`
	RpcChunkSize   string `yaml:"rpcChunkSize"`
	UseNotifyStore bool   `yaml:"useNotifyStore" default:"false"`

	ChunkSizeBytes           int64 `yaml:"-"`
	RpcChunkSizeBytes        int64 `yaml:"-"`
	CosPrefetchSizeBytes     int64 `yaml:"-"`
	ChunkCacheSizeBytes      int64 `yaml:"-"`
	ClientReadAheadSizeBytes int64 `yaml:"-"`
	RemoteCacheSizeBytes     int64 `yaml:"-"`

	IfName           string `yaml:"ifName"`
	DebugFuse        bool   `yaml:"debugFuse"`
	DebugS3          bool   `yaml:"debugS3"`
	BlockProfileRate int    `yaml:"blockProfileRate"`
	MutexProfileRate int    `yaml:"mutexProfileRate"`

	HeartBeatInterval    string `yaml:"heartBeatInterval"`
	ElectTimeout         string `yaml:"electTimeout"`
	ShutdownTimeout      string `yaml:"shutdownTimeout"`
	EvictionInterval     string `yaml:"evictionInterval"`
	DirtyExpireInterval  string `yaml:"dirtyExpireInterval"`
	DirtyFlusherInterval string `yaml:"dirtyFlusherInterval"`
	RpcTimeout           string `yaml:"rpcTimeout"`
	ChunkRpcTimeout      string `yaml:"chunkRpcTimeout"`
	CommitRpcTimeout     string `yaml:"commitRpcTimeout"`
	CoordinatorTimeout   string `yaml:"coordinatorTimeout"`
	MpuTimeout           string `yaml:"mpuTimeout"`
	PersistTimeout       string `yaml:"persistTimeout"`

	HeartBeatIntervalDuration    time.Duration `yaml:"-"`
	ElectTimeoutDuration         time.Duration `yaml:"-"`
	ShutdownTimeoutDuration      time.Duration `yaml:"-"`
	EvictionIntervalDuration     time.Duration `yaml:"-"`
	DirtyExpireIntervalMs        int32         `yaml:"-"`
	DirtyFlusherIntervalDuration time.Duration `yaml:"-"`
	RpcTimeoutDuration           time.Duration `yaml:"-"`
	ChunkRpcTimeoutDuration      time.Duration `yaml:"-"`
	CommitRpcTimeoutDuration     time.Duration `yaml:"-"`
	CoordinatorTimeoutDuration   time.Duration `yaml:"-"`
	MpuTimeoutDuration           time.Duration `yaml:"-"`
	PersistTimeoutDuration       time.Duration `yaml:"-"`
}

func NewConfig

func NewConfig(yamlFile string) (c ObjcacheConfig)

func NewConfigFromByteArray

func NewConfigFromByteArray(buf []byte) (c ObjcacheConfig, err error)

func (*ObjcacheConfig) MergeServerConfig

func (c *ObjcacheConfig) MergeServerConfig(conf *ObjcacheConfig) (newConfig ObjcacheConfig)

type ObjcacheIdentityServer

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

func NewObjcacheIdentityServer

func NewObjcacheIdentityServer(name string, version string) *ObjcacheIdentityServer

func (*ObjcacheIdentityServer) GetPluginCapabilities

func (*ObjcacheIdentityServer) GetPluginInfo

func (*ObjcacheIdentityServer) Probe

Jump to

Keyboard shortcuts

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