|
@@ -120,7 +120,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
null,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -152,7 +152,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
null,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new ThrowingMappingUpdatePerformer(new RuntimeException("fail")),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -209,7 +209,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
null,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ActionListener.runAfter(ActionTestUtils.assertNoFailureListener(result -> {
|
|
|
// since at least 1 item passed, the tran log location should exist,
|
|
|
assertThat(((WritePrimaryResult<BulkShardRequest, BulkShardResponse>) result).location, notNullValue());
|
|
@@ -285,7 +285,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
assertNotNull(update);
|
|
|
updateCalled.incrementAndGet();
|
|
|
listener.onResponse(null);
|
|
|
- }, listener -> listener.onResponse(null), ASSERTING_DONE_LISTENER, DocumentParsingProvider.EMPTY_INSTANCE);
|
|
|
+ }, (listener, mappingVersion) -> listener.onResponse(null), ASSERTING_DONE_LISTENER, DocumentParsingProvider.EMPTY_INSTANCE);
|
|
|
assertTrue(context.isInitial());
|
|
|
assertTrue(context.hasMoreOperationsToExecute());
|
|
|
assertThat(context.getUpdateRetryCounter(), equalTo(0));
|
|
@@ -304,7 +304,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
null,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
(update, shardId, listener) -> fail("should not have had to update the mappings"),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -345,7 +345,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
null,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
errorOnWait == false ? new ThrowingMappingUpdatePerformer(err) : new NoopMappingUpdatePerformer(),
|
|
|
- errorOnWait ? listener -> listener.onFailure(err) : listener -> listener.onResponse(null),
|
|
|
+ errorOnWait ? (listener, mappingVersion) -> listener.onFailure(err) : (listener, mappingVersion) -> listener.onResponse(null),
|
|
|
new LatchedActionListener<>(new ActionListener<Void>() {
|
|
|
@Override
|
|
|
public void onResponse(Void aVoid) {}
|
|
@@ -398,7 +398,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
null,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -446,7 +446,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
null,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -510,7 +510,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
updateHelper,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -566,7 +566,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
updateHelper,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -631,7 +631,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
updateHelper,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> listener.onResponse(null),
|
|
|
+ (listener, mappingVersion) -> listener.onResponse(null),
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
documentParsingProvider
|
|
|
);
|
|
@@ -697,7 +697,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
updateHelper,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
documentParsingProvider
|
|
|
);
|
|
@@ -756,7 +756,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
updateHelper,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> listener.onResponse(null),
|
|
|
+ (listener, mappingVersion) -> listener.onResponse(null),
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -794,7 +794,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
updateHelper,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -834,7 +834,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
null,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> {},
|
|
|
+ (listener, mappingVersion) -> {},
|
|
|
ASSERTING_DONE_LISTENER,
|
|
|
DocumentParsingProvider.EMPTY_INSTANCE
|
|
|
);
|
|
@@ -937,7 +937,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
updateHelper,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
new NoopMappingUpdatePerformer(),
|
|
|
- listener -> listener.onResponse(null),
|
|
|
+ (listener, mappingVersion) -> listener.onResponse(null),
|
|
|
new LatchedActionListener<>(ActionTestUtils.assertNoFailureListener(result -> {
|
|
|
assertThat(((WritePrimaryResult<BulkShardRequest, BulkShardResponse>) result).location, equalTo(resultLocation));
|
|
|
BulkItemResponse primaryResponse = result.replicaRequest().items()[0].getPrimaryResponse();
|
|
@@ -1034,7 +1034,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
throw new IllegalStateException(e);
|
|
|
}
|
|
|
},
|
|
|
- listener -> listener.onResponse(null),
|
|
|
+ (listener, mappingVersion) -> listener.onResponse(null),
|
|
|
new LatchedActionListener<>(ActionTestUtils.assertNoFailureListener(result ->
|
|
|
// Assert that we still need to fsync the location that was successfully written
|
|
|
assertThat(((WritePrimaryResult<BulkShardRequest, BulkShardResponse>) result).location, equalTo(resultLocation1))), latch),
|
|
@@ -1096,7 +1096,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
listener.onResponse(null);
|
|
|
}
|
|
|
},
|
|
|
- listener -> listener.onFailure(new IllegalStateException("no failure expected")),
|
|
|
+ (listener, mappingVersion) -> listener.onFailure(new IllegalStateException("no failure expected")),
|
|
|
new LatchedActionListener<>(ActionTestUtils.assertNoFailureListener(result -> {
|
|
|
try {
|
|
|
BulkStats bulkStats = shard.bulkStats();
|
|
@@ -1156,7 +1156,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
updateHelper,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
(update, shardId, listener) -> fail("the master should not be contacted as the operation yielded a noop mapping update"),
|
|
|
- listener -> listener.onResponse(null),
|
|
|
+ (listener, mappingVersion) -> listener.onResponse(null),
|
|
|
ActionTestUtils.assertNoFailureListener(result -> {}),
|
|
|
threadPool.executor(Names.WRITE)
|
|
|
)
|
|
@@ -1200,7 +1200,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
when(mapperService.merge(any(), any(CompressedXContent.class), any())).thenReturn(documentMapper);
|
|
|
// on the second invocation, the mapping version is incremented
|
|
|
// so that the second mapping update attempt doesn't trigger the infinite loop prevention
|
|
|
- when(mapperService.mappingVersion()).thenReturn(0L, 1L);
|
|
|
+ when(mapperService.mappingVersion()).thenReturn(0L, 0L, 1L);
|
|
|
|
|
|
UpdateHelper updateHelper = mock(UpdateHelper.class);
|
|
|
when(updateHelper.prepare(any(), eq(shard), any())).thenReturn(
|
|
@@ -1223,7 +1223,7 @@ public class TransportShardBulkActionTests extends IndexShardTestCase {
|
|
|
updateHelper,
|
|
|
threadPool::absoluteTimeInMillis,
|
|
|
(update, shardId, listener) -> fail("the master should not be contacted as the operation yielded a noop mapping update"),
|
|
|
- listener -> listener.onFailure(new IllegalStateException("no failure expected")),
|
|
|
+ (listener, mappingVersion) -> listener.onFailure(new IllegalStateException("no failure expected")),
|
|
|
new LatchedActionListener<>(ActionTestUtils.assertNoFailureListener(result -> {
|
|
|
BulkItemResponse primaryResponse = result.replicaRequest().items()[0].getPrimaryResponse();
|
|
|
assertFalse(primaryResponse.isFailed());
|