Skip to content

Commit

Permalink
Add first prototype for object storage device abstraction.
Browse files Browse the repository at this point in the history
For this we use libdroplet from scality.
  • Loading branch information
Marco van Wieringen committed Feb 25, 2014
1 parent 5b0a367 commit 5cfa70c
Show file tree
Hide file tree
Showing 7 changed files with 617 additions and 3 deletions.
60 changes: 60 additions & 0 deletions autoconf/configure.in
Expand Up @@ -3446,6 +3446,65 @@ fi
AC_SUBST(GLUSTER_INC)
AC_SUBST(GLUSTER_LIBS)

dnl
dnl Check for Object storage via libdroplet.
dnl
DROPLET_LIBS="-ldroplet"
DROPLET_INC=""
have_droplet=no
AC_ARG_WITH(droplet,
AC_HELP_STRING([--with-droplet@<:@=DIR@:>@], [Directory holding DROPLET includes/libs]),
with_droplet_directory=$withval
)

if test "x${with_droplet_directory}" != "xyes" && test x"${with_droplet_directory}" != "x"; then
#
# Make sure the $with_droplet_directory also makes sense
#
if test -d "${with_droplet_directory}/lib" -a -d "${with_droplet_directory}/include"; then
DROPLET_LIBS="-L${with_droplet_directory}/lib ${DROPLET_LIBS}"
DROPLET_INC="-I${with_droplet_directory}/include ${DROPLET_INC}"
fi
fi

saved_LIBS="${LIBS}"
saved_CFLAGS="${CFLAGS}"
saved_CPPFLAGS="${CPPFLAGS}"
LIBS="${saved_LIBS} ${DROPLET_LIBS}"
CFLAGS="${saved_CFLAGS} ${DROPLET_INC}"
CPPFLAGS="${saved_CPPFLAGS} ${DROPLET_INC}"

AC_CHECK_HEADER(droplet.h)

AC_MSG_CHECKING(for dpl_ctx_new in libdroplet library)
AC_TRY_LINK(
[
#include <droplet.h>
], [
dpl_ctx_new(NULL, NULL);
], [
AC_MSG_RESULT(yes)
have_droplet="yes"
], [
AC_MSG_RESULT(no)
have_droplet="no"
]
)

LIBS="${saved_LIBS}"
CFLAGS="${saved_CFLAGS}"
CPPFLAGS="${saved_CPPFLAGS}"

if test "x${have_droplet}" = "xyes"; then
AC_DEFINE(HAVE_OBJECTSTORE, 1, [Define to 1 if you have libdroplet lib])
else
DROPLET_LIBS=""
DROPLET_INC=""
fi

AC_SUBST(DROPLET_INC)
AC_SUBST(DROPLET_LIBS)

dnl
dnl Check for pthread libraries
dnl
Expand Down Expand Up @@ -4042,6 +4101,7 @@ Configuration on `date`:
XATTR support: ${have_xattr}
SCSI Crypto support: ${have_scsi_crypto}
GLUSTERFS support: ${have_glusterfs}
DROPLET support: ${have_droplet}
Python support: ${support_python} ${PYTHON_LIBS}
systemd support: ${support_systemd} ${SYSTEMD_UNITDIR}
Batch insert enabled: ${batch_insert_db_backends}
Expand Down
9 changes: 8 additions & 1 deletion src/stored/Makefile.in
Expand Up @@ -28,6 +28,7 @@ first_rule: all
dummy:

DEVICE_API_SRCS = gfapi_device.c \
object_store_device.c \
unix_file_device.c \
unix_tape_device.c \
vtape.c
Expand Down Expand Up @@ -82,7 +83,9 @@ BEXTRACT_LIBS += @LZO_LIBS_NONSHARED@
BEXTRACT_LIBS += @FASTLZ_LIBS_NONSHARED@

GLUSTER_INC = @GLUSTER_INC@
DROPLET_INC = @DROPLET_INC@
LIBS += @GLUSTER_LIBS@
LIBS += @DROPLET_LIBS@
INCLUDES += -I$(srcdir) -I$(basedir) -I$(basedir)/include

DEBUG = @DEBUG@
Expand All @@ -104,12 +107,16 @@ NDMP_LIBS = @NDMP_LIBS@

dev.o: dev.c
@echo "Compiling $<"
$(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) $(GLUSTER_INC) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<
$(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) $(GLUSTER_INC) $(DROPLET_INC) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<

gfapi_device.o: gfapi_device.c
@echo "Compiling $<"
$(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) $(GLUSTER_INC) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<

object_storage_device.o: object_storage_device.c
@echo "Compiling $<"
$(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) $(DROPLET_INC) -c $(WCFLAGS) $(CPPFLAGS) $(INCLUDES) $(DINCLUDE) $(CXXFLAGS) $<

all: Makefile bareos-sd @STATIC_SD@ bls bextract bscan btape bcopy
@echo "===== Make of stored is good ===="
@echo " "
Expand Down

0 comments on commit 5cfa70c

Please sign in to comment.