mirror of https://github.com/mongodb/mongo
SERVER-87974 Enable modernize-use-override and apply fixes (#20075)
GitOrigin-RevId: c69dc68af83faf399b2e82454ce27d95379c094c
This commit is contained in:
parent
dbd98ffd19
commit
2ac7a199fd
|
|
@ -36,6 +36,7 @@ Checks: '-*,
|
|||
modernize-replace-random-shuffle,
|
||||
modernize-shrink-to-fit,
|
||||
modernize-unary-static-assert,
|
||||
modernize-use-override,
|
||||
mongo-assert-check,
|
||||
mongo-cctype-check,
|
||||
mongo-config-header-check,
|
||||
|
|
|
|||
|
|
@ -922,7 +922,7 @@ private:
|
|||
const std::string root;
|
||||
int generation = 0;
|
||||
|
||||
GeneratorImplementation* clone_impl() const {
|
||||
GeneratorImplementation* clone_impl() const override {
|
||||
return new GeneratorImplementation{*this};
|
||||
}
|
||||
|
||||
|
|
@ -940,7 +940,7 @@ class StorageImplementation : public Interface {
|
|||
private:
|
||||
std::string store;
|
||||
|
||||
StorageImplementation* clone_impl() const {
|
||||
StorageImplementation* clone_impl() const override {
|
||||
return new StorageImplementation{*this};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ TEST_F(DocumentTest, FindInEmptyObject) {
|
|||
}
|
||||
|
||||
class OneChildTest : public DocumentTest {
|
||||
virtual void setUp() {
|
||||
void setUp() override {
|
||||
ASSERT_EQUALS(Status::OK(), doc().root().appendBool("t", true));
|
||||
}
|
||||
};
|
||||
|
|
@ -96,7 +96,7 @@ TEST_F(OneChildTest, FindMatch) {
|
|||
}
|
||||
|
||||
class ManyChildrenTest : public DocumentTest {
|
||||
virtual void setUp() {
|
||||
void setUp() override {
|
||||
ASSERT_EQUALS(Status::OK(), doc().root().appendString("begin", "a"));
|
||||
ASSERT_EQUALS(Status::OK(), doc().root().appendString("repeated_sparse", "b"));
|
||||
ASSERT_EQUALS(Status::OK(), doc().root().appendString("repeated_dense", "c"));
|
||||
|
|
@ -237,7 +237,7 @@ TEST_F(ManyChildrenTest, getNthSibling) {
|
|||
}
|
||||
|
||||
class CountTest : public DocumentTest {
|
||||
virtual void setUp() {
|
||||
void setUp() override {
|
||||
Element root = doc().root();
|
||||
|
||||
ASSERT_OK(root.appendInt("leaf", 0));
|
||||
|
|
|
|||
|
|
@ -59,12 +59,12 @@ public:
|
|||
std::shared_ptr<RemoteCommandTargeter> targeter)
|
||||
: _readPref(readPref), _targeter(targeter) {}
|
||||
|
||||
SemiFuture<std::vector<HostAndPort>> resolve(CancellationToken t) override final {
|
||||
SemiFuture<std::vector<HostAndPort>> resolve(CancellationToken t) final {
|
||||
return _targeter->findHosts(_readPref, t);
|
||||
}
|
||||
|
||||
SemiFuture<void> onRemoteCommandError(HostAndPort remoteHost,
|
||||
Status remoteCommandStatus) override final {
|
||||
Status remoteCommandStatus) final {
|
||||
_targeter->updateHostWithStatus(remoteHost, remoteCommandStatus);
|
||||
return SemiFuture<void>::makeReady();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public:
|
|||
const std::vector<HostAndPort> kHosts{HostAndPort("FakeHost1", 12345),
|
||||
HostAndPort("FakeHost2", 12345)};
|
||||
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
auto factory = RemoteCommandTargeterFactoryMock();
|
||||
_targeter = factory.create(ConnectionString::forStandalones(kHosts));
|
||||
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ Future<void> authX509(RunCommandHook runCommand, const BSONObj& params, StringDa
|
|||
|
||||
class DefaultInternalAuthParametersProvider : public InternalAuthParametersProvider {
|
||||
public:
|
||||
~DefaultInternalAuthParametersProvider() = default;
|
||||
~DefaultInternalAuthParametersProvider() override = default;
|
||||
|
||||
BSONObj get(size_t index, StringData mechanism) final {
|
||||
return getInternalAuthParams(index, mechanism);
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ public:
|
|||
class DBConnectionPool : public PeriodicTask {
|
||||
public:
|
||||
DBConnectionPool();
|
||||
~DBConnectionPool();
|
||||
~DBConnectionPool() override;
|
||||
|
||||
/** right now just controls some asserts. defaults to "dbconnectionpool" */
|
||||
void setName(const std::string& name) {
|
||||
|
|
@ -404,10 +404,10 @@ public:
|
|||
bool operator()(const std::string& a, const std::string& b) const;
|
||||
};
|
||||
|
||||
virtual std::string taskName() const {
|
||||
std::string taskName() const override {
|
||||
return "DBConnectionPool-cleaner";
|
||||
}
|
||||
virtual void taskDoWork();
|
||||
void taskDoWork() override;
|
||||
|
||||
/**
|
||||
* Shuts down the connection pool, unblocking any waiters on connections.
|
||||
|
|
@ -512,7 +512,7 @@ public:
|
|||
_setSocketTimeout();
|
||||
}
|
||||
|
||||
~ScopedDbConnection();
|
||||
~ScopedDbConnection() override;
|
||||
|
||||
static void clearPool();
|
||||
|
||||
|
|
@ -529,16 +529,16 @@ public:
|
|||
}
|
||||
|
||||
/** get the associated connection object */
|
||||
DBClientBase* get() {
|
||||
DBClientBase* get() override {
|
||||
uassert(13102, "connection was returned to the pool already", _conn);
|
||||
return _conn;
|
||||
}
|
||||
|
||||
bool ok() const {
|
||||
bool ok() const override {
|
||||
return _conn != nullptr;
|
||||
}
|
||||
|
||||
std::string getHost() const {
|
||||
std::string getHost() const override {
|
||||
return _host;
|
||||
}
|
||||
|
||||
|
|
@ -553,7 +553,7 @@ public:
|
|||
we can't be sure we fully read all expected data of a reply on the socket. so
|
||||
we don't try to reuse the connection in that situation.
|
||||
*/
|
||||
void done();
|
||||
void done() override;
|
||||
|
||||
private:
|
||||
void _setSocketTimeout();
|
||||
|
|
|
|||
|
|
@ -44,12 +44,12 @@ class CyrusSaslClientSession : public SaslClientSession {
|
|||
|
||||
public:
|
||||
CyrusSaslClientSession();
|
||||
~CyrusSaslClientSession();
|
||||
~CyrusSaslClientSession() override;
|
||||
|
||||
/**
|
||||
* Overriding to store the password data in sasl_secret_t format
|
||||
*/
|
||||
virtual void setParameter(Parameter id, StringData value);
|
||||
void setParameter(Parameter id, StringData value) override;
|
||||
|
||||
/**
|
||||
* Returns the value of the parameterPassword parameter in the form of a sasl_secret_t, used
|
||||
|
|
@ -59,9 +59,9 @@ public:
|
|||
*/
|
||||
sasl_secret_t* getPasswordAsSecret();
|
||||
|
||||
virtual Status initialize();
|
||||
Status initialize() override;
|
||||
|
||||
virtual Status step(StringData inputData, std::string* outputData);
|
||||
Status step(StringData inputData, std::string* outputData) override;
|
||||
|
||||
bool isSuccess() const override {
|
||||
return _success;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ public:
|
|||
const HandshakeValidationHook& hook = HandshakeValidationHook(),
|
||||
const ClientAPIVersionParameters* apiParameters = nullptr);
|
||||
|
||||
virtual ~DBClientConnection() {
|
||||
~DBClientConnection() override {
|
||||
_numConnections.fetchAndAdd(-1);
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ public:
|
|||
|
||||
bool isUsingTransientSSLParams() const override;
|
||||
|
||||
bool isTLS();
|
||||
bool isTLS() override;
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public:
|
|||
bool provideResumeToken = false,
|
||||
unsigned long batchSize = 0);
|
||||
|
||||
virtual ~DBClientMockCursor() {}
|
||||
~DBClientMockCursor() override {}
|
||||
|
||||
bool more() override;
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
auto serviceContext = ServiceContext::make();
|
||||
setGlobalServiceContext(std::move(serviceContext));
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ private:
|
|||
*/
|
||||
class BasicRS : public DBClientRSTest {
|
||||
protected:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
DBClientRSTest::setUp();
|
||||
ReplicaSetMonitor::cleanup();
|
||||
|
||||
|
|
@ -127,7 +127,7 @@ protected:
|
|||
ConnectionString::setConnectionHook(mongo::MockConnRegistry::get()->getConnStrHook());
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
_replSet.reset();
|
||||
|
||||
mongo::ScopedDbConnection::clearPool();
|
||||
|
|
@ -238,7 +238,7 @@ TEST_F(BasicRS, CommandSecondaryPreferred) {
|
|||
*/
|
||||
class AllNodesDown : public DBClientRSTest {
|
||||
protected:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
DBClientRSTest::setUp();
|
||||
ReplicaSetMonitor::cleanup();
|
||||
|
||||
|
|
@ -255,7 +255,7 @@ protected:
|
|||
getTopologyManager()->setTopologyDescription(_replSet->getTopologyDescription(clock()));
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
ReplicaSetMonitor::cleanup();
|
||||
_replSet.reset();
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ TEST_F(AllNodesDown, CommandNearest) {
|
|||
*/
|
||||
class PrimaryDown : public DBClientRSTest {
|
||||
protected:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
DBClientRSTest::setUp();
|
||||
ReplicaSetMonitor::cleanup();
|
||||
|
||||
|
|
@ -370,7 +370,7 @@ protected:
|
|||
getTopologyManager()->setTopologyDescription(_replSet->getTopologyDescription(clock()));
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
ReplicaSetMonitor::cleanup();
|
||||
_replSet.reset();
|
||||
|
||||
|
|
@ -466,7 +466,7 @@ TEST_F(PrimaryDown, Nearest) {
|
|||
*/
|
||||
class SecondaryDown : public DBClientRSTest {
|
||||
protected:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
DBClientRSTest::setUp();
|
||||
ReplicaSetMonitor::cleanup();
|
||||
|
||||
|
|
@ -479,7 +479,7 @@ protected:
|
|||
getTopologyManager()->setTopologyDescription(_replSet->getTopologyDescription(clock()));
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
ReplicaSetMonitor::cleanup();
|
||||
_replSet.reset();
|
||||
|
||||
|
|
@ -576,7 +576,7 @@ TEST_F(SecondaryDown, CommandNearest) {
|
|||
*/
|
||||
class TaggedFiveMemberRS : public DBClientRSTest {
|
||||
protected:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
DBClientRSTest::setUp();
|
||||
|
||||
// This shuts down the background RSMWatcher thread and prevents it from running. These
|
||||
|
|
@ -681,7 +681,7 @@ protected:
|
|||
getTopologyManager()->setTopologyDescription(_replSet->getTopologyDescription(clock()));
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
ConnectionString::setConnectionHook(_originalConnectionHook);
|
||||
ReplicaSetMonitor::cleanup();
|
||||
_replSet.reset();
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ public:
|
|||
const HandshakeValidationHook& hook,
|
||||
const ClientAPIVersionParameters* apiParameters);
|
||||
|
||||
virtual ~DBClientSession() {}
|
||||
~DBClientSession() override {}
|
||||
|
||||
/**
|
||||
* Connect to a Mongo database server.
|
||||
|
|
@ -164,11 +164,11 @@ public:
|
|||
_maxWireVersion = maxWireVersion;
|
||||
}
|
||||
|
||||
virtual int getMinWireVersion() {
|
||||
int getMinWireVersion() override {
|
||||
return _minWireVersion;
|
||||
}
|
||||
|
||||
virtual int getMaxWireVersion() {
|
||||
int getMaxWireVersion() override {
|
||||
return _maxWireVersion;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,11 +49,11 @@ class NativeSaslClientSession : public SaslClientSession {
|
|||
|
||||
public:
|
||||
NativeSaslClientSession();
|
||||
~NativeSaslClientSession();
|
||||
~NativeSaslClientSession() override;
|
||||
|
||||
virtual Status initialize();
|
||||
Status initialize() override;
|
||||
|
||||
virtual Status step(StringData inputData, std::string* outputData);
|
||||
Status step(StringData inputData, std::string* outputData) override;
|
||||
|
||||
bool isSuccess() const override {
|
||||
return _success;
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class TaskExecutorWithFailureInScheduleRemoteCommand : public unittest::TaskExec
|
|||
public:
|
||||
TaskExecutorWithFailureInScheduleRemoteCommand(executor::TaskExecutor* executor)
|
||||
: unittest::TaskExecutorProxy(executor) {}
|
||||
virtual StatusWith<executor::TaskExecutor::CallbackHandle> scheduleRemoteCommandOnAny(
|
||||
StatusWith<executor::TaskExecutor::CallbackHandle> scheduleRemoteCommandOnAny(
|
||||
const executor::RemoteCommandRequestOnAny& request,
|
||||
const RemoteCommandOnAnyCallbackFn& cb,
|
||||
const BatonHandle& baton = nullptr) override {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace mongo {
|
|||
class RemoteCommandTargeterFactoryImpl final : public RemoteCommandTargeterFactory {
|
||||
public:
|
||||
RemoteCommandTargeterFactoryImpl();
|
||||
~RemoteCommandTargeterFactoryImpl();
|
||||
~RemoteCommandTargeterFactoryImpl() override;
|
||||
|
||||
std::unique_ptr<RemoteCommandTargeter> create(const ConnectionString& connStr) override;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace mongo {
|
|||
class RemoteCommandTargeterFactoryMock final : public RemoteCommandTargeterFactory {
|
||||
public:
|
||||
RemoteCommandTargeterFactoryMock();
|
||||
~RemoteCommandTargeterFactoryMock();
|
||||
~RemoteCommandTargeterFactoryMock() override;
|
||||
|
||||
/**
|
||||
* If the input connection string matches one of the pre-defined targeters added through an
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace mongo {
|
|||
class RemoteCommandTargeterMock final : public RemoteCommandTargeter {
|
||||
public:
|
||||
RemoteCommandTargeterMock();
|
||||
virtual ~RemoteCommandTargeterMock();
|
||||
~RemoteCommandTargeterMock() override;
|
||||
|
||||
/**
|
||||
* Shortcut for unit-tests.
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ class MongoURI;
|
|||
class ReplicaSetMonitorManagerNetworkConnectionHook final : public executor::NetworkConnectionHook {
|
||||
public:
|
||||
ReplicaSetMonitorManagerNetworkConnectionHook() = default;
|
||||
virtual ~ReplicaSetMonitorManagerNetworkConnectionHook() = default;
|
||||
~ReplicaSetMonitorManagerNetworkConnectionHook() override = default;
|
||||
|
||||
Status validateHost(const HostAndPort& remoteHost,
|
||||
const BSONObj& helloRequest,
|
||||
|
|
|
|||
|
|
@ -41,12 +41,12 @@ namespace {
|
|||
*/
|
||||
class ReplicaSetMonitorProtocolTest : public unittest::Test {
|
||||
protected:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
setGlobalServiceContext(ServiceContext::make());
|
||||
ReplicaSetMonitor::cleanup();
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
ReplicaSetMonitor::cleanup();
|
||||
ReplicaSetMonitorProtocolTestUtil::resetRSMProtocol();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class SaslAWSClientConversation : public SaslClientConversation {
|
|||
public:
|
||||
explicit SaslAWSClientConversation(SaslClientSession* saslClientSession);
|
||||
|
||||
virtual ~SaslAWSClientConversation() = default;
|
||||
~SaslAWSClientConversation() override = default;
|
||||
|
||||
StatusWith<bool> step(StringData inputData, std::string* outputData) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ public:
|
|||
**/
|
||||
explicit SaslPLAINClientConversation(SaslClientSession* saslClientSession);
|
||||
|
||||
virtual ~SaslPLAINClientConversation();
|
||||
~SaslPLAINClientConversation() override;
|
||||
|
||||
virtual StatusWith<bool> step(StringData inputData, std::string* outputData);
|
||||
StatusWith<bool> step(StringData inputData, std::string* outputData) override;
|
||||
};
|
||||
|
||||
} // namespace mongo
|
||||
|
|
|
|||
|
|
@ -146,9 +146,9 @@ public:
|
|||
parseTest(testFilePath);
|
||||
}
|
||||
|
||||
~JsonRttTestCase() = default;
|
||||
~JsonRttTestCase() override = default;
|
||||
|
||||
TestCaseResult execute() {
|
||||
TestCaseResult execute() override {
|
||||
LOGV2(4333500, "### Running Test ###", "testFilePath"_attr = _testFilePath);
|
||||
|
||||
ServerDescriptionPtr updatedServerDescription;
|
||||
|
|
@ -176,7 +176,7 @@ public:
|
|||
return result;
|
||||
}
|
||||
|
||||
const std::string& FilePath() const {
|
||||
const std::string& FilePath() const override {
|
||||
return _testFilePath;
|
||||
}
|
||||
|
||||
|
|
@ -250,9 +250,9 @@ public:
|
|||
testFilePath.string()};
|
||||
}
|
||||
}
|
||||
~JsonServerSelectionTestCase() = default;
|
||||
~JsonServerSelectionTestCase() override = default;
|
||||
|
||||
TestCaseResult execute() {
|
||||
TestCaseResult execute() override {
|
||||
LOGV2(4333504, "### Running Test ###", "testFilePath"_attr = _testFilePath);
|
||||
if (_parseError)
|
||||
return *_parseError;
|
||||
|
|
@ -289,11 +289,11 @@ public:
|
|||
return result;
|
||||
}
|
||||
|
||||
const std::string& FilePath() const {
|
||||
const std::string& FilePath() const override {
|
||||
return _testFilePath;
|
||||
}
|
||||
|
||||
bool errorIsExpected() {
|
||||
bool errorIsExpected() override {
|
||||
return _errorExpected;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,13 +110,13 @@ public:
|
|||
|
||||
void onTopologyDescriptionChangedEvent(TopologyDescriptionPtr previousDescription,
|
||||
TopologyDescriptionPtr newDescription) override;
|
||||
virtual void onServerHandshakeCompleteEvent(HelloRTT duration,
|
||||
const HostAndPort& address,
|
||||
BSONObj reply = BSONObj()) override;
|
||||
void onServerHandshakeCompleteEvent(HelloRTT duration,
|
||||
const HostAndPort& address,
|
||||
BSONObj reply = BSONObj()) override;
|
||||
|
||||
void onServerHandshakeFailedEvent(const HostAndPort& address,
|
||||
const Status& status,
|
||||
BSONObj reply);
|
||||
BSONObj reply) override;
|
||||
|
||||
void onServerHeartbeatSucceededEvent(const HostAndPort& hostAndPort, BSONObj reply) override;
|
||||
void onServerHeartbeatFailureEvent(Status errorStatus,
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ namespace mongo::sdam {
|
|||
class TopologyListenerMock : public TopologyListener {
|
||||
public:
|
||||
TopologyListenerMock() = default;
|
||||
virtual ~TopologyListenerMock() = default;
|
||||
~TopologyListenerMock() override = default;
|
||||
|
||||
void onServerHeartbeatSucceededEvent(const HostAndPort& hostAndPort, BSONObj reply) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ public:
|
|||
std::shared_ptr<ReplicaSetMonitorStats> stats,
|
||||
std::shared_ptr<executor::TaskExecutor> executor = nullptr);
|
||||
|
||||
virtual ~ServerDiscoveryMonitor() {}
|
||||
~ServerDiscoveryMonitor() override {}
|
||||
|
||||
void shutdown();
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public:
|
|||
sdam::TopologyListener* rttListener,
|
||||
Milliseconds pingFrequency,
|
||||
std::shared_ptr<executor::TaskExecutor> executor);
|
||||
~ServerPingMonitor();
|
||||
~ServerPingMonitor() override;
|
||||
|
||||
/**
|
||||
* Drops all SingleServerMonitors and shuts down the task executor.
|
||||
|
|
@ -162,14 +162,14 @@ public:
|
|||
*/
|
||||
void onServerHandshakeCompleteEvent(sdam::HelloRTT durationMs,
|
||||
const HostAndPort& address,
|
||||
BSONObj reply = BSONObj());
|
||||
BSONObj reply = BSONObj()) override;
|
||||
|
||||
/**
|
||||
* Drop corresponding SingleServerPingMonitors if the server is not included in the
|
||||
* newDescritpion.
|
||||
*/
|
||||
void onTopologyDescriptionChangedEvent(sdam::TopologyDescriptionPtr previousDescription,
|
||||
sdam::TopologyDescriptionPtr newDescription);
|
||||
sdam::TopologyDescriptionPtr newDescription) override;
|
||||
|
||||
private:
|
||||
MongoURI _setUri;
|
||||
|
|
|
|||
|
|
@ -245,14 +245,14 @@ private:
|
|||
|
||||
class SingleServerPingMonitorTest : public ServerPingMonitorTestFixture {
|
||||
protected:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
ServerPingMonitorTestFixture::setUp();
|
||||
_replSet.reset(new MockReplicaSet(
|
||||
"test", 1, /* hasPrimary = */ false, /* dollarPrefixHosts = */ false));
|
||||
_hostAndPort = HostAndPort(_replSet->getSecondaries()[0]);
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
_replSet.reset();
|
||||
ServerPingMonitorTestFixture::tearDown();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ public:
|
|||
|
||||
BSONObj getEncryptedKey(const UUID& uuid) override;
|
||||
|
||||
SymmetricKey& getKMSLocalKey() {
|
||||
SymmetricKey& getKMSLocalKey() override {
|
||||
return _localKey;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class MockJWKSFetcher : public JWKSFetcher {
|
|||
public:
|
||||
MockJWKSFetcher(BSONObj keys) : _keys(std::move(keys)) {}
|
||||
|
||||
JWKSet fetch() {
|
||||
JWKSet fetch() override {
|
||||
if (_shouldFail) {
|
||||
uasserted(ErrorCodes::NetworkTimeout,
|
||||
"Mock JWKS fetcher configured to simulate timeout");
|
||||
|
|
|
|||
|
|
@ -120,12 +120,12 @@ public:
|
|||
std::unique_ptr<TicketHolder> readTicketHolder,
|
||||
std::unique_ptr<TicketHolder> writeTicketHolder,
|
||||
Milliseconds interval);
|
||||
virtual bool supportsRuntimeSizeAdjustment() const override {
|
||||
bool supportsRuntimeSizeAdjustment() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void _appendImplStats(BSONObjBuilder& builder) const override;
|
||||
void _appendImplStats(BSONObjBuilder& builder) const override;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -114,12 +114,12 @@ public:
|
|||
std::unique_ptr<TicketHolder> writeTicketHolder)
|
||||
: TicketHolderManager(std::move(readTicketHolder), std::move(writeTicketHolder)) {}
|
||||
|
||||
virtual bool supportsRuntimeSizeAdjustment() const override {
|
||||
bool supportsRuntimeSizeAdjustment() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void _appendImplStats(BSONObjBuilder& builder) const override {}
|
||||
void _appendImplStats(BSONObjBuilder& builder) const override {}
|
||||
};
|
||||
} // namespace admission
|
||||
} // namespace mongo
|
||||
|
|
|
|||
|
|
@ -473,179 +473,182 @@ struct TryLogEventParams {
|
|||
class AuditNoOp : public AuditInterface {
|
||||
public:
|
||||
AuditNoOp() = default;
|
||||
~AuditNoOp() = default;
|
||||
~AuditNoOp() override = default;
|
||||
|
||||
void logClientMetadata(Client* client) const {};
|
||||
void logClientMetadata(Client* client) const override{};
|
||||
|
||||
void logAuthentication(Client* client, const AuthenticateEvent& event) const {};
|
||||
void logAuthentication(Client* client, const AuthenticateEvent& event) const override{};
|
||||
|
||||
void logCommandAuthzCheck(Client* client,
|
||||
const OpMsgRequest& cmdObj,
|
||||
const CommandInterface& command,
|
||||
ErrorCodes::Error result) const {};
|
||||
ErrorCodes::Error result) const override{};
|
||||
|
||||
void logKillCursorsAuthzCheck(Client* client,
|
||||
const NamespaceString& ns,
|
||||
long long cursorId,
|
||||
ErrorCodes::Error result) const {};
|
||||
ErrorCodes::Error result) const override{};
|
||||
|
||||
void logCreateUser(Client* client,
|
||||
const UserName& username,
|
||||
bool password,
|
||||
const BSONObj* customData,
|
||||
const std::vector<RoleName>& roles,
|
||||
const boost::optional<BSONArray>& restrictions) const {};
|
||||
const boost::optional<BSONArray>& restrictions) const override{};
|
||||
|
||||
void logDropUser(Client* client, const UserName& username) const {};
|
||||
void logDropUser(Client* client, const UserName& username) const override{};
|
||||
|
||||
void logDropAllUsersFromDatabase(Client* client, const DatabaseName& dbname) const {};
|
||||
void logDropAllUsersFromDatabase(Client* client, const DatabaseName& dbname) const override{};
|
||||
|
||||
void logUpdateUser(Client* client,
|
||||
const UserName& username,
|
||||
bool password,
|
||||
const BSONObj* customData,
|
||||
const std::vector<RoleName>* roles,
|
||||
const boost::optional<BSONArray>& restrictions) const {};
|
||||
const boost::optional<BSONArray>& restrictions) const override{};
|
||||
|
||||
void logGrantRolesToUser(Client* client,
|
||||
const UserName& username,
|
||||
const std::vector<RoleName>& roles) const {};
|
||||
const std::vector<RoleName>& roles) const override{};
|
||||
|
||||
void logRevokeRolesFromUser(Client* client,
|
||||
const UserName& username,
|
||||
const std::vector<RoleName>& roles) const {};
|
||||
const std::vector<RoleName>& roles) const override{};
|
||||
|
||||
void logCreateRole(Client* client,
|
||||
const RoleName& role,
|
||||
const std::vector<RoleName>& roles,
|
||||
const PrivilegeVector& privileges,
|
||||
const boost::optional<BSONArray>& restrictions) const {};
|
||||
const boost::optional<BSONArray>& restrictions) const override{};
|
||||
|
||||
void logUpdateRole(Client* client,
|
||||
const RoleName& role,
|
||||
const std::vector<RoleName>* roles,
|
||||
const PrivilegeVector* privileges,
|
||||
const boost::optional<BSONArray>& restrictions) const {};
|
||||
const boost::optional<BSONArray>& restrictions) const override{};
|
||||
|
||||
void logDropRole(Client* client, const RoleName& role) const {};
|
||||
void logDropRole(Client* client, const RoleName& role) const override{};
|
||||
|
||||
void logDropAllRolesFromDatabase(Client* client, const DatabaseName& dbname) const {};
|
||||
void logDropAllRolesFromDatabase(Client* client, const DatabaseName& dbname) const override{};
|
||||
|
||||
void logGrantRolesToRole(Client* client,
|
||||
const RoleName& role,
|
||||
const std::vector<RoleName>& roles) const {};
|
||||
const std::vector<RoleName>& roles) const override{};
|
||||
|
||||
void logRevokeRolesFromRole(Client* client,
|
||||
const RoleName& role,
|
||||
const std::vector<RoleName>& roles) const {};
|
||||
const std::vector<RoleName>& roles) const override{};
|
||||
|
||||
void logGrantPrivilegesToRole(Client* client,
|
||||
const RoleName& role,
|
||||
const PrivilegeVector& privileges) const {};
|
||||
const PrivilegeVector& privileges) const override{};
|
||||
|
||||
void logRevokePrivilegesFromRole(Client* client,
|
||||
const RoleName& role,
|
||||
const PrivilegeVector& privileges) const {};
|
||||
const PrivilegeVector& privileges) const override{};
|
||||
|
||||
void logReplSetReconfig(Client* client,
|
||||
const BSONObj* oldConfig,
|
||||
const BSONObj* newConfig) const {};
|
||||
const BSONObj* newConfig) const override{};
|
||||
|
||||
void logApplicationMessage(Client* client, StringData msg) const {};
|
||||
void logApplicationMessage(Client* client, StringData msg) const override{};
|
||||
|
||||
void logStartupOptions(Client* client, const BSONObj& startupOptions) const {};
|
||||
void logStartupOptions(Client* client, const BSONObj& startupOptions) const override{};
|
||||
|
||||
void logShutdown(Client* client) const {};
|
||||
void logShutdown(Client* client) const override{};
|
||||
|
||||
void logLogout(Client* client,
|
||||
StringData reason,
|
||||
const BSONArray& initialUsers,
|
||||
const BSONArray& updatedUsers,
|
||||
const boost::optional<Date_t>& loginTime) const {};
|
||||
const boost::optional<Date_t>& loginTime) const override{};
|
||||
|
||||
void logCreateIndex(Client* client,
|
||||
const BSONObj* indexSpec,
|
||||
StringData indexname,
|
||||
const NamespaceString& nsname,
|
||||
StringData indexBuildState,
|
||||
ErrorCodes::Error result) const {};
|
||||
ErrorCodes::Error result) const override{};
|
||||
|
||||
void logCreateCollection(Client* client, const NamespaceString& nsname) const {};
|
||||
void logCreateCollection(Client* client, const NamespaceString& nsname) const override{};
|
||||
|
||||
void logCreateView(Client* client,
|
||||
const NamespaceString& nsname,
|
||||
const NamespaceString& viewOn,
|
||||
BSONArray pipeline,
|
||||
ErrorCodes::Error code) const {};
|
||||
ErrorCodes::Error code) const override{};
|
||||
|
||||
void logImportCollection(Client* client, const NamespaceString& nsname) const {};
|
||||
void logImportCollection(Client* client, const NamespaceString& nsname) const override{};
|
||||
|
||||
void logCreateDatabase(Client* client, const DatabaseName& dbname) const {};
|
||||
void logCreateDatabase(Client* client, const DatabaseName& dbname) const override{};
|
||||
|
||||
|
||||
void logDropIndex(Client* client, StringData indexname, const NamespaceString& nsname) const {};
|
||||
void logDropIndex(Client* client,
|
||||
StringData indexname,
|
||||
const NamespaceString& nsname) const override{};
|
||||
|
||||
void logDropCollection(Client* client, const NamespaceString& nsname) const {};
|
||||
void logDropCollection(Client* client, const NamespaceString& nsname) const override{};
|
||||
|
||||
void logDropView(Client* client,
|
||||
const NamespaceString& nsname,
|
||||
const NamespaceString& viewOn,
|
||||
const std::vector<BSONObj>& pipeline,
|
||||
ErrorCodes::Error code) const {};
|
||||
ErrorCodes::Error code) const override{};
|
||||
|
||||
void logDropDatabase(Client* client, const DatabaseName& dbname) const {};
|
||||
void logDropDatabase(Client* client, const DatabaseName& dbname) const override{};
|
||||
|
||||
void logRenameCollection(Client* client,
|
||||
const NamespaceString& source,
|
||||
const NamespaceString& target) const {};
|
||||
const NamespaceString& target) const override{};
|
||||
|
||||
void logEnableSharding(Client* client, StringData dbname) const {};
|
||||
void logEnableSharding(Client* client, StringData dbname) const override{};
|
||||
|
||||
void logAddShard(Client* client, StringData name, const std::string& servers) const {};
|
||||
void logAddShard(Client* client, StringData name, const std::string& servers) const override{};
|
||||
|
||||
void logRemoveShard(Client* client, StringData shardname) const {};
|
||||
void logRemoveShard(Client* client, StringData shardname) const override{};
|
||||
|
||||
void logShardCollection(Client* client,
|
||||
const NamespaceString& ns,
|
||||
const BSONObj& keyPattern,
|
||||
bool unique) const {};
|
||||
bool unique) const override{};
|
||||
|
||||
void logRefineCollectionShardKey(Client* client,
|
||||
const NamespaceString& ns,
|
||||
const BSONObj& keyPattern) const {};
|
||||
const BSONObj& keyPattern) const override{};
|
||||
|
||||
void logInsertOperation(Client* client,
|
||||
const NamespaceString& nss,
|
||||
const BSONObj& doc) const {};
|
||||
const BSONObj& doc) const override{};
|
||||
|
||||
void logUpdateOperation(Client* client,
|
||||
const NamespaceString& nss,
|
||||
const BSONObj& doc) const {};
|
||||
const BSONObj& doc) const override{};
|
||||
|
||||
void logRemoveOperation(Client* client,
|
||||
const NamespaceString& nss,
|
||||
const BSONObj& doc) const {};
|
||||
const BSONObj& doc) const override{};
|
||||
|
||||
void logGetClusterParameter(
|
||||
Client* client,
|
||||
const std::variant<std::string, std::vector<std::string>>& requestedParameters) const {};
|
||||
void logGetClusterParameter(Client* client,
|
||||
const std::variant<std::string, std::vector<std::string>>&
|
||||
requestedParameters) const override{};
|
||||
|
||||
void logSetClusterParameter(Client* client,
|
||||
const BSONObj& oldValue,
|
||||
const BSONObj& newValue,
|
||||
const boost::optional<TenantId>& tenantId) const {};
|
||||
const boost::optional<TenantId>& tenantId) const override{};
|
||||
|
||||
void logUpdateCachedClusterParameter(Client* client,
|
||||
const BSONObj& oldValue,
|
||||
const BSONObj& newValue,
|
||||
const boost::optional<TenantId>& tenantId) const {};
|
||||
void logUpdateCachedClusterParameter(
|
||||
Client* client,
|
||||
const BSONObj& oldValue,
|
||||
const BSONObj& newValue,
|
||||
const boost::optional<TenantId>& tenantId) const override{};
|
||||
|
||||
void logRotateLog(Client* client,
|
||||
const Status& logStatus,
|
||||
const std::vector<Status>& errors,
|
||||
const std::string& suffix) const {};
|
||||
const std::string& suffix) const override{};
|
||||
|
||||
void logConfigEvent(Client* client, const AuditConfigDocument& config) const {};
|
||||
void logConfigEvent(Client* client, const AuditConfigDocument& config) const override{};
|
||||
};
|
||||
|
||||
} // namespace audit
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class AuthOpObserver final : public OpObserverNoop {
|
|||
|
||||
public:
|
||||
AuthOpObserver();
|
||||
~AuthOpObserver();
|
||||
~AuthOpObserver() override;
|
||||
|
||||
// The filtering for this OpObserver is derived from the namespace filters in
|
||||
// AuthorizationManagerImpl and the various AuditInterface implementations, see SERVER-83383.
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
|
||||
AuthorizationManagerImpl(Service* service,
|
||||
std::unique_ptr<AuthzManagerExternalState> externalState);
|
||||
~AuthorizationManagerImpl();
|
||||
~AuthorizationManagerImpl() override;
|
||||
|
||||
|
||||
std::unique_ptr<AuthorizationSession> makeAuthorizationSession() override;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ public:
|
|||
"password", saslGlobalParams.scramSHA256IterationCount.load()));
|
||||
}
|
||||
|
||||
~AuthorizationManagerTest() {
|
||||
~AuthorizationManagerTest() override {
|
||||
if (authzManager)
|
||||
AuthorizationManager::get(opCtx->getService())->invalidateUserCache();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace mongo {
|
|||
class FailureCapableAuthzManagerExternalStateMock : public AuthzManagerExternalStateMock {
|
||||
public:
|
||||
FailureCapableAuthzManagerExternalStateMock() = default;
|
||||
~FailureCapableAuthzManagerExternalStateMock() = default;
|
||||
~FailureCapableAuthzManagerExternalStateMock() override = default;
|
||||
|
||||
void setFindsShouldFail(bool enable) {
|
||||
_findsShouldFail = enable;
|
||||
|
|
@ -68,7 +68,7 @@ private:
|
|||
|
||||
class AuthorizationSessionTestFixture : public ServiceContextMongoDTest {
|
||||
public:
|
||||
void setUp();
|
||||
void setUp() override;
|
||||
|
||||
void tearDown() override {
|
||||
authzSession->logoutAllDatabases(_client.get(), "Ending AuthorizationSessionTest");
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class AuthzManagerExternalStateMongod : public AuthzManagerExternalStateLocal {
|
|||
|
||||
public:
|
||||
AuthzManagerExternalStateMongod();
|
||||
virtual ~AuthzManagerExternalStateMongod();
|
||||
~AuthzManagerExternalStateMongod() override;
|
||||
|
||||
std::unique_ptr<AuthzSessionExternalState> makeAuthzSessionExternalState(
|
||||
AuthorizationManager* authzManager) final;
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class AuthzManagerExternalStateLocal : public AuthzManagerExternalState {
|
|||
AuthzManagerExternalStateLocal& operator=(const AuthzManagerExternalStateLocal&) = delete;
|
||||
|
||||
public:
|
||||
virtual ~AuthzManagerExternalStateLocal() = default;
|
||||
~AuthzManagerExternalStateLocal() override = default;
|
||||
|
||||
Status hasValidStoredAuthorizationVersion(OperationContext* opCtx,
|
||||
BSONObj* foundVersionDoc) override;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ class AuthzManagerExternalStateMock : public AuthzManagerExternalStateLocal {
|
|||
|
||||
public:
|
||||
AuthzManagerExternalStateMock();
|
||||
virtual ~AuthzManagerExternalStateMock();
|
||||
~AuthzManagerExternalStateMock() override;
|
||||
|
||||
void setAuthorizationManager(AuthorizationManager* authzManager);
|
||||
void setAuthzVersion(OperationContext* opCtx, int version);
|
||||
|
|
|
|||
|
|
@ -45,13 +45,13 @@ class AuthzSessionExternalStateMongod : public AuthzSessionExternalStateServerCo
|
|||
|
||||
public:
|
||||
AuthzSessionExternalStateMongod(AuthorizationManager* authzManager);
|
||||
virtual ~AuthzSessionExternalStateMongod();
|
||||
~AuthzSessionExternalStateMongod() override;
|
||||
|
||||
virtual bool shouldIgnoreAuthChecks() const;
|
||||
bool shouldIgnoreAuthChecks() const override;
|
||||
|
||||
virtual bool serverIsArbiter() const;
|
||||
bool serverIsArbiter() const override;
|
||||
|
||||
virtual void startRequest(OperationContext* opCtx);
|
||||
void startRequest(OperationContext* opCtx) override;
|
||||
};
|
||||
|
||||
} // namespace mongo
|
||||
|
|
|
|||
|
|
@ -50,15 +50,15 @@ public:
|
|||
_allowLocalhostReturnValue(false),
|
||||
_serverIsArbiterReturnValue(false) {}
|
||||
|
||||
virtual bool shouldIgnoreAuthChecks() const {
|
||||
bool shouldIgnoreAuthChecks() const override {
|
||||
return _ignoreAuthChecksReturnValue;
|
||||
}
|
||||
|
||||
virtual bool shouldAllowLocalhost() const {
|
||||
bool shouldAllowLocalhost() const override {
|
||||
return _allowLocalhostReturnValue;
|
||||
}
|
||||
|
||||
virtual bool serverIsArbiter() const {
|
||||
bool serverIsArbiter() const override {
|
||||
return _serverIsArbiterReturnValue;
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ public:
|
|||
_allowLocalhostReturnValue = returnValue;
|
||||
}
|
||||
|
||||
virtual void startRequest(OperationContext* opCtx) {}
|
||||
void startRequest(OperationContext* opCtx) override {}
|
||||
|
||||
private:
|
||||
bool _ignoreAuthChecksReturnValue;
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ class AuthzSessionExternalStateMongos : public AuthzSessionExternalStateServerCo
|
|||
|
||||
public:
|
||||
AuthzSessionExternalStateMongos(AuthorizationManager* authzManager);
|
||||
virtual ~AuthzSessionExternalStateMongos();
|
||||
~AuthzSessionExternalStateMongos() override;
|
||||
|
||||
virtual void startRequest(OperationContext* opCtx);
|
||||
void startRequest(OperationContext* opCtx) override;
|
||||
};
|
||||
|
||||
} // namespace mongo
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ class AuthzSessionExternalStateServerCommon : public AuthzSessionExternalState {
|
|||
delete;
|
||||
|
||||
public:
|
||||
virtual ~AuthzSessionExternalStateServerCommon();
|
||||
~AuthzSessionExternalStateServerCommon() override;
|
||||
|
||||
virtual bool shouldAllowLocalhost() const;
|
||||
virtual bool shouldIgnoreAuthChecks() const;
|
||||
virtual bool serverIsArbiter() const;
|
||||
bool shouldAllowLocalhost() const override;
|
||||
bool shouldIgnoreAuthChecks() const override;
|
||||
bool serverIsArbiter() const override;
|
||||
|
||||
protected:
|
||||
AuthzSessionExternalStateServerCommon(AuthorizationManager* authzManager);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public:
|
|||
"Mock restriction forced to be unmet");
|
||||
}
|
||||
|
||||
virtual void appendToBuilder(BSONArrayBuilder* builder) const {
|
||||
void appendToBuilder(BSONArrayBuilder* builder) const override {
|
||||
builder->append(_shouldPass);
|
||||
}
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ public:
|
|||
"Mock restriction forced to be unmet");
|
||||
}
|
||||
|
||||
virtual void appendToBuilder(BSONObjBuilder* builder) const final {
|
||||
void appendToBuilder(BSONObjBuilder* builder) const final {
|
||||
builder->append(_name, _shouldPass);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public:
|
|||
return NamespaceString(request().getDbName());
|
||||
}
|
||||
|
||||
Reply typedRun(OperationContext* opCtx);
|
||||
Reply typedRun(OperationContext* opCtx) override;
|
||||
};
|
||||
|
||||
std::string help() const final {
|
||||
|
|
@ -137,7 +137,7 @@ public:
|
|||
return NamespaceString(request().getDbName());
|
||||
}
|
||||
|
||||
Reply typedRun(OperationContext* opCtx);
|
||||
Reply typedRun(OperationContext* opCtx) override;
|
||||
};
|
||||
|
||||
std::string help() const final {
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ public:
|
|||
explicit ServerMechanismBase(std::string authenticationDatabase)
|
||||
: _authenticationDatabase(std::move(authenticationDatabase)) {}
|
||||
|
||||
virtual ~ServerMechanismBase() = default;
|
||||
~ServerMechanismBase() override = default;
|
||||
|
||||
/**
|
||||
* Returns the principal name which this mechanism is performing authentication for.
|
||||
|
|
@ -296,7 +296,7 @@ class MakeServerMechanism : public ServerMechanismBase {
|
|||
public:
|
||||
explicit MakeServerMechanism(std::string authenticationDatabase)
|
||||
: ServerMechanismBase(std::move(authenticationDatabase)) {}
|
||||
virtual ~MakeServerMechanism() = default;
|
||||
~MakeServerMechanism() override = default;
|
||||
|
||||
using policy_type = Policy;
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ public:
|
|||
explicit MakeServerFactory(Service*) {}
|
||||
MakeServerFactory() = default;
|
||||
|
||||
virtual ServerMechanism* createImpl(std::string authenticationDatabase) override {
|
||||
ServerMechanism* createImpl(std::string authenticationDatabase) override {
|
||||
return new ServerMechanism(std::move(authenticationDatabase));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public:
|
|||
*
|
||||
**/
|
||||
StatusWith<std::tuple<bool, std::string>> stepImpl(OperationContext* opCtx,
|
||||
StringData inputData);
|
||||
StringData inputData) override;
|
||||
|
||||
StatusWith<std::string> saslPrep(StringData str) const {
|
||||
if (std::is_same<SHA1Block, HashBlock>::value) {
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public:
|
|||
BSONObj credentials;
|
||||
BSONObj sha1_creds, sha256_creds;
|
||||
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
user.reset(new User(UserRequest(UserName("spencer", "test"), boost::none)));
|
||||
adminUser.reset(new User(UserRequest(UserName("admin", "admin"), boost::none)));
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class SubBaton final : public Baton {
|
|||
public:
|
||||
explicit SubBaton(BatonHandle baton) : _baton(std::move(baton)) {}
|
||||
|
||||
~SubBaton() {
|
||||
~SubBaton() override {
|
||||
invariant(_isDead);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class Baton : public Waitable,
|
|||
public OutOfLineExecutor,
|
||||
public std::enable_shared_from_this<Baton> {
|
||||
public:
|
||||
virtual ~Baton() = default;
|
||||
~Baton() override = default;
|
||||
|
||||
/**
|
||||
* Detaches a baton from an associated opCtx.
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ public:
|
|||
};
|
||||
|
||||
Collection() = default;
|
||||
virtual ~Collection() = default;
|
||||
~Collection() override = default;
|
||||
|
||||
/**
|
||||
* Clones this Collection instance. Some members are deep copied and some are shallow copied.
|
||||
|
|
@ -771,7 +771,7 @@ public:
|
|||
|
||||
CollectionPtr(const CollectionPtr&) = delete;
|
||||
CollectionPtr(CollectionPtr&&);
|
||||
~CollectionPtr();
|
||||
~CollectionPtr() override;
|
||||
|
||||
CollectionPtr& operator=(const CollectionPtr&) = delete;
|
||||
CollectionPtr& operator=(CollectionPtr&&);
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ public:
|
|||
std::make_unique<repl::ReplicationCoordinatorMock>(getServiceContext()));
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
globalLock.reset();
|
||||
}
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ protected:
|
|||
|
||||
class CollectionCatalogIterationTest : public ServiceContextMongoDTest {
|
||||
public:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
ServiceContextMongoDTest::setUp();
|
||||
opCtx = makeOperationContext();
|
||||
globalLock.emplace(opCtx.get());
|
||||
|
|
@ -162,7 +162,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
for (auto& it : dbMap) {
|
||||
for (auto& kv : it.second) {
|
||||
catalog.deregisterCollection(
|
||||
|
|
@ -217,7 +217,7 @@ protected:
|
|||
|
||||
class CollectionCatalogResourceTest : public ServiceContextMongoDTest {
|
||||
public:
|
||||
void setUp() {
|
||||
void setUp() override {
|
||||
ServiceContextMongoDTest::setUp();
|
||||
opCtx = makeOperationContext();
|
||||
globalLock.emplace(opCtx.get());
|
||||
|
|
@ -242,7 +242,7 @@ public:
|
|||
ASSERT_EQ(5, numEntries);
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
void tearDown() override {
|
||||
std::vector<UUID> collectionsToDeregister;
|
||||
for (auto&& coll :
|
||||
catalog.range(DatabaseName::createDatabaseName_forTest(boost::none, "resourceDb"))) {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ public:
|
|||
std::shared_ptr<BSONCollectionCatalogEntry::MetaData> metadata,
|
||||
std::unique_ptr<RecordStore> recordStore);
|
||||
|
||||
~CollectionImpl();
|
||||
~CollectionImpl() override;
|
||||
|
||||
std::shared_ptr<Collection> clone() const final;
|
||||
|
||||
|
|
@ -302,7 +302,7 @@ public:
|
|||
*/
|
||||
bool isEmpty(OperationContext* opCtx) const final;
|
||||
|
||||
inline int averageObjectSize(OperationContext* opCtx) const {
|
||||
inline int averageObjectSize(OperationContext* opCtx) const override {
|
||||
uint64_t n = numRecords(opCtx);
|
||||
|
||||
if (n == 0)
|
||||
|
|
|
|||
|
|
@ -53,29 +53,29 @@ public:
|
|||
: _uuid(uuid), _nss(nss), _indexCatalog(std::move(indexCatalog)) {}
|
||||
CollectionMock(const NamespaceString& nss, RecordId catalogId)
|
||||
: _nss(nss), _catalogId(std::move(catalogId)) {}
|
||||
~CollectionMock() = default;
|
||||
~CollectionMock() override = default;
|
||||
|
||||
std::shared_ptr<Collection> clone() const {
|
||||
std::shared_ptr<Collection> clone() const override {
|
||||
return std::make_shared<CollectionMock>(*this);
|
||||
}
|
||||
|
||||
|
||||
SharedCollectionDecorations* getSharedDecorations() const {
|
||||
SharedCollectionDecorations* getSharedDecorations() const override {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void init(OperationContext* opCtx) {
|
||||
void init(OperationContext* opCtx) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
Status initFromExisting(OperationContext* opCtx,
|
||||
const std::shared_ptr<const Collection>& collection,
|
||||
const DurableCatalogEntry& catalogEntry,
|
||||
boost::optional<Timestamp> readTimestamp) {
|
||||
boost::optional<Timestamp> readTimestamp) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
RecordId getCatalogId() const {
|
||||
RecordId getCatalogId() const override {
|
||||
return _catalogId;
|
||||
}
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ public:
|
|||
_catalogId = std::move(catalogId);
|
||||
}
|
||||
|
||||
const NamespaceString& ns() const {
|
||||
const NamespaceString& ns() const override {
|
||||
return _nss;
|
||||
}
|
||||
|
||||
|
|
@ -92,58 +92,61 @@ public:
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
const IndexCatalog* getIndexCatalog() const {
|
||||
const IndexCatalog* getIndexCatalog() const override {
|
||||
return _indexCatalog.get();
|
||||
}
|
||||
IndexCatalog* getIndexCatalog() {
|
||||
IndexCatalog* getIndexCatalog() override {
|
||||
return _indexCatalog.get();
|
||||
}
|
||||
|
||||
RecordStore* getRecordStore() const {
|
||||
RecordStore* getRecordStore() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
std::shared_ptr<Ident> getSharedIdent() const {
|
||||
std::shared_ptr<Ident> getSharedIdent() const override {
|
||||
return std::make_shared<Ident>(_nss.toString_forTest());
|
||||
}
|
||||
void setIdent(std::shared_ptr<Ident> newIdent) {
|
||||
void setIdent(std::shared_ptr<Ident> newIdent) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
BSONObj getValidatorDoc() const {
|
||||
BSONObj getValidatorDoc() const override {
|
||||
return BSONObj();
|
||||
}
|
||||
|
||||
std::pair<SchemaValidationResult, Status> checkValidation(OperationContext* opCtx,
|
||||
const BSONObj& document) const {
|
||||
std::pair<SchemaValidationResult, Status> checkValidation(
|
||||
OperationContext* opCtx, const BSONObj& document) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
virtual Status checkValidationAndParseResult(OperationContext* opCtx,
|
||||
const BSONObj& document) const {
|
||||
Status checkValidationAndParseResult(OperationContext* opCtx,
|
||||
const BSONObj& document) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool requiresIdIndex() const {
|
||||
bool requiresIdIndex() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
Snapshotted<BSONObj> docFor(OperationContext* opCtx, const RecordId& loc) const {
|
||||
Snapshotted<BSONObj> docFor(OperationContext* opCtx, const RecordId& loc) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool findDoc(OperationContext* opCtx, const RecordId& loc, Snapshotted<BSONObj>* out) const {
|
||||
bool findDoc(OperationContext* opCtx,
|
||||
const RecordId& loc,
|
||||
Snapshotted<BSONObj>* out) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
std::unique_ptr<SeekableRecordCursor> getCursor(OperationContext* opCtx, bool forward) const {
|
||||
std::unique_ptr<SeekableRecordCursor> getCursor(OperationContext* opCtx,
|
||||
bool forward) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool updateWithDamagesSupported() const {
|
||||
bool updateWithDamagesSupported() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
Status truncate(OperationContext* opCtx) {
|
||||
Status truncate(OperationContext* opCtx) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
|
|
@ -155,32 +158,32 @@ public:
|
|||
const BSONObj& validator,
|
||||
MatchExpressionParser::AllowedFeatureSet allowedFeatures,
|
||||
boost::optional<multiversion::FeatureCompatibilityVersion>
|
||||
maxFeatureCompatibilityVersion) const {
|
||||
maxFeatureCompatibilityVersion) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void setValidator(OperationContext* opCtx, Validator validator) {
|
||||
void setValidator(OperationContext* opCtx, Validator validator) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
Status setValidationLevel(OperationContext* opCtx, ValidationLevelEnum newLevel) {
|
||||
Status setValidationLevel(OperationContext* opCtx, ValidationLevelEnum newLevel) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
Status setValidationAction(OperationContext* opCtx, ValidationActionEnum newAction) {
|
||||
Status setValidationAction(OperationContext* opCtx, ValidationActionEnum newAction) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
boost::optional<ValidationLevelEnum> getValidationLevel() const {
|
||||
boost::optional<ValidationLevelEnum> getValidationLevel() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
boost::optional<ValidationActionEnum> getValidationAction() const {
|
||||
boost::optional<ValidationActionEnum> getValidationAction() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
Status updateValidator(OperationContext* opCtx,
|
||||
BSONObj newValidator,
|
||||
boost::optional<ValidationLevelEnum> newLevel,
|
||||
boost::optional<ValidationActionEnum> newAction) {
|
||||
boost::optional<ValidationActionEnum> newAction) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
|
|
@ -188,61 +191,61 @@ public:
|
|||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool isTemporary() const {
|
||||
bool isTemporary() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
boost::optional<bool> getTimeseriesBucketsMayHaveMixedSchemaData() const {
|
||||
boost::optional<bool> getTimeseriesBucketsMayHaveMixedSchemaData() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void setTimeseriesBucketsMayHaveMixedSchemaData(OperationContext* opCtx,
|
||||
boost::optional<bool> setting) {
|
||||
boost::optional<bool> setting) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
boost::optional<bool> timeseriesBucketingParametersHaveChanged() const {
|
||||
boost::optional<bool> timeseriesBucketingParametersHaveChanged() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void setTimeseriesBucketingParametersChanged(OperationContext* opCtx,
|
||||
boost::optional<bool> value) {
|
||||
boost::optional<bool> value) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
StatusWith<bool> doesTimeseriesBucketsDocContainMixedSchemaData(
|
||||
const BSONObj& bucketsDoc) const {
|
||||
const BSONObj& bucketsDoc) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool getRequiresTimeseriesExtendedRangeSupport() const {
|
||||
bool getRequiresTimeseriesExtendedRangeSupport() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void setRequiresTimeseriesExtendedRangeSupport(OperationContext* opCtx) const {
|
||||
void setRequiresTimeseriesExtendedRangeSupport(OperationContext* opCtx) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool areTimeseriesBucketsFixed() const {
|
||||
bool areTimeseriesBucketsFixed() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool isClustered() const {
|
||||
bool isClustered() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
boost::optional<ClusteredCollectionInfo> getClusteredInfo() const {
|
||||
boost::optional<ClusteredCollectionInfo> getClusteredInfo() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void updateClusteredIndexTTLSetting(OperationContext* opCtx,
|
||||
boost::optional<int64_t> expireAfterSeconds) {
|
||||
boost::optional<int64_t> expireAfterSeconds) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
Status updateCappedSize(OperationContext* opCtx,
|
||||
boost::optional<long long> newCappedSize,
|
||||
boost::optional<long long> newCappedMax) {
|
||||
boost::optional<long long> newCappedMax) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
|
|
@ -250,32 +253,32 @@ public:
|
|||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool isChangeStreamPreAndPostImagesEnabled() const {
|
||||
bool isChangeStreamPreAndPostImagesEnabled() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void setChangeStreamPreAndPostImages(OperationContext* opCtx,
|
||||
ChangeStreamPreAndPostImagesOptions val) {
|
||||
ChangeStreamPreAndPostImagesOptions val) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool areRecordIdsReplicated() const {
|
||||
bool areRecordIdsReplicated() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isCapped() const {
|
||||
bool isCapped() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
long long getCappedMaxDocs() const {
|
||||
long long getCappedMaxDocs() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
long long getCappedMaxSize() const {
|
||||
long long getCappedMaxSize() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool usesCappedSnapshots() const {
|
||||
bool usesCappedSnapshots() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -285,43 +288,45 @@ public:
|
|||
|
||||
void registerCappedInserts(OperationContext* opCtx,
|
||||
const RecordId& minRecord,
|
||||
const RecordId& maxRecord) const {
|
||||
const RecordId& maxRecord) const override {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
CappedVisibilityObserver* getCappedVisibilityObserver() const {
|
||||
CappedVisibilityObserver* getCappedVisibilityObserver() const override {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
CappedVisibilitySnapshot takeCappedVisibilitySnapshot() const {
|
||||
CappedVisibilitySnapshot takeCappedVisibilitySnapshot() const override {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
long long numRecords(OperationContext* opCtx) const {
|
||||
long long numRecords(OperationContext* opCtx) const override {
|
||||
return 0LL;
|
||||
}
|
||||
|
||||
long long dataSize(OperationContext* opCtx) const {
|
||||
long long dataSize(OperationContext* opCtx) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool isEmpty(OperationContext* opCtx) const {
|
||||
bool isEmpty(OperationContext* opCtx) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
int averageObjectSize(OperationContext* const opCtx) const {
|
||||
int averageObjectSize(OperationContext* const opCtx) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
uint64_t getIndexSize(OperationContext* opCtx, BSONObjBuilder* details, int scale) const {
|
||||
uint64_t getIndexSize(OperationContext* opCtx,
|
||||
BSONObjBuilder* details,
|
||||
int scale) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
uint64_t getIndexFreeStorageBytes(OperationContext* const opCtx) const {
|
||||
uint64_t getIndexFreeStorageBytes(OperationContext* const opCtx) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
boost::optional<Timestamp> getMinimumValidSnapshot() const {
|
||||
boost::optional<Timestamp> getMinimumValidSnapshot() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
|
|
@ -329,29 +334,30 @@ public:
|
|||
// no-op, called by unittests
|
||||
}
|
||||
|
||||
boost::optional<TimeseriesOptions> getTimeseriesOptions() const {
|
||||
boost::optional<TimeseriesOptions> getTimeseriesOptions() const override {
|
||||
return boost::none;
|
||||
}
|
||||
|
||||
void setTimeseriesOptions(OperationContext* opCtx, const TimeseriesOptions& tsOptions) {
|
||||
void setTimeseriesOptions(OperationContext* opCtx,
|
||||
const TimeseriesOptions& tsOptions) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
const CollatorInterface* getDefaultCollator() const {
|
||||
const CollatorInterface* getDefaultCollator() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
const CollectionOptions& getCollectionOptions() const {
|
||||
const CollectionOptions& getCollectionOptions() const override {
|
||||
return _options;
|
||||
}
|
||||
|
||||
StatusWith<BSONObj> addCollationDefaultsToIndexSpecsForCreate(OperationContext* opCtx,
|
||||
const BSONObj& indexSpecs) const {
|
||||
StatusWith<BSONObj> addCollationDefaultsToIndexSpecsForCreate(
|
||||
OperationContext* opCtx, const BSONObj& indexSpecs) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
StatusWith<std::vector<BSONObj>> addCollationDefaultsToIndexSpecsForCreate(
|
||||
OperationContext* opCtx, const std::vector<BSONObj>& indexSpecs) const {
|
||||
OperationContext* opCtx, const std::vector<BSONObj>& indexSpecs) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
|
|
@ -364,72 +370,75 @@ public:
|
|||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void onDeregisterFromCatalog(OperationContext* opCtx) {}
|
||||
void onDeregisterFromCatalog(OperationContext* opCtx) override {}
|
||||
|
||||
UUID uuid() const {
|
||||
UUID uuid() const override {
|
||||
return _uuid;
|
||||
}
|
||||
|
||||
void indexBuildSuccess(OperationContext* opCtx, IndexCatalogEntry* index) {
|
||||
void indexBuildSuccess(OperationContext* opCtx, IndexCatalogEntry* index) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
StatusWith<int> checkMetaDataForIndex(const std::string& indexName, const BSONObj& spec) const {
|
||||
StatusWith<int> checkMetaDataForIndex(const std::string& indexName,
|
||||
const BSONObj& spec) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void updateTTLSetting(OperationContext* opCtx, StringData idxName, long long newExpireSeconds) {
|
||||
void updateTTLSetting(OperationContext* opCtx,
|
||||
StringData idxName,
|
||||
long long newExpireSeconds) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void updateHiddenSetting(OperationContext* opCtx, StringData idxName, bool hidden) {
|
||||
void updateHiddenSetting(OperationContext* opCtx, StringData idxName, bool hidden) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void updateUniqueSetting(OperationContext* opCtx, StringData idxName, bool unique) {
|
||||
void updateUniqueSetting(OperationContext* opCtx, StringData idxName, bool unique) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void updatePrepareUniqueSetting(OperationContext* opCtx,
|
||||
StringData idxName,
|
||||
bool prepareUnique) {
|
||||
bool prepareUnique) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
std::vector<std::string> repairInvalidIndexOptions(OperationContext* opCtx) {
|
||||
std::vector<std::string> repairInvalidIndexOptions(OperationContext* opCtx) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void setIsTemp(OperationContext* opCtx, bool isTemp) {
|
||||
void setIsTemp(OperationContext* opCtx, bool isTemp) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void removeIndex(OperationContext* opCtx, StringData indexName) {
|
||||
void removeIndex(OperationContext* opCtx, StringData indexName) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
Status prepareForIndexBuild(OperationContext* opCtx,
|
||||
const IndexDescriptor* spec,
|
||||
boost::optional<UUID> buildUUID,
|
||||
bool isBackgroundSecondaryBuild) {
|
||||
bool isBackgroundSecondaryBuild) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
boost::optional<UUID> getIndexBuildUUID(StringData indexName) const {
|
||||
boost::optional<UUID> getIndexBuildUUID(StringData indexName) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool isIndexMultikey(OperationContext* opCtx,
|
||||
StringData indexName,
|
||||
MultikeyPaths* multikeyPaths,
|
||||
int indexOffset) const {
|
||||
int indexOffset) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool setIndexIsMultikey(OperationContext* opCtx,
|
||||
StringData indexName,
|
||||
const MultikeyPaths& multikeyPaths,
|
||||
int indexOffset) const {
|
||||
int indexOffset) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
|
|
@ -440,52 +449,52 @@ public:
|
|||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
int getTotalIndexCount() const {
|
||||
int getTotalIndexCount() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
int getCompletedIndexCount() const {
|
||||
int getCompletedIndexCount() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
BSONObj getIndexSpec(StringData indexName) const {
|
||||
BSONObj getIndexSpec(StringData indexName) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void getAllIndexes(std::vector<std::string>* names) const {
|
||||
void getAllIndexes(std::vector<std::string>* names) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void getReadyIndexes(std::vector<std::string>* names) const {
|
||||
void getReadyIndexes(std::vector<std::string>* names) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool isIndexPresent(StringData indexName) const {
|
||||
bool isIndexPresent(StringData indexName) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool isIndexReady(StringData indexName) const {
|
||||
bool isIndexReady(StringData indexName) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void replaceMetadata(OperationContext* opCtx,
|
||||
std::shared_ptr<BSONCollectionCatalogEntry::MetaData> md) {
|
||||
std::shared_ptr<BSONCollectionCatalogEntry::MetaData> md) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool isMetadataEqual(const BSONObj& otherMetadata) const {
|
||||
bool isMetadataEqual(const BSONObj& otherMetadata) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
void sanitizeCollectionOptions(OperationContext* opCtx) {
|
||||
void sanitizeCollectionOptions(OperationContext* opCtx) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool needsCappedLock() const {
|
||||
bool needsCappedLock() const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
bool isCappedAndNeedsDelete(OperationContext* opCtx) const {
|
||||
bool isCappedAndNeedsDelete(OperationContext* opCtx) const override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
Database() = default;
|
||||
|
||||
// must call close first
|
||||
virtual ~Database() = default;
|
||||
~Database() override = default;
|
||||
|
||||
inline Database(Database&&) = delete;
|
||||
inline Database& operator=(Database&&) = delete;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public:
|
|||
return std::make_unique<IndexCatalogMock>(*this);
|
||||
}
|
||||
|
||||
void init(OperationContext*, Collection*, bool = false) {
|
||||
void init(OperationContext*, Collection*, bool = false) override {
|
||||
MONGO_UNREACHABLE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ public:
|
|||
|
||||
VirtualCollectionImpl(const VirtualCollectionImpl&) = default;
|
||||
|
||||
~VirtualCollectionImpl() = default;
|
||||
~VirtualCollectionImpl() override = default;
|
||||
|
||||
const VirtualCollectionOptions& getVirtualCollectionOptions() const {
|
||||
return _shared->_recordStore->getOptions();
|
||||
|
|
@ -512,7 +512,7 @@ public:
|
|||
return _shared->_recordStore->dataSize(opCtx) == 0LL;
|
||||
}
|
||||
|
||||
inline int averageObjectSize(OperationContext* opCtx) const {
|
||||
inline int averageObjectSize(OperationContext* opCtx) const override {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -147,12 +147,12 @@ namespace {
|
|||
* before the client decorations are destroyed. See SERVER-48901 for more details.
|
||||
*/
|
||||
class ClientOutOfLineExecutorClientObserver final : public ServiceContext::ClientObserver {
|
||||
void onCreateClient(Client*) {}
|
||||
void onDestroyClient(Client* client) {
|
||||
void onCreateClient(Client*) override {}
|
||||
void onDestroyClient(Client* client) override {
|
||||
ClientOutOfLineExecutor::get(client)->shutdown();
|
||||
}
|
||||
void onCreateOperationContext(OperationContext*) {}
|
||||
void onDestroyOperationContext(OperationContext*) {}
|
||||
void onCreateOperationContext(OperationContext*) override {}
|
||||
void onDestroyOperationContext(OperationContext*) override {}
|
||||
};
|
||||
|
||||
ServiceContext::ConstructorActionRegisterer
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class ClientOutOfLineExecutor final : public OutOfLineExecutor {
|
|||
public:
|
||||
ClientOutOfLineExecutor() noexcept;
|
||||
|
||||
~ClientOutOfLineExecutor() noexcept;
|
||||
~ClientOutOfLineExecutor() noexcept override;
|
||||
|
||||
static ClientOutOfLineExecutor* get(const Client*) noexcept;
|
||||
|
||||
|
|
|
|||
|
|
@ -420,11 +420,11 @@ namespace {
|
|||
*/
|
||||
class ClientCursorMonitor : public BackgroundJob {
|
||||
public:
|
||||
std::string name() const {
|
||||
std::string name() const override {
|
||||
return "ClientCursorMonitor";
|
||||
}
|
||||
|
||||
void run() {
|
||||
void run() override {
|
||||
ThreadClient tc("clientcursormon",
|
||||
getGlobalServiceContext()->getService(ClusterRole::ShardServer));
|
||||
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ private:
|
|||
* Cursors must be unpinned and deregistered from the CursorManager before they can be
|
||||
* destroyed.
|
||||
*/
|
||||
~ClientCursor();
|
||||
~ClientCursor() override;
|
||||
|
||||
/**
|
||||
* Disposes this ClientCursor's PlanExecutor. Must be called before deleting a ClientCursor to
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public:
|
|||
Future<DbResponse> handleRequest(OperationContext* opCtx,
|
||||
const Message& request) const override;
|
||||
|
||||
bool runsClusterOperations() const {
|
||||
bool runsClusterOperations() const override {
|
||||
// Cluster commands will attach appropriate shard versions for any targeted namespaces, so
|
||||
// it is safe to use this client within a caller's operation with shard versions.
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ public:
|
|||
AllowedOnSecondary secondaryAllowed(ServiceContext*) const override {
|
||||
return AllowedOnSecondary::kNever;
|
||||
}
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class CmdCount : public BasicCommand {
|
|||
public:
|
||||
CmdCount() : BasicCommand("count") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersions1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ public:
|
|||
result.append("durationSeconds", durationCount<Seconds>(micros));
|
||||
return true;
|
||||
}
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -779,7 +779,7 @@ public:
|
|||
return request().getNamespace();
|
||||
}
|
||||
|
||||
void doCheckAuthorization(OperationContext* opCtx) const {
|
||||
void doCheckAuthorization(OperationContext* opCtx) const override {
|
||||
Privilege p(CommandHelpers::resourcePatternForNamespace(ns()), ActionType::createIndex);
|
||||
uassert(ErrorCodes::Unauthorized,
|
||||
"Unauthorized",
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual StatusWith<CursorResponse> runAggregation(
|
||||
OperationContext* opCtx, AggregateCommandRequest& request) const final {
|
||||
StatusWith<CursorResponse> runAggregation(OperationContext* opCtx,
|
||||
AggregateCommandRequest& request) const final {
|
||||
auto aggCmdObj = aggregation_request_helper::serializeToCommandObj(request);
|
||||
|
||||
rpc::OpMsgReplyBuilder replyBuilder;
|
||||
|
|
@ -113,7 +113,7 @@ public:
|
|||
SerializationContext::stateCommandReply(request.getSerializationContext()));
|
||||
}
|
||||
|
||||
virtual void appendToResponse(BSONObjBuilder* result) const final {
|
||||
void appendToResponse(BSONObjBuilder* result) const final {
|
||||
if (lockedForWriting()) {
|
||||
result->append("fsyncLock", true);
|
||||
result->append("info",
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class CurrentOpCommandBase : public BasicCommand {
|
|||
public:
|
||||
CurrentOpCommandBase() : BasicCommand("currentOp") {}
|
||||
|
||||
virtual ~CurrentOpCommandBase() {}
|
||||
~CurrentOpCommandBase() override {}
|
||||
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const final {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1886,11 +1886,11 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual bool adminOnly() const {
|
||||
bool adminOnly() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1918,10 +1918,10 @@ public:
|
|||
return isAuthorized ? Status::OK() : Status(ErrorCodes::Unauthorized, "Unauthorized");
|
||||
}
|
||||
|
||||
virtual bool run(OperationContext* opCtx,
|
||||
const DatabaseName& dbName,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) {
|
||||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName& dbName,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) override {
|
||||
auto job = getRun(opCtx, dbName, cmdObj);
|
||||
(new DbCheckJob(opCtx->getService(), std::move(job)))->go();
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -526,7 +526,7 @@ public:
|
|||
using Request = CollMod;
|
||||
using Reply = CollModReply;
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersions1;
|
||||
}
|
||||
|
||||
|
|
@ -759,7 +759,7 @@ class BuildInfoExecutor final : public AsyncRequestExecutor {
|
|||
public:
|
||||
BuildInfoExecutor() : AsyncRequestExecutor("BuildInfoExecutor") {}
|
||||
|
||||
Status handleRequest(std::shared_ptr<RequestExecutionContext> rec) {
|
||||
Status handleRequest(std::shared_ptr<RequestExecutionContext> rec) override {
|
||||
// Critical to observability and diagnosability, categorize as immediate priority.
|
||||
ScopedAdmissionPriority skipAdmissionControl(rec->getOpCtx(),
|
||||
AdmissionContext::Priority::kExempt);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class DBHashCmd : public BasicCommand {
|
|||
public:
|
||||
DBHashCmd() : BasicCommand("dbHash", "dbhash") {}
|
||||
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ public:
|
|||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName& dbName,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) {
|
||||
BSONObjBuilder& result) override {
|
||||
tasserted(8687400, "distinct command should have not invoked this method");
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ public:
|
|||
// rather than with a NotWritablePrimary error.
|
||||
return AllowedOnSecondary::kAlways;
|
||||
}
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
std::string help() const override {
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class CmdExplain final : public Command {
|
|||
public:
|
||||
CmdExplain() : Command("explain") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersions1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ class FindCmd final : public Command {
|
|||
public:
|
||||
FindCmd() : Command("find") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersions1;
|
||||
}
|
||||
|
||||
|
|
@ -465,7 +465,7 @@ public:
|
|||
* --Save state for getMore, transferring ownership of the executor to a ClientCursor.
|
||||
* --Generate response to send to the client.
|
||||
*/
|
||||
void run(OperationContext* opCtx, rpc::ReplyBuilderInterface* replyBuilder) {
|
||||
void run(OperationContext* opCtx, rpc::ReplyBuilderInterface* replyBuilder) override {
|
||||
CommandHelpers::handleMarkKillOnClientDisconnect(opCtx);
|
||||
|
||||
const BSONObj& cmdObj = _request.body;
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public:
|
|||
|
||||
KeyMaterial getKey(const UUID& uuid) override;
|
||||
BSONObj getEncryptedKey(const UUID& uuid) override;
|
||||
SymmetricKey& getKMSLocalKey() {
|
||||
SymmetricKey& getKMSLocalKey() override {
|
||||
return _localKey;
|
||||
}
|
||||
|
||||
|
|
@ -205,8 +205,8 @@ public:
|
|||
};
|
||||
|
||||
protected:
|
||||
void setUp();
|
||||
void tearDown();
|
||||
void setUp() override;
|
||||
void tearDown() override;
|
||||
|
||||
void createCollection(const NamespaceString& ns);
|
||||
|
||||
|
|
|
|||
|
|
@ -359,7 +359,7 @@ class GetMoreCmd final : public Command {
|
|||
public:
|
||||
GetMoreCmd() : Command("getMore") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersions1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public:
|
|||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName&,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) {
|
||||
BSONObjBuilder& result) override {
|
||||
// Critical to observability and diagnosability, annotate as immediate priority.
|
||||
ScopedAdmissionPriority skipAdmissionControl(opCtx, AdmissionContext::Priority::kExempt);
|
||||
result.append("id", repl::instanceId);
|
||||
|
|
|
|||
|
|
@ -97,10 +97,10 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual bool run(OperationContext* opCtx,
|
||||
const DatabaseName& dbName,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) override {
|
||||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName& dbName,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) override {
|
||||
IDLParserContext ctx("KillAllSessionsByPatternCmd");
|
||||
auto ksc = KillAllSessionsByPatternCmd::parse(ctx, cmdObj);
|
||||
|
||||
|
|
|
|||
|
|
@ -94,10 +94,10 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual bool run(OperationContext* opCtx,
|
||||
const DatabaseName&,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) override {
|
||||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName&,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) override {
|
||||
IDLParserContext ctx("KillAllSessionsCmd");
|
||||
auto ksc = KillAllSessionsCmd::parse(ctx, cmdObj);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class KillOpCmdBase : public BasicCommand {
|
|||
public:
|
||||
KillOpCmdBase() : BasicCommand("killOp") {}
|
||||
|
||||
virtual ~KillOpCmdBase() = default;
|
||||
~KillOpCmdBase() override = default;
|
||||
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -119,10 +119,10 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual bool run(OperationContext* opCtx,
|
||||
const DatabaseName& dbName,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) override {
|
||||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName& dbName,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) override {
|
||||
IDLParserContext ctx("KillSessionsCmd");
|
||||
auto ksc = KillSessionsCmdFromClient::parse(ctx, cmdObj);
|
||||
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ public:
|
|||
class Invocation final : public InvocationBaseGen {
|
||||
public:
|
||||
using InvocationBaseGen::InvocationBaseGen;
|
||||
virtual bool supportsWriteConcern() const final {
|
||||
bool supportsWriteConcern() const final {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ public:
|
|||
* would need to be done confirm support for both command and aggregation stages as is done for
|
||||
* the aggregate command.
|
||||
*/
|
||||
virtual ReadConcernSupportResult supportsReadConcern(const BSONObj& cmdObj,
|
||||
repl::ReadConcernLevel level,
|
||||
bool isImplicitDefault) const {
|
||||
ReadConcernSupportResult supportsReadConcern(const BSONObj& cmdObj,
|
||||
repl::ReadConcernLevel level,
|
||||
bool isImplicitDefault) const override {
|
||||
static const Status kReadConcernNotSupported{ErrorCodes::InvalidOptions,
|
||||
"read concern not supported"};
|
||||
static const Status kDefaultReadConcernNotPermitted{ErrorCodes::InvalidOptions,
|
||||
|
|
@ -68,7 +68,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return map_reduce_common::mrSupportsWriteConcern(cmd);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,11 +116,11 @@ public:
|
|||
return AllowedOnSecondary::kNever;
|
||||
}
|
||||
|
||||
virtual bool adminOnly() const {
|
||||
bool adminOnly() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -140,10 +140,10 @@ public:
|
|||
return Status::OK();
|
||||
}
|
||||
|
||||
virtual bool run(OperationContext* opCtx,
|
||||
const DatabaseName&,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) {
|
||||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName&,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) override {
|
||||
hangInAppendOplogNote.pauseWhileSet();
|
||||
|
||||
auto replCoord = repl::ReplicationCoordinator::get(opCtx);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class PipelineCommand final : public Command {
|
|||
public:
|
||||
PipelineCommand() : Command("aggregate") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersions1;
|
||||
}
|
||||
|
||||
|
|
@ -335,7 +335,7 @@ public:
|
|||
bool maintenanceOk() const override {
|
||||
return false;
|
||||
}
|
||||
ReadWriteType getReadWriteType() const {
|
||||
ReadWriteType getReadWriteType() const override {
|
||||
return ReadWriteType::kRead;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class ProfileCmdRequest;
|
|||
class ProfileCmdBase : public BasicCommand {
|
||||
public:
|
||||
ProfileCmdBase() : BasicCommand("profile") {}
|
||||
virtual ~ProfileCmdBase() {}
|
||||
~ProfileCmdBase() override {}
|
||||
|
||||
AllowedOnSecondary secondaryAllowed(ServiceContext*) const final {
|
||||
return AllowedOnSecondary::kAlways;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class CmdRenameCollection final : public TypedCommand<CmdRenameCollection> {
|
|||
public:
|
||||
using Request = RenameCollectionCommand;
|
||||
|
||||
virtual bool adminOnly() const {
|
||||
bool adminOnly() const override {
|
||||
return true;
|
||||
}
|
||||
AllowedOnSecondary secondaryAllowed(ServiceContext*) const override {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -101,7 +101,7 @@ public:
|
|||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName&,
|
||||
const BSONObj& jsobj,
|
||||
BSONObjBuilder& result) {
|
||||
BSONObjBuilder& result) override {
|
||||
AutoGetCollection coll(opCtx, NamespaceString::kRsOplogNamespace, MODE_X);
|
||||
uassert(ErrorCodes::NamespaceNotFound, "oplog does not exist", coll);
|
||||
uassert(ErrorCodes::IllegalOperation, "oplog isn't capped", coll->isCapped());
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class MockParameterService : public ServerParameterService {
|
|||
public:
|
||||
MockParameterService(std::function<ServerParameter*(StringData)> get) : _getMock(get){};
|
||||
|
||||
ServerParameter* get(StringData parameterName) {
|
||||
ServerParameter* get(StringData parameterName) override {
|
||||
return _getMock(parameterName);
|
||||
}
|
||||
|
||||
|
|
@ -83,23 +83,24 @@ public:
|
|||
void append(OperationContext* opCtx,
|
||||
BSONObjBuilder* b,
|
||||
StringData name,
|
||||
const boost::optional<TenantId>&) {}
|
||||
const boost::optional<TenantId>&) override {}
|
||||
|
||||
void appendSupportingRoundtrip(OperationContext* opCtx,
|
||||
BSONObjBuilder* b,
|
||||
StringData name,
|
||||
const boost::optional<TenantId>&) {}
|
||||
const boost::optional<TenantId>&) override {}
|
||||
|
||||
Status set(const BSONElement& newValueElement, const boost::optional<TenantId>& tenantId) {
|
||||
Status set(const BSONElement& newValueElement,
|
||||
const boost::optional<TenantId>& tenantId) override {
|
||||
return Status(ErrorCodes::BadValue, "Should not call set() in this test");
|
||||
}
|
||||
|
||||
Status setFromString(StringData str, const boost::optional<TenantId>& tenantId) {
|
||||
Status setFromString(StringData str, const boost::optional<TenantId>& tenantId) override {
|
||||
return Status(ErrorCodes::BadValue, "Should not call setFromString() in this test");
|
||||
}
|
||||
|
||||
Status validate(const BSONElement& newValueElement,
|
||||
const boost::optional<TenantId>& tenantId) const {
|
||||
const boost::optional<TenantId>& tenantId) const override {
|
||||
return validateImpl(newValueElement);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public:
|
|||
bool requiresAuth() const override {
|
||||
return true;
|
||||
}
|
||||
virtual bool adminOnly() const {
|
||||
bool adminOnly() const override {
|
||||
return true;
|
||||
}
|
||||
bool localHostOnlyIfNoAuth() const override {
|
||||
|
|
|
|||
|
|
@ -58,11 +58,11 @@ namespace mongo {
|
|||
/* For diagnostic / testing purposes. Enabled via command line. See docs/test_commands.md. */
|
||||
class CmdSleep : public BasicCommand {
|
||||
public:
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool adminOnly() const {
|
||||
bool adminOnly() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ public:
|
|||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName&,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) {
|
||||
BSONObjBuilder& result) override {
|
||||
LOGV2(20504, "Test-only command 'sleep' invoked");
|
||||
long long msToSleep = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -57,10 +57,10 @@ public:
|
|||
AllowedOnSecondary secondaryAllowed(ServiceContext*) const override {
|
||||
return AllowedOnSecondary::kAlways;
|
||||
}
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
virtual bool adminOnly() const {
|
||||
bool adminOnly() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ public:
|
|||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName&,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) {
|
||||
BSONObjBuilder& result) override {
|
||||
auto snapshotManager = getGlobalServiceContext()->getStorageEngine()->getSnapshotManager();
|
||||
if (!snapshotManager) {
|
||||
uasserted(ErrorCodes::CommandNotSupported, "");
|
||||
|
|
@ -102,10 +102,10 @@ public:
|
|||
AllowedOnSecondary secondaryAllowed(ServiceContext*) const override {
|
||||
return AllowedOnSecondary::kAlways;
|
||||
}
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
virtual bool adminOnly() const {
|
||||
bool adminOnly() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ public:
|
|||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName&,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) {
|
||||
BSONObjBuilder& result) override {
|
||||
auto snapshotManager = getGlobalServiceContext()->getStorageEngine()->getSnapshotManager();
|
||||
if (!snapshotManager) {
|
||||
uasserted(ErrorCodes::CommandNotSupported, "");
|
||||
|
|
|
|||
|
|
@ -191,12 +191,12 @@ public:
|
|||
bool supportsWriteConcern() const override {
|
||||
return false;
|
||||
}
|
||||
NamespaceString ns() const {
|
||||
NamespaceString ns() const override {
|
||||
return NamespaceString(request().getDbName());
|
||||
}
|
||||
};
|
||||
|
||||
std::string help() const {
|
||||
std::string help() const override {
|
||||
return "Start migrating databases whose names match the specified prefix to the specified "
|
||||
"replica set.";
|
||||
}
|
||||
|
|
@ -271,7 +271,7 @@ public:
|
|||
bool supportsWriteConcern() const override {
|
||||
return false;
|
||||
}
|
||||
NamespaceString ns() const {
|
||||
NamespaceString ns() const override {
|
||||
return NamespaceString(request().getDbName());
|
||||
}
|
||||
};
|
||||
|
|
@ -361,7 +361,7 @@ public:
|
|||
bool supportsWriteConcern() const override {
|
||||
return false;
|
||||
}
|
||||
NamespaceString ns() const {
|
||||
NamespaceString ns() const override {
|
||||
return NamespaceString(request().getDbName());
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -202,12 +202,12 @@ public:
|
|||
bool supportsWriteConcern() const override {
|
||||
return false;
|
||||
}
|
||||
NamespaceString ns() const {
|
||||
NamespaceString ns() const override {
|
||||
return NamespaceString(request().getDbName());
|
||||
}
|
||||
};
|
||||
|
||||
std::string help() const {
|
||||
std::string help() const override {
|
||||
return "Internal replica set command; instructs the recipient to sync data as part of a "
|
||||
"tenant migration.";
|
||||
}
|
||||
|
|
@ -419,12 +419,12 @@ public:
|
|||
return false;
|
||||
}
|
||||
|
||||
NamespaceString ns() const {
|
||||
NamespaceString ns() const override {
|
||||
return NamespaceString(request().getDbName());
|
||||
}
|
||||
};
|
||||
|
||||
std::string help() const {
|
||||
std::string help() const override {
|
||||
return "Interrupts tenant migration data sync and marks that the recipient's durable state "
|
||||
"machine may be garbage collected.";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class TestVersion2Cmd : public BasicCommand {
|
|||
public:
|
||||
TestVersion2Cmd() : BasicCommand("testVersion2") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersion2;
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ class TestVersions1And2Cmd : public BasicCommand {
|
|||
public:
|
||||
TestVersions1And2Cmd() : BasicCommand("testVersions1And2") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersion1And2;
|
||||
}
|
||||
|
||||
|
|
@ -114,11 +114,11 @@ class TestDeprecationInVersion2Cmd : public BasicCommand {
|
|||
public:
|
||||
TestDeprecationInVersion2Cmd() : BasicCommand("testDeprecationInVersion2") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersion1And2;
|
||||
}
|
||||
|
||||
const std::set<std::string>& deprecatedApiVersions() const {
|
||||
const std::set<std::string>& deprecatedApiVersions() const override {
|
||||
return kApiVersion2;
|
||||
}
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ class TestRemovalCmd : public BasicCommand {
|
|||
public:
|
||||
TestRemovalCmd() : BasicCommand("testRemoval") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersions1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,11 +51,11 @@ class TestDeprecationCmd : public BasicCommand {
|
|||
public:
|
||||
TestDeprecationCmd() : BasicCommand("testDeprecation") {}
|
||||
|
||||
const std::set<std::string>& apiVersions() const {
|
||||
const std::set<std::string>& apiVersions() const override {
|
||||
return kApiVersions1;
|
||||
}
|
||||
|
||||
const std::set<std::string>& deprecatedApiVersions() const {
|
||||
const std::set<std::string>& deprecatedApiVersions() const override {
|
||||
return kApiVersions1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ public:
|
|||
<< "Cannot specify both {full: true, background: true}.";
|
||||
}
|
||||
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -234,7 +234,7 @@ public:
|
|||
bool run(OperationContext* opCtx,
|
||||
const DatabaseName& dbName,
|
||||
const BSONObj& cmdObj,
|
||||
BSONObjBuilder& result) {
|
||||
BSONObjBuilder& result) override {
|
||||
if (MONGO_unlikely(validateCmdCollectionNotValid.shouldFail())) {
|
||||
result.appendBool("valid", false);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ public:
|
|||
return AllowedOnSecondary::kAlways;
|
||||
}
|
||||
|
||||
bool maintenanceOk() const {
|
||||
bool maintenanceOk() const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public:
|
|||
return AllowedOnSecondary::kAlways;
|
||||
}
|
||||
|
||||
virtual bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
bool supportsWriteConcern(const BSONObj& cmd) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue