~ubuntu-branches/ubuntu/trusty/mongodb/trusty-proposed

« back to all changes in this revision

Viewing changes to s/strategy.h

  • Committer: Bazaar Package Importer
  • Author(s): Antonin Kral
  • Date: 2010-01-29 19:48:45 UTC
  • Revision ID: james.westby@ubuntu.com-20100129194845-8wbmkf626fwcavc9
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// strategy.h
 
2
 
 
3
#pragma once
 
4
 
 
5
#include "../stdafx.h"
 
6
#include "chunk.h"
 
7
#include "request.h"
 
8
 
 
9
namespace mongo {
 
10
    
 
11
    class Strategy {
 
12
    public:
 
13
        Strategy(){}
 
14
        virtual ~Strategy() {}
 
15
        virtual void queryOp( Request& r ) = 0;
 
16
        virtual void getMore( Request& r ) = 0;
 
17
        virtual void writeOp( int op , Request& r ) = 0;
 
18
        
 
19
    protected:
 
20
        void doWrite( int op , Request& r , string server );
 
21
        void doQuery( Request& r , string server );
 
22
        
 
23
        void insert( string server , const char * ns , const BSONObj& obj );
 
24
        
 
25
    };
 
26
 
 
27
    extern Strategy * SINGLE;
 
28
    extern Strategy * SHARDED;
 
29
 
 
30
    bool setShardVersion( DBClientBase & conn , const string& ns , ShardChunkVersion version , bool authoritative , BSONObj& result );
 
31
 
 
32
    bool lockNamespaceOnServer( const string& server , const string& ns );
 
33
    bool lockNamespaceOnServer( DBClientBase& conn , const string& ns );
 
34
 
 
35
}
 
36