~ubuntu-branches/ubuntu/wily/mongodb/wily

« back to all changes in this revision

Viewing changes to src/mongo/db/ttl.cpp

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-26 09:41:32 UTC
  • mfrom: (1.2.25)
  • Revision ID: package-import@ubuntu.com-20130826094132-8cknfm4syxyip1zt
Tags: 1:2.4.6-0ubuntu1
* New upstream point release.
* d/control,d/tests/*: Add autopkgtests for server process and client
  shell functionality.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "mongo/db/instance.h"
28
28
#include "mongo/db/ops/delete.h"
29
29
#include "mongo/db/replutil.h"
 
30
#include "mongo/db/server_parameters.h"
30
31
#include "mongo/util/background.h"
31
32
 
32
33
namespace mongo {
37
38
    ServerStatusMetricField<Counter64> ttlPassesDisplay("ttl.passes", &ttlPasses);
38
39
    ServerStatusMetricField<Counter64> ttlDeletedDocumentsDisplay("ttl.deletedDocuments", &ttlDeletedDocuments);
39
40
 
40
 
 
 
41
    MONGO_EXPORT_SERVER_PARAMETER( ttlMonitorEnabled, bool, true );
41
42
    
42
43
    class TTLMonitor : public BackgroundJob {
43
44
    public:
124
125
                sleepsecs( 60 );
125
126
                
126
127
                LOG(3) << "TTLMonitor thread awake" << endl;
 
128
 
 
129
                if ( !ttlMonitorEnabled ) {
 
130
                   LOG(1) << "TTLMonitor is disabled" << endl;
 
131
                   continue;
 
132
                }
127
133
                
128
134
                if ( lockedForWriting() ) {
129
135
                    // note: this is not perfect as you can go into fsync+lock between