Source code of Windows XP (NT5)
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.

167 lines
4.8 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1991 - 1998.
  5. //
  6. // File: CHANGES.HXX
  7. //
  8. // Contents: Table of changes
  9. //
  10. // Classes: CChange
  11. //
  12. // History: 29-Mar-91 BartoszM Created
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include <doclist.hxx>
  17. #include "dqueue.hxx"
  18. class CChangeTrans;
  19. class CTransaction;
  20. class CFresh;
  21. class CNotificationTransaction;
  22. //+---------------------------------------------------------------------------
  23. //
  24. // Class: CChange (ch)
  25. //
  26. // Purpose: Record changes to volatile indexes
  27. //
  28. // History: 29-Mar-91 BartoszM Created.
  29. // 08-Feb-94 DwightKr Added persistent methods/code
  30. //
  31. //----------------------------------------------------------------------------
  32. class CChange
  33. {
  34. public:
  35. CChange ( WORKID wid, PStorage& storage, CCiFrameworkParams & frmwrkParams );
  36. void LokEmpty();
  37. NTSTATUS LokDismount( CChangeTrans & xact )
  38. {
  39. NTSTATUS status1 = _queue.LokDismount( xact );
  40. NTSTATUS status2 = _secQueue.LokDismount( xact );
  41. return (STATUS_SUCCESS != status1) ? status1 : status2;
  42. }
  43. //
  44. // Log updates - this is transacted
  45. //
  46. SCODE LokUpdateDocument( CChangeTrans & xact,
  47. WORKID wid,
  48. USN usn,
  49. VOLUMEID volumeId,
  50. ULONG flags,
  51. ULONG cRetries,
  52. ULONG cSecQRetries )
  53. {
  54. return _queue.Append ( xact, wid, usn, volumeId, flags, cRetries, cSecQRetries );
  55. }
  56. void LokFlushUpdates()
  57. {
  58. _queue.LokFlushUpdates();
  59. _secQueue.LokFlushUpdates();
  60. }
  61. void LokAddToSecQueue( CChangeTrans & xact,
  62. WORKID wid,
  63. VOLUMEID volumeId,
  64. ULONG cSecQRetries );
  65. void LokRefileSecQueue( CChangeTrans & xact );
  66. void LokRefileDocs( const CDocList & docList )
  67. {
  68. _queue.LokRefileDocs( docList );
  69. }
  70. void LokAppendRefiledDocs( CChangeTrans & xact )
  71. {
  72. _queue.LokAppendRefiledDocs( xact );
  73. }
  74. // don't remove updates from list
  75. BOOL LokGetPendingUpdates( WORKID * aWid, unsigned & cWid );
  76. // remove updates from list - this is transacted
  77. void LokQueryPendingUpdates ( CChangeTrans & xact,
  78. unsigned max,
  79. CDocList& docList );
  80. // log creation of new wordlist
  81. void LokDone ( CChangeTrans & xact,
  82. INDEXID iid,
  83. CDocList& docList );
  84. // log removal of wordlists
  85. void LokRemoveIndexes ( CTransaction& xact,
  86. unsigned cIndex,
  87. INDEXID aIndexIds[] );
  88. unsigned LokCount() const
  89. {
  90. return _queue.Count();
  91. }
  92. unsigned LokCountSec() const
  93. {
  94. return _secQueue.Count();
  95. }
  96. void LokCompact();
  97. void LokDeleteWIDsInPersistentIndexes( CChangeTrans & xact,
  98. CFreshTest & freshTestLatest,
  99. CFreshTest & freshTestAtMerge,
  100. CDocList & docList,
  101. CNotificationTransaction & notifTrans )
  102. {
  103. _queue.LokDeleteWIDsInPersistentIndexes( xact,
  104. freshTestLatest,
  105. freshTestAtMerge,
  106. docList,
  107. notifTrans );
  108. _secQueue.LokDeleteWIDsInPersistentIndexes( xact,
  109. freshTestLatest,
  110. freshTestAtMerge,
  111. docList,
  112. notifTrans );
  113. }
  114. void LokDisableUpdates()
  115. {
  116. _queue.LokDisableUpdates();
  117. _secQueue.LokDisableUpdates();
  118. }
  119. void LokEnableUpdates( BOOL fFirstTimeUpdatesAreEnabled )
  120. {
  121. _queue.LokEnableUpdates( fFirstTimeUpdatesAreEnabled );
  122. _secQueue.LokEnableUpdates( fFirstTimeUpdatesAreEnabled );
  123. }
  124. void SetResMan( CResManager * pResMan, BOOL fPushFiltering )
  125. {
  126. _queue.SetResMan( pResMan, fPushFiltering );
  127. _secQueue.SetResMan( pResMan, fPushFiltering );
  128. }
  129. private:
  130. CCiFrameworkParams & _frmwrkParams;
  131. CDocQueue _queue;
  132. CDocQueue _secQueue; // Secondary queue for documents that
  133. // should be retried later.
  134. LONGLONG _ftLast; // Last Time Stamp
  135. };