Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
3.1 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1998.
  5. //
  6. // File: FRESH.HXX
  7. //
  8. // Contents: Fresh indexes
  9. //
  10. // Classes: CFresh
  11. //
  12. // History: 16-May-91 BartoszM Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <xact.hxx>
  17. #include <freshlog.hxx>
  18. #include "fretest.hxx"
  19. #include "dqueue.hxx"
  20. class CIndexTrans;
  21. class CMergeTrans;
  22. class PStorage;
  23. class CWidArray;
  24. class CDocList;
  25. class CResManager;
  26. class CPartList;
  27. class CPartition;
  28. class CWordList;
  29. class PSaveProgressTracker;
  30. class CEnumWorkid;
  31. //+---------------------------------------------------------------------------
  32. //
  33. // Class: CFresh
  34. //
  35. // Purpose: Contains the mapping of work id's into the most current
  36. // indexes for these work id's.
  37. //
  38. // History: 16-May-91 BartoszM Created.
  39. //
  40. //----------------------------------------------------------------------------
  41. class CFresh
  42. {
  43. friend class CFreshTest;
  44. friend class CResManager;
  45. friend class CMerge;
  46. public:
  47. CFresh ( PStorage& storage, CTransaction& xact,
  48. CPartList & partList );
  49. ~CFresh ();
  50. void LokInit();
  51. CFreshTest* LokGetFreshTest();
  52. unsigned LokCount() const { return _master->Count(); }
  53. unsigned LokDeleteCount() const { return _master->DeleteCount(); }
  54. WORKID LokUpdate ( CMerge & merge, CMergeTrans& xact,
  55. CPersFresh & newFreshLog,
  56. INDEXID new_iid,
  57. int cInd,
  58. INDEXID aIidOld[],
  59. XPtr<CFreshTest> & xFreshTestAtMerge );
  60. void LokAddIndex ( CIndexTrans& xact,
  61. INDEXID iid, INDEXID iidDeleted,
  62. CDocList& docList,
  63. CWordList const & wordList );
  64. WORKID LokRemoveIndexes ( CMergeTrans& xact, CPersFresh & newFreshLog,
  65. unsigned cInd,
  66. INDEXID aIidOld[],
  67. INDEXID iidOldDeleted );
  68. void LokDeleteDocuments (
  69. CIndexTrans& xact,
  70. CDocList& docList,
  71. INDEXID iidDeleted );
  72. void LokReleaseFreshTest( CFreshTest* test );
  73. void LokCommitMaster ( CFreshTest* newMaster );
  74. void LokEmpty();
  75. void LokMakeFreshLogBackup( PStorage & storage,
  76. PSaveProgressTracker & progressTracker,
  77. XInterface<ICiEnumWorkids> & xWorkidEnum );
  78. #if DEVL == 1
  79. void Dump ();
  80. #endif
  81. #ifdef CIEXTMODE
  82. void CiExtDump(void *ciExtSelf);
  83. #endif
  84. private:
  85. WORKID LokBuildNewFreshLog( CFreshTest *newFreTest,
  86. CPersFresh & newFreshLog,
  87. CIdxSubstitution& subst);
  88. PStorage & _storage;
  89. CFreshTest* _master; // master copy of in-memory fresh test
  90. CPersFresh _persFresh;
  91. CPartList & _partList; // PartList
  92. };