Search in sources :

Example 6 with UpdateHelper

use of org.elasticsearch.action.update.UpdateHelper in project elasticsearch by elastic.

the class DynamicMappingDisabledTests method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    Settings settings = Settings.builder().put(MapperService.INDEX_MAPPER_DYNAMIC_SETTING.getKey(), false).build();
    clusterService = createClusterService(threadPool);
    Transport transport = new MockTcpTransport(settings, threadPool, BigArrays.NON_RECYCLING_INSTANCE, new NoneCircuitBreakerService(), new NamedWriteableRegistry(Collections.emptyList()), new NetworkService(settings, Collections.emptyList()));
    transportService = new TransportService(clusterService.getSettings(), transport, threadPool, TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> clusterService.localNode(), null);
    IndicesService indicesService = getInstanceFromNode(IndicesService.class);
    ShardStateAction shardStateAction = new ShardStateAction(settings, clusterService, transportService, null, null, threadPool);
    ActionFilters actionFilters = new ActionFilters(Collections.emptySet());
    IndexNameExpressionResolver indexNameExpressionResolver = new IndexNameExpressionResolver(settings);
    AutoCreateIndex autoCreateIndex = new AutoCreateIndex(settings, new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS), indexNameExpressionResolver);
    UpdateHelper updateHelper = new UpdateHelper(settings, null);
    TransportShardBulkAction shardBulkAction = new TransportShardBulkAction(settings, transportService, clusterService, indicesService, threadPool, shardStateAction, null, updateHelper, actionFilters, indexNameExpressionResolver);
    transportBulkAction = new TransportBulkAction(settings, threadPool, transportService, clusterService, null, shardBulkAction, null, actionFilters, indexNameExpressionResolver, autoCreateIndex, System::currentTimeMillis);
}
Also used : NamedWriteableRegistry(org.elasticsearch.common.io.stream.NamedWriteableRegistry) ESSingleNodeTestCase(org.elasticsearch.test.ESSingleNodeTestCase) UpdateHelper(org.elasticsearch.action.update.UpdateHelper) BeforeClass(org.junit.BeforeClass) BigArrays(org.elasticsearch.common.util.BigArrays) ClusterServiceUtils.createClusterService(org.elasticsearch.test.ClusterServiceUtils.createClusterService) TransportBulkAction(org.elasticsearch.action.bulk.TransportBulkAction) ClusterService(org.elasticsearch.cluster.service.ClusterService) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TransportShardBulkAction(org.elasticsearch.action.bulk.TransportShardBulkAction) AutoCreateIndex(org.elasticsearch.action.support.AutoCreateIndex) CoreMatchers.instanceOf(org.hamcrest.CoreMatchers.instanceOf) IndexRequest(org.elasticsearch.action.index.IndexRequest) NetworkService(org.elasticsearch.common.network.NetworkService) Settings(org.elasticsearch.common.settings.Settings) NoneCircuitBreakerService(org.elasticsearch.indices.breaker.NoneCircuitBreakerService) NamedWriteableRegistry(org.elasticsearch.common.io.stream.NamedWriteableRegistry) IndexNotFoundException(org.elasticsearch.index.IndexNotFoundException) After(org.junit.After) ThreadPool(org.elasticsearch.threadpool.ThreadPool) Requests(org.elasticsearch.client.Requests) IndicesService(org.elasticsearch.indices.IndicesService) TransportService(org.elasticsearch.transport.TransportService) TestThreadPool(org.elasticsearch.threadpool.TestThreadPool) AfterClass(org.junit.AfterClass) ActionFilters(org.elasticsearch.action.support.ActionFilters) Transport(org.elasticsearch.transport.Transport) BulkResponse(org.elasticsearch.action.bulk.BulkResponse) MockTcpTransport(org.elasticsearch.transport.MockTcpTransport) TimeUnit(java.util.concurrent.TimeUnit) ClusterSettings(org.elasticsearch.common.settings.ClusterSettings) ShardStateAction(org.elasticsearch.cluster.action.shard.ShardStateAction) IndexNameExpressionResolver(org.elasticsearch.cluster.metadata.IndexNameExpressionResolver) BulkRequest(org.elasticsearch.action.bulk.BulkRequest) Collections(java.util.Collections) ActionListener(org.elasticsearch.action.ActionListener) ClusterSettings(org.elasticsearch.common.settings.ClusterSettings) TransportBulkAction(org.elasticsearch.action.bulk.TransportBulkAction) IndicesService(org.elasticsearch.indices.IndicesService) ShardStateAction(org.elasticsearch.cluster.action.shard.ShardStateAction) ActionFilters(org.elasticsearch.action.support.ActionFilters) TransportShardBulkAction(org.elasticsearch.action.bulk.TransportShardBulkAction) MockTcpTransport(org.elasticsearch.transport.MockTcpTransport) UpdateHelper(org.elasticsearch.action.update.UpdateHelper) TransportService(org.elasticsearch.transport.TransportService) NetworkService(org.elasticsearch.common.network.NetworkService) AutoCreateIndex(org.elasticsearch.action.support.AutoCreateIndex) IndexNameExpressionResolver(org.elasticsearch.cluster.metadata.IndexNameExpressionResolver) Transport(org.elasticsearch.transport.Transport) MockTcpTransport(org.elasticsearch.transport.MockTcpTransport) Settings(org.elasticsearch.common.settings.Settings) ClusterSettings(org.elasticsearch.common.settings.ClusterSettings) NoneCircuitBreakerService(org.elasticsearch.indices.breaker.NoneCircuitBreakerService)

Aggregations

UpdateHelper (org.elasticsearch.action.update.UpdateHelper)6 IndexRequest (org.elasticsearch.action.index.IndexRequest)5 DocWriteRequest (org.elasticsearch.action.DocWriteRequest)4 IndexMetaData (org.elasticsearch.cluster.metadata.IndexMetaData)4 VersionConflictEngineException (org.elasticsearch.index.engine.VersionConflictEngineException)4 IndexShard (org.elasticsearch.index.shard.IndexShard)4 Translog (org.elasticsearch.index.translog.Translog)4 IOException (java.io.IOException)3 ElasticsearchException (org.elasticsearch.ElasticsearchException)2 DeleteRequest (org.elasticsearch.action.delete.DeleteRequest)2 DeleteResponse (org.elasticsearch.action.delete.DeleteResponse)2 Collections (java.util.Collections)1 TimeUnit (java.util.concurrent.TimeUnit)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 ActionListener (org.elasticsearch.action.ActionListener)1 BulkRequest (org.elasticsearch.action.bulk.BulkRequest)1 BulkResponse (org.elasticsearch.action.bulk.BulkResponse)1 TransportBulkAction (org.elasticsearch.action.bulk.TransportBulkAction)1 TransportShardBulkAction (org.elasticsearch.action.bulk.TransportShardBulkAction)1 IndexResponse (org.elasticsearch.action.index.IndexResponse)1