Class WatermarkBootstrap

java.lang.Object
org.alfresco.elasticsearch.batchindexing.WatermarkBootstrap

public class WatermarkBootstrap extends Object
One-shot startup guard and cursor seed for the batch-indexing watermark. Bundles three opt-in behaviours so the ContinuousReindexingConfig bean wiring reads like a single call:
  • ContinuousReindexingProperties#isAutoCreateStateIndex() — when false, refuse to start on a missing state index instead of silently bootstrapping fresh.
  • ContinuousReindexingProperties#isBootstrapFromAlfrescoIndex() — when true and the state doc is missing, seed the cursor from MAX(METADATA_INDEXING_LAST_UPDATE) on the Alfresco index instead of the "start from now − overlap" first-run default.
  • ContinuousReindexingProperties#isRequireAlfrescoIndex() — when true and the state doc records real indexing progress, refuse to start if the Alfresco index is missing (silent data loss guard).
All three are opt-in: leaving the flags at their defaults means no functional change for existing installs.
  • Constructor Details

  • Method Details

    • bootstrap

      public void bootstrap() throws WatermarkAccessException
      Run the startup dance: enforce the state-index guard, ensure the state index exists, seed the cursor from the Alfresco index if applicable, enforce the Alfresco-index presence guard. Any failure aborts startup by throwing.
      Throws:
      WatermarkAccessException