Package org.elasticsearch.cluster.metadata

Examples of org.elasticsearch.cluster.metadata.SnapshotMetaData$ShardSnapshotStatus


    private Decision canMove(ShardRouting shardRouting, RoutingAllocation allocation) {
        if (!enableRelocation && shardRouting.primary()) {
            // Only primary shards are snapshotted

            SnapshotMetaData snapshotMetaData = allocation.metaData().custom(SnapshotMetaData.TYPE);
            if (snapshotMetaData == null) {
                // Snapshots are not running
                return allocation.decision(Decision.YES, NAME, "no snapshots are currently running");
            }

            for (SnapshotMetaData.Entry snapshot : snapshotMetaData.entries()) {
                SnapshotMetaData.ShardSnapshotStatus shardSnapshotStatus = snapshot.shards().get(shardRouting.shardId());
                if (shardSnapshotStatus != null && !shardSnapshotStatus.state().completed() && shardSnapshotStatus.nodeId() != null && shardSnapshotStatus.nodeId().equals(shardRouting.currentNodeId())) {
                    logger.trace("Preventing snapshotted shard [{}] to be moved from node [{}]", shardRouting.shardId(), shardSnapshotStatus.nodeId());
                    return allocation.decision(Decision.NO, NAME, "snapshot for shard [%s] is currently running on node [%s]",
                            shardRouting.shardId(), shardSnapshotStatus.nodeId());
View Full Code Here

TOP

Related Classes of org.elasticsearch.cluster.metadata.SnapshotMetaData$ShardSnapshotStatus

Copyright © 2018 www.massapicom. 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.