Commit Graph

282 Commits

Author SHA1 Message Date
Livio Soares 57195e64fe rados_test.go: Improve Stat() test for non existant object name.
The test currently fails since 'RadosErrorNotFound' is not properly returned.
2016-03-25 00:58:11 -04:00
Livio Soares d5b49dd4ea rados_test.go: Fix import header to allow `gofmt` to work. 2016-03-25 00:57:23 -04:00
Livio Soares 46f5d61aba Namespace support for Pools.
This commit simply adds a SetNamespace() method to IOContext, allowing users to
perform pool operations in the context of a specific namespace.
2016-03-25 00:42:49 -04:00
Livio Soares 2d33c55c6b rados: Fix iterator memory allocation; allocating a c_entry is not necessary and performed directly by the library. 2016-03-25 00:08:28 -04:00
Livio Soares 373a3043d7 rados: Implement Iter() interface to allow incremental listing of Pools.
The current IOContext struct has a ListObjects() method that works well for
pools with a reasonable number of objects. However, for very large pools, having
finer control over the iteration may be desirable.

This commit adds a new Iter() interface for pools. It allows callers to stop
iterating at any time by issuing a iter.Close(). It also allows callers to
"Seek" into the pool list using a token object.
2016-03-24 23:18:07 -04:00
Livio Soares 74d77ff49b Fix rados.GetRadosError() interface to allow package-external use.
In Go, the "C" package is a special type of package that creates local symbols
names (non exportable) to the importing package. The result, in the case of
rados.GetRadosError() is that trying to use results in:

cannot use cerr (type C.int) as type rados.C.int in argument to rados.GetRadosError

It seems that "C.int" within 'rados' namespace produces a symbol of the type
`_Ctype_int`, which given it's first character `_` is not exported. As such, we
have the type being defined as `rados._Ctype_int`, which is not accessible
outside of the rados package.

This commit changes the interface to use the native Go `int` type.
2016-03-24 22:37:52 -04:00
Livio Soares 6f8cc46f47 rados/conn: Fix passing of Go allocated pointer to CGO function in MonCommand(), which panics Go 1.6.
Addresses issue #10.
2016-03-24 22:13:09 -04:00
Livio Soares 5133b0eaa2 Dockerfile: upgrade Go from 1.3 to 1.6. 2016-03-24 22:08:55 -04:00
Crazykev ee740834a2 add param 'order' to Create() and Image.Clone(), and upgrade ci ceph version to hammer
Signed-off-by: Crazykev <crazykev@zju.edu.cn>
2016-03-03 21:59:09 -05:00
Noah Watkins 0e703bba9c Merge branch 'append'
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-10-30 13:05:21 -07:00
Emmet Cassidy f251b539c3 added append function and a test 2015-10-28 09:25:11 -07:00
Noah Watkins 75b327e4c7 Merge pull request #1 from ceph/update-paths
repo: update new repo path

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-08-31 08:35:56 -06:00
Noah Watkins 3f52ea219a repo: update new repo path
noahdesu -> ceph

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-08-31 07:34:42 -07:00
Noah Watkins f9be60af9f Merge pull request #26 from hustcat/err_code
Convert some C error code to Go code
2015-07-24 09:24:36 -07:00
Ye Yin 5c2d42ef5a Change return new error for rados and rbd
Signed-off-by: Ye Yin <eyniy@qq.com>
2015-07-24 11:34:18 +08:00
Ye Yin 193dbacdb0 Convert some C error code to Go code, for convenient Golang code to handle error.
Define some Rbd constant variables, to pass to librbd API.
Add test unit for RbdErrorNotFound

Signed-off-by: Ye Yin <eyniy@qq.com>
2015-07-23 15:33:34 +08:00
Noah Watkins a0f3c26798 Merge pull request #24 from hustcat/parent_info
Add rbd_get_parent_info for image

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-07-20 07:31:03 -06:00
Noah Watkins cd051751e4 Merge pull request #27 from hustcat/rados_write_full
Add rados_write_full function

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-07-20 07:23:42 -06:00
Ye Yin f39179553f Add rados_write_full function
Signed-off-by: Ye Yin <eyniy@qq.com>
2015-07-20 20:37:32 +08:00
Ye Yin 80e3e9ea7f Add rbd_get_parent_info
Signed-off-by: Ye Yin <eyniy@qq.com>
2015-07-20 11:34:47 +08:00
Noah Watkins 0448b62d47 Merge pull request #25 from theanalyst/doc/contribute
doc: add basic instructions for contributing

Signed-off-by:  Noah Watkins <noahwatkins@gmail.com>
2015-07-17 11:28:02 -06:00
Abhishek Lekshmanan 2d8d57f246 doc: add basic instructions for contributing
Added basic info for some standards to be followed, how to run tests
etc.

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
2015-07-17 22:41:18 +05:30
Noah Watkins 8f882afdc3 Merge pull request #23 from theanalyst/wip-gofmt
go fmt the source files and add travis check for go fmt
2015-07-12 14:23:37 -06:00
Abhishek Lekshmanan 722a5ff06f travis: check for go fmt violations for patches
While submitting patches travis will fail if source isn't go fmt'ed

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
2015-07-08 14:07:55 +05:30
Abhishek Lekshmanan d63c6698c2 gofmt all the source files
Running gofmt ./... on the repository

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
2015-07-08 14:04:54 +05:30
Noah Watkins 037adbe79e Merge pull request #22 from travisn/patch-1
Add an overload for creating a connection to a non-default cluster name

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-06-18 06:50:52 -06:00
Travis Nielsen 8e73ca4191 Pass the correct admin user name 2015-06-16 16:10:09 -07:00
Travis Nielsen c7214b5694 Add a test for connecting with the cluster name and user name 2015-06-16 15:55:12 -07:00
Travis Nielsen 2835eeac35 Add an overload for creating a connection to a cluster other than the default cluster name of "ceph". 2015-06-16 15:32:09 -07:00
Noah Watkins 571d19f634 ci: fetch dependencies
This was apparently happening automatically and not now. I'm not sure what's going on.
2015-05-24 11:21:29 -07:00
Noah Watkins 19cf5ac043 Merge pull request #21 from theanalyst/docker-ci
Run local tests in a docker
2015-05-24 11:16:32 -07:00
Abhishek Lekshmanan cec4e4d870 Add a simple makefile
Primarily allowing for testing via docker; and other simple stuff like
fmt

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
2015-05-24 13:43:05 +05:30
Abhishek Lekshmanan e38a5a25e0 ci: Allow local tests to run in a docker
Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
2015-05-24 11:12:54 +05:30
Noah Watkins 6f60f5a203 Merge pull request #19 from gierschv/feat-omap-iterator
ioctx: ListOmapValues & GetAllOmapValues added
2015-05-04 11:49:46 -07:00
Vincent Giersch b15639c44c ioctx: ListOmapValues & GetAllOmapValues added
* `ListOmapValues` allows to iterate on all the key feteched during
a read operation of an omap (the goal is to easily get the last
read key from the C iterator. This one can then be used in another
call as `startAfter` parameter).
* `GetAllOmapValues` returns all the keys / values of the whole omap
* `GetOmapValues` now uses `ListOmapValues`

Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
2015-05-04 14:50:59 +00:00
Noah Watkins 0f4cf26919 cephfs: add mkdir
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-05-01 12:57:07 -07:00
Noah Watkins de82ee54cf Merge pull request #18 from noahdesu/cephfs
cephfs: add initial cephfs go wrappers
2015-05-01 12:42:57 -07:00
Noah Watkins 1efdf980f0 cephfs: begin cephfs wrappers
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-05-01 12:41:47 -07:00
Noah Watkins 95fa549c14 travis: add mds to micro cluster
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-05-01 12:41:47 -07:00
Noah Watkins c7a0450712 Merge pull request #15 from gierschv/feat-stat
ioctx: Stat added
2015-04-27 11:32:58 -07:00
Noah Watkins dc2948d83e Merge pull request #16 from gierschv/feat-omap
ioctx: omap set / get / delete / clear added
2015-04-27 11:30:28 -07:00
Vincent Giersch 476dc4001d ioctx: omap set / get / delete / clear added
Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
2015-04-27 15:21:54 +00:00
Vincent Giersch 1779dc795a ioctx: Stat added
Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
2015-04-24 12:01:50 +00:00
Noah Watkins 0d0d33389a Merge pull request #14 from theanalyst/rm-xattr
ioctx: RmXattr added

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-04-08 12:17:11 -07:00
Abhishek Lekshmanan 68bbcb2f80 ioctx: RmXattr added
Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
2015-04-09 00:09:27 +05:30
Noah Watkins 1f2352fecd Merge pull request #13 from theanalyst/f/list-xattrs
ioctx: added ListXattrs()

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-04-07 14:09:52 -07:00
Abhishek Lekshmanan 6324a7917d ioctx: use bytes for ListXattrs
Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
2015-04-07 14:29:00 +05:30
Abhishek Lekshmanan ee55aa1810 ioctx: added ListXattrs()
Added a function to List Xattrs, which returns a map of all xattrs set
on an object, errors out otherwise

Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>
2015-04-06 12:39:37 +05:30
Noah Watkins 85ccb42861 Merge pull request #12 from theanalyst/f/rw_xattr
ioctx: get/set xattr added

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2015-03-31 07:47:16 -07:00
Abhishek Lekshmanan 592900cb3a ioctx: get/put xattr added
Added functions GetXattr & SetXattr for getting &/ setting xattrs on
objects in a pool
2015-03-31 15:10:17 +05:30