diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java index 4abfd713bcd..b078a983357 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java @@ -580,7 +580,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase { BulkResponse bulkResponse = execute(bulkRequest, highLevelClient()::bulk, highLevelClient()::bulkAsync); assertEquals(RestStatus.OK, bulkResponse.status()); - assertTrue(bulkResponse.getTookInMillis() > 0); + assertTrue(bulkResponse.getTook().getMillis() > 0); assertEquals(nbItems, bulkResponse.getItems().length); validateBulkResponses(nbItems, errors, bulkResponse, bulkRequest); @@ -671,7 +671,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase { BulkRequest bulkRequest = requestRef.get(); assertEquals(RestStatus.OK, bulkResponse.status()); - assertTrue(bulkResponse.getTookInMillis() > 0); + assertTrue(bulkResponse.getTook().getMillis() > 0); assertEquals(nbItems, bulkResponse.getItems().length); assertNull(error.get()); diff --git a/core/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java b/core/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java index 8e0b48143dc..30bf2dc1477 100644 --- a/core/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java +++ b/core/src/main/java/org/elasticsearch/action/bulk/BulkResponse.java @@ -76,13 +76,6 @@ public class BulkResponse extends ActionResponse implements Iterable wrapActionListenerIfNeeded(long ingestTookInMillis, ActionListener actionListener) { if (itemResponses.isEmpty()) { return ActionListener.wrap( - response -> actionListener.onResponse( - new BulkResponse(response.getItems(), response.getTookInMillis(), ingestTookInMillis)), - actionListener::onFailure); + response -> actionListener.onResponse(new BulkResponse(response.getItems(), + response.getTook().getMillis(), ingestTookInMillis)), + actionListener::onFailure); } else { return new IngestBulkResponseListener(ingestTookInMillis, originalSlots, itemResponses, actionListener); } @@ -610,7 +610,9 @@ public class TransportBulkAction extends HandledTransportAction