Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sds
sds-keyval
Commits
286cffda
Commit
286cffda
authored
May 08, 2018
by
Matthieu Dorier
Browse files
removed boost dependency
parent
ab411254
Changes
8
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
286cffda
...
...
@@ -84,12 +84,12 @@ SERVER_DEPS_PKG=""
# uncertain what the lowest Boost we need is.
# Ubuntu 14.04 has boost 1.54. Seems like a good starting point
AX_BOOST_BASE([1.54], ,
AC_MSG_ERROR([sdskeyval requires Boost but was unable to find it]))
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
#
AX_BOOST_BASE([1.54], ,
#
AC_MSG_ERROR([sdskeyval requires Boost but was unable to find it]))
#
AX_BOOST_SYSTEM
#
AX_BOOST_FILESYSTEM
SERVER_LIBS_EXT="$SERVER_LIBS_EXT ${BOOST_LDFLAGS} ${BOOST_FILESYSTEM_LIB} ${BOOST_SYSTEM_LIB}"
#
SERVER_LIBS_EXT="$SERVER_LIBS_EXT ${BOOST_LDFLAGS} ${BOOST_FILESYSTEM_LIB} ${BOOST_SYSTEM_LIB}"
# we have three possible backends for our datastore. If none are selected,
# then nothing will initialize the class and well that doesn't make any sense
...
...
src/bulk.h
View file @
286cffda
...
...
@@ -3,9 +3,11 @@
#ifndef bulk_h
#define bulk_h
#include
<stddef.h>
#include
"kv-config.h"
#include
<boost/functional/hash.hpp>
//
#include <boost/functional/hash.hpp>
#include
<vector>
#include
<string>
// implementation is std::vector<char> specific
// typedef is for convenience
...
...
@@ -14,7 +16,8 @@ typedef std::vector<char> ds_bulk_t;
struct
ds_bulk_hash
{
size_t
operator
()(
const
ds_bulk_t
&
v
)
const
{
size_t
hash
=
0
;
boost
::
hash_range
(
hash
,
v
.
begin
(),
v
.
end
());
hash
=
std
::
hash
<
std
::
string
>
()
(
std
::
string
(
v
.
begin
(),
v
.
end
()
)
);
//boost::hash_range(hash, v.begin(), v.end());
return
hash
;
}
};
...
...
src/datastore/berkeleydb_datastore.cc
View file @
286cffda
...
...
@@ -2,10 +2,10 @@
// All rights reserved.
#include
"berkeleydb_datastore.h"
#include
"kv-config.h"
#include
<sstream>
#include
<chrono>
#include
<cstring>
#include
<iostream>
#include
<boost/filesystem.hpp>
using
namespace
std
::
chrono
;
...
...
@@ -31,7 +31,9 @@ void BerkeleyDBDataStore::createDatabase(const std::string& db_name, const std::
int
status
=
0
;
if
(
!
db_path
.
empty
())
{
boost
::
filesystem
::
create_directories
(
db_path
);
std
::
stringstream
str_db_path
(
"mkdir -p "
);
str_db_path
<<
db_path
;
system
(
str_db_path
.
str
().
c_str
());
}
// initialize the environment
...
...
src/datastore/bwtree_datastore.cc
View file @
286cffda
...
...
@@ -4,7 +4,6 @@
#include
"kv-config.h"
#include
<chrono>
#include
<iostream>
#include
<boost/filesystem.hpp>
using
namespace
std
::
chrono
;
...
...
src/datastore/datastore.cc
View file @
286cffda
...
...
@@ -5,8 +5,6 @@
#include
<chrono>
#include
<iostream>
#include
<boost/filesystem.hpp>
using
namespace
std
::
chrono
;
AbstractDataStore
::
AbstractDataStore
()
{
...
...
src/datastore/datastore.h
View file @
286cffda
...
...
@@ -6,7 +6,6 @@
#include
"kv-config.h"
#include
"bulk.h"
#include
<boost/functional/hash.hpp>
#include
<vector>
enum
class
Duplicates
:
int
{
ALLOW
,
IGNORE
};
...
...
src/datastore/leveldb_datastore.cc
View file @
286cffda
...
...
@@ -2,9 +2,10 @@
// All rights reserved.
#include
"leveldb_datastore.h"
#include
"kv-config.h"
#include
<cstring>
#include
<chrono>
#include
<iostream>
#include
<
boost/filesystem.hpp
>
#include
<
sstream
>
using
namespace
std
::
chrono
;
...
...
@@ -38,7 +39,9 @@ void LevelDBDataStore::createDatabase(const std::string& db_name, const std::str
leveldb
::
Status
status
;
if
(
!
db_path
.
empty
())
{
boost
::
filesystem
::
create_directories
(
db_path
);
std
::
stringstream
str_db_path
(
"mkdir -p "
);
str_db_path
<<
db_path
;
system
(
str_db_path
.
str
().
c_str
());
}
options
.
comparator
=
&
_keycmp
;
options
.
create_if_missing
=
true
;
...
...
src/datastore/map_datastore.h
View file @
286cffda
...
...
@@ -4,6 +4,7 @@
#define map_datastore_h
#include
<map>
#include
<cstring>
#include
"kv-config.h"
#include
"bulk.h"
#include
"datastore/datastore.h"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment