Search in sources :

Example 1 with EngineFactory

use of org.elasticsearch.index.engine.EngineFactory in project elasticsearch by elastic.

the class IndexShardTestCase method newShard.

/**
     * creates a new initializing shard.
     *
     * @param routing              shard routing to use
     * @param shardPath            path to use for shard data
     * @param indexMetaData        indexMetaData for the shard, including any mapping
     * @param indexSearcherWrapper an optional wrapper to be used during searchers
     * @param listeners            an optional set of listeners to add to the shard
     */
protected IndexShard newShard(ShardRouting routing, ShardPath shardPath, IndexMetaData indexMetaData, @Nullable IndexSearcherWrapper indexSearcherWrapper, Runnable globalCheckpointSyncer, @Nullable EngineFactory engineFactory, IndexingOperationListener... listeners) throws IOException {
    final Settings nodeSettings = Settings.builder().put("node.name", routing.currentNodeId()).build();
    final IndexSettings indexSettings = new IndexSettings(indexMetaData, nodeSettings);
    final IndexShard indexShard;
    final Store store = createStore(indexSettings, shardPath);
    boolean success = false;
    try {
        IndexCache indexCache = new IndexCache(indexSettings, new DisabledQueryCache(indexSettings), null);
        MapperService mapperService = MapperTestUtils.newMapperService(xContentRegistry(), createTempDir(), indexSettings.getSettings());
        mapperService.merge(indexMetaData, MapperService.MergeReason.MAPPING_RECOVERY, true);
        SimilarityService similarityService = new SimilarityService(indexSettings, Collections.emptyMap());
        final IndexEventListener indexEventListener = new IndexEventListener() {
        };
        final Engine.Warmer warmer = searcher -> {
        };
        IndicesFieldDataCache indicesFieldDataCache = new IndicesFieldDataCache(nodeSettings, new IndexFieldDataCache.Listener() {
        });
        IndexFieldDataService indexFieldDataService = new IndexFieldDataService(indexSettings, indicesFieldDataCache, new NoneCircuitBreakerService(), mapperService);
        indexShard = new IndexShard(routing, indexSettings, shardPath, store, indexCache, mapperService, similarityService, indexFieldDataService, engineFactory, indexEventListener, indexSearcherWrapper, threadPool, BigArrays.NON_RECYCLING_INSTANCE, warmer, globalCheckpointSyncer, Collections.emptyList(), Arrays.asList(listeners));
        success = true;
    } finally {
        if (success == false) {
            IOUtils.close(store);
        }
    }
    return indexShard;
}
Also used : IndexNotFoundException(org.apache.lucene.index.IndexNotFoundException) Versions(org.elasticsearch.common.lucene.uid.Versions) ByteSizeUnit(org.elasticsearch.common.unit.ByteSizeUnit) Arrays(java.util.Arrays) Nullable(org.elasticsearch.common.Nullable) BigArrays(org.elasticsearch.common.util.BigArrays) BiFunction(java.util.function.BiFunction) VersionType(org.elasticsearch.index.VersionType) Document(org.apache.lucene.document.Document) IndexRequest(org.elasticsearch.action.index.IndexRequest) Settings(org.elasticsearch.common.settings.Settings) ShardRoutingHelper(org.elasticsearch.cluster.routing.ShardRoutingHelper) Directory(org.apache.lucene.store.Directory) ThreadPool(org.elasticsearch.threadpool.ThreadPool) LeafReaderContext(org.apache.lucene.index.LeafReaderContext) UidFieldMapper(org.elasticsearch.index.mapper.UidFieldMapper) EnumSet(java.util.EnumSet) PeerRecoveryTargetService(org.elasticsearch.indices.recovery.PeerRecoveryTargetService) Set(java.util.Set) MapperTestUtils(org.elasticsearch.index.MapperTestUtils) Engine(org.elasticsearch.index.engine.Engine) SimilarityService(org.elasticsearch.index.similarity.SimilarityService) RecoverySource(org.elasticsearch.cluster.routing.RecoverySource) MapperService(org.elasticsearch.index.mapper.MapperService) Version(org.elasticsearch.Version) Matchers.contains(org.hamcrest.Matchers.contains) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) RecoveryState(org.elasticsearch.indices.recovery.RecoveryState) LeafReader(org.apache.lucene.index.LeafReader) TestShardRouting(org.elasticsearch.cluster.routing.TestShardRouting) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) StartRecoveryRequest(org.elasticsearch.indices.recovery.StartRecoveryRequest) XContentType(org.elasticsearch.common.xcontent.XContentType) IndexFieldDataService(org.elasticsearch.index.fielddata.IndexFieldDataService) RecoveryFailedException(org.elasticsearch.indices.recovery.RecoveryFailedException) ShardRoutingState(org.elasticsearch.cluster.routing.ShardRoutingState) DisabledQueryCache(org.elasticsearch.index.cache.query.DisabledQueryCache) BytesArray(org.elasticsearch.common.bytes.BytesArray) RecoverySourceHandler(org.elasticsearch.indices.recovery.RecoverySourceHandler) HashSet(java.util.HashSet) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) IndexCache(org.elasticsearch.index.cache.IndexCache) SequenceNumbersService(org.elasticsearch.index.seqno.SequenceNumbersService) NoneCircuitBreakerService(org.elasticsearch.indices.breaker.NoneCircuitBreakerService) Store(org.elasticsearch.index.store.Store) IndexSettings(org.elasticsearch.index.IndexSettings) Node(org.elasticsearch.node.Node) Matchers.hasSize(org.hamcrest.Matchers.hasSize) ESTestCase(org.elasticsearch.test.ESTestCase) Bits(org.apache.lucene.util.Bits) SourceToParse(org.elasticsearch.index.mapper.SourceToParse) TestThreadPool(org.elasticsearch.threadpool.TestThreadPool) IndexFieldDataCache(org.elasticsearch.index.fielddata.IndexFieldDataCache) Uid(org.elasticsearch.index.mapper.Uid) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) IOUtils(org.apache.lucene.util.IOUtils) IOException(java.io.IOException) DirectoryService(org.elasticsearch.index.store.DirectoryService) EngineFactory(org.elasticsearch.index.engine.EngineFactory) TimeUnit(java.util.concurrent.TimeUnit) FlushRequest(org.elasticsearch.action.admin.indices.flush.FlushRequest) NodeEnvironment(org.elasticsearch.env.NodeEnvironment) IndicesFieldDataCache(org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache) DummyShardLock(org.elasticsearch.test.DummyShardLock) Collections(java.util.Collections) IndexSettings(org.elasticsearch.index.IndexSettings) Store(org.elasticsearch.index.store.Store) IndexFieldDataCache(org.elasticsearch.index.fielddata.IndexFieldDataCache) IndicesFieldDataCache(org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache) IndexFieldDataService(org.elasticsearch.index.fielddata.IndexFieldDataService) IndexCache(org.elasticsearch.index.cache.IndexCache) SimilarityService(org.elasticsearch.index.similarity.SimilarityService) Settings(org.elasticsearch.common.settings.Settings) IndexSettings(org.elasticsearch.index.IndexSettings) DisabledQueryCache(org.elasticsearch.index.cache.query.DisabledQueryCache) MapperService(org.elasticsearch.index.mapper.MapperService) Engine(org.elasticsearch.index.engine.Engine) NoneCircuitBreakerService(org.elasticsearch.indices.breaker.NoneCircuitBreakerService)

Example 2 with EngineFactory

use of org.elasticsearch.index.engine.EngineFactory in project elasticsearch by elastic.

the class IndexService method createShard.

public synchronized IndexShard createShard(ShardRouting routing) throws IOException {
    final boolean primary = routing.primary();
    /*
         * TODO: we execute this in parallel but it's a synced method. Yet, we might
         * be able to serialize the execution via the cluster state in the future. for now we just
         * keep it synced.
         */
    if (closed.get()) {
        throw new IllegalStateException("Can't create shard " + routing.shardId() + ", closed");
    }
    final Settings indexSettings = this.indexSettings.getSettings();
    final ShardId shardId = routing.shardId();
    boolean success = false;
    Store store = null;
    IndexShard indexShard = null;
    ShardLock lock = null;
    try {
        lock = nodeEnv.shardLock(shardId, TimeUnit.SECONDS.toMillis(5));
        eventListener.beforeIndexShardCreated(shardId, indexSettings);
        ShardPath path;
        try {
            path = ShardPath.loadShardPath(logger, nodeEnv, shardId, this.indexSettings);
        } catch (IllegalStateException ex) {
            logger.warn("{} failed to load shard path, trying to remove leftover", shardId);
            try {
                ShardPath.deleteLeftoverShardDirectory(logger, nodeEnv, lock, this.indexSettings);
                path = ShardPath.loadShardPath(logger, nodeEnv, shardId, this.indexSettings);
            } catch (Exception inner) {
                ex.addSuppressed(inner);
                throw ex;
            }
        }
        if (path == null) {
            // TODO: we should, instead, hold a "bytes reserved" of how large we anticipate this shard will be, e.g. for a shard
            // that's being relocated/replicated we know how large it will become once it's done copying:
            // Count up how many shards are currently on each data path:
            Map<Path, Integer> dataPathToShardCount = new HashMap<>();
            for (IndexShard shard : this) {
                Path dataPath = shard.shardPath().getRootStatePath();
                Integer curCount = dataPathToShardCount.get(dataPath);
                if (curCount == null) {
                    curCount = 0;
                }
                dataPathToShardCount.put(dataPath, curCount + 1);
            }
            path = ShardPath.selectNewPathForShard(nodeEnv, shardId, this.indexSettings, routing.getExpectedShardSize() == ShardRouting.UNAVAILABLE_EXPECTED_SHARD_SIZE ? getAvgShardSizeInBytes() : routing.getExpectedShardSize(), dataPathToShardCount);
            logger.debug("{} creating using a new path [{}]", shardId, path);
        } else {
            logger.debug("{} creating using an existing path [{}]", shardId, path);
        }
        if (shards.containsKey(shardId.id())) {
            throw new IllegalStateException(shardId + " already exists");
        }
        logger.debug("creating shard_id {}", shardId);
        // if we are on a shared FS we only own the shard (ie. we can safely delete it) if we are the primary.
        final boolean canDeleteShardContent = this.indexSettings.isOnSharedFilesystem() == false || (primary && this.indexSettings.isOnSharedFilesystem());
        final Engine.Warmer engineWarmer = (searcher) -> {
            IndexShard shard = getShardOrNull(shardId.getId());
            if (shard != null) {
                warmer.warm(searcher, shard, IndexService.this.indexSettings);
            }
        };
        store = new Store(shardId, this.indexSettings, indexStore.newDirectoryService(path), lock, new StoreCloseListener(shardId, canDeleteShardContent, () -> eventListener.onStoreClosed(shardId)));
        if (useShadowEngine(primary, this.indexSettings)) {
            indexShard = new ShadowIndexShard(routing, this.indexSettings, path, store, indexCache, mapperService, similarityService, indexFieldData, engineFactory, eventListener, searcherWrapper, threadPool, bigArrays, engineWarmer, searchOperationListeners);
        // no indexing listeners - shadow  engines don't index
        } else {
            indexShard = new IndexShard(routing, this.indexSettings, path, store, indexCache, mapperService, similarityService, indexFieldData, engineFactory, eventListener, searcherWrapper, threadPool, bigArrays, engineWarmer, () -> globalCheckpointSyncer.accept(shardId), searchOperationListeners, indexingOperationListeners);
        }
        eventListener.indexShardStateChanged(indexShard, null, indexShard.state(), "shard created");
        eventListener.afterIndexShardCreated(indexShard);
        shards = newMapBuilder(shards).put(shardId.id(), indexShard).immutableMap();
        success = true;
        return indexShard;
    } catch (ShardLockObtainFailedException e) {
        throw new IOException("failed to obtain in-memory shard lock", e);
    } finally {
        if (success == false) {
            if (lock != null) {
                IOUtils.closeWhileHandlingException(lock);
            }
            closeShard("initialization failed", shardId, indexShard, store, eventListener);
        }
    }
}
Also used : Path(java.nio.file.Path) ShardPath(org.elasticsearch.index.shard.ShardPath) BitsetFilterCache(org.elasticsearch.index.cache.bitset.BitsetFilterCache) ShardId(org.elasticsearch.index.shard.ShardId) ScheduledFuture(java.util.concurrent.ScheduledFuture) QueryShardContext(org.elasticsearch.index.query.QueryShardContext) LongSupplier(java.util.function.LongSupplier) Nullable(org.elasticsearch.common.Nullable) BigArrays(org.elasticsearch.common.util.BigArrays) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) IndexAnalyzers(org.elasticsearch.index.analysis.IndexAnalyzers) MapperRegistry(org.elasticsearch.indices.mapper.MapperRegistry) ShardNotFoundException(org.elasticsearch.index.shard.ShardNotFoundException) Settings(org.elasticsearch.common.settings.Settings) SearchOperationListener(org.elasticsearch.index.shard.SearchOperationListener) Map(java.util.Map) ThreadPool(org.elasticsearch.threadpool.ThreadPool) Path(java.nio.file.Path) NamedXContentRegistry(org.elasticsearch.common.xcontent.NamedXContentRegistry) IndexStore(org.elasticsearch.index.store.IndexStore) Set(java.util.Set) ShardLockObtainFailedException(org.elasticsearch.env.ShardLockObtainFailedException) AnalysisRegistry(org.elasticsearch.index.analysis.AnalysisRegistry) MapBuilder.newMapBuilder(org.elasticsearch.common.collect.MapBuilder.newMapBuilder) Engine(org.elasticsearch.index.engine.Engine) SimilarityService(org.elasticsearch.index.similarity.SimilarityService) Objects(java.util.Objects) MapperService(org.elasticsearch.index.mapper.MapperService) List(java.util.List) Supplier(org.apache.logging.log4j.util.Supplier) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) IndicesClusterStateService(org.elasticsearch.indices.cluster.IndicesClusterStateService) Accountable(org.apache.lucene.util.Accountable) ShardPath(org.elasticsearch.index.shard.ShardPath) IndexingOperationListener(org.elasticsearch.index.shard.IndexingOperationListener) ShadowIndexShard(org.elasticsearch.index.shard.ShadowIndexShard) IndexReader(org.apache.lucene.index.IndexReader) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) IndexShardClosedException(org.elasticsearch.index.shard.IndexShardClosedException) IndexFieldDataService(org.elasticsearch.index.fielddata.IndexFieldDataService) ClusterService(org.elasticsearch.cluster.service.ClusterService) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) HashMap(java.util.HashMap) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) CircuitBreakerService(org.elasticsearch.indices.breaker.CircuitBreakerService) IndexCache(org.elasticsearch.index.cache.IndexCache) IndexSearcherWrapper(org.elasticsearch.index.shard.IndexSearcherWrapper) TimeValue(org.elasticsearch.common.unit.TimeValue) Store(org.elasticsearch.index.store.Store) Collections.emptyMap(java.util.Collections.emptyMap) FutureUtils(org.elasticsearch.common.util.concurrent.FutureUtils) IndexFieldDataCache(org.elasticsearch.index.fielddata.IndexFieldDataCache) IndexEventListener(org.elasticsearch.index.shard.IndexEventListener) Iterator(java.util.Iterator) Client(org.elasticsearch.client.Client) IndexShard(org.elasticsearch.index.shard.IndexShard) IOUtils(org.apache.lucene.util.IOUtils) IOException(java.io.IOException) ShardLock(org.elasticsearch.env.ShardLock) EngineFactory(org.elasticsearch.index.engine.EngineFactory) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) NodeEnvironment(org.elasticsearch.env.NodeEnvironment) IndicesFieldDataCache(org.elasticsearch.indices.fielddata.cache.IndicesFieldDataCache) QueryCache(org.elasticsearch.index.cache.query.QueryCache) Closeable(java.io.Closeable) Translog(org.elasticsearch.index.translog.Translog) Collections.unmodifiableMap(java.util.Collections.unmodifiableMap) ScriptService(org.elasticsearch.script.ScriptService) Collections(java.util.Collections) HashMap(java.util.HashMap) ShadowIndexShard(org.elasticsearch.index.shard.ShadowIndexShard) IndexShard(org.elasticsearch.index.shard.IndexShard) IndexStore(org.elasticsearch.index.store.IndexStore) Store(org.elasticsearch.index.store.Store) ShadowIndexShard(org.elasticsearch.index.shard.ShadowIndexShard) IOException(java.io.IOException) AlreadyClosedException(org.apache.lucene.store.AlreadyClosedException) ShardNotFoundException(org.elasticsearch.index.shard.ShardNotFoundException) ShardLockObtainFailedException(org.elasticsearch.env.ShardLockObtainFailedException) IndexShardClosedException(org.elasticsearch.index.shard.IndexShardClosedException) IOException(java.io.IOException) ShardId(org.elasticsearch.index.shard.ShardId) ShardPath(org.elasticsearch.index.shard.ShardPath) ShardLock(org.elasticsearch.env.ShardLock) ShardLockObtainFailedException(org.elasticsearch.env.ShardLockObtainFailedException) Settings(org.elasticsearch.common.settings.Settings) Engine(org.elasticsearch.index.engine.Engine)

Example 3 with EngineFactory

use of org.elasticsearch.index.engine.EngineFactory in project elasticsearch by elastic.

the class RecoveryDuringReplicationTests method testWaitForPendingSeqNo.

@TestLogging("_root:DEBUG,org.elasticsearch.action.bulk:TRACE,org.elasticsearch.action.get:TRACE," + "org.elasticsearch.discovery:TRACE," + "org.elasticsearch.cluster.service:TRACE,org.elasticsearch.indices.recovery:TRACE," + "org.elasticsearch.indices.cluster:TRACE,org.elasticsearch.index.shard:TRACE," + "org.elasticsearch.index.seqno:TRACE")
public void testWaitForPendingSeqNo() throws Exception {
    IndexMetaData metaData = buildIndexMetaData(1);
    final int pendingDocs = randomIntBetween(1, 5);
    final AtomicReference<Semaphore> blockIndexingOnPrimary = new AtomicReference<>();
    final CountDownLatch blockedIndexers = new CountDownLatch(pendingDocs);
    try (ReplicationGroup shards = new ReplicationGroup(metaData) {

        @Override
        protected EngineFactory getEngineFactory(ShardRouting routing) {
            if (routing.primary()) {
                return new EngineFactory() {

                    @Override
                    public Engine newReadWriteEngine(EngineConfig config) {
                        return InternalEngineTests.createInternalEngine((directory, writerConfig) -> new IndexWriter(directory, writerConfig) {

                            @Override
                            public long addDocument(Iterable<? extends IndexableField> doc) throws IOException {
                                Semaphore block = blockIndexingOnPrimary.get();
                                if (block != null) {
                                    blockedIndexers.countDown();
                                    try {
                                        block.acquire();
                                    } catch (InterruptedException e) {
                                        throw new AssertionError("unexpectedly interrupted", e);
                                    }
                                }
                                return super.addDocument(doc);
                            }
                        }, null, config);
                    }

                    @Override
                    public Engine newReadOnlyEngine(EngineConfig config) {
                        throw new UnsupportedOperationException();
                    }
                };
            } else {
                return null;
            }
        }
    }) {
        shards.startAll();
        int docs = shards.indexDocs(randomIntBetween(1, 10));
        IndexShard replica = shards.getReplicas().get(0);
        shards.removeReplica(replica);
        closeShards(replica);
        docs += pendingDocs;
        final Semaphore pendingDocsSemaphore = new Semaphore(pendingDocs);
        blockIndexingOnPrimary.set(pendingDocsSemaphore);
        blockIndexingOnPrimary.get().acquire(pendingDocs);
        CountDownLatch pendingDocsDone = new CountDownLatch(pendingDocs);
        for (int i = 0; i < pendingDocs; i++) {
            final String id = "pending_" + i;
            threadPool.generic().submit(() -> {
                try {
                    shards.index(new IndexRequest(index.getName(), "type", id).source("{}", XContentType.JSON));
                } catch (Exception e) {
                    throw new AssertionError(e);
                } finally {
                    pendingDocsDone.countDown();
                }
            });
        }
        // wait for the pending ops to "hang"
        blockedIndexers.await();
        blockIndexingOnPrimary.set(null);
        // index some more
        docs += shards.indexDocs(randomInt(5));
        IndexShard newReplica = shards.addReplicaWithExistingPath(replica.shardPath(), replica.routingEntry().currentNodeId());
        CountDownLatch recoveryStart = new CountDownLatch(1);
        AtomicBoolean preparedForTranslog = new AtomicBoolean(false);
        final Future<Void> recoveryFuture = shards.asyncRecoverReplica(newReplica, (indexShard, node) -> {
            recoveryStart.countDown();
            return new RecoveryTarget(indexShard, node, recoveryListener, l -> {
            }) {

                @Override
                public void prepareForTranslogOperations(int totalTranslogOps, long maxUnsafeAutoIdTimestamp) throws IOException {
                    preparedForTranslog.set(true);
                    super.prepareForTranslogOperations(totalTranslogOps, maxUnsafeAutoIdTimestamp);
                }
            };
        });
        recoveryStart.await();
        for (int i = 0; i < pendingDocs; i++) {
            assertFalse((pendingDocs - i) + " pending operations, recovery should wait", preparedForTranslog.get());
            pendingDocsSemaphore.release();
        }
        pendingDocsDone.await();
        // now recovery can finish
        recoveryFuture.get();
        assertThat(newReplica.recoveryState().getIndex().fileDetails(), empty());
        assertThat(newReplica.recoveryState().getTranslog().recoveredOperations(), equalTo(docs));
        shards.assertAllEqual(docs);
    }
}
Also used : Semaphore(java.util.concurrent.Semaphore) RecoveryTarget(org.elasticsearch.indices.recovery.RecoveryTarget) IndexRequest(org.elasticsearch.action.index.IndexRequest) EngineFactory(org.elasticsearch.index.engine.EngineFactory) IndexShard(org.elasticsearch.index.shard.IndexShard) AtomicReference(java.util.concurrent.atomic.AtomicReference) IOException(java.io.IOException) CountDownLatch(java.util.concurrent.CountDownLatch) IOException(java.io.IOException) IndexMetaData(org.elasticsearch.cluster.metadata.IndexMetaData) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) IndexWriter(org.apache.lucene.index.IndexWriter) EngineConfig(org.elasticsearch.index.engine.EngineConfig) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) TestLogging(org.elasticsearch.test.junit.annotations.TestLogging)

Example 4 with EngineFactory

use of org.elasticsearch.index.engine.EngineFactory in project crate by crate.

the class IndicesService method getEngineFactory.

private EngineFactory getEngineFactory(final IndexSettings idxSettings) {
    final IndexMetadata indexMetadata = idxSettings.getIndexMetadata();
    if (indexMetadata != null && indexMetadata.getState() == IndexMetadata.State.CLOSE) {
        // NoOpEngine takes precedence as long as the index is closed
        return NoOpEngine::new;
    }
    final List<Optional<EngineFactory>> engineFactories = engineFactoryProviders.stream().map(engineFactoryProvider -> engineFactoryProvider.apply(idxSettings)).filter(maybe -> Objects.requireNonNull(maybe).isPresent()).collect(Collectors.toList());
    if (engineFactories.isEmpty()) {
        return new InternalEngineFactory();
    } else if (engineFactories.size() == 1) {
        assert engineFactories.get(0).isPresent();
        return engineFactories.get(0).get();
    } else {
        final String message = String.format(Locale.ROOT, "multiple engine factories provided for %s: %s", idxSettings.getIndex(), engineFactories.stream().map(t -> {
            assert t.isPresent();
            return "[" + t.get().getClass().getName() + "]";
        }).collect(Collectors.joining(",")));
        throw new IllegalStateException(message);
    }
}
Also used : ElasticsearchException(org.elasticsearch.ElasticsearchException) ShardId(org.elasticsearch.index.shard.ShardId) NoOpEngine(org.elasticsearch.index.engine.NoOpEngine) BigArrays(org.elasticsearch.common.util.BigArrays) IndexMetadata(org.elasticsearch.cluster.metadata.IndexMetadata) MetadataStateFormat(org.elasticsearch.gateway.MetadataStateFormat) MapperRegistry(org.elasticsearch.indices.mapper.MapperRegistry) Sets(io.crate.common.collections.Sets) ClusterState(org.elasticsearch.cluster.ClusterState) Settings(org.elasticsearch.common.settings.Settings) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Locale(java.util.Locale) IndexNotFoundException(org.elasticsearch.index.IndexNotFoundException) Map(java.util.Map) ThreadPool(org.elasticsearch.threadpool.ThreadPool) IndexStorePlugin(org.elasticsearch.plugins.IndexStorePlugin) NamedXContentRegistry(org.elasticsearch.common.xcontent.NamedXContentRegistry) InternalEngineFactory(org.elasticsearch.index.engine.InternalEngineFactory) ByteSizeValue(org.elasticsearch.common.unit.ByteSizeValue) PeerRecoveryTargetService(org.elasticsearch.indices.recovery.PeerRecoveryTargetService) PluginsService(org.elasticsearch.plugins.PluginsService) Setting(org.elasticsearch.common.settings.Setting) AbstractRefCounted(org.elasticsearch.common.util.concurrent.AbstractRefCounted) Collections.emptyList(java.util.Collections.emptyList) Predicate(java.util.function.Predicate) Collection(java.util.Collection) Set(java.util.Set) ShardLockObtainFailedException(org.elasticsearch.env.ShardLockObtainFailedException) AnalysisRegistry(org.elasticsearch.index.analysis.AnalysisRegistry) Collectors(java.util.stream.Collectors) Executors(java.util.concurrent.Executors) Iterables(io.crate.common.collections.Iterables) UncheckedIOException(java.io.UncheckedIOException) Objects(java.util.Objects) CountDownLatch(java.util.concurrent.CountDownLatch) RecoverySource(org.elasticsearch.cluster.routing.RecoverySource) MapperService(org.elasticsearch.index.mapper.MapperService) List(java.util.List) AbstractRunnable(org.elasticsearch.common.util.concurrent.AbstractRunnable) Logger(org.apache.logging.log4j.Logger) IndicesClusterStateService(org.elasticsearch.indices.cluster.IndicesClusterStateService) RecoveryState(org.elasticsearch.indices.recovery.RecoveryState) RetentionLeaseSyncer(org.elasticsearch.index.seqno.RetentionLeaseSyncer) TimeValue(io.crate.common.unit.TimeValue) Optional(java.util.Optional) EsExecutors.daemonThreadFactory(org.elasticsearch.common.util.concurrent.EsExecutors.daemonThreadFactory) IndexingOperationListener(org.elasticsearch.index.shard.IndexingOperationListener) ShardRouting(org.elasticsearch.cluster.routing.ShardRouting) MapBuilder.newMapBuilder(io.crate.common.collections.MapBuilder.newMapBuilder) XContentType(org.elasticsearch.common.xcontent.XContentType) HashMap(java.util.HashMap) MetaStateService(org.elasticsearch.gateway.MetaStateService) Index(org.elasticsearch.index.Index) IndexModule(org.elasticsearch.index.IndexModule) EsThreadPoolExecutor(org.elasticsearch.common.util.concurrent.EsThreadPoolExecutor) Function(java.util.function.Function) ParameterizedMessage(org.apache.logging.log4j.message.ParameterizedMessage) ArrayList(java.util.ArrayList) ResourceAlreadyExistsException(org.elasticsearch.ResourceAlreadyExistsException) CircuitBreakerService(org.elasticsearch.indices.breaker.CircuitBreakerService) DiscoveryNode(org.elasticsearch.cluster.node.DiscoveryNode) NamedWriteableRegistry(org.elasticsearch.common.io.stream.NamedWriteableRegistry) IndexSettings(org.elasticsearch.index.IndexSettings) Node(org.elasticsearch.node.Node) ExecutorService(java.util.concurrent.ExecutorService) Nullable(javax.annotation.Nullable) Collections.emptyMap(java.util.Collections.emptyMap) FileSystemUtils(org.elasticsearch.common.io.FileSystemUtils) EsExecutors(org.elasticsearch.common.util.concurrent.EsExecutors) AbstractIndexComponent(org.elasticsearch.index.AbstractIndexComponent) Iterator(java.util.Iterator) IndexEventListener(org.elasticsearch.index.shard.IndexEventListener) Files(java.nio.file.Files) IndexCreationContext(org.elasticsearch.index.IndexService.IndexCreationContext) Client(org.elasticsearch.client.Client) IndexService(org.elasticsearch.index.IndexService) IndexShard(org.elasticsearch.index.shard.IndexShard) IOUtils(io.crate.common.io.IOUtils) IOException(java.io.IOException) ShardLock(org.elasticsearch.env.ShardLock) RepositoriesService(org.elasticsearch.repositories.RepositoriesService) AbstractLifecycleComponent(org.elasticsearch.common.component.AbstractLifecycleComponent) EngineFactory(org.elasticsearch.index.engine.EngineFactory) IndexScopedSettings(org.elasticsearch.common.settings.IndexScopedSettings) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) CollectionUtil(org.apache.lucene.util.CollectionUtil) NodeEnvironment(org.elasticsearch.env.NodeEnvironment) EsRejectedExecutionException(org.elasticsearch.common.util.concurrent.EsRejectedExecutionException) Closeable(java.io.Closeable) Collections.unmodifiableMap(java.util.Collections.unmodifiableMap) LogManager(org.apache.logging.log4j.LogManager) Optional(java.util.Optional) InternalEngineFactory(org.elasticsearch.index.engine.InternalEngineFactory) IndexMetadata(org.elasticsearch.cluster.metadata.IndexMetadata)

Aggregations

IOException (java.io.IOException)4 ShardRouting (org.elasticsearch.cluster.routing.ShardRouting)4 EngineFactory (org.elasticsearch.index.engine.EngineFactory)4 Set (java.util.Set)3 TimeUnit (java.util.concurrent.TimeUnit)3 IndexMetaData (org.elasticsearch.cluster.metadata.IndexMetaData)3 Settings (org.elasticsearch.common.settings.Settings)3 BigArrays (org.elasticsearch.common.util.BigArrays)3 NodeEnvironment (org.elasticsearch.env.NodeEnvironment)3 MapperService (org.elasticsearch.index.mapper.MapperService)3 IndexShard (org.elasticsearch.index.shard.IndexShard)3 ThreadPool (org.elasticsearch.threadpool.ThreadPool)3 Closeable (java.io.Closeable)2 Collections (java.util.Collections)2 Collections.emptyMap (java.util.Collections.emptyMap)2 Collections.unmodifiableMap (java.util.Collections.unmodifiableMap)2 HashMap (java.util.HashMap)2 Iterator (java.util.Iterator)2 List (java.util.List)2 Map (java.util.Map)2