Ejemplo n.º 1
0
// MakePool creates a new pool with default settings.
func (c *Conn) MakePool(name string) error {
	c_name := C.CString(name)
	defer C.free(unsafe.Pointer(c_name))
	ret := int(C.rados_pool_create(c.cluster, c_name))
	if ret == 0 {
		return nil
	} else {
		return RadosError(ret)
	}
}
Ejemplo n.º 2
0
// CreatePool creates the named pool in the given RADOS cluster.
// CreatePool uses the default admin user and crush rule.
//
// TODO: Add ability to create pools with specific admin users/crush rules.
func (r *Rados) CreatePool(poolName string) error {
	cname := C.CString(poolName)
	defer C.free(unsafe.Pointer(cname))

	if cerr := C.rados_pool_create(r.rados, cname); cerr < 0 {
		return radosReturnCodeError(cerr)
	}

	return nil
}
Ejemplo n.º 3
0
// CreatePool creates the named pool in the given RADOS cluster.
// CreatePool uses the default admin user and crush rule.
//
// TODO: Add ability to create pools with specific admin users/crush rules.
func (r *Rados) CreatePool(poolName string) error {
	cname := C.CString(poolName)
	defer C.free(unsafe.Pointer(cname))

	if cerr := C.rados_pool_create(r.rados, cname); cerr < 0 {
		return fmt.Errorf("RADOS pool create %s: %s", poolName, strerror(cerr))
	}

	return nil
}
Ejemplo n.º 4
0
// CreatePool creates a new pool using the given poolName. This uses the default pool configuration.
func (cluster *Cluster) CreatePool(poolName string) error {
	p := C.CString(poolName)
	defer freeString(p)
	ret := C.rados_pool_create(cluster.handle, p)
	err := toRadosError(ret)
	if err != nil {
		err.Message = fmt.Sprintf("Unable to create pool %s with default settings.", poolName)
		return err
	}
	return nil
}