ceph

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MON_TIMEOUT                = "10"
	OSD_TIMEOUT                = "10"
	STRIPE_UNIT                = 512 << 10 /* 512K */
	STRIPE_COUNT               = 2
	OBJECT_SIZE                = 8 << 20 /* 8M */
	AIO_CONCURRENT             = 4
	DEFAULT_CEPHCONFIG_PATTERN = "conf/*.conf"
	MIN_CHUNK_SIZE             = 512 << 10       // 512K
	BUFFER_SIZE                = 1 << 20         // 1M
	MAX_CHUNK_SIZE             = 8 * BUFFER_SIZE // 8M
)

Variables

This section is empty.

Functions

func Initialize

func Initialize(config helper.Config) map[string]backend.Cluster

Types

type AioCompletion

type AioCompletion interface {
	WaitForComplete()
	Release()
	IsComplete() int
	GetReturnValue() int
}

type CephCluster

type CephCluster struct {
	Name       string
	Conn       RadosConn
	InstanceId uint64
	// contains filtered or unexported fields
}

func NewCephStorage

func NewCephStorage(configFile string) *CephCluster

func (*CephCluster) Append

func (cluster *CephCluster) Append(poolname string, existName string, data io.Reader,
	offset int64) (oid string, size uint64, err error)

func (*CephCluster) GetReader

func (cluster *CephCluster) GetReader(poolName string, oid string, startOffset int64,
	length uint64) (reader io.ReadCloser, err error)

func (*CephCluster) GetUsage

func (cluster *CephCluster) GetUsage() (usage backend.Usage, err error)

func (*CephCluster) ID

func (cluster *CephCluster) ID() string

func (*CephCluster) Put

func (cluster *CephCluster) Put(poolname string, data io.Reader) (oid string,
	size uint64, err error)

func (*CephCluster) Remove

func (cluster *CephCluster) Remove(poolname string, oid string) error

func (*CephCluster) Shutdown

func (cluster *CephCluster) Shutdown()

type Pool

type Pool interface {
	Write(oid string, data []byte, offset uint64) error
	Read(oid string, data []byte, offset uint64) (int, error)
	Delete(oid string) error
	Truncate(oid string, size uint64) error
	Destroy()
	CreateStriper() (StriperPool, error)
	WriteSmallObject(oid string, data []byte) error
}

type RadosConn

type RadosConn interface {
	OpenPool(name string) (Pool, error)
	GetClusterStats() (rados.ClusterStat, error)
	Shutdown()
}

type RadosDownloader

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

func (*RadosDownloader) Close

func (rd *RadosDownloader) Close() error

func (*RadosDownloader) Read

func (rd *RadosDownloader) Read(p []byte) (n int, err error)

func (*RadosDownloader) Seek

func (rd *RadosDownloader) Seek(offset int64, whence int) (int64, error)

type RadosSmallDownloader

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

func (*RadosSmallDownloader) Close

func (rd *RadosSmallDownloader) Close() error

func (*RadosSmallDownloader) Read

func (rd *RadosSmallDownloader) Read(p []byte) (n int, err error)

func (*RadosSmallDownloader) Seek

func (rd *RadosSmallDownloader) Seek(offset int64, whence int) (int64, error)

type StriperPool

type StriperPool interface {
	Read(oid string, data []byte, offset uint64) (int, error)
	Write(oid string, data []byte, offset uint64) (int, error)
	WriteAIO(oid string, data []byte, offset uint64) (AioCompletion, error)
	Delete(oid string) error
	Destroy()
	SetLayoutStripeUnit(uint uint) int
	SetLayoutStripeCount(count uint) int
	SetLayoutObjectSize(size uint) int
}

Jump to

Keyboard shortcuts

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