Files
mongo/client/clientOnly.cpp

93 lines
2.1 KiB
C++
Raw Normal View History

// clientOnly.cpp
/* Copyright 2009 10gen Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
2010-04-27 15:33:27 -04:00
#include "pch.h"
2009-12-03 17:48:18 -05:00
#include "../client/dbclient.h"
#include "../db/cmdline.h"
2011-09-18 01:04:44 -04:00
#include "../db/client_common.h"
2010-08-03 21:56:51 -04:00
#include "../s/shard.h"
2011-10-02 14:04:31 -04:00
#include "../util/timer.h"
namespace mongo {
CmdLine cmdLine;
const char * curNs = "in client mode";
bool dbexitCalled = false;
2011-10-28 09:43:41 -04:00
string dynHostMyName() { return ""; }
void dynHostResolve(string& name, int& port) {
assert(false);
}
2011-04-05 02:37:18 -04:00
void exitCleanly( ExitCode code ) {
dbexit( code );
}
void dbexit( ExitCode returnCode, const char *whyMsg , bool tryToGetLock ) {
dbexitCalled = true;
out() << "dbexit called" << endl;
if ( whyMsg )
out() << " b/c " << whyMsg << endl;
out() << "exiting" << endl;
2009-01-25 16:25:36 -05:00
::exit( returnCode );
}
2011-01-04 00:40:41 -05:00
bool inShutdown() {
return dbexitCalled;
}
2011-01-04 00:40:41 -05:00
void setupSignals() {
// maybe should do SIGPIPE here, not sure
}
string getDbContext() {
return "in client only mode";
}
2011-01-04 00:40:41 -05:00
bool haveLocalShardingInfo( const string& ns ) {
return false;
}
2010-02-17 11:02:36 -05:00
2011-01-04 00:40:41 -05:00
DBClientBase * createDirectClient() {
2010-02-17 11:02:36 -05:00
uassert( 10256 , "no createDirectClient in clientOnly" , 0 );
return 0;
}
2010-08-03 21:56:51 -04:00
2011-01-04 00:40:41 -05:00
void Shard::getAllShards( vector<Shard>& all ) {
2010-08-03 21:56:51 -04:00
assert(0);
}
2011-02-12 14:54:07 -05:00
bool Shard::isAShardNode( const string& ident ) {
2010-08-03 21:56:51 -04:00
assert(0);
return false;
2009-12-03 17:48:18 -05:00
}
2010-08-03 21:56:51 -04:00
string prettyHostName() {
assert(0);
return "";
}
2010-08-03 21:56:51 -04:00
2011-09-18 01:04:44 -04:00
ClientBasic* ClientBasic::getCurrent() {
return 0;
}
}