blob: cae3d6b540007d61d839b3f334598d933eb40f8f [file] [log] [blame]
Zhenkai Zhu8224bb62013-01-06 15:58:02 -08001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2013 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
Alexander Afanasyev20bc8e22013-01-17 10:56:04 -080018 * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
19 * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
Zhenkai Zhu8224bb62013-01-06 15:58:02 -080020 */
21
22#include "sync-core.h"
Alexander Afanasyevc507ac22013-01-21 16:01:58 -080023#include "logging.h"
Alexander Afanasyevabe952a2013-01-17 17:06:32 -080024#include "random-interval-generator.h"
25
Alexander Afanasyevc507ac22013-01-21 16:01:58 -080026#include <boost/lexical_cast.hpp>
27
28INIT_LOGGER ("Sync.Core");
29
Zhenkai Zhue851b952013-01-13 22:29:57 -080030const string SyncCore::RECOVER = "RECOVER";
Zhenkai Zhue573ae82013-01-15 13:15:52 -080031const double SyncCore::WAIT = 0.05;
Zhenkai Zhue851b952013-01-13 22:29:57 -080032const double SyncCore::RANDOM_PERCENT = 0.5;
33
Alexander Afanasyevc507ac22013-01-21 16:01:58 -080034using namespace boost;
35
Zhenkai Zhu4e1c1d92013-01-17 14:12:46 -080036// for debugging
37static void
38printMsg(SyncStateMsgPtr &msg)
39{
Alexander Afanasyevc507ac22013-01-21 16:01:58 -080040 _LOG_TRACE (" ===== start Msg ======");
Zhenkai Zhu4e1c1d92013-01-17 14:12:46 -080041 int size = msg->state_size();
42 if (size > 0)
43 {
44 int index = 0;
45 while (index < size)
46 {
47 SyncState state = msg->state(index);
48 string strName = state.name();
49 string strLocator = state.locator();
50 sqlite3_int64 seq = state.seq();
Alexander Afanasyevc507ac22013-01-21 16:01:58 -080051 _LOG_TRACE ("Name: " << Name((const unsigned char *)strName.c_str(), strName.size())
52 <<", Locator: " << Name((const unsigned char *)strLocator.c_str(), strLocator.size())
53 << ", seq: " << seq);
Zhenkai Zhu4e1c1d92013-01-17 14:12:46 -080054 index ++;
55 }
56 }
57 else
58 {
Alexander Afanasyevc507ac22013-01-21 16:01:58 -080059 _LOG_TRACE ("Msg size 0");
Zhenkai Zhu4e1c1d92013-01-17 14:12:46 -080060 }
Alexander Afanasyevc507ac22013-01-21 16:01:58 -080061 _LOG_TRACE (" ++++++++ end Msg ++++++++ ");
Zhenkai Zhu4e1c1d92013-01-17 14:12:46 -080062}
63
Zhenkai Zhub330aed2013-01-17 13:29:37 -080064SyncCore::SyncCore(SyncLogPtr syncLog, const Name &userName, const Name &localPrefix, const Name &syncPrefix, const StateMsgCallback &callback, const CcnxWrapperPtr &handle, const SchedulerPtr &scheduler)
65 : m_log(syncLog)
66 , m_scheduler(scheduler)
Alexander Afanasyeva44a7a22013-01-14 17:37:06 -080067 , m_stateMsgCallback(callback)
Alexander Afanasyev7326a252013-01-20 23:43:25 -080068 // , m_userName(userName)
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -080069 , m_syncPrefix(syncPrefix)
Zhenkai Zhu8224bb62013-01-06 15:58:02 -080070 , m_handle(handle)
Alexander Afanasyevd6c2a902013-01-19 21:24:30 -080071 , m_syncClosure (boost::bind(&SyncCore::handleSyncData, this, _1, _2),
72 boost::bind(&SyncCore::handleSyncInterestTimeout, this, _1))
73 , m_recoverClosure (boost::bind(&SyncCore::handleRecoverData, this, _1, _2),
74 boost::bind(&SyncCore::handleRecoverInterestTimeout, this, _1))
Zhenkai Zhue573ae82013-01-15 13:15:52 -080075 , m_recoverWaitGenerator(new RandomIntervalGenerator(WAIT, RANDOM_PERCENT, RandomIntervalGenerator::UP))
Zhenkai Zhu8224bb62013-01-06 15:58:02 -080076{
Zhenkai Zhub330aed2013-01-17 13:29:37 -080077 m_rootHash = m_log->RememberStateInStateLog();
Alexander Afanasyevd6c2a902013-01-19 21:24:30 -080078
Zhenkai Zhue851b952013-01-13 22:29:57 -080079 m_handle->setInterestFilter(m_syncPrefix, boost::bind(&SyncCore::handleInterest, this, _1));
Alexander Afanasyevdac84922013-01-20 23:32:17 -080080 // m_log->initYP(m_yp);
Alexander Afanasyev7326a252013-01-20 23:43:25 -080081 m_log->UpdateLocalLocator (localPrefix);
82
Zhenkai Zhue573ae82013-01-15 13:15:52 -080083 m_scheduler->start();
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -080084 sendSyncInterest();
85}
86
87SyncCore::~SyncCore()
88{
Alexander Afanasyevd6c2a902013-01-19 21:24:30 -080089 // need to "deregister" closures
Zhenkai Zhue851b952013-01-13 22:29:57 -080090}
91
Alexander Afanasyevdac84922013-01-20 23:32:17 -080092// Name
93// SyncCore::yp(const Name &deviceName)
94// {
95// Name locator;
96// ReadLock lock(m_ypMutex);
97// if (m_yp.find(deviceName) != m_yp.end())
98// {
99// locator = m_yp[deviceName];
100// }
101// else
102// {
103// cout << "self: " << m_userName << ", deviceName: " << deviceName << " not found in yp " << endl;
104// }
105// return locator;
106// }
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800107
Alexander Afanasyevdac84922013-01-20 23:32:17 -0800108// void
109// SyncCore::updateLocalPrefix(const Name &localPrefix)
110// {
111// m_localPrefix = localPrefix;
112// // optionally, we can have a sync action to announce the new prefix
113// // we are not doing this for now
114// }
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800115
116void
Zhenkai Zhue851b952013-01-13 22:29:57 -0800117SyncCore::updateLocalState(sqlite3_int64 seqno)
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800118{
Alexander Afanasyev7326a252013-01-20 23:43:25 -0800119 m_log->UpdateLocalSeqNo (seqno);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800120 // choose to update locator everytime
Alexander Afanasyev7326a252013-01-20 23:43:25 -0800121 // m_log->UpdateLocator(m_userName, m_localPrefix);
Alexander Afanasyevdac84922013-01-20 23:32:17 -0800122 // {
123 // WriteLock lock(m_ypMutex);
124 // m_yp[m_userName] = m_localPrefix;
125 // }
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800126 HashPtr oldHash = m_rootHash;
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800127 m_rootHash = m_log->RememberStateInStateLog();
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800128
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800129 SyncStateMsgPtr msg = m_log->FindStateDifferences(*oldHash, *m_rootHash);
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800130
131 // reply sync Interest with oldHash as last component
132 Name syncName = constructSyncName(oldHash);
133 Bytes syncData;
134 msgToBytes(msg, syncData);
135 m_handle->publishData(syncName, syncData, FRESHNESS);
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800136 _LOG_DEBUG (m_log->GetLocalName () << " publishes: " << *oldHash);
Zhenkai Zhu4e1c1d92013-01-17 14:12:46 -0800137 printMsg(msg);
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800138
139 // no hurry in sending out new Sync Interest; if others send the new Sync Interest first, no problem, we know the new root hash already;
140 // this is trying to avoid the situation that the order of SyncData and new Sync Interest gets reversed at receivers
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800141 Scheduler::scheduleOneTimeTask (m_scheduler, 0.1,
142 bind(&SyncCore::sendSyncInterest, this),
143 lexical_cast<string> (*m_rootHash));
144
Zhenkai Zhue573ae82013-01-15 13:15:52 -0800145 sendSyncInterest();
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800146}
147
148void
Zhenkai Zhue851b952013-01-13 22:29:57 -0800149SyncCore::handleInterest(const Name &name)
150{
151 int size = name.size();
152 int prefixSize = m_syncPrefix.size();
153 if (size == prefixSize + 1)
154 {
155 // this is normal sync interest
156 handleSyncInterest(name);
157 }
158 else if (size == prefixSize + 2 && name.getCompAsString(m_syncPrefix.size()) == RECOVER)
159 {
160 // this is recovery interest
161 handleRecoverInterest(name);
162 }
163}
164
165void
166SyncCore::handleRecoverInterest(const Name &name)
167{
168 Bytes hashBytes = name.getComp(name.size() - 1);
169 // this is the hash unkonwn to the sender of the interest
170 Hash hash(head(hashBytes), hashBytes.size());
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800171 if (m_log->LookupSyncLog(hash) > 0)
Zhenkai Zhue851b952013-01-13 22:29:57 -0800172 {
173 // we know the hash, should reply everything
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800174 SyncStateMsgPtr msg = m_log->FindStateDifferences(*(Hash::Origin), *m_rootHash);
Zhenkai Zhue573ae82013-01-15 13:15:52 -0800175 // DEBUG
Zhenkai Zhu6e7d4d22013-01-15 18:18:18 -0800176 /*
Zhenkai Zhue573ae82013-01-15 13:15:52 -0800177 assert(msg->state_size() > 0);
178 int size = msg->state_size();
179 int index = 0;
Alexander Afanasyevf278db32013-01-21 14:41:01 -0800180 cerr << "Reply recover interest with: " << endl;
Zhenkai Zhue573ae82013-01-15 13:15:52 -0800181 while (index < size)
182 {
183 SyncState state = msg->state(index);
184 string strName = state.name();
185 string strLoc = state.locator();
186 cout << "Name: " << Name((const unsigned char *)strName.c_str(), strName.size()) << ", Loc: " << Name((const unsigned char *)strLoc.c_str(), strLoc.size()) << ", seq: " << state.seq() << endl;
187 if (state.type() == SyncState::UPDATE)
188 {
189 cout << "Action: update" << endl;
190 }
191 else
192 {
193 cout << "Action: delete" << endl;
194 }
195 index++;
196 }
Zhenkai Zhu6e7d4d22013-01-15 18:18:18 -0800197 */
Zhenkai Zhue573ae82013-01-15 13:15:52 -0800198 // END DEBUG
Zhenkai Zhue851b952013-01-13 22:29:57 -0800199 Bytes syncData;
200 msgToBytes(msg, syncData);
201 m_handle->publishData(name, syncData, FRESHNESS);
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800202 _LOG_DEBUG (m_log->GetLocalName () << " publishes " << hash);
Zhenkai Zhu4e1c1d92013-01-17 14:12:46 -0800203 printMsg(msg);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800204 }
205 else
206 {
207 // we don't recognize this hash, can not help
208 }
209}
210
211void
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800212SyncCore::handleSyncInterest(const Name &name)
213{
Zhenkai Zhue851b952013-01-13 22:29:57 -0800214 Bytes hashBytes = name.getComp(name.size() - 1);
215 HashPtr hash(new Hash(head(hashBytes), hashBytes.size()));
216 if (*hash == *m_rootHash)
217 {
218 // we have the same hash; nothing needs to be done
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800219 _LOG_DEBUG ("same as root hash: " << *hash);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800220 return;
221 }
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800222 else if (m_log->LookupSyncLog(*hash) > 0)
Zhenkai Zhue851b952013-01-13 22:29:57 -0800223 {
224 // we know something more
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800225 _LOG_DEBUG ("found hash in sync log");
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800226 SyncStateMsgPtr msg = m_log->FindStateDifferences(*hash, *m_rootHash);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800227
228 Bytes syncData;
229 msgToBytes(msg, syncData);
230 m_handle->publishData(name, syncData, FRESHNESS);
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800231 _LOG_DEBUG (m_log->GetLocalName () << " publishes: " << *hash);
Zhenkai Zhu4e1c1d92013-01-17 14:12:46 -0800232 printMsg(msg);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800233 }
234 else
235 {
236 // we don't recognize the hash, send recover Interest if still don't know the hash after a randomized wait period
Zhenkai Zhue573ae82013-01-15 13:15:52 -0800237 double wait = m_recoverWaitGenerator->nextInterval();
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800238 _LOG_DEBUG (m_log->GetLocalName () << ", rootHash: " << *m_rootHash << ", hash: " << *hash);
239 _LOG_DEBUG ("recover task scheduled after wait: " << wait);
Zhenkai Zhue573ae82013-01-15 13:15:52 -0800240
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800241 Scheduler::scheduleOneTimeTask (m_scheduler,
242 wait, boost::bind(&SyncCore::recover, this, hash),
243 "r-"+lexical_cast<string> (*hash));
Zhenkai Zhue851b952013-01-13 22:29:57 -0800244 }
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800245}
246
247Closure::TimeoutCallbackReturnValue
248SyncCore::handleSyncInterestTimeout(const Name &name)
249{
250 // sendInterestInterest with the current root hash;
251 sendSyncInterest();
Zhenkai Zhue851b952013-01-13 22:29:57 -0800252 return Closure::RESULT_OK;
253}
254
255Closure::TimeoutCallbackReturnValue
256SyncCore::handleRecoverInterestTimeout(const Name &name)
257{
258 // We do not re-express recovery interest for now
259 // if difference is not resolved, the sync interest will trigger
260 // recovery anyway; so it's not so important to have recovery interest
261 // re-expressed
262 return Closure::RESULT_OK;
263}
264
265void
Alexander Afanasyevf278db32013-01-21 14:41:01 -0800266SyncCore::handleRecoverData(const Name &name, PcoPtr content)
Zhenkai Zhue851b952013-01-13 22:29:57 -0800267{
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800268 //cout << "handle recover data" << end;
Alexander Afanasyevf278db32013-01-21 14:41:01 -0800269 handleStateData(*content->contentPtr ());
Zhenkai Zhu6e7d4d22013-01-15 18:18:18 -0800270 sendSyncInterest();
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800271}
272
273void
Alexander Afanasyevf278db32013-01-21 14:41:01 -0800274SyncCore::handleSyncData(const Name &name, PcoPtr content)
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800275{
Zhenkai Zhue851b952013-01-13 22:29:57 -0800276 // suppress recover in interest - data out of order case
Alexander Afanasyevf278db32013-01-21 14:41:01 -0800277 handleStateData(*content->contentPtr ());
Zhenkai Zhue851b952013-01-13 22:29:57 -0800278
279 // resume outstanding sync interest
280 sendSyncInterest();
281}
282
283void
284SyncCore::handleStateData(const Bytes &content)
285{
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800286 SyncStateMsgPtr msg(new SyncStateMsg);
287 bool success = msg->ParseFromArray(head(content), content.size());
288 if(!success)
289 {
290 // ignore misformed SyncData
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800291 _LOG_ERROR ("Misformed SyncData");
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800292 return;
293 }
294
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800295 _LOG_DEBUG (m_log->GetLocalName () << " receives Msg ");
Zhenkai Zhu4e1c1d92013-01-17 14:12:46 -0800296 printMsg (msg);
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800297 int size = msg->state_size();
298 int index = 0;
299 while (index < size)
300 {
301 SyncState state = msg->state(index);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800302 string devStr = state.name();
303 Name deviceName((const unsigned char *)devStr.c_str(), devStr.size());
Zhenkai Zhu6e7d4d22013-01-15 18:18:18 -0800304 // cout << "Got Name: " << deviceName;
Zhenkai Zhue851b952013-01-13 22:29:57 -0800305 if (state.type() == SyncState::UPDATE)
306 {
307 sqlite3_int64 seqno = state.seq();
Zhenkai Zhu6e7d4d22013-01-15 18:18:18 -0800308 // cout << ", Got seq: " << seqno << endl;
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800309 m_log->UpdateDeviceSeqNo(deviceName, seqno);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800310 if (state.has_locator())
311 {
312 string locStr = state.locator();
313 Name locatorName((const unsigned char *)locStr.c_str(), locStr.size());
Zhenkai Zhu6e7d4d22013-01-15 18:18:18 -0800314 // cout << ", Got loc: " << locatorName << endl;
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800315 m_log->UpdateLocator(deviceName, locatorName);
Alexander Afanasyevdac84922013-01-20 23:32:17 -0800316 // WriteLock lock(m_ypMutex);
317 // m_yp[deviceName] = locatorName;
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800318 _LOG_DEBUG ("self: " << m_log->GetLocalName () << ", device: " << deviceName << " < == > " << locatorName);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800319 }
320 }
321 else
322 {
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800323 _LOG_TRACE ("nani");
Zhenkai Zhue851b952013-01-13 22:29:57 -0800324 deregister(deviceName);
325 }
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800326 index++;
327 }
328
Zhenkai Zhue851b952013-01-13 22:29:57 -0800329 // find the actuall difference and invoke callback on the actual difference
330 HashPtr oldHash = m_rootHash;
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800331 m_rootHash = m_log->RememberStateInStateLog();
Zhenkai Zhu085aae72013-01-17 21:09:01 -0800332 // get diff with both new SeqNo and old SeqNo
333 SyncStateMsgPtr diff = m_log->FindStateDifferences(*oldHash, *m_rootHash, true);
Zhenkai Zhu6e7d4d22013-01-15 18:18:18 -0800334
Zhenkai Zhu9501b8b2013-01-17 12:37:00 -0800335 if (diff->state_size() > 0)
336 {
337 m_stateMsgCallback(diff);
338 }
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800339}
340
341void
342SyncCore::sendSyncInterest()
343{
344 Name syncInterest = constructSyncName(m_rootHash);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800345 m_handle->sendInterest(syncInterest, m_syncClosure);
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800346 _LOG_DEBUG (m_log->GetLocalName () << " send SYNC interest: " << *m_rootHash);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800347}
348
349void
350SyncCore::recover(const HashPtr &hash)
351{
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800352 if (!(*hash == *m_rootHash) && m_log->LookupSyncLog(*hash) <= 0)
Zhenkai Zhue851b952013-01-13 22:29:57 -0800353 {
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800354 _LOG_DEBUG (m_log->GetLocalName () << ", Recover for: " << *hash);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800355 // unfortunately we still don't recognize this hash
356 Bytes bytes;
357 readRaw(bytes, (const unsigned char *)hash->GetHash(), hash->GetHashBytes());
358 Name recoverInterest = m_syncPrefix;
359 recoverInterest.appendComp(RECOVER);
360 // append the unknown hash
361 recoverInterest.appendComp(bytes);
362 m_handle->sendInterest(recoverInterest, m_recoverClosure);
Alexander Afanasyevc507ac22013-01-21 16:01:58 -0800363 _LOG_DEBUG (m_log->GetLocalName () << " send RECOVER Interest: " << *hash);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800364 }
365 else
366 {
367 // we already learned the hash; cheers!
368 }
369}
370
371void
372SyncCore::deregister(const Name &name)
373{
374 // Do nothing for now
375 // TODO: handle deregistering
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800376}
377
378Name
379SyncCore::constructSyncName(const HashPtr &hash)
380{
381 Bytes bytes;
Zhenkai Zhue851b952013-01-13 22:29:57 -0800382 readRaw(bytes, (const unsigned char*)hash->GetHash(), hash->GetHashBytes());
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800383 Name syncName = m_syncPrefix;
Zhenkai Zhue851b952013-01-13 22:29:57 -0800384 syncName.appendComp(bytes);
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800385 return syncName;
386}
387
388void
389SyncCore::msgToBytes(const SyncStateMsgPtr &msg, Bytes &bytes)
390{
Zhenkai Zhue851b952013-01-13 22:29:57 -0800391 int size = msg->ByteSize();
Zhenkai Zhu74dd53c2013-01-10 23:39:57 -0800392 bytes.resize(size);
Zhenkai Zhue851b952013-01-13 22:29:57 -0800393 msg->SerializeToArray(head(bytes), size);
Zhenkai Zhu8224bb62013-01-06 15:58:02 -0800394}
Zhenkai Zhu9501b8b2013-01-17 12:37:00 -0800395
396sqlite3_int64
397SyncCore::seq(const Name &name)
398{
Zhenkai Zhub330aed2013-01-17 13:29:37 -0800399 return m_log->SeqNo(name);
Zhenkai Zhu9501b8b2013-01-17 12:37:00 -0800400}