projects
/
invirt/third/libt4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Lots more clean-ups
[invirt/third/libt4.git]
/
log.cc
diff --git
a/log.cc
b/log.cc
index
95c40e3
..
3b881fa
100644
(file)
--- a/
log.cc
+++ b/
log.cc
@@
-27,19
+27,19
@@
void log::logread(void) {
pxs->instance_h = instance;
LOG("logread: instance: " << instance << " w. v = " <<
pxs->values[instance]);
pxs->instance_h = instance;
LOG("logread: instance: " << instance << " w. v = " <<
pxs->values[instance]);
- pxs->v_a.clear();
- pxs->n_h.n = 0;
- pxs->n_a.n = 0;
+ pxs->accepted_value.clear();
+ pxs->promise.n = 0;
+ pxs->accepted.n = 0;
} else if (type == "propseen") {
} else if (type == "propseen") {
- from >> pxs->n_h.n >> pxs->n_h.m;
- LOG("logread: high update: " << pxs->n_h.n << "(" << pxs->n_h.m << ")");
+ from >> pxs->promise.n >> pxs->promise.m;
+ LOG("logread: high update: " << pxs->promise.n << "(" << pxs->promise.m << ")");
} else if (type == "accepted") {
string v;
} else if (type == "accepted") {
string v;
- from >> pxs->n_a.n >> pxs->n_a.m;
+ from >> pxs->accepted.n >> pxs->accepted.m;
from.get();
getline(from, v);
from.get();
getline(from, v);
- pxs->v_a = v;
- LOG("logread: prop update " << pxs->n_a.n << "(" << pxs->n_a.m << ") with v = " << pxs->v_a);
+ pxs->accepted_value = v;
+ LOG("logread: prop update " << pxs->accepted.n << "(" << pxs->accepted.m << ") with v = " << pxs->accepted_value);
} else {
LOG("logread: unknown log record");
VERIFY(0);
} else {
LOG("logread: unknown log record");
VERIFY(0);
@@
-60,30
+60,30
@@
string log::dump() {
void log::restore(string s) {
LOG("restore: " << s);
void log::restore(string s) {
LOG("restore: " << s);
- ofstream f(name, std::ios::trunc);
+ ofstream f(name, ios::trunc);
f << s;
f.close();
}
// XXX should be an atomic operation
void log::loginstance(unsigned instance, string v) {
f << s;
f.close();
}
// XXX should be an atomic operation
void log::loginstance(unsigned instance, string v) {
- ofstream f(name, std::ios::app);
+ ofstream f(name, ios::app);
f << "done " << instance << " " << v << "\n";
f.close();
}
f << "done " << instance << " " << v << "\n";
f.close();
}
-// an acceptor should call logprop(n_h) when it
+// an acceptor should call logprop(promise) when it
// receives a prepare to which it responds prepare_ok().
// receives a prepare to which it responds prepare_ok().
-void log::logprop(prop_t n_h) {
- ofstream f(name, std::ios::app);
- f << "propseen " << n_h.n << " " << n_h.m << "\n";
+void log::logprop(prop_t promise) {
+ ofstream f(name, ios::app);
+ f << "propseen " << promise.n << " " << promise.m << "\n";
f.close();
}
f.close();
}
-// an acceptor should call logaccept(n_a, v_a) when it
+// an acceptor should call logaccept(accepted, accepted_value) when it
// receives an accept RPC to which it replies accept_ok().
void log::logaccept(prop_t n, string v) {
// receives an accept RPC to which it replies accept_ok().
void log::logaccept(prop_t n, string v) {
- ofstream f(name, std::ios::app);
+ ofstream f(name, ios::app);
f << "accepted " << n.n << " " << n.m << " " << v << "\n";
f.close();
}
f << "accepted " << n.n << " " << n.m << " " << v << "\n";
f.close();
}