Permalink
Browse files

Thrift version 0.5.0 started scoping their enums, which broke our cod…

…e. These are the fixes required to get it to work with the latest version of thrift. Unfortunately, these are not backwards compatible changes, so we now require thrift 0.5.0 to build FAWN-KV properly.
  • Loading branch information...
1 parent 710c20d commit 911859f82301e67b6b38435828947ee12b5caa87 Vijay Vasudevan committed Nov 2, 2010
Showing with 23 additions and 20 deletions.
  1. +6 −3 INSTALL
  2. +4 −4 fawnkv/FawnKVBackendHandler.cpp
  3. +5 −5 fawnkv/Manager.cpp
  4. +2 −2 fawnkv/fawnkvmesg.thrift
  5. +3 −3 fawnkv/fe.cpp
  6. +1 −1 fawnkv/fe.h
  7. +2 −2 fawnkv/node_mgr.h
View
@@ -2,9 +2,9 @@ Steps to build source code
0. On Debian/Ubuntu GNU/Linux install the following (to build source)
-autoconf automake autotools-dev pkg-config m4 libtool libtbb2 libtbb-dev libboost-dev bison flex ruby-dev libssl-dev libgtest-dev
+autoconf automake autotools-dev pkg-config m4 libtool libtbb2 libtbb-dev libboost-dev libssl-dev libgtest-dev
-thrift-0.2.0 or later (install from source)
+thrift-0.5.0 or later (install from source)
IMPORTANT: You must apply fawn-thrift.patch patch to the thrift source before compiling
# cd thrift-0.X.0 && patch -p1 < FAWN-KV/patches/fawn-thrift.patch
This is to ensure that our sighandler actually kills the TThreadedServer threads properly.
@@ -13,8 +13,11 @@ thrift-0.2.0 or later (install from source)
If using TSimpleServer apply this patch
http://issues.apache.org/jira/browse/THRIFT-567
+thrift may require the following packages to build: bison flex ruby-dev python-dev php5-dev
+You may also need to install a more specific boost package (libboost-thread-dev) for FAWN-KV.
-1. autoreconf -fis
+
+1. autoreconf -is
2. ./configure [--with-ycsb]
3. make
@@ -127,7 +127,7 @@ void node_mgr::vnode_pre_join_response(const std::string& VnodeID, const std::ve
}
}
-void node_mgr::vnode_extend_chain( const std::string& vid, const std::string& nid, const std::string& start_key, const std::string& end_key, const std::string& ip, int32_t port, flushmode mode)
+void node_mgr::vnode_extend_chain( const std::string& vid, const std::string& nid, const std::string& start_key, const std::string& end_key, const std::string& ip, int32_t port, int32_t mode)
{
cout << "Extend Chain for range [" << bytes_to_hex(start_key) << ", " << bytes_to_hex(end_key) << "]" << endl;
cout << "Vid key is " << bytes_to_hex(vid) << endl;
@@ -251,7 +251,7 @@ void node_mgr::precopy_response(const std::string& startKey, const std::string&
vid_precopy_map[vid]++; // atomically increment
cout << "vnode -- " << bytes_to_hex(vid.data()) << endl;
cout << "got " << vid_precopy_map[vid] << " precopy responses." << endl;
- if (vid_extension_map[startKey] != SPLIT)
+ if (vid_extension_map[startKey] != flushmode::SPLIT)
{
cout << "[Precopy Response] Calling vnode_join with non-splitting flag" << endl;
pthread_mutex_lock(&socket_lock);
@@ -972,7 +972,7 @@ void node_mgr::get_handler(const std::string& key, const int64_t continuation, c
//unlock original DB
pthread_rwlock_unlock(&(idb->dbLock));
- gr->status = rc ? SUCCESS : NOT_EXIST;
+ gr->status = rc ? returnStatus::SUCCESS : returnStatus::NOT_EXIST;
if (!rc) {
gr->value.clear();
}
@@ -982,7 +982,7 @@ void node_mgr::get_handler(const std::string& key, const int64_t continuation, c
}
else {
cout << "Error GH: key does not lie in the DB ranges owned by this node!" << endl;
- gr->status = STALE_RING;
+ gr->status = returnStatus::STALE_RING;
gr->ip = ip;
get_resp_queue.push(gr);
}
View
@@ -450,7 +450,7 @@ void Manager::failNode(Node* i)
fail->id->actual_data_str(),
pred->n->IP,
pred->n->port,
- MERGE);
+ flushmode::MERGE);
cout << "shortening range: " << getSuccessorID(fail->id, true)->actual_data_str() << endl;
@@ -964,7 +964,7 @@ void Manager::chain_repair_done(const std::string& key, const std::string& endke
key,
endkey,
pred->n->IP,
- pred->n->port, PLAIN);
+ pred->n->port, flushmode::PLAIN);
}
@@ -1130,7 +1130,7 @@ void Manager::vnode_pre_join(const std::string& vid, const std::string& ip, cons
**/
void Manager::vnode_join(const std::string& vid, const std::string& ip, const int32_t port, int32_t merge) {
- if ((merge == MERGE) || (merge == PLAIN)) {
+ if ((merge == flushmode::MERGE) || (merge == flushmode::PLAIN)) {
vnode_join_extend_chain(vid, ip, port, merge);
return;
}
@@ -1269,7 +1269,7 @@ void Manager::vnode_join_extend_chain(const std::string& vid, const std::string&
///
vid_shorter_map[vid] = false; // safe to always set this to false regardless of range.
- if (merge == MERGE)
+ if (merge == flushmode::MERGE)
{
cout << "[vnode_join] MERGE" << endl;
@@ -1289,7 +1289,7 @@ void Manager::vnode_join_extend_chain(const std::string& vid, const std::string&
replica_group_size-1);
}
- else if (merge == PLAIN)
+ else if (merge == flushmode::PLAIN)
{
cout << "[vnode_join] PLAIN" << endl;
View
@@ -51,7 +51,7 @@ service FawnKVBackend {
repairInfo chain_repair_mid_succ(1: binary key, 2: binary p_vid, 3: binary p_ip),
oneway void chain_repair_single(1:binary new_start, 2: binary end_id),
- oneway void vnode_extend_chain( 1: binary vid,2: binary nid, 3: binary start_key, 4: binary end_key, 5: binary ip, 6: i32 port, 7: flushmode mode),
+ oneway void vnode_extend_chain( 1: binary vid,2: binary nid, 3: binary start_key, 4: binary end_key, 5: binary ip, 6: i32 port, 7: i32 mode),
oneway void integrity(1: i32 hops),
oneway void init(1: string ip, 2: i32 port),
@@ -61,7 +61,7 @@ service FawnKVBackend {
service FawnKVFrontend {
oneway void put_response(1: binary key, 3: i64 continuation, 4: bool success, 16: string ip),
oneway void put_w_response(1: binary key, 3: i64 continuation, 4: bool success, 5: i64 version, 16: string ip),
- oneway void get_response(1: binary key, 2: binary value, 3: i64 continuation, 4: returnStatus status, 16: string ip),
+ oneway void get_response(1: binary key, 2: binary value, 3: i64 continuation, 4: i16 status, 16: string ip),
oneway void remove_response(1: binary key, 3: i64 continuation, 4: bool success, 16: string ip),
}
View
@@ -149,8 +149,8 @@ void FrontEnd::put_w_response(const std::string& key, const int64_t continuation
}
}
-void FrontEnd::get_response(const std::string& key, const std::string& value, const int64_t continuation, const returnStatus status, const std::string& ip) {
- if (status == STALE_RING) {
+void FrontEnd::get_response(const std::string& key, const std::string& value, const int64_t continuation, const int16_t status, const std::string& ip) {
+ if (status == returnStatus::STALE_RING) {
// Update ring and try again
UpdateRingState();
get(key, continuation);
@@ -159,7 +159,7 @@ void FrontEnd::get_response(const std::string& key, const std::string& value, co
if (NULL != get_cb) {
DBID dkey(key);
- bool success = (status == SUCCESS);
+ bool success = (status == returnStatus::SUCCESS);
get_cb(dkey, value, continuation, success);
}
}
View
@@ -72,7 +72,7 @@ class FrontEnd : virtual public FawnKVFrontendIf
void put_response(const std::string& key, const int64_t continuation, const bool success, const std::string& ip);
void put_w_response(const std::string& key, const int64_t continuation, const bool success, const int64_t version, const std::string& ip);
- void get_response(const std::string& key, const std::string& value, const int64_t continuation, const returnStatus status, const std::string& ip);
+ void get_response(const std::string& key, const std::string& value, const int64_t continuation, const int16_t status, const std::string& ip);
void remove_response(const std::string& key, const int64_t continuation, const bool success, const std::string& ip);
};
View
@@ -112,7 +112,7 @@ class GetResponseObj {
const string key;
int64_t continuation;
string value;
- returnStatus status;
+ int16_t status;
string ip;
GetResponseObj(string key, int64_t continuation) :
key(key), continuation(continuation) {}
@@ -205,7 +205,7 @@ class node_mgr : virtual public FawnKVBackendIf {
void init(string managerIP, string localIP, string stat_filename);
void get_handler(const std::string& key, const int64_t continuation, const std::string& ip);
- void vnode_extend_chain( const std::string& vid,const std::string& nid, const std::string& start_key, const std::string& end_key, const std::string& ip, int32_t port, flushmode mode);
+ void vnode_extend_chain( const std::string& vid,const std::string& nid, const std::string& start_key, const std::string& end_key, const std::string& ip, int32_t port, int32_t mode);
void init(const string& ip, int32_t port);

0 comments on commit 911859f

Please sign in to comment.