-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created extent_client_cache as a simple proxy for extent_client
- Loading branch information
Showing
5 changed files
with
77 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// RPC stubs for clients to talk to extent_server | ||
|
||
#include "extent_client_cache.h" | ||
#include "extent_client.h" | ||
#include <sstream> | ||
#include <iostream> | ||
#include <stdio.h> | ||
#include <unistd.h> | ||
#include <time.h> | ||
|
||
// The calls assume that the caller holds a lock on the extent | ||
|
||
extent_client_cache::extent_client_cache(std::string dst) | ||
{ | ||
ec = new extent_client(dst); | ||
} | ||
|
||
extent_protocol::status | ||
extent_client_cache::get(extent_protocol::extentid_t eid, std::string &buf) | ||
{ | ||
return ec->get(eid, buf); | ||
} | ||
|
||
extent_protocol::status | ||
extent_client_cache::getattr(extent_protocol::extentid_t eid, | ||
extent_protocol::attr &attr) | ||
{ | ||
return ec->getattr(eid, attr); | ||
} | ||
|
||
extent_protocol::status | ||
extent_client_cache::put(extent_protocol::extentid_t eid, std::string buf) | ||
{ | ||
return ec->put(eid, buf); | ||
} | ||
|
||
extent_protocol::status | ||
extent_client_cache::remove(extent_protocol::extentid_t eid) | ||
{ | ||
return ec->remove(eid); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// extent client interface. | ||
|
||
#ifndef extent_client_cache_h | ||
#define extent_client_cache_h | ||
|
||
#include <string> | ||
#include "extent_protocol.h" | ||
#include "extent_client.h" | ||
#include "rpc.h" | ||
|
||
class extent_client_cache { | ||
|
||
private: | ||
extent_client *ec; | ||
|
||
public: | ||
extent_client_cache(std::string dst); | ||
|
||
extent_protocol::status get(extent_protocol::extentid_t eid, | ||
std::string &buf); | ||
extent_protocol::status getattr(extent_protocol::extentid_t eid, | ||
extent_protocol::attr &a); | ||
extent_protocol::status put(extent_protocol::extentid_t eid, std::string buf); | ||
extent_protocol::status remove(extent_protocol::extentid_t eid); | ||
}; | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters