Esempio n. 1
0
func (sp *StriperPool) State(oid string) (uint64, uint64, error) {
	c_oid := C.CString(oid)
	defer C.free(unsafe.Pointer(c_oid))
	var c_psize C.uint64_t
	var c_ptime C.time_t
	ret := C.rados_striper_stat(sp.striper, c_oid, &c_psize, &c_ptime)
	if ret < 0 {
		return 0, 0, RadosError(int(ret))
	}
	return uint64(c_psize), uint64(c_ptime), nil
}
Esempio n. 2
0
// Synchronously get object stats
// returns object size and modification time
func (rso *RadosStripedObject) Stat() (size uint64, pmtime uint64, err error) {
	obj := C.CString(rso.ObjectName)
	defer C.free(unsafe.Pointer(obj))

	var c_size C.uint64_t
	var c_time_t C.time_t
	ret := C.rados_striper_stat(rso.Striper, obj, &c_size, &c_time_t)
	if ret < 0 {
		return 0, 0, errors.New("get stat failed")
	}
	return uint64(c_size), uint64(C.uint64_t(c_time_t)), nil
}