Package org.elasticsearch.index.gateway

Examples of org.elasticsearch.index.gateway.SnapshotStatus


    @Override public SnapshotStatus lastSnapshotStatus() {
        return this.lastSnapshotStatus;
    }

    @Override public SnapshotStatus currentSnapshotStatus() {
        SnapshotStatus snapshotStatus = this.currentSnapshotStatus;
        if (snapshotStatus == null) {
            return snapshotStatus;
        }
        if (snapshotStatus.stage() != SnapshotStatus.Stage.DONE || snapshotStatus.stage() != SnapshotStatus.Stage.FAILURE) {
            snapshotStatus.time(System.currentTimeMillis() - snapshotStatus.startTime());
        }
        return snapshotStatus;
    }
View Full Code Here


        }
        return snapshotStatus;
    }

    @Override public SnapshotStatus snapshot(final Snapshot snapshot) throws IndexShardGatewaySnapshotFailedException {
        currentSnapshotStatus = new SnapshotStatus();
        currentSnapshotStatus.startTime(System.currentTimeMillis());

        try {
            doSnapshot(snapshot);
            currentSnapshotStatus.time(System.currentTimeMillis() - currentSnapshotStatus.startTime());
View Full Code Here

            }
        }

        if (request.snapshot) {
            IndexShardGatewayService gatewayService = indexService.shardInjector(request.shardId()).getInstance(IndexShardGatewayService.class);
            SnapshotStatus snapshotStatus = gatewayService.snapshotStatus();
            if (snapshotStatus != null) {
                GatewaySnapshotStatus.Stage stage;
                switch (snapshotStatus.stage()) {
                    case DONE:
                        stage = GatewaySnapshotStatus.Stage.DONE;
                        break;
                    case FAILURE:
                        stage = GatewaySnapshotStatus.Stage.FAILURE;
                        break;
                    case TRANSLOG:
                        stage = GatewaySnapshotStatus.Stage.TRANSLOG;
                        break;
                    case FINALIZE:
                        stage = GatewaySnapshotStatus.Stage.FINALIZE;
                        break;
                    case INDEX:
                        stage = GatewaySnapshotStatus.Stage.INDEX;
                        break;
                    default:
                        stage = GatewaySnapshotStatus.Stage.NONE;
                        break;
                }
                shardStatus.gatewaySnapshotStatus = new GatewaySnapshotStatus(stage, snapshotStatus.startTime(), snapshotStatus.time(),
                        snapshotStatus.index().totalSize(), snapshotStatus.translog().expectedNumberOfOperations());
            }
        }

        return shardStatus;
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.gateway.SnapshotStatus

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.