[sheepdog] [PATCH v2 0/4] add http interface for sheepfs

Robin Dong robin.k.dong at gmail.com
Fri Jan 24 04:46:59 CET 2014


From: Robin Dong <sanbai at taobao.com>

Some old softwares can only use files on filesystem as input, so we should add
a new type of interface for sheepfs to access object-storage as a
posix-filesystem.
It is called "http interface", since it use libcurl to access object-storage
service (such as s3 or swift) and show accounts, containers as directories and
objects as files.
This http interface only shows containers and objects that are written into
file "object" by name.

Usage:

sheepfs /sheepfs
# give ip and port
echo "192.168.1.1:83" > /sheepfs/http/address
# give object
echo "/john/fruit/apple" > /sheepfs/http/object
echo "/lily/pet/cat" > /sheepfs/http/address
# rm will delete local entries in sheepfs
rm /sheepfs/http/john/
# now we have new directories "lily", "pet" and
# new files "cat" as show below:
/sheepfs/http/lily/
/sheepfs/http/lily/pet/
/sheepfs/http/lily/pet/cat

v1-->v2:
    1. change "sd_err()" to "sheepfs_pr()"
    2. add support for rm directory and file
    3. add check for libcurl in configure.ac

Robin Dong (4):
  sheepfs: add framework for http interface
  sheepfs: implement the http interface of sheepfs by using libcurl
  sheepfs: add support for "rmdir" and "unlink"
  test: add test-case for http interface of sheepfs

 configure.ac             |   4 +
 sheepfs/Makefile.am      |   4 +-
 sheepfs/core.c           |  38 ++++-
 sheepfs/http.c           | 352 +++++++++++++++++++++++++++++++++++++++++++++++
 sheepfs/shadow_file.c    |  28 +++-
 sheepfs/sheepfs.h        |  21 ++-
 tests/functional/084     |  54 ++++++++
 tests/functional/084.out |   5 +
 tests/functional/group   |   1 +
 9 files changed, 501 insertions(+), 6 deletions(-)
 create mode 100644 sheepfs/http.c
 create mode 100755 tests/functional/084
 create mode 100644 tests/functional/084.out

-- 
1.7.12.4




More information about the sheepdog mailing list