Documentation ¶
Index ¶
- func Version() (int, int, int)
- type AioCompletion
- type CephDetail
- type ClusterStat
- type Conn
- func (c *Conn) Connect() error
- func (c *Conn) DeletePool(name string) error
- func (c *Conn) GetCephDf() (response string, status string, err error)
- func (c *Conn) GetClusterStats() (stat ClusterStat, err error)
- func (c *Conn) GetConfigOption(name string) (value string, err error)
- func (c *Conn) GetFSID() (fsid string, err error)
- func (c *Conn) GetInstanceID() uint64
- func (c *Conn) ListPools() (names []string, err error)
- func (c *Conn) MakePool(name string) error
- func (c *Conn) OpenPool(pool string) (*Pool, error)
- func (c *Conn) ParseCmdLineArgs(args []string) error
- func (c *Conn) ParseDefaultConfigEnv() error
- func (c *Conn) PingMonitor(id string) (string, error)
- func (c *Conn) ReadConfigFile(path string) error
- func (c *Conn) ReadDefaultConfigFile() error
- func (c *Conn) SetConfigOption(option, value string) error
- func (c *Conn) Shutdown()
- func (c *Conn) Status() (string, error)
- func (c *Conn) WaitForLatestOSDMap() error
- type Pool
- func (p *Pool) CreateStriper() (StriperPool, error)
- func (p *Pool) Delete(oid string) error
- func (p *Pool) Destroy()
- func (p *Pool) Read(oid string, data []byte, offset uint64) (int, error)
- func (p *Pool) Stat(oid string) (uint64, uint64, error)
- func (p *Pool) Truncate(oid string, size uint64) error
- func (p *Pool) Write(oid string, data []byte, offset uint64) error
- func (p *Pool) WriteSmallObject(oid string, data []byte) error
- type PoolStat
- type PoolsStatMap
- type RadosError
- type StriperPool
- func (sp *StriperPool) Delete(oid string) error
- func (sp *StriperPool) Destroy()
- func (sp *StriperPool) Flush()
- func (sp *StriperPool) Read(oid string, data []byte, offset uint64) (int, error)
- func (sp *StriperPool) SetLayoutObjectSize(object_size uint) int
- func (sp *StriperPool) SetLayoutStripeCount(stripe_count uint) int
- func (sp *StriperPool) SetLayoutStripeUnit(stripe_unit uint) int
- func (sp *StriperPool) State(oid string) (uint64, uint64, error)
- func (sp *StriperPool) Truncate(oid string, offset uint64) error
- func (sp *StriperPool) Write(oid string, data []byte, offset uint64) (int, error)
- func (sp *StriperPool) WriteAIO(c *AioCompletion, oid string, data []byte, offset uint64) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AioCompletion ¶
type AioCompletion struct {
// contains filtered or unexported fields
}
func (*AioCompletion) Create ¶
func (c *AioCompletion) Create() error
func (*AioCompletion) GetReturnValue ¶
func (c *AioCompletion) GetReturnValue() int
func (*AioCompletion) IsComplete ¶
func (c *AioCompletion) IsComplete() int
func (*AioCompletion) Release ¶
func (c *AioCompletion) Release()
func (*AioCompletion) WaitForComplete ¶
func (c *AioCompletion) WaitForComplete()
type CephDetail ¶
type CephDetail struct { Stats struct { TotalBytes int64 `json:"total_bytes"` TotalAvailBytes int64 `json:"total_avail_bytes"` TotalUsedBytes int64 `json:"total_used_bytes"` TotalUsedRawBytes int64 `json:"total_used_raw_bytes"` TotalUsedRawRatio float64 `json:"total_used_raw_ratio"` NumOsds int `json:"num_osds"` NumPerPoolOsds int `json:"num_per_pool_osds"` } `json:"stats"` StatsByClass struct { Hdd struct { TotalBytes int64 `json:"total_bytes"` TotalAvailBytes int64 `json:"total_avail_bytes"` TotalUsedBytes int64 `json:"total_used_bytes"` TotalUsedRawBytes int64 `json:"total_used_raw_bytes"` TotalUsedRawRatio float64 `json:"total_used_raw_ratio"` } `json:"hdd"` Ssd struct { TotalBytes int64 `json:"total_bytes"` TotalAvailBytes int64 `json:"total_avail_bytes"` TotalUsedBytes int64 `json:"total_used_bytes"` TotalUsedRawBytes int64 `json:"total_used_raw_bytes"` TotalUsedRawRatio float64 `json:"total_used_raw_ratio"` } `json:"ssd"` } `json:"stats_by_class"` Pools []struct { Name string `json:"name"` ID int `json:"id"` Stats struct { Stored int64 `json:"stored"` Objects int `json:"objects"` KbUsed int64 `json:"kb_used"` BytesUsed int64 `json:"bytes_used"` PercentUsed float64 `json:"percent_used"` MaxAvail int64 `json:"max_avail"` } `json:"stats"` } `json:"pools"` }
type ClusterStat ¶
ClusterStat represents Ceph cluster statistics.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a connection handle to a Ceph cluster.
func NewConn ¶
NewConn creates a new connection object. It returns the connection and an error, if any.
func (*Conn) Connect ¶
Connect establishes a connection to a RADOS cluster. It returns an error, if any.
func (*Conn) DeletePool ¶
DeletePool deletes a pool and all the data inside the pool.
func (*Conn) GetClusterStats ¶
func (c *Conn) GetClusterStats() (stat ClusterStat, err error)
GetClusterStat returns statistics about the cluster associated with the connection.
func (*Conn) GetConfigOption ¶
GetConfigOption returns the value of the Ceph configuration option identified by the given name.
func (*Conn) GetFSID ¶
GetFSID returns the fsid of the cluster as a hexadecimal string. The fsid is a unique identifier of an entire Ceph cluster.
func (*Conn) GetInstanceID ¶
GetInstanceID returns a globally unique identifier for the cluster connection instance.
func (*Conn) ParseCmdLineArgs ¶
ParseCmdLineArgs configures the connection from command line arguments.
func (*Conn) ParseDefaultConfigEnv ¶
ParseDefaultConfigEnv configures the connection from the default Ceph environment variable(s).
func (*Conn) PingMonitor ¶
PingMonitor sends a ping to a monitor and returns the reply.
func (*Conn) ReadConfigFile ¶
ReadConfigFile configures the connection using a Ceph configuration file.
func (*Conn) ReadDefaultConfigFile ¶
ReadDefaultConfigFile configures the connection using a Ceph configuration file located at default locations.
func (*Conn) SetConfigOption ¶
SetConfigOption sets the value of the configuration option identified by the given name.
func (*Conn) WaitForLatestOSDMap ¶
WaitForLatestOSDMap blocks the caller until the latest OSD map has been retrieved.
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool represents a context for performing I/O within a pool.
func (*Pool) CreateStriper ¶
func (p *Pool) CreateStriper() (StriperPool, error)
func (*Pool) Read ¶
Read reads up to len(data) bytes from the object with key oid starting at byte offset offset. It returns the number of bytes read and an error, if any.
func (*Pool) Truncate ¶
Truncate resizes the object with key oid to size size. If the operation enlarges the object, the new area is logically filled with zeroes. If the operation shrinks the object, the excess data is removed. It returns an error, if any.
type PoolsStatMap ¶
type StriperPool ¶
type StriperPool struct {
// contains filtered or unexported fields
}
func (*StriperPool) Delete ¶
func (sp *StriperPool) Delete(oid string) error
func (*StriperPool) Destroy ¶
func (sp *StriperPool) Destroy()
func (*StriperPool) Flush ¶
func (sp *StriperPool) Flush()
func (*StriperPool) SetLayoutObjectSize ¶
func (sp *StriperPool) SetLayoutObjectSize(object_size uint) int
func (*StriperPool) SetLayoutStripeCount ¶
func (sp *StriperPool) SetLayoutStripeCount(stripe_count uint) int
func (*StriperPool) SetLayoutStripeUnit ¶
func (sp *StriperPool) SetLayoutStripeUnit(stripe_unit uint) int
func (*StriperPool) WriteAIO ¶
func (sp *StriperPool) WriteAIO(c *AioCompletion, oid string, data []byte, offset uint64) (int, error)