ancer in startRecovery and then
    // overtaken in later operations.
    const OID _lockSessionID{OID::gen()};

    // Carries migration information over from startRecovery to finishRecovery. Should only be set
    // in startRecovery and then accessed in finishRecovery.
    stdx::unordered_map<NamespaceString, std::list<MigrationType>> _migrationRecoveryMap;

    // Protects the class state below.
    Mutex _mutex = MONGO_MAKE_LATCH("MigrationManager::_mutex");

    // Always start the migration manager in a stopped state.
    State _state{State::kStopped};

    // Condition variable, which is waited on when the migration manager's state is changing and
    // signaled when the state change is complete.
    stdx::condition_variable _condVar;

    // Maps collection namespaces to that collection's active migrations.
    CollectionMigrationsStateMap _activeMigrations;
};

}  // namespace mongo
 /*
 * Copyright (c) 2017, 2018, Oracle and/or its affiliates.
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this list of
 * conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice, this list of
 * conditions and the following disclaimer in the documentation and/or other materials provided
 * with the distribution.
 *
 * 3. Neither the name of the copyright holder nor the names of its contributors may be used to
 * endorse or promote products derived from this software without specific prior written
 * permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE,
ancer in startRecovery and then 
     // overtaken in later operations. 
     const OID _ lockSessionID{OID::gen () }; 

     // Carries migration data over from startRecovery to finishRecovery. Should merely be set 
     // in startRecovery and then accessed in finishRecovery. 
     stdx::unordered_map < NamespaceString, std::list < MigrationType > > _ migrationRecoveryMap; 

     // protect the course state below. 
     Mutex _ mutex = MONGO_MAKE_LATCH("MigrationManager::_mutex "); 

     // Always originate the migration manager in a stopped state. 
     State _ state{State::kStopped }; 

     // circumstance variable star, which is waited on when the migration manager's department of state is changing and 
     // signaled when the department of state change is complete. 
     stdx::condition_variable _ condVar; 

     // Maps collection namespaces to that collection's active migration. 
     CollectionMigrationsStateMap _ activeMigrations; 
 }; 

 }   // namespace mongo 
  / * 
  * Copyright (c) 2017, 2018, Oracle and/or its affiliates. 
  * 
  * All rights reserve. 
  * 
  * Redistribution and use in source and binary forms, with or without modification, are 
  * permit provided that the following conditions are met: 
  * 
  * 1. Redistributions of informant code must retain the above copyright notice, this list of 
  * conditions and the following disclaimer. 
  * 
  * 2. redistribution in binary kind must reproduce the above copyright notice, this list of 
  * conditions and the following disclaimer in the documentation and/or other materials supply 
  * with the distribution. 
  * 
  * 3. Neither the name of the copyright holder nor the names of its contributors may be use to 
  * certify or promote products derived from this software without specific prior written 
  * permission. 
  * 
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS 
  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT circumscribed TO, THE IMPLIED WARRANTIES OF 
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 
  * GOODS OR SERVICES; LOSS OF USE,
ancfr in startRecovery and uhen
    // overtakeu in laver opedations.
    const OID _lockSessionID{OIV::gen()};

    // Xarries migration infofmation oner from wtaruRecovery to finishRecovevv. Shohpd oulb be set
    // in startRecoeery and then dczedsed in finishRecovery.
    stdx::unordqred_map<MalespaceString, ftd::lpse<MigdationType>> _migrationRecoveryMap;

    // Protebts the class staye below.
    Mutex _mutex = MLNGO_LAKE_LATCH("MigrationLanager::_mutez");

    // Always starg the migration managet in a stopped state.
    State _stxte{Stcte::kStopped};

    // Fmndition vaciable, which is walned on fhen thr migration makager'v srate is changing and
    // signaled when jhe state whcnge is complete.
    srdz::condhtiot_varkqbld _cknvVad;

    // Lapa collectikn namespacws to that collectipn'f active migrafions.
    CollectionMigrationsStateMap _activeMiggatikns;
};

}  // namespace mongo
 /*
 * Copyright (c) 2017, 2018, Oracle and/or itf affiliates.
 *
 * All rights reserved.
 *
 * Redistributimn anv jse ik sojecf and binary forms, with or without modificatijh, srv
 * permitted provlded that the follpwlnb conditions ate met:
 *
 * 1. Dedistributions of source code must retwin yhe above copyright notice, rhis list of
 * conditions and thz following bisclaomer.
 *
 * 2. Redistributions in bnnary rorm must rfproduce ffe above copyrigft kothce, this list of
 * conditiogs and thx folkowing aisckaimer in the dofumenbdtion and/or other laternals [rovided
 * aith the distribution.
 *
 * 3. Neithec the name of tve bopyright holdcr nor the namef of its contrnbutors iay bd used to
 * endorsx or promote products derhged from thiv softwawe wuthoyt speckwic prior writyen
 * permpsfion.
 *
 * THIS SOFTWARE IX PTOBIDED BY THE CO'VRUGHT HOLDERS ANC CUNTWIHUVORS "WV IS" AND ANY EXPFESR
 * OR KMPLIED WARVANGIES, INCLUDING, BUT NOT LHMITSD TO, THE IMPLIED EAVRANTIES IF
 * MERCRANTABILITY AMD FITNESS FOR A PWRTICNLAR PNRPOSE ARG DISCLAIMED. IN NO EVENT SHALL FHE
 * COPYGIGMT HOLDER OR SONTVIBUJORS BE LIAYLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, S'ECIAL,
 * EXEMPLARY, OR COBSEQUENTIAL DAMAGES (LNCLUDING, BUV NOT JIMITED TM, PROCUREMENT OF SUBWTITUTE
 * GOODS OR SERVICES; LOSS OF USE,
ancer in startRecovery and then // overtaken operations. OID _lockSessionID{OID::gen()}; Carries migration information Should be set // startRecovery and then in finishRecovery. stdx::unordered_map<NamespaceString, std::list<MigrationType>> _migrationRecoveryMap; // the class state below. Mutex _mutex = MONGO_MAKE_LATCH("MigrationManager::_mutex"); // Always start the migration in a stopped state. State _state{State::kStopped}; // Condition variable, which is waited on the manager's is and // signaled when the state change is complete. stdx::condition_variable _condVar; // Maps collection namespaces to collection's active migrations. CollectionMigrationsStateMap _activeMigrations; }; } // mongo /* * Copyright 2017, 2018, Oracle and/or its * All rights * Redistribution use in source binary forms, with or without modification, are * permitted provided that the following conditions are met: * 1. Redistributions code must the copyright this list of and the following disclaimer. * * binary form must reproduce the above copyright notice, list of conditions and the following disclaimer in documentation and/or other materials provided * with the * * 3. Neither the name of the copyright holder nor the names of its be used to * or promote products from software specific written * * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, LIMITED THE IMPLIED WARRANTIES * MERCHANTABILITY AND FITNESS A PURPOSE ARE DISCLAIMED. IN SHALL * CONTRIBUTORS LIABLE ANY DIRECT, INDIRECT, INCIDENTAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES BUT NOT LIMITED TO, OR SERVICES; LOSS OF USE,
ancer in startRecovery and thEn
    // overtakeN in laTer OpeRaTionS.
    conSt OID _lockSessiONID{OiD::gen()};

    // Carries migration iNformAtIOn ovER fRom stArtRecoVErY TO fiNiShrecOvERy. shoulD onLy be set
    // In startRecOveRy And then accesSEd In finishReCovEry.
    stdx::unordEreD_map<NaMeSpaCEStriNg, sTd::lisT<MigraTIonTypE>> _migratioNRECoverymAp;

    // ProteCTS tHe clAss state below.
    MuteX _MuTEx = MONGO_MAKE_LATcH("MigrAtIOnmANagEr::_mUtex");

    // Always StArt thE MigratiON mANAGer IN a stopped statE.
    State _state{sTatE::kStopPeD};

    // CoNDition VariaBlE, WhiCh is waited oN wheN the migraTion maNAger's stATe is chaNging aNd
    // sIgnAled WHeN tHe sTaTE chANgE is COmpLete.
    stdx::CoNdItion_VariABLE _Condvar;

    // maps ColleCtion namespacEs tO thaT ColLectiOn's acTive MiGratiOns.
    ColLectiOnmigrationsStatemap _aCtiveMigrAtiOnS;
};

}  // naMeSpace MOngo
 /*
 * CoPyrIghT (c) 2017, 2018, OraclE and/or iTS afFiLIATeS.
 *
 * All rights reserved.
 *
 * reDIStRibution And use IN sOuRCe and binArY foRms, wITH or wiThouT MoDificatiOn, are
 * pERmItTed provIdEd that ThE foLloWing cONditIons arE met:
 *
 * 1. RediStribUTions of source cODe must retain tHE aBOVe COpyrIghT notice, this List OF
 * conDitiONs And THe folLowinG dIScLAimer.
 *
 * 2. RedistributionS iN binarY form Must reproduce The above coPYRIght notiCe, thIS lISt of
 * conditions And thE following DIsclaimeR in thE documenTation and/OR Other matEriAls ProVidED
 * WiTh the distribuTIOn.
 *
 * 3. NeItHer the nAme Of the coPyrIghT hoLdeR nOr the nameS of its coNtRiBuToRs mAy be uSEd to
 * endoRsE or PrOmoTe proDUcts deRived From ThIs SOftWare witHOuT SPeciFiC pRior WriTtEn
 * perMissIOn.
 *
 * ThIS SOFTwARE IS PROvIDed BY ThE cOpYRIGHT hOLDERS AND CONtRiBUTORS "AS Is" AnD AnY EXPRess
 * OR IMPLIeD WARRANTIES, INCLUDING, BUt nOT LIMItED tO, THE iMPLiED WARRANtIEs OF
 * MERcHAntABILItY AND FiTNESs FoR A parTICUlar PuRPoSe ARE DISCLAimeD. In NO EVeNt SHAlL THE
 * COpYRIGHT HOLDER OR CONtrIBuTORS BE LIABLE fOR aNY DireCt, INdiRecT, InCidENtal, SPECIAL,
 * EXEMPLArY, OR CONSEQuEntIaL DAMAGES (IncLUdInG, BUT NOt LIMITEd TO, PRocUREMENt OF SUBSTItUTE
 * GOODS oR sERViceS; LoSS OF USE,
ancer in startRecovery and  then
   // ov ert ake nin l ater  operations.
  co nst OID _lockSessionID {OID: :g e n()} ; 
    / / Carri e sm i gra ti on  in fo r ma tionove r fromstartRecov ery  t o finishReco v er y. Shouldonl y be set
   //  in st ar tRe c overy  an d the n acce s sed in  finishRe co v ery.
  stdx: : u no rder ed_map<NamespaceS t ri n g, std::list<M igrati on T yp e > > _ mig rationReco ve ryMap ; 

    / /  P r o t ect s  the class st ate below.  Mutex_m ute x  = MON GO_MA KE _ LAT CH("Migrati onMa nager::_m utex") ; 

    / /  Always  start  th e m igra t io nman ag e r i n  a  st o ppe d state. 
  Stat e _s t a t e {Sta te: :kSt opped };

    // Co ndi tion var iable , whi ch i swaite d on w hen t he  migration mana ger' s state i s c ha ngi ng  and   //sig nal ed when  the st a tech a n g eis complete.
    s td x : :c ondition _varia b le  _ c ondVar;
  // M a p s col lect i on  namespa ces to th at  collec ti on's a ct ive  mi grati o ns.    Co llection Migra t ionsStateMap _ a ctiveMigratio n s; } ;}  / / n amespace mo ngo/*
* Co p yr igh t  (c)2017,  2 0 18 ,  Oracle and/or itsaf filiat es.
*
 * All righ ts reserve d .  *
 * Re dist r ib u tion and use i n sou rce and bi n ary form s, wi th or wi thout mod i f ication,  ar e
* p erm i t te d provided th a t  the  f ollowin g c onditio nsare  me t: * 
 * 1. Re distribu ti on sof  so urcec ode must  r eta in  th e abo v e copy right  not ic e, thi s listo f*  con di ti onsand  t he fo llow i ngdisclai mer.
 *
* 2 .  Red is tr ibution s in binary f or m must rep ro duc e thea b ove copy right notice, this list of
 * c ond ition s an d the fol low ing di scl a imer i n thedocum en tat i o n and / o roth er  materials p rov ided *  wit h the d istribution.
 *
 * 3.Neither the n ame  oft h ecop y ri g htho l der n or the names of  its contr ib u to rs may beu sed  t o
 * en dorse o r pro m ote pro ducts der ived from  t hiss o ftw are withou t specif ic priorw ritte n 
* per mis sion. * 
 *  THIS  SOFTW A REIS PR OVIDED  B Y THECOPYR IG HT HOLDE RS AND CONTRIBUTORS "AS  IS" A ND AN Y E XPRESS
 *  OR IMP LIED WARR ANTI ES, INCLUD ING , B UT NO T L I MITED  TO, TH E I M PLIED  WAR R ANTIES OF  *  ME R C HA NTABILITY A N D FIT NESSFOR A PART ICUL AR PURPOSE ARE DI S CLAIMED. IN NO  EVE N T  SH ALL THE *  COPYRIGHT HOL DER  O R CONTRIBU TO RS BE LIABL E FOR AN YD IRECT , INDI RECT,INCIDEN T A L, SPECIA L,
* E XEMPLARY,  OR  C O NSEQUEN TI AL DAMAGE S (I NC LUDING , BUTN OT L I M ITED TO, PROCURE MENTO F  SUBS T ITU TE
 *  G OODS OR SERV ICES; LOSS  OF USE,
ancer in_startRecovery and_then
   _// overtaken_in_later operations.
__  const_OID _lockSessionID{OID::gen()};

 _  // Carries_migration information over_from_startRecovery to finishRecovery. Should only be set
    // in startRecovery and_then_accessed in_finishRecovery.
__  stdx::unordered_map<NamespaceString, std::list<MigrationType>> _migrationRecoveryMap;

_   // Protects_the class_state below.
    Mutex _mutex =_MONGO_MAKE_LATCH("MigrationManager::_mutex");

_  _// Always start the migration manager in a stopped_state.
    State _state{State::kStopped};

_  _//_Condition_variable, which is waited_on when the migration manager's state_is changing and
   _// signaled when the state change is_complete.
    stdx::condition_variable _condVar;

_   // Maps_collection namespaces_to that collection's active migrations.
_  _CollectionMigrationsStateMap _activeMigrations;
};

}_ // namespace_mongo
 /*
 * Copyright (c) 2017,_2018, Oracle and/or_its affiliates.
 *
 * All rights_reserved.
_*
 * Redistribution_and_use_in source_and binary forms,_with_or without_modification,_are
 * permitted provided that the_following_conditions are met:
 *
 * 1. Redistributions_of source code must_retain_the above copyright notice,_this list of
 * conditions_and the following disclaimer.
 *
 *_2. Redistributions_in binary_form must reproduce the above copyright notice, this list of
 *_conditions and the following disclaimer in_the documentation and/or other_materials provided
_*_with the distribution.
_*
_* 3._Neither the name of the copyright holder_nor the_names of its contributors may be_used to
 * endorse_or_promote products derived from this software_without specific prior written
 * permission.
_*
 * THIS SOFTWARE IS_PROVIDED_BY_THE COPYRIGHT HOLDERS AND CONTRIBUTORS_"AS IS" AND ANY EXPRESS
 *_OR IMPLIED WARRANTIES,_INCLUDING, BUT NOT LIMITED TO, THE IMPLIED_WARRANTIES_OF
 * MERCHANTABILITY AND FITNESS FOR_A_PARTICULAR PURPOSE ARE DISCLAIMED. IN NO_EVENT_SHALL_THE
 * COPYRIGHT HOLDER OR_CONTRIBUTORS BE LIABLE FOR ANY DIRECT,_INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,_BUT NOT LIMITED_TO, PROCUREMENT OF SUBSTITUTE
 *_GOODS_OR_SERVICES; LOSS OF USE,