Package org.elasticsearch.index.seqno
Class SequenceNumbersTestUtils
java.lang.Object
org.elasticsearch.index.seqno.SequenceNumbersTestUtils
Utilities for asserting on sequence number fields at the Lucene level in integration tests.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertRetentionLeasesAdvanced(Client client, String indexName, long expectedRetainingSeqNo) Waits until all retention leases on all shards of the given index have their retaining sequence number equal to the expected value.static voidassertShardsHaveSeqNoDocValues(String indexName, boolean expectDocValuesOnDisk, int expectedShards) Asserts that all shards of the given index either have or lack_seq_nodoc values on disk.static voidassertShardsHaveSeqNoDocValues(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_nodoc values on disk.static voidassertShardsSeqNoDocValuesCount(IndicesService indicesService, String indexName, long expectedCount, int expectedShards) Asserts that the total number of_seq_nodoc values for each shard of the given index on a specific node equals the expected count.static voidassertShardsSeqNoDocValuesCount(InternalTestCluster cluster, String indexName, long expectedCount, int expectedShards) Asserts that the total number of_seq_nodoc values across all shards of the given index equals the expected count.
-
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_nodoc values on disk. Uses the defaultESIntegTestCase.internalCluster().- Parameters:
indexName- the index to checkexpectDocValuesOnDisk-trueto assert doc values are present,falseto assert they are emptyexpectedShards- 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_nodoc values on disk.- Parameters:
cluster- the cluster to checkindexName- the index to checkexpectDocValuesOnDisk-trueto assert doc values are present,falseto assert they are emptyexpectedShards- 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_nodoc values across all shards of the given index equals the expected count.- Parameters:
cluster- the cluster to checkindexName- the index to checkexpectedCount- the expected total number of doc values per shardexpectedShards- 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_nodoc values for each shard of the given index on a specific node equals the expected count.- Parameters:
indicesService- theIndicesServiceinstance for the node to checkindexName- the index to checkexpectedCount- the expected total number of doc values per shardexpectedShards- 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 requestsindexName- the index to checkexpectedRetainingSeqNo- the expected retaining sequence number for every lease- Throws:
Exception
-