00001 // @file rs_optime.h 00002 00003 /* 00004 * Copyright (C) 2010 10gen Inc. 00005 * 00006 * This program is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU Affero General Public License, version 3, 00008 * as published by the Free Software Foundation. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU Affero General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Affero General Public License 00016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00017 */ 00018 00019 #pragma once 00020 00021 #include "../../util/optime.h" 00022 00023 namespace mongo { 00024 00025 const char rsoplog[] = "local.oplog.rs"; 00026 00027 /* 00028 class RSOpTime : public OpTime { 00029 public: 00030 bool initiated() const { return getSecs() != 0; } 00031 };*/ 00032 00033 /*struct RSOpTime { 00034 unsigned long long ord; 00035 00036 RSOpTime() : ord(0) { } 00037 00038 bool initiated() const { return ord > 0; } 00039 00040 void initiate() { 00041 assert( !initiated() ); 00042 ord = 1000000; 00043 } 00044 00045 ReplTime inc() { 00046 DEV assertInWriteLock(); 00047 return ++ord; 00048 } 00049 00050 string toString() const { return str::stream() << ord; } 00051 00052 // query the oplog and set the highest value herein. acquires a db read lock. throws. 00053 void load(); 00054 }; 00055 00056 extern RSOpTime rsOpTime;*/ 00057 00058 }