Package org.elasticsearch.index.merge

Examples of org.elasticsearch.index.merge.MergeStats


    @Override public NodeIndicesStats stats() {
        long storeTotalSize = 0;
        long numberOfDocs = 0;
        CacheStats cacheStats = new CacheStats();
        MergeStats mergeStats = new MergeStats();
        for (IndexService indexService : indices.values()) {
            for (IndexShard indexShard : indexService) {
                try {
                    storeTotalSize += ((InternalIndexShard) indexShard).store().estimateSize().bytes();
                } catch (IOException e) {
                    // ignore
                }

                if (indexShard.state() == IndexShardState.STARTED) {
                    Engine.Searcher searcher = indexShard.searcher();
                    try {
                        numberOfDocs += searcher.reader().numDocs();
                    } finally {
                        searcher.release();
                    }
                }
                mergeStats.add(((InternalIndexShard) indexShard).mergeScheduler().stats());
            }
            cacheStats.add(indexService.cache().stats());
        }
        return new NodeIndicesStats(new ByteSizeValue(storeTotalSize), numberOfDocs, cacheStats, mergeStats);
    }
View Full Code Here


        schedulers.add(concurrentMergeScheduler);
        return concurrentMergeScheduler;
    }

    @Override public MergeStats stats() {
        MergeStats mergeStats = new MergeStats();
        for (CustomConcurrentMergeScheduler scheduler : schedulers) {
            mergeStats.add(scheduler.totalMerges(), scheduler.currentMerges(), scheduler.totalMergeTime());
        }
        return mergeStats;
    }
View Full Code Here

        schedulers.add(scheduler);
        return scheduler;
    }

    @Override public MergeStats stats() {
        MergeStats mergeStats = new MergeStats();
        for (CustomSerialMergeScheduler scheduler : schedulers) {
            mergeStats.add(scheduler.totalMerges(), scheduler.currentMerges(), scheduler.totalMergeTime());
        }
        return mergeStats;
    }
View Full Code Here

    /**
     * Total merges of this shard replication group.
     */
    public MergeStats mergeStats() {
        MergeStats mergeStats = new MergeStats();
        for (ShardStatus shard : shards) {
            mergeStats.add(shard.mergeStats());
        }
        return mergeStats;
    }
View Full Code Here

    /**
     * Total merges of this index.
     */
    public MergeStats mergeStats() {
        MergeStats mergeStats = new MergeStats();
        for (IndexShardStatus shard : this) {
            mergeStats.add(shard.mergeStats());
        }
        return mergeStats;
    }
View Full Code Here

                builder.field(Fields.MAX_DOC, indexStatus.docs().maxDoc());
                builder.field(Fields.DELETED_DOCS, indexStatus.docs().deletedDocs());
                builder.endObject();
            }

            MergeStats mergeStats = indexStatus.mergeStats();
            if (mergeStats != null) {
                mergeStats.toXContent(builder, params);
            }
            RefreshStats refreshStats = indexStatus.refreshStats();
            if (refreshStats != null) {
                refreshStats.toXContent(builder, params);
            }

            builder.startObject(Fields.SHARDS);
            for (IndexShardStatus indexShardStatus : indexStatus) {
                builder.startArray(Integer.toString(indexShardStatus.shardId().id()));
                for (ShardStatus shardStatus : indexShardStatus) {
                    builder.startObject();

                    builder.startObject(Fields.ROUTING)
                            .field(Fields.STATE, shardStatus.shardRouting().state())
                            .field(Fields.PRIMARY, shardStatus.shardRouting().primary())
                            .field(Fields.NODE, shardStatus.shardRouting().currentNodeId())
                            .field(Fields.RELOCATING_NODE, shardStatus.shardRouting().relocatingNodeId())
                            .field(Fields.SHARD, shardStatus.shardRouting().shardId().id())
                            .field(Fields.INDEX, shardStatus.shardRouting().shardId().index().name())
                            .endObject();

                    builder.field(Fields.STATE, shardStatus.state());
                    if (shardStatus.storeSize() != null) {
                        builder.startObject(Fields.INDEX);
                        builder.field(Fields.SIZE, shardStatus.storeSize().toString());
                        builder.field(Fields.SIZE_IN_BYTES, shardStatus.storeSize().bytes());
                        builder.endObject();
                    }
                    if (shardStatus.translogId() != -1) {
                        builder.startObject(Fields.TRANSLOG);
                        builder.field(Fields.ID, shardStatus.translogId());
                        builder.field(Fields.OPERATIONS, shardStatus.translogOperations());
                        builder.endObject();
                    }

                    if (shardStatus.docs() != null) {
                        builder.startObject(Fields.DOCS);
                        builder.field(Fields.NUM_DOCS, shardStatus.docs().numDocs());
                        builder.field(Fields.MAX_DOC, shardStatus.docs().maxDoc());
                        builder.field(Fields.DELETED_DOCS, shardStatus.docs().deletedDocs());
                        builder.endObject();
                    }

                    mergeStats = shardStatus.mergeStats();
                    if (mergeStats != null) {
                        mergeStats.toXContent(builder, params);
                    }

                    refreshStats = shardStatus.refreshStats();
                    if (refreshStats != null) {
                        refreshStats.toXContent(builder, params);
View Full Code Here

        return concurrentMergeScheduler;
    }

    @Override
    public MergeStats stats() {
        MergeStats mergeStats = new MergeStats();
        for (CustomConcurrentMergeScheduler scheduler : schedulers) {
            mergeStats.add(scheduler.totalMerges(), scheduler.totalMergeTime(), scheduler.totalMergeNumDocs(), scheduler.totalMergeSizeInBytes(),
                    scheduler.currentMerges(), scheduler.currentMergesNumDocs(), scheduler.currentMergesSizeInBytes());
        }
        return mergeStats;
    }
View Full Code Here

                    break;
                case Search:
                    search = new SearchStats();
                    break;
                case Merge:
                    merge = new MergeStats();
                    break;
                case Refresh:
                    refresh = new RefreshStats();
                    break;
                case Flush:
View Full Code Here

        } else {
            search.add(stats.getSearch());
        }
        if (merge == null) {
            if (stats.getMerge() != null) {
                merge = new MergeStats();
                merge.add(stats.getMerge());
            }
        } else {
            merge.add(stats.getMerge());
        }
View Full Code Here

TOP

Related Classes of org.elasticsearch.index.merge.MergeStats

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.