| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('ABSPATH')) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
/** |
| 8 |
* Public contract for the wp_abj404_logs_hits rollup lifecycle. |
| 9 |
* |
| 10 |
* Extracted from LogsRepository under M201. Owns: |
| 11 |
* - existence/readiness checks for the rollup table |
| 12 |
* - rollup rebuild (direct and chunked pipelines) |
| 13 |
* - rebuild scheduling (cron + shutdown) with per-request dedupe |
| 14 |
* - cross-request rebuild locking |
| 15 |
* - staleness signaling (admin notice when cron is not running) |
| 16 |
* - logsv2 max/min/stored-max id reads used by drift detection and read paths |
| 17 |
* - last-scheduled / last-refreshed flags |
| 18 |
* |
| 19 |
* Log writes, log read queries, GDPR anonymization, and lookup-table CRUD |
| 20 |
* stay on LogsRepository. LogsRepository forwards the rollup-lifecycle |
| 21 |
* interface methods to this service. |
| 22 |
*/ |
| 23 |
interface ABJ_404_Solution_LogsHitsRollupServiceInterface { |
| 24 |
|
| 25 |
/** @return void */ |
| 26 |
public function recordLogsHitsRollupStalenessSignal(): void; |
| 27 |
|
| 28 |
/** @return bool */ |
| 29 |
public function hitsTableNeedsRebuild(); |
| 30 |
|
| 31 |
/** @return int|null Unix timestamp of last update, or null if table doesn't exist */ |
| 32 |
public function getLogsHitsTableLastUpdated(); |
| 33 |
|
| 34 |
/** @return bool */ |
| 35 |
public function createRedirectsForViewHitsTable(): bool; |
| 36 |
|
| 37 |
/** @return bool */ |
| 38 |
public function logsHitsTableExists(); |
| 39 |
|
| 40 |
/** @return void */ |
| 41 |
public function scheduleHitsTableRebuild(): void; |
| 42 |
|
| 43 |
/** @return int */ |
| 44 |
public function getMaxLogId(); |
| 45 |
|
| 46 |
/** @return int */ |
| 47 |
public function getMinLogId(); |
| 48 |
|
| 49 |
/** @return int */ |
| 50 |
public function getStoredMaxLogId(); |
| 51 |
|
| 52 |
/** @return int|null */ |
| 53 |
public function getLogsHitsTableLastScheduledAt(); |
| 54 |
} |
| 55 |
|