balancer_policy.h   balancer_policy.h 
skipping to change at line 188 skipping to change at line 188
/** @return all shards we know about */ /** @return all shards we know about */
const set<string>& shards() const { return _shards; } const set<string>& shards() const { return _shards; }
/** @return the ShardInfo for the shard */ /** @return the ShardInfo for the shard */
const ShardInfo& shardInfo( const string& shard ) const; const ShardInfo& shardInfo( const string& shard ) const;
/** writes all state to log() */ /** writes all state to log() */
void dump() const; void dump() const;
static void populateShardInfoMap(const std::vector<Shard> allShards static Status populateShardInfoMap(ShardInfoMap* shardInfo);
,
ShardInfoMap* shardInfo);
/** /**
* Note: jumbo and versions are not set. * Note: jumbo and versions are not set.
*/ */
static void populateShardToChunksMap(const std::vector<Shard>& allS hards, static void populateShardToChunksMap(const ShardInfoMap& allShards,
const ChunkManager& chunkMgr, const ChunkManager& chunkMgr,
ShardToChunksMap* shardToChunk sMap); ShardToChunksMap* shardToChunk sMap);
/** /**
* Returns the tag of the given chunk by querying the config server . * Returns the tag of the given chunk by querying the config server .
* *
* TODO: add a way to incrementally update chunk tags metadata so t his is not needed. * TODO: add a way to incrementally update chunk tags metadata so t his is not needed.
*/ */
static StatusWith<std::string> getTagForSingleChunk(const std::stri ng& configServer, static StatusWith<std::string> getTagForSingleChunk(const std::stri ng& configServer,
const std::stri ng& ns, const std::stri ng& ns,
 End of changes. 2 change blocks. 
4 lines changed or deleted 2 lines changed or added


 compiler.h   compiler.h 
// Copyright 2012 the V8 project authors. All rights reserved. /*
// Redistribution and use in source and binary forms, with or without * Copyright 2012 10gen Inc.
// modification, are permitted provided that the following conditions are *
// met: * Licensed under the Apache License, Version 2.0 (the "License");
// * you may not use this file except in compliance with the License.
// * Redistributions of source code must retain the above copyright * You may obtain a copy of the License at
// notice, this list of conditions and the following disclaimer. *
// * Redistributions in binary form must reproduce the above * http://www.apache.org/licenses/LICENSE-2.0
// copyright notice, this list of conditions and the following *
// disclaimer in the documentation and/or other materials provided * Unless required by applicable law or agreed to in writing, software
// with the distribution. * distributed under the License is distributed on an "AS IS" BASIS,
// * Neither the name of Google Inc. nor the names of its * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// contributors may be used to endorse or promote products derived * See the License for the specific language governing permissions and
// from this software without specific prior written permission. * limitations under the License.
// */
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #pragma once
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT /**
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * Include "mongo/platform/compiler.h" to get compiler-targeted macro defin
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT itions and utilities.
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * The following macros are provided in all compiler environments:
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * MONGO_COMPILER_NORETURN
*
#ifndef V8_COMPILER_H_ * Instructs the compiler that the decorated function will not return thr
#define V8_COMPILER_H_ ough the normal return
* path.
#include "allocation.h" *
#include "ast.h" * Correct: MONGO_COMPILER_NORETURN void myAbortFunction();
#include "zone.h" *
*
namespace v8 { * MONGO_COMPILER_VARIABLE_UNUSED
namespace internal { *
* Instructs the compiler not to warn if it detects no use of the decorat
class ScriptDataImpl; ed variable.
* Typically only useful for variables that are always declared but only
// CompilationInfo encapsulates some information known at compile time. It used in
// is constructed based on the resources available at compile-time. * conditionally-compiled code.
class CompilationInfo { *
public: * Correct: MONGO_COMPILER_VARIABLE_UNUSED int ignored;
CompilationInfo(Handle<Script> script, Zone* zone); *
CompilationInfo(Handle<SharedFunctionInfo> shared_info, Zone* zone); *
CompilationInfo(Handle<JSFunction> closure, Zone* zone); * MONGO_COMPILER_ALIGN_TYPE(ALIGNMENT)
*
virtual ~CompilationInfo(); * Instructs the compiler to use the given minimum alignment for the deco
rated type.
Isolate* isolate() { *
ASSERT(Isolate::Current() == isolate_); * Alignments should probably always be powers of two. Also, note that m
return isolate_; ost allocators will not
} * be able to guarantee better than 16- or 32-byte alignment.
Zone* zone() { *
return zone_; * Correct:
} * class MONGO_COMPILER_ALIGN_TYPE(16) MyClass {...};
bool is_lazy() const { return IsLazy::decode(flags_); } *
bool is_eval() const { return IsEval::decode(flags_); } * Incorrect:
bool is_global() const { return IsGlobal::decode(flags_); } * MONGO_COMPILER_ALIGN_TYPE(16) class MyClass {...};
bool is_classic_mode() const { return language_mode() == CLASSIC_MODE; } * class MyClass{...} MONGO_COMPILER_ALIGN_TYPE(16);
bool is_extended_mode() const { return language_mode() == EXTENDED_MODE; *
} *
LanguageMode language_mode() const { * MONGO_COMPILER_ALIGN_VARIABLE(ALIGNMENT)
return LanguageModeField::decode(flags_); *
} * Instructs the compiler to use the given minimum alignment for the deco
bool is_in_loop() const { return IsInLoop::decode(flags_); } rated variable.
FunctionLiteral* function() const { return function_; } *
Scope* scope() const { return scope_; } * Note that most allocators will not allow heap allocated alignments tha
Scope* global_scope() const { return global_scope_; } t are better than 16- or
Handle<Code> code() const { return code_; } * 32-byte aligned. Stack allocators may only guarantee up to the natura
Handle<JSFunction> closure() const { return closure_; } l word length worth of
Handle<SharedFunctionInfo> shared_info() const { return shared_info_; } * alignment.
Handle<Script> script() const { return script_; } *
v8::Extension* extension() const { return extension_; } * Correct:
ScriptDataImpl* pre_parse_data() const { return pre_parse_data_; } * class MyClass {
Handle<Context> calling_context() const { return calling_context_; } * MONGO_COMPILER_ALIGN_VARIABLE(8) char a;
int osr_ast_id() const { return osr_ast_id_; } * };
*
void MarkAsEval() { * MONGO_COMPILER_ALIGN_VARIABLE(8) class MyClass {...} singletonInstan
ASSERT(!is_lazy()); ce;
flags_ |= IsEval::encode(true); *
} * Incorrect:
void MarkAsGlobal() { * int MONGO_COMPILER_ALIGN_VARIABLE(16) a, b;
ASSERT(!is_lazy()); *
flags_ |= IsGlobal::encode(true); *
} * MONGO_COMPILER_API_EXPORT
void SetLanguageMode(LanguageMode language_mode) { *
ASSERT(this->language_mode() == CLASSIC_MODE || * Instructs the compiler to label the given type, variable or function a
this->language_mode() == language_mode || s part of the
language_mode == EXTENDED_MODE); * exported interface of the library object under construction.
flags_ = LanguageModeField::update(flags_, language_mode); *
} * Correct:
void MarkAsInLoop() { * MONGO_COMPILER_API_EXPORT int globalSwitch;
ASSERT(is_lazy()); * class MONGO_COMPILER_API_EXPORT ExportedType { ... };
flags_ |= IsInLoop::encode(true); * MONGO_COMPILER_API_EXPORT SomeType exportedFunction(...);
} *
void MarkAsNative() { * NOTE: Rather than using this macro directly, one typically declares an
flags_ |= IsNative::encode(true); other macro named for the
} * library, which is conditionally defined to either MONGO_COMIPLER_API_E
bool is_native() const { XPORT or
return IsNative::decode(flags_); * MONGO_COMPILER_API_IMPORT based on whether the compiler is currently b
} uilding the library or
void SetFunction(FunctionLiteral* literal) { * building an object that depends on the library, respectively. For exa
ASSERT(function_ == NULL); mple, MONGO_CLIENT_API
function_ = literal; * might be defined to MONGO_COMPILER_API_EXPORT when building the MongoD
} B shared library, and to
void SetScope(Scope* scope) { * MONGO_COMPILER_API_IMPORT when building an application that links agai
ASSERT(scope_ == NULL); nst the shared library.
scope_ = scope; *
} *
void SetGlobalScope(Scope* global_scope) { * MONGO_COMPILER_API_IMPORT
ASSERT(global_scope_ == NULL); *
global_scope_ = global_scope; * Instructs the compiler to label the given type, variable or function a
} s imported
void SetCode(Handle<Code> code) { code_ = code; } * from another library, and not part of the library object under constru
void SetExtension(v8::Extension* extension) { ction.
ASSERT(!is_lazy()); *
extension_ = extension; * Same correct/incorrect usage as for MONGO_COMPILER_API_EXPORT.
} *
void SetPreParseData(ScriptDataImpl* pre_parse_data) { *
ASSERT(!is_lazy()); * MONGO_COMPILER_API_CALLING_CONVENTION
pre_parse_data_ = pre_parse_data; *
} * Explicitly decorates a function declaration the api calling conventio
void SetCallingContext(Handle<Context> context) { n used for
ASSERT(is_eval()); * shared libraries.
calling_context_ = context; *
} * Same correct/incorrect usage as for MONGO_COMPILER_API_EXPORT.
void SetOsrAstId(int osr_ast_id) { */
ASSERT(IsOptimizing());
osr_ast_id_ = osr_ast_id; #if defined(_MSC_VER)
} #include "mongo/platform/compiler_msvc.h"
void MarkCompilingForDebugging(Handle<Code> current_code) { #elif defined(__GNUC__)
ASSERT(mode_ != OPTIMIZE); #include "mongo/platform/compiler_gcc.h"
ASSERT(current_code->kind() == Code::FUNCTION); #else
flags_ |= IsCompilingForDebugging::encode(true); #error "Unsupported compiler family"
if (current_code->is_compiled_optimizable()) {
EnableDeoptimizationSupport();
} else {
mode_ = CompilationInfo::NONOPT;
}
}
bool IsCompilingForDebugging() {
return IsCompilingForDebugging::decode(flags_);
}
bool has_global_object() const {
return !closure().is_null() && (closure()->context()->global() != NULL)
;
}
GlobalObject* global_object() const {
return has_global_object() ? closure()->context()->global() : NULL;
}
// Accessors for the different compilation modes.
bool IsOptimizing() const { return mode_ == OPTIMIZE; }
bool IsOptimizable() const { return mode_ == BASE; }
void SetOptimizing(int osr_ast_id) {
SetMode(OPTIMIZE);
osr_ast_id_ = osr_ast_id;
}
void DisableOptimization();
// Deoptimization support.
bool HasDeoptimizationSupport() const {
return SupportsDeoptimization::decode(flags_);
}
void EnableDeoptimizationSupport() {
ASSERT(IsOptimizable());
flags_ |= SupportsDeoptimization::encode(true);
}
// Determines whether or not to insert a self-optimization header.
bool ShouldSelfOptimize();
// Disable all optimization attempts of this info for the rest of the
// current compilation pipeline.
void AbortOptimization();
void set_deferred_handles(DeferredHandles* deferred_handles) {
ASSERT(deferred_handles_ == NULL);
deferred_handles_ = deferred_handles;
}
void SaveHandles() {
SaveHandle(&closure_);
SaveHandle(&shared_info_);
SaveHandle(&calling_context_);
SaveHandle(&script_);
}
private:
Isolate* isolate_;
// Compilation mode.
// BASE is generated by the full codegen, optionally prepared for bailout
s.
// OPTIMIZE is optimized code generated by the Hydrogen-based backend.
// NONOPT is generated by the full codegen and is not prepared for
// recompilation/bailouts. These functions are never recompiled.
enum Mode {
BASE,
OPTIMIZE,
NONOPT
};
void Initialize(Mode mode) {
mode_ = V8::UseCrankshaft() ? mode : NONOPT;
ASSERT(!script_.is_null());
if (script_->type()->value() == Script::TYPE_NATIVE) {
MarkAsNative();
}
if (!shared_info_.is_null()) {
ASSERT(language_mode() == CLASSIC_MODE);
SetLanguageMode(shared_info_->language_mode());
}
}
void SetMode(Mode mode) {
ASSERT(V8::UseCrankshaft());
mode_ = mode;
}
// Flags using template class BitField<type, start, length>. All are
// false by default.
//
// Compilation is either eager or lazy.
class IsLazy: public BitField<bool, 0, 1> {};
// Flags that can be set for eager compilation.
class IsEval: public BitField<bool, 1, 1> {};
class IsGlobal: public BitField<bool, 2, 1> {};
// Flags that can be set for lazy compilation.
class IsInLoop: public BitField<bool, 3, 1> {};
// Strict mode - used in eager compilation.
class LanguageModeField: public BitField<LanguageMode, 4, 2> {};
// Is this a function from our natives.
class IsNative: public BitField<bool, 6, 1> {};
// Is this code being compiled with support for deoptimization..
class SupportsDeoptimization: public BitField<bool, 7, 1> {};
// If compiling for debugging produce just full code matching the
// initial mode setting.
class IsCompilingForDebugging: public BitField<bool, 8, 1> {};
unsigned flags_;
// Fields filled in by the compilation pipeline.
// AST filled in by the parser.
FunctionLiteral* function_;
// The scope of the function literal as a convenience. Set to indicate
// that scopes have been analyzed.
Scope* scope_;
// The global scope provided as a convenience.
Scope* global_scope_;
// The compiled code.
Handle<Code> code_;
// Possible initial inputs to the compilation process.
Handle<JSFunction> closure_;
Handle<SharedFunctionInfo> shared_info_;
Handle<Script> script_;
// Fields possibly needed for eager compilation, NULL by default.
v8::Extension* extension_;
ScriptDataImpl* pre_parse_data_;
// The context of the caller is needed for eval code, and will be a null
// handle otherwise.
Handle<Context> calling_context_;
// Compilation mode flag and whether deoptimization is allowed.
Mode mode_;
int osr_ast_id_;
// The zone from which the compilation pipeline working on this
// CompilationInfo allocates.
Zone* zone_;
DeferredHandles* deferred_handles_;
template<typename T>
void SaveHandle(Handle<T> *object) {
if (!object->is_null()) {
Handle<T> handle(*(*object));
*object = handle;
}
}
DISALLOW_COPY_AND_ASSIGN(CompilationInfo);
};
// Exactly like a CompilationInfo, except also creates and enters a
// Zone on construction and deallocates it on exit.
class CompilationInfoWithZone: public CompilationInfo {
public:
explicit CompilationInfoWithZone(Handle<Script> script)
: CompilationInfo(script, &zone_),
zone_(script->GetIsolate()),
zone_scope_(&zone_, DELETE_ON_EXIT) {}
explicit CompilationInfoWithZone(Handle<SharedFunctionInfo> shared_info)
: CompilationInfo(shared_info, &zone_),
zone_(shared_info->GetIsolate()),
zone_scope_(&zone_, DELETE_ON_EXIT) {}
explicit CompilationInfoWithZone(Handle<JSFunction> closure)
: CompilationInfo(closure, &zone_),
zone_(closure->GetIsolate()),
zone_scope_(&zone_, DELETE_ON_EXIT) {}
private:
Zone zone_;
ZoneScope zone_scope_;
};
// A wrapper around a CompilationInfo that detaches the Handles from
// the underlying DeferredHandleScope and stores them in info_ on
// destruction.
class CompilationHandleScope BASE_EMBEDDED {
public:
explicit CompilationHandleScope(CompilationInfo* info)
: deferred_(info->isolate()), info_(info) {}
~CompilationHandleScope() {
info_->set_deferred_handles(deferred_.Detach());
}
private:
DeferredHandleScope deferred_;
CompilationInfo* info_;
};
class HGraph;
class HGraphBuilder;
class LChunk;
// A helper class that calls the three compilation phases in
// Crankshaft and keeps track of its state. The three phases
// CreateGraph, OptimizeGraph and GenerateAndInstallCode can either
// fail, bail-out to the full code generator or succeed. Apart from
// their return value, the status of the phase last run can be checked
// using last_status().
class OptimizingCompiler: public ZoneObject {
public:
explicit OptimizingCompiler(CompilationInfo* info)
: info_(info),
oracle_(NULL),
graph_builder_(NULL),
graph_(NULL),
chunk_(NULL),
time_taken_to_create_graph_(0),
time_taken_to_optimize_(0),
time_taken_to_codegen_(0),
last_status_(FAILED) { }
enum Status {
FAILED, BAILED_OUT, SUCCEEDED
};
MUST_USE_RESULT Status CreateGraph();
MUST_USE_RESULT Status OptimizeGraph();
MUST_USE_RESULT Status GenerateAndInstallCode();
Status last_status() const { return last_status_; }
CompilationInfo* info() const { return info_; }
MUST_USE_RESULT Status AbortOptimization() {
info_->AbortOptimization();
info_->shared_info()->DisableOptimization();
return SetLastStatus(BAILED_OUT);
}
private:
CompilationInfo* info_;
TypeFeedbackOracle* oracle_;
HGraphBuilder* graph_builder_;
HGraph* graph_;
LChunk* chunk_;
int64_t time_taken_to_create_graph_;
int64_t time_taken_to_optimize_;
int64_t time_taken_to_codegen_;
Status last_status_;
MUST_USE_RESULT Status SetLastStatus(Status status) {
last_status_ = status;
return last_status_;
}
void RecordOptimizationStats();
struct Timer {
Timer(OptimizingCompiler* compiler, int64_t* location)
: compiler_(compiler),
start_(OS::Ticks()),
location_(location) { }
~Timer() {
*location_ += (OS::Ticks() - start_);
}
OptimizingCompiler* compiler_;
int64_t start_;
int64_t* location_;
};
};
// The V8 compiler
//
// General strategy: Source code is translated into an anonymous function w
/o
// parameters which then can be executed. If the source code contains other
// functions, they will be compiled and allocated as part of the compilatio
n
// of the source code.
// Please note this interface returns shared function infos. This means yo
u
// need to call Factory::NewFunctionFromSharedFunctionInfo before you have
a
// real function with a context.
class Compiler : public AllStatic {
public:
// Default maximum number of function optimization attempts before we
// give up.
static const int kDefaultMaxOptCount = 10;
static const int kMaxInliningLevels = 3;
// Call count before primitive functions trigger their own optimization.
static const int kCallsUntilPrimitiveOpt = 200;
// All routines return a SharedFunctionInfo.
// If an error occurs an exception is raised and the return handle
// contains NULL.
// Compile a String source within a context.
static Handle<SharedFunctionInfo> Compile(Handle<String> source,
Handle<Object> script_name,
int line_offset,
int column_offset,
v8::Extension* extension,
ScriptDataImpl* pre_data,
Handle<Object> script_data,
NativesFlag is_natives_code);
// Compile a String source within a context for Eval.
static Handle<SharedFunctionInfo> CompileEval(Handle<String> source,
Handle<Context> context,
bool is_global,
LanguageMode language_mode,
int scope_position);
// Compile from function info (used for lazy compilation). Returns true o
n
// success and false if the compilation resulted in a stack overflow.
static bool CompileLazy(CompilationInfo* info);
static void RecompileParallel(Handle<JSFunction> function);
// Compile a shared function info object (the function is possibly lazily
// compiled).
static Handle<SharedFunctionInfo> BuildFunctionInfo(FunctionLiteral* node
,
Handle<Script> script
);
// Set the function info for a newly compiled function.
static void SetFunctionInfo(Handle<SharedFunctionInfo> function_info,
FunctionLiteral* lit,
bool is_toplevel,
Handle<Script> script);
static void InstallOptimizedCode(OptimizingCompiler* info);
#ifdef ENABLE_DEBUGGER_SUPPORT
static bool MakeCodeForLiveEdit(CompilationInfo* info);
#endif #endif
static void RecordFunctionCompilation(Logger::LogEventsAndTags tag,
CompilationInfo* info,
Handle<SharedFunctionInfo> shared);
};
} } // namespace v8::internal
#endif // V8_COMPILER_H_
 End of changes. 2 change blocks. 
472 lines changed or deleted 135 lines changed or added


 dbclient_rs.h   dbclient_rs.h 
skipping to change at line 136 skipping to change at line 136
*/ */
void isntSecondary(); void isntSecondary();
// ----- status ------ // ----- status ------
virtual bool isFailed() const { return ! _master || _master->isFail ed(); } virtual bool isFailed() const { return ! _master || _master->isFail ed(); }
bool isStillConnected(); bool isStillConnected();
// ----- informational ---- // ----- informational ----
/**
* Gets the replica set name of the set we are connected to.
*/
const std::string& getSetName() const { return _setName; }
/**
* Returns the HostAndPort of the server this connection believes b
elongs to the primary,
* or returns an empty HostAndPort if it doesn't know about a curre
nt primary.
*/
HostAndPort getSuspectedPrimaryHostAndPort() const;
double getSoTimeout() const { return _so_timeout; } double getSoTimeout() const { return _so_timeout; }
string toString() const { return getServerAddress(); } string toString() const { return getServerAddress(); }
string getServerAddress() const; string getServerAddress() const;
virtual ConnectionString::ConnectionType type() const { return Conn ectionString::SET; } virtual ConnectionString::ConnectionType type() const { return Conn ectionString::SET; }
virtual bool lazySupported() const { return true; } virtual bool lazySupported() const { return true; }
// ---- low level ------ // ---- low level ------
 End of changes. 1 change blocks. 
0 lines changed or deleted 13 lines changed or added


 dbclientinterface.h   dbclientinterface.h 
skipping to change at line 1305 skipping to change at line 1305
string toString() const { string toString() const {
stringstream ss; stringstream ss;
ss << _serverString; ss << _serverString;
if ( !_serverAddrString.empty() ) ss << " (" << _serverAddrStri ng << ")"; if ( !_serverAddrString.empty() ) ss << " (" << _serverAddrStri ng << ")";
if ( _failed ) ss << " failed"; if ( _failed ) ss << " failed";
return ss.str(); return ss.str();
} }
string getServerAddress() const { return _serverString; } string getServerAddress() const { return _serverString; }
const HostAndPort& getServerHostAndPort() const { return _server; }
virtual void killCursor( long long cursorID ); virtual void killCursor( long long cursorID );
virtual bool callRead( Message& toSend , Message& response ) { retu rn call( toSend , response ); } virtual bool callRead( Message& toSend , Message& response ) { retu rn call( toSend , response ); }
virtual void say( Message &toSend, bool isRetry = false , string * actualServer = 0 ); virtual void say( Message &toSend, bool isRetry = false , string * actualServer = 0 );
virtual bool recv( Message& m ); virtual bool recv( Message& m );
virtual void checkResponse( const char *data, int nReturned, bool* retry = NULL, string* host = NULL ); virtual void checkResponse( const char *data, int nReturned, bool* retry = NULL, string* host = NULL );
virtual bool call( Message &toSend, Message &response, bool assertO k = true , string * actualServer = 0 ); virtual bool call( Message &toSend, Message &response, bool assertO k = true , string * actualServer = 0 );
virtual ConnectionString::ConnectionType type() const { return Conn ectionString::MASTER; } virtual ConnectionString::ConnectionType type() const { return Conn ectionString::MASTER; }
void setSoTimeout(double timeout); void setSoTimeout(double timeout);
double getSoTimeout() const { return _so_timeout; } double getSoTimeout() const { return _so_timeout; }
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 parallel.h   parallel.h 
skipping to change at line 195 skipping to change at line 195
string type() const { return "ParallelSort"; } string type() const { return "ParallelSort"; }
void fullInit(); void fullInit();
void startInit(); void startInit();
void finishInit(); void finishInit();
bool isCommand(){ return NamespaceString( _qSpec.ns() ).isCommand() ; } bool isCommand(){ return NamespaceString( _qSpec.ns() ).isCommand() ; }
bool isExplain(){ return _qSpec.isExplain(); } bool isExplain(){ return _qSpec.isExplain(); }
bool isVersioned(){ return _qShards.size() == 0; } bool isVersioned(){ return _qShards.size() == 0; }
/**
* Sets the batch size on all underlying cursors to 'newBatchSize'.
*/
void setBatchSize(int newBatchSize);
bool isSharded(); bool isSharded();
ShardPtr getPrimary(); ShardPtr getPrimary();
void getQueryShards( set<Shard>& shards ); void getQueryShards( set<Shard>& shards );
ChunkManagerPtr getChunkManager( const Shard& shard ); ChunkManagerPtr getChunkManager( const Shard& shard );
DBClientCursorPtr getShardCursor( const Shard& shard ); DBClientCursorPtr getShardCursor( const Shard& shard );
BSONObj toBSON() const; BSONObj toBSON() const;
string toString() const; string toString() const;
void explain(BSONObjBuilder& b); void explain(BSONObjBuilder& b);
skipping to change at line 275 skipping to change at line 280
~FilteringClientCursor(); ~FilteringClientCursor();
void reset( auto_ptr<DBClientCursor> cursor ); void reset( auto_ptr<DBClientCursor> cursor );
void reset( DBClientCursor* cursor, ParallelConnectionMetadata* _pc mData = NULL ); void reset( DBClientCursor* cursor, ParallelConnectionMetadata* _pc mData = NULL );
bool more(); bool more();
BSONObj next(); BSONObj next();
BSONObj peek(); BSONObj peek();
void setBatchSize(int newBatchSize) { _cursor->setBatchSize(newBatc
hSize); }
DBClientCursor* raw() { return _cursor.get(); } DBClientCursor* raw() { return _cursor.get(); }
ParallelConnectionMetadata* rawMData(){ return _pcmData; } ParallelConnectionMetadata* rawMData(){ return _pcmData; }
// Required for new PCursor // Required for new PCursor
void release(){ void release(){
_cursor.release(); _cursor.release();
_pcmData = NULL; _pcmData = NULL;
} }
private: private:
 End of changes. 2 change blocks. 
0 lines changed or deleted 8 lines changed or added


 shard.h   shard.h 
skipping to change at line 63 skipping to change at line 63
: _name(name) , _addr( addr ) , _maxSize( maxSize ) , _isDraini ng( isDraining ) { : _name(name) , _addr( addr ) , _maxSize( maxSize ) , _isDraini ng( isDraining ) {
_setAddr( addr ); _setAddr( addr );
} }
Shard( const string& ident ) { Shard( const string& ident ) {
reset( ident ); reset( ident );
} }
Shard( const Shard& other ) Shard( const Shard& other )
: _name( other._name ) , _addr( other._addr ) , _cs( other._cs ) , : _name( other._name ) , _addr( other._addr ) , _cs( other._cs ) ,
_maxSize( other._maxSize ) , _isDraining( other._isDraining ) _maxSize( other._maxSize ) , _isDraining( other._isDraining )
, {
_tags( other._tags ) {
} }
Shard( const Shard* other ) Shard( const Shard* other )
: _name( other->_name ) , _addr( other->_addr ), _cs( other->_c s ) , : _name( other->_name ) , _addr( other->_addr ), _cs( other->_c s ) ,
_maxSize( other->_maxSize ) , _isDraining( other->_isDraining ) { _maxSize( other->_maxSize ) , _isDraining( other->_isDraining ) {
} }
static Shard make( const string& ident ) { static Shard make( const string& ident ) {
Shard s; Shard s;
s.reset( ident ); s.reset( ident );
skipping to change at line 154 skipping to change at line 153
ShardStatus getStatus() const ; ShardStatus getStatus() const ;
/** /**
* mostly for replica set * mostly for replica set
* retursn true if node is the shard * retursn true if node is the shard
* of if the replica set contains node * of if the replica set contains node
*/ */
bool containsNode( const string& node ) const; bool containsNode( const string& node ) const;
const set<string>& tags() const { return _tags; }
void addTag( const string& tag ) { _tags.insert( tag ); }
static void getAllShards( vector<Shard>& all ); static void getAllShards( vector<Shard>& all );
static void printShardInfo( ostream& out ); static void printShardInfo( ostream& out );
static Shard lookupRSName( const string& name); static Shard lookupRSName( const string& name);
/** /**
* @parm current - shard where the chunk/database currently lives i n * @parm current - shard where the chunk/database currently lives i n
* @return the currently emptiest shard, if best then current, or E MPTY * @return the currently emptiest shard, if best then current, or E MPTY
*/ */
static Shard pick( const Shard& current = EMPTY ); static Shard pick( const Shard& current = EMPTY );
skipping to change at line 184 skipping to change at line 180
private: private:
void _setAddr( const string& addr ); void _setAddr( const string& addr );
string _name; string _name;
string _addr; string _addr;
ConnectionString _cs; ConnectionString _cs;
long long _maxSize; // in MBytes, 0 is unlimited long long _maxSize; // in MBytes, 0 is unlimited
bool _isDraining; // shard is currently being removed bool _isDraining; // shard is currently being removed
set<string> _tags;
}; };
typedef shared_ptr<Shard> ShardPtr; typedef shared_ptr<Shard> ShardPtr;
class ShardStatus { class ShardStatus {
public: public:
ShardStatus( const Shard& shard , const BSONObj& obj ); ShardStatus( const Shard& shard , const BSONObj& obj );
friend ostream& operator << (ostream& out, const ShardStatus& s) { friend ostream& operator << (ostream& out, const ShardStatus& s) {
out << s.toString(); out << s.toString();
 End of changes. 3 change blocks. 
7 lines changed or deleted 2 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/