-
Notifications
You must be signed in to change notification settings - Fork 0
/
extent_client.cc
58 lines (49 loc) · 1.21 KB
/
extent_client.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// RPC stubs for clients to talk to extent_server
#include "extent_client.h"
#include <sstream>
#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <time.h>
extent_client::extent_client()
{
es = new extent_server();
}
extent_protocol::status
extent_client::create(uint32_t type, extent_protocol::extentid_t &id)
{
extent_protocol::status ret = extent_protocol::OK;
ret = es->create(type, id);
return ret;
}
extent_protocol::status
extent_client::get(extent_protocol::extentid_t eid, std::string &buf)
{
extent_protocol::status ret = extent_protocol::OK;
ret = es->get(eid, buf);
return ret;
}
extent_protocol::status
extent_client::getattr(extent_protocol::extentid_t eid,
extent_protocol::attr &attr)
{
extent_protocol::status ret = extent_protocol::OK;
ret = es->getattr(eid, attr);
return ret;
}
extent_protocol::status
extent_client::put(extent_protocol::extentid_t eid, std::string buf)
{
extent_protocol::status ret = extent_protocol::OK;
int r;
ret = es->put(eid, buf, r);
return ret;
}
extent_protocol::status
extent_client::remove(extent_protocol::extentid_t eid)
{
extent_protocol::status ret = extent_protocol::OK;
int r;
ret = es->remove(eid, r);
return ret;
}