Examples of shardId()


Examples of org.elasticsearch.index.shard.service.IndexShard.shardId()

        indicesService.indicesLifecycle().addListener(new IndicesLifecycle.Listener() {
            @Override
            public void beforeIndexClosed(IndexService indexService) {
                for (Iterator<IndexShard> shardServiceIterator = indexService.iterator(); shardServiceIterator.hasNext(); ) {
                    IndexShard indexShard  = shardServiceIterator.next();
                    ShardSuggestService suggestShardService = indexService.shardInjectorSafe(indexShard.shardId().id()).getInstance(ShardSuggestService.class);
                    suggestShardService.shutDown();
                }
            }
        });
View Full Code Here

Examples of org.elasticsearch.index.shard.service.InternalIndexShard.shardId()

                if (entry.primary() && entry.started()) {
                    // only recover from started primary, if we can't find one, we will do it next round
                    final DiscoveryNode sourceNode = nodes.get(entry.currentNodeId());
                    try {
                        // we are recovering a backup from a primary, so no need to mark it as relocated
                        final StartRecoveryRequest request = new StartRecoveryRequest(indexShard.shardId(), sourceNode, nodes.localNode(), false, indexShard.store().list());
                        recoveryTarget.startRecovery(request, false, new PeerRecoveryListener(request, shardRouting, indexService));
                    } catch (Exception e) {
                        handleRecoveryFailure(indexService, shardRouting, true, e);
                        break;
                    }
View Full Code Here

Examples of org.elasticsearch.index.shard.service.InternalIndexShard.shardId()

                // relocating primaries, recovery from the relocating shard
                final DiscoveryNode sourceNode = nodes.get(shardRouting.relocatingNodeId());
                try {
                    // we don't mark this one as relocated at the end, requests in any case are routed to both when its relocating
                    // and that way we handle the edge case where its mark as relocated, and we might need to roll it back...
                    final StartRecoveryRequest request = new StartRecoveryRequest(indexShard.shardId(), sourceNode, nodes.localNode(), false, indexShard.store().list());
                    recoveryTarget.startRecovery(request, false, new PeerRecoveryListener(request, shardRouting, indexService));
                } catch (Exception e) {
                    handleRecoveryFailure(indexService, shardRouting, true, e);
                }
            }
View Full Code Here

Examples of org.elasticsearch.index.shard.service.InternalIndexShard.shardId()

        if (request.recovery) {
            // check on going recovery (from peer or gateway)
            RecoveryStatus peerRecoveryStatus = indexShard.peerRecoveryStatus();
            if (peerRecoveryStatus == null) {
                peerRecoveryStatus = peerRecoveryTarget.peerRecoveryStatus(indexShard.shardId());
            }
            if (peerRecoveryStatus != null) {
                PeerRecoveryStatus.Stage stage;
                switch (peerRecoveryStatus.stage()) {
                    case INIT:
View Full Code Here

Examples of org.elasticsearch.index.shard.service.InternalIndexShard.shardId()

        }

        @Override public void messageReceived(RecoveryPrepareForTranslogOperationsRequest request, TransportChannel channel) throws Exception {
            InternalIndexShard shard = (InternalIndexShard) indicesService.indexServiceSafe(request.shardId().index().name()).shardSafe(request.shardId().id());

            RecoveryStatus onGoingRecovery = onGoingRecoveries.get(shard.shardId());
            if (onGoingRecovery == null) {
                // shard is getting closed on us
                throw new IndexShardClosedException(shard.shardId());
            }
            onGoingRecovery.stage = RecoveryStatus.Stage.TRANSLOG;
View Full Code Here

Examples of org.elasticsearch.index.shard.service.InternalIndexShard.shardId()

            InternalIndexShard shard = (InternalIndexShard) indicesService.indexServiceSafe(request.shardId().index().name()).shardSafe(request.shardId().id());

            RecoveryStatus onGoingRecovery = onGoingRecoveries.get(shard.shardId());
            if (onGoingRecovery == null) {
                // shard is getting closed on us
                throw new IndexShardClosedException(shard.shardId());
            }
            onGoingRecovery.stage = RecoveryStatus.Stage.TRANSLOG;

            shard.performRecoveryPrepareForTranslog();
            channel.sendResponse(VoidStreamable.INSTANCE);
View Full Code Here

Examples of org.elasticsearch.index.shard.service.InternalIndexShard.shardId()

            return ThreadPool.Names.CACHED;
        }

        @Override public void messageReceived(RecoveryFinalizeRecoveryRequest request, TransportChannel channel) throws Exception {
            InternalIndexShard shard = (InternalIndexShard) indicesService.indexServiceSafe(request.shardId().index().name()).shardSafe(request.shardId().id());
            RecoveryStatus peerRecoveryStatus = onGoingRecoveries.get(shard.shardId());
            if (peerRecoveryStatus == null) {
                // shard is getting closed on us
                throw new IndexShardClosedException(shard.shardId());
            }
            peerRecoveryStatus.stage = RecoveryStatus.Stage.FINALIZE;
View Full Code Here

Examples of org.elasticsearch.index.shard.service.InternalIndexShard.shardId()

        @Override public void messageReceived(RecoveryFinalizeRecoveryRequest request, TransportChannel channel) throws Exception {
            InternalIndexShard shard = (InternalIndexShard) indicesService.indexServiceSafe(request.shardId().index().name()).shardSafe(request.shardId().id());
            RecoveryStatus peerRecoveryStatus = onGoingRecoveries.get(shard.shardId());
            if (peerRecoveryStatus == null) {
                // shard is getting closed on us
                throw new IndexShardClosedException(shard.shardId());
            }
            peerRecoveryStatus.stage = RecoveryStatus.Stage.FINALIZE;
            shard.performRecoveryFinalization(false, peerRecoveryStatus);
            peerRecoveryStatus.time = System.currentTimeMillis() - peerRecoveryStatus.startTime;
            peerRecoveryStatus.stage = RecoveryStatus.Stage.DONE;
View Full Code Here

Examples of org.elasticsearch.index.shard.service.InternalIndexShard.shardId()

            InternalIndexShard shard = (InternalIndexShard) indicesService.indexServiceSafe(request.shardId().index().name()).shardSafe(request.shardId().id());
            for (Translog.Operation operation : request.operations()) {
                shard.performRecoveryOperation(operation);
            }

            RecoveryStatus onGoingRecovery = onGoingRecoveries.get(shard.shardId());
            if (onGoingRecovery == null) {
                // shard is getting closed on us
                throw new IndexShardClosedException(shard.shardId());
            }
            onGoingRecovery.currentTranslogOperations += request.operations().size();
View Full Code Here

Examples of org.elasticsearch.index.shard.service.InternalIndexShard.shardId()

            }

            RecoveryStatus onGoingRecovery = onGoingRecoveries.get(shard.shardId());
            if (onGoingRecovery == null) {
                // shard is getting closed on us
                throw new IndexShardClosedException(shard.shardId());
            }
            onGoingRecovery.currentTranslogOperations += request.operations().size();

            channel.sendResponse(VoidStreamable.INSTANCE);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.