mirror of https://github.com/ceph/go-ceph
rados: add ioctx destroy method
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
This commit is contained in:
parent
7316c3d70f
commit
62e6137f1f
7
ioctx.go
7
ioctx.go
|
@ -84,3 +84,10 @@ func (p *IOContext) Truncate(oid string, size uint64) error {
|
|||
return RadosError(int(ret))
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy informs librados that the I/O context is no longer in use.
|
||||
// Resources associated with the context may not be freed immediately, and the
|
||||
// context should not be used again after calling this method.
|
||||
func (ioctx *IOContext) Destroy() {
|
||||
C.rados_ioctx_destroy(ioctx.ioctx)
|
||||
}
|
||||
|
|
|
@ -114,6 +114,7 @@ func TestGetClusterStats(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
pool.Destroy()
|
||||
conn.Shutdown()
|
||||
t.Error("Cluster stats aren't changing")
|
||||
}
|
||||
|
@ -302,4 +303,6 @@ func TestReadWrite(t *testing.T) {
|
|||
|
||||
assert.Equal(t, n_out, len(bytes_in))
|
||||
assert.Equal(t, bytes_in, bytes_out)
|
||||
|
||||
pool.Destroy()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue