~evarlast/ubuntu/utopic/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to src/mongo/db/index_update.h

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "mongo/db/diskloc.h"
20
20
#include "mongo/db/index.h"
21
21
#include "mongo/db/jsobj.h"
 
22
#include "mongo/platform/cstdint.h"
22
23
 
23
24
namespace mongo {
24
25
    class NamespaceDetails;
30
31
    // Build an index in the foreground
31
32
    // If background is false, uses fast index builder
32
33
    // If background is true, uses background index builder; blocks until done.
33
 
    void buildAnIndex(string ns, NamespaceDetails *d, IndexDetails& idx, int idxNo, bool background);
 
34
    void buildAnIndex(const std::string& ns,
 
35
                      NamespaceDetails *d,
 
36
                      IndexDetails& idx,
 
37
                      bool background,
 
38
                      bool mayInterrupt);
34
39
 
35
40
    // add index keys for a newly inserted record 
36
41
    // done in two steps/phases to allow potential deferal of write lock portion in the future
48
53
 
49
54
    bool dropIndexes( NamespaceDetails *d, const char *ns, const char *name, string &errmsg, BSONObjBuilder &anObjBuilder, bool maydeleteIdIndex );
50
55
 
51
 
}
 
56
    /**
 
57
     * Add an _id index to namespace @param 'ns' if not already present.
 
58
     * @param mayInterrupt When true, killop may interrupt the function call.
 
59
     */
 
60
    void ensureHaveIdIndex(const char* ns, bool mayInterrupt);
 
61
 
 
62
    ////// The remaining functions are only included in this header file for unit testing.
 
63
 
 
64
    class BSONObjExternalSorter;
 
65
    class CurOp;
 
66
    class ProgressMeter;
 
67
    class ProgressMeterHolder;
 
68
    struct SortPhaseOne;
 
69
    class Timer;
 
70
 
 
71
    /** Extract index keys from the @param 'ns' to the external sorter in @param 'phaseOne'. */
 
72
    void addKeysToPhaseOne( const char* ns,
 
73
                            const IndexDetails& idx,
 
74
                            const BSONObj& order,
 
75
                            SortPhaseOne* phaseOne,
 
76
                            int64_t nrecords,
 
77
                            ProgressMeter* progressMeter,
 
78
                            bool mayInterrupt );
 
79
 
 
80
    /** Popuate the index @param 'idx' using the keys contained in @param 'sorter'. */
 
81
    template< class V >
 
82
    void buildBottomUpPhases2And3( bool dupsAllowed,
 
83
                                   IndexDetails& idx,
 
84
                                   BSONObjExternalSorter& sorter,
 
85
                                   bool dropDups,
 
86
                                   set<DiskLoc>& dupsToDrop,
 
87
                                   CurOp* op,
 
88
                                   SortPhaseOne* phase1,
 
89
                                   ProgressMeterHolder& pm,
 
90
                                   Timer& t,
 
91
                                   bool mayInterrupt );
 
92
 
 
93
    /** Drop duplicate documents from the set @param 'dupsToDrop'. */
 
94
    void doDropDups( const char* ns,
 
95
                     NamespaceDetails* d,
 
96
                     const set<DiskLoc>& dupsToDrop,
 
97
                     bool mayInterrupt );
 
98
 
 
99
} // namespace mongo