diff options
Diffstat (limited to 'src/mongo/db/s/shard_metadata_util.h')
-rw-r--r-- | src/mongo/db/s/shard_metadata_util.h | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/src/mongo/db/s/shard_metadata_util.h b/src/mongo/db/s/shard_metadata_util.h index 52f043a0b9a..a23efa4b577 100644 --- a/src/mongo/db/s/shard_metadata_util.h +++ b/src/mongo/db/s/shard_metadata_util.h @@ -32,7 +32,7 @@ #include <string> #include <vector> -#include "mongo/base/status.h" +#include "mongo/base/status_with.h" #include "mongo/bson/bsonobj.h" #include "mongo/bson/oid.h" #include "mongo/s/chunk_version.h" @@ -40,17 +40,11 @@ namespace mongo { class ChunkType; -class CollectionMetadata; class NamespaceString; class OperationContext; class ShardCollectionType; class ShardDatabaseType; -template <typename T> -class StatusWith; -/** - * Function helpers to locally, using a DBDirectClient, read and write sharding metadata on a shard. - */ namespace shardmetadatautil { /** @@ -62,25 +56,6 @@ struct QueryAndSort { }; /** - * Subset of the shard's collections collection document that relates to refresh state. - */ -struct RefreshState { - bool operator==(const RefreshState& other) const; - - std::string toString() const; - - // The current generation of the collection. - CollectionGeneration generation; - - // Whether a refresh is currently in progress. - bool refreshing; - - // The collection version after the last complete refresh. Indicates change if refreshing has - // started and finished since last loaded. - ChunkVersion lastRefreshedCollectionVersion; -}; - -/** * Returns the query needed to find incremental changes to the chunks collection on a shard server. * * The query has to find all the chunks $gte the current max version. Currently, any splits, merges @@ -115,6 +90,26 @@ Status unsetPersistedRefreshFlags(OperationContext* opCtx, const ChunkVersion& refreshedVersion); /** + * Represents a subset of a collection's config.cache.collections entry that relates to refresh + * state. + */ +struct RefreshState { + bool operator==(const RefreshState& other) const; + + std::string toString() const; + + // The current generation of the collection. + CollectionGeneration generation; + + // Whether a refresh is currently in progress. + bool refreshing; + + // The collection version after the last complete refresh. Indicates change if refreshing has + // started and finished since last loaded. + ChunkVersion lastRefreshedCollectionVersion; +}; + +/** * Reads the persisted refresh signal for 'nss' and returns those settings. */ StatusWith<RefreshState> getPersistedRefreshFlags(OperationContext* opCtx, |