Class SequenceNumbersTestUtils

java.lang.Object
org.elasticsearch.index.seqno.SequenceNumbersTestUtils

public final class SequenceNumbersTestUtils extends Object
Utilities for asserting on sequence number fields at the Lucene level in integration tests.
  • Method Details

    • assertShardsHaveSeqNoDocValues

      public static void assertShardsHaveSeqNoDocValues(String indexName, boolean expectDocValuesOnDisk, int expectedShards)
      Asserts that all shards of the given index either have or lack _seq_no doc values on disk. Uses the default ESIntegTestCase.internalCluster().
      Parameters:
      indexName - the index to check
      expectDocValuesOnDisk - true to assert doc values are present, false to assert they are empty
      expectedShards - the exact number of shards expected to be verified
    • assertShardsHaveSeqNoDocValues

      public static void assertShardsHaveSeqNoDocValues(InternalTestCluster cluster, String indexName, boolean expectDocValuesOnDisk, int expectedShards)
      Asserts that all shards of the given index on the given cluster either have or lack _seq_no doc values on disk.
      Parameters:
      cluster - the cluster to check
      indexName - the index to check
      expectDocValuesOnDisk - true to assert doc values are present, false to assert they are empty
      expectedShards - the exact number of shards expected to be verified
    • assertShardsSeqNoDocValuesCount

      public static void assertShardsSeqNoDocValuesCount(InternalTestCluster cluster, String indexName, long expectedCount, int expectedShards)
      Asserts that the total number of _seq_no doc values across all shards of the given index equals the expected count.
      Parameters:
      cluster - the cluster to check
      indexName - the index to check
      expectedCount - the expected total number of doc values per shard
      expectedShards - the exact number of shards expected to be verified
    • assertShardsSeqNoDocValuesCount

      public static void assertShardsSeqNoDocValuesCount(IndicesService indicesService, String indexName, long expectedCount, int expectedShards)
      Asserts that the total number of _seq_no doc values for each shard of the given index on a specific node equals the expected count.
      Parameters:
      indicesService - the IndicesService instance for the node to check
      indexName - the index to check
      expectedCount - the expected total number of doc values per shard
      expectedShards - the exact number of shards expected to be verified
    • assertRetentionLeasesAdvanced

      public static void assertRetentionLeasesAdvanced(Client client, String indexName, long expectedRetainingSeqNo) throws Exception
      Waits until all retention leases on all shards of the given index have their retaining sequence number equal to the expected value.
      Parameters:
      client - the client to use for stats requests
      indexName - the index to check
      expectedRetainingSeqNo - the expected retaining sequence number for every lease
      Throws:
      Exception