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.

255 lines
5.7 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. partctrl.h
  5. Abstract:
  6. SIS Groveler partition controller headers
  7. Authors:
  8. John Douceur, 1998
  9. Environment:
  10. User Mode
  11. Revision History:
  12. --*/
  13. #ifndef _INC_PARTCTRL
  14. #define _INC_PARTCTRL
  15. class PartitionController
  16. {
  17. public:
  18. PartitionController(
  19. Groveler *groveler,
  20. GrovelStatus groveler_status,
  21. int target_entries_per_extraction,
  22. int max_extraction_interval,
  23. int base_grovel_interval,
  24. int max_grovel_interval,
  25. int low_confidence_grovel_interval,
  26. int low_disk_space_grovel_interval,
  27. int partition_info_update_interval,
  28. int base_restart_extraction_interval,
  29. int max_restart_extraction_interval,
  30. int base_restart_groveling_interval,
  31. int max_restart_groveling_interval,
  32. int base_regrovel_interval,
  33. int max_regrovel_interval,
  34. int volscan_regrovel_threshold,
  35. int partition_balance_time_constant,
  36. int read_time_increase_history_size,
  37. int read_time_decrease_history_size,
  38. int file_size_history_size,
  39. bool error_retry_log_extraction,
  40. bool error_retry_groveling,
  41. __int64 base_usn_log_size,
  42. __int64 max_usn_log_size,
  43. int sample_group_size,
  44. double acceptance_p_value,
  45. double rejection_p_value,
  46. double base_use_multiplier,
  47. double max_use_multiplier,
  48. double peak_finder_accuracy,
  49. double peak_finder_range,
  50. double base_cpu_load_threshold,
  51. double max_cpu_load_threshold,
  52. double *hash_match_ratio,
  53. double *compare_match_ratio,
  54. double *dequeue_hash_ratio,
  55. double *hash_read_time_estimate,
  56. double *compare_read_time_estimate,
  57. double *mean_file_size,
  58. double *read_time_confidence,
  59. int *volume_serial_number,
  60. int partition_index,
  61. double read_report_discard_threshold,
  62. int min_file_size,
  63. int min_file_age,
  64. bool allow_compressed_files,
  65. bool allow_encrypted_files,
  66. bool allow_hidden_files,
  67. bool allow_offline_files,
  68. bool allow_temporary_files,
  69. int num_excluded_paths,
  70. const _TCHAR **excluded_paths);
  71. ~PartitionController();
  72. bool control_operation(
  73. DWORD grovel_duration,
  74. DWORD *count_of_files_hashed,
  75. DWORDLONG *bytes_of_files_hashed,
  76. DWORD *count_of_files_matching,
  77. DWORDLONG *bytes_of_files_matching,
  78. DWORD *count_of_files_compared,
  79. DWORDLONG *bytes_of_files_compared,
  80. DWORD *count_of_files_merged,
  81. DWORDLONG *bytes_of_files_merged,
  82. DWORD *count_of_files_enqueued,
  83. DWORD *count_of_files_dequeued,
  84. double cpu_load);
  85. void advance(
  86. int time_delta);
  87. double priority() const;
  88. int wait() const;
  89. void demarcate_foreground_batch();
  90. void command_full_volume_scan();
  91. private:
  92. enum ReadType
  93. {
  94. RT_hash,
  95. RT_compare
  96. };
  97. static void control_extraction(
  98. void *context);
  99. static void restart_extraction(
  100. void *context);
  101. static void restart_groveling(
  102. void *context);
  103. static void update_partition_info(
  104. void *context);
  105. void initialize_groveling(
  106. GrovelStatus groveler_status);
  107. bool control_groveling(
  108. DWORD grovel_duration,
  109. DWORD *count_of_files_hashed,
  110. DWORDLONG *bytes_of_files_hashed,
  111. DWORD *count_of_files_matching,
  112. DWORDLONG *bytes_of_files_matching,
  113. DWORD *count_of_files_compared,
  114. DWORDLONG *bytes_of_files_compared,
  115. DWORD *count_of_files_merged,
  116. DWORDLONG *bytes_of_files_merged,
  117. DWORD *count_of_files_enqueued,
  118. DWORD *count_of_files_dequeued,
  119. double cpu_load);
  120. bool control_volume_scan(
  121. int scan_duration,
  122. DWORD *count_of_files_enqueued);
  123. void update_peak_finder(
  124. ReadType read_type,
  125. DWORD read_time,
  126. DWORD read_ops);
  127. void calculate_effective_max_grovel_interval();
  128. Groveler *groveler;
  129. int partition_index;
  130. IncidentFilter file_size_filter;
  131. ConfidenceEstimator read_time_confidence_estimator;
  132. DecayingAccumulator partition_grovel_accumulator;
  133. MeanComparator read_mean_comparator;
  134. PeakFinder *read_peak_finder[2];
  135. DirectedIncidentFilter *read_time_filter[2];
  136. double *read_time_estimate[2];
  137. bool initiate_full_volume_scan;
  138. bool performing_full_volume_scan;
  139. int target_entries_per_extraction;
  140. int max_extraction_interval;
  141. int extraction_interval;
  142. __int64 base_usn_log_size;
  143. __int64 max_usn_log_size;
  144. __int64 current_usn_log_size;
  145. int max_grovel_interval;
  146. int base_grovel_interval;
  147. int effective_max_grovel_interval;
  148. int grovel_interval;
  149. int remaining_grovel_interval;
  150. bool ok_to_record_measurement;
  151. int next_untrusted_measurement_time;
  152. int untrusted_measurement_interval;
  153. double log_max_grovel_interval;
  154. double log_low_confidence_slope;
  155. double low_disk_space_slope;
  156. double base_use_multiplier;
  157. double use_multiplier_slope;
  158. double base_cpu_load_threshold;
  159. double cpu_load_threshold_slope;
  160. bool error_retry_log_extraction;
  161. bool error_retry_groveling;
  162. bool restart_extraction_required;
  163. int base_restart_extraction_interval;
  164. int max_restart_extraction_interval;
  165. int base_restart_groveling_interval;
  166. int max_restart_groveling_interval;
  167. int restart_extraction_interval;
  168. int remaining_restart_extraction_interval;
  169. int restart_groveling_interval;
  170. double peak_finder_accuracy;
  171. int volscan_regrovel_threshold;
  172. int partition_info_update_interval;
  173. bool restart_volume_scan;
  174. bool first_extraction;
  175. bool log_extractor_dead;
  176. bool groveler_dead;
  177. bool extended_restart_in_progress;
  178. double volume_total_bytes;
  179. double volume_free_bytes;
  180. double *hash_match_ratio;
  181. double *compare_match_ratio;
  182. double *dequeue_hash_ratio;
  183. double *mean_file_size;
  184. double *read_time_confidence;
  185. double free_space_ratio;
  186. int *volume_serial_number;
  187. int base_regrovel_interval;
  188. int max_regrovel_interval;
  189. double read_report_discard_threshold;
  190. int min_file_size;
  191. int min_file_age;
  192. bool allow_compressed_files;
  193. bool allow_encrypted_files;
  194. bool allow_hidden_files;
  195. bool allow_offline_files;
  196. bool allow_temporary_files;
  197. int num_excluded_paths;
  198. const _TCHAR **excluded_paths;
  199. };
  200. #endif /* _INC_PARTCTRL */