diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java index 511867eabf1..3f6c1362303 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/job/persistence/JobResultsPersister.java @@ -11,9 +11,7 @@ import org.elasticsearch.action.admin.indices.refresh.RefreshRequest; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkResponse; import org.elasticsearch.action.index.IndexRequest; -import org.elasticsearch.action.support.WriteRequest; import org.elasticsearch.client.Client; -import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.ToXContent; @@ -343,8 +341,7 @@ public class JobResultsPersister extends AbstractComponent { this.jobId = jobId; this.object = object; this.type = type; - // TODO: (norelease): Fix the assertion tripping in internal engine for index requests without an id being retried: - this.id = id != null ? id : UUIDs.base64UUID(); + this.id = id; } boolean persist(String indexName) { diff --git a/plugin/src/main/java/org/elasticsearch/xpack/ml/notifications/Auditor.java b/plugin/src/main/java/org/elasticsearch/xpack/ml/notifications/Auditor.java index ad7f2f64fe7..0eba3d16487 100644 --- a/plugin/src/main/java/org/elasticsearch/xpack/ml/notifications/Auditor.java +++ b/plugin/src/main/java/org/elasticsearch/xpack/ml/notifications/Auditor.java @@ -11,7 +11,6 @@ import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.service.ClusterService; -import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -47,8 +46,7 @@ public class Auditor { } private void indexDoc(String type, ToXContent toXContent) { - // TODO: (norelease): Fix the assertion tripping in internal engine for index requests without an id being retried: - client.prepareIndex(NOTIFICATIONS_INDEX, type, UUIDs.base64UUID()) + client.prepareIndex(NOTIFICATIONS_INDEX, type) .setSource(toXContentBuilder(toXContent)) .execute(new ActionListener() { @Override diff --git a/plugin/src/test/java/org/elasticsearch/xpack/ml/notifications/AuditorTests.java b/plugin/src/test/java/org/elasticsearch/xpack/ml/notifications/AuditorTests.java index 8eb475f55cb..77ac76ce24d 100644 --- a/plugin/src/test/java/org/elasticsearch/xpack/ml/notifications/AuditorTests.java +++ b/plugin/src/test/java/org/elasticsearch/xpack/ml/notifications/AuditorTests.java @@ -21,7 +21,6 @@ import org.mockito.ArgumentCaptor; import java.io.IOException; -import static org.mockito.Matchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -88,9 +87,9 @@ public class AuditorTests extends ESTestCase { IndexRequestBuilder indexRequestBuilder = mock(IndexRequestBuilder.class); when(indexRequestBuilder.setSource(jsonCaptor.capture())).thenReturn(indexRequestBuilder); when(indexRequestBuilder.execute()).thenReturn(indexResponse); - when(client.prepareIndex(indexCaptor.capture(), typeCaptor.capture(), any())) + when(client.prepareIndex(indexCaptor.capture(), typeCaptor.capture())) .thenReturn(indexRequestBuilder); - when(client.prepareIndex(indexCaptor.capture(), typeCaptor.capture(), any())) + when(client.prepareIndex(indexCaptor.capture(), typeCaptor.capture())) .thenReturn(indexRequestBuilder); }