Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
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
Show whitespace changes
Inline
Side-by-side
configure.ac
View file @
286cffda
...
@@ -84,12 +84,12 @@ SERVER_DEPS_PKG=""
...
@@ -84,12 +84,12 @@ SERVER_DEPS_PKG=""
# uncertain what the lowest Boost we need is.
# uncertain what the lowest Boost we need is.
# Ubuntu 14.04 has boost 1.54. Seems like a good starting point
# Ubuntu 14.04 has boost 1.54. Seems like a good starting point
AX_BOOST_BASE([1.54], ,
#
AX_BOOST_BASE([1.54], ,
AC_MSG_ERROR([sdskeyval requires Boost but was unable to find it]))
#
AC_MSG_ERROR([sdskeyval requires Boost but was unable to find it]))
AX_BOOST_SYSTEM
#
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
#
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,
# 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
# then nothing will initialize the class and well that doesn't make any sense
...
...
src/bulk.h
View file @
286cffda
...
@@ -3,9 +3,11 @@
...
@@ -3,9 +3,11 @@
#ifndef bulk_h
#ifndef bulk_h
#define bulk_h
#define bulk_h
#include <stddef.h>
#include "kv-config.h"
#include "kv-config.h"
#include <boost/functional/hash.hpp>
//
#include <boost/functional/hash.hpp>
#include <vector>
#include <vector>
#include <string>
// implementation is std::vector<char> specific
// implementation is std::vector<char> specific
// typedef is for convenience
// typedef is for convenience
...
@@ -14,7 +16,8 @@ typedef std::vector<char> ds_bulk_t;
...
@@ -14,7 +16,8 @@ typedef std::vector<char> ds_bulk_t;
struct
ds_bulk_hash
{
struct
ds_bulk_hash
{
size_t
operator
()(
const
ds_bulk_t
&
v
)
const
{
size_t
operator
()(
const
ds_bulk_t
&
v
)
const
{
size_t
hash
=
0
;
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
;
return
hash
;
}
}
};
};
...
...
src/datastore/berkeleydb_datastore.cc
View file @
286cffda
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
// All rights reserved.
// All rights reserved.
#include "berkeleydb_datastore.h"
#include "berkeleydb_datastore.h"
#include "kv-config.h"
#include "kv-config.h"
#include <sstream>
#include <chrono>
#include <chrono>
#include <cstring>
#include <cstring>
#include <iostream>
#include <iostream>
#include <boost/filesystem.hpp>
using
namespace
std
::
chrono
;
using
namespace
std
::
chrono
;
...
@@ -31,7 +31,9 @@ void BerkeleyDBDataStore::createDatabase(const std::string& db_name, const std::
...
@@ -31,7 +31,9 @@ void BerkeleyDBDataStore::createDatabase(const std::string& db_name, const std::
int
status
=
0
;
int
status
=
0
;
if
(
!
db_path
.
empty
())
{
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
// initialize the environment
...
...
src/datastore/bwtree_datastore.cc
View file @
286cffda
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
#include "kv-config.h"
#include "kv-config.h"
#include <chrono>
#include <chrono>
#include <iostream>
#include <iostream>
#include <boost/filesystem.hpp>
using
namespace
std
::
chrono
;
using
namespace
std
::
chrono
;
...
...
src/datastore/datastore.cc
View file @
286cffda
...
@@ -5,8 +5,6 @@
...
@@ -5,8 +5,6 @@
#include <chrono>
#include <chrono>
#include <iostream>
#include <iostream>
#include <boost/filesystem.hpp>
using
namespace
std
::
chrono
;
using
namespace
std
::
chrono
;
AbstractDataStore
::
AbstractDataStore
()
{
AbstractDataStore
::
AbstractDataStore
()
{
...
...
src/datastore/datastore.h
View file @
286cffda
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
#include "kv-config.h"
#include "kv-config.h"
#include "bulk.h"
#include "bulk.h"
#include <boost/functional/hash.hpp>
#include <vector>
#include <vector>
enum
class
Duplicates
:
int
{
ALLOW
,
IGNORE
};
enum
class
Duplicates
:
int
{
ALLOW
,
IGNORE
};
...
...
src/datastore/leveldb_datastore.cc
View file @
286cffda
...
@@ -2,9 +2,10 @@
...
@@ -2,9 +2,10 @@
// All rights reserved.
// All rights reserved.
#include "leveldb_datastore.h"
#include "leveldb_datastore.h"
#include "kv-config.h"
#include "kv-config.h"
#include <cstring>
#include <chrono>
#include <chrono>
#include <iostream>
#include <iostream>
#include <
boost/filesystem.hpp
>
#include <
sstream
>
using
namespace
std
::
chrono
;
using
namespace
std
::
chrono
;
...
@@ -38,7 +39,9 @@ void LevelDBDataStore::createDatabase(const std::string& db_name, const std::str
...
@@ -38,7 +39,9 @@ void LevelDBDataStore::createDatabase(const std::string& db_name, const std::str
leveldb
::
Status
status
;
leveldb
::
Status
status
;
if
(
!
db_path
.
empty
())
{
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
.
comparator
=
&
_keycmp
;
options
.
create_if_missing
=
true
;
options
.
create_if_missing
=
true
;
...
...
src/datastore/map_datastore.h
View file @
286cffda
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#define map_datastore_h
#define map_datastore_h
#include <map>
#include <map>
#include <cstring>
#include "kv-config.h"
#include "kv-config.h"
#include "bulk.h"
#include "bulk.h"
#include "datastore/datastore.h"
#include "datastore/datastore.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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