Package org.elasticsearch.common

Examples of org.elasticsearch.common.Table$Cell


        });
    }

    @Override
    Table getTableWithHeader(final RestRequest request) {
        Table table = new Table();
        table.startHeaders();
        table.addCell("id", "default:false;alias:nodeId;desc:unique node id");
        table.addCell("pid", "default:false;alias:p;desc:process id");
        table.addCell("host", "alias:h;desc:host name");
        table.addCell("ip", "alias:i;desc:ip address");
        table.addCell("port", "default:false;alias:po;desc:bound transport port");

        final String[] requestedPools = fetchSortedPools(request, DEFAULT_THREAD_POOLS);
        for (String pool : SUPPORTED_NAMES) {
            String poolAlias = THREAD_POOL_TO_ALIAS.get(pool);
            boolean display = false;
            for (String requestedPool : requestedPools) {
                if (pool.equals(requestedPool)) {
                    display = true;
                    break;
                }
            }

            String defaultDisplayVal = Boolean.toString(display);
            table.addCell(
                    pool + ".type",
                    "alias:" + poolAlias + "t;default:false;desc:" + pool + " thread pool type"
            );
            table.addCell(
                    pool + ".active",
                    "alias:" + poolAlias + "a;default:" + defaultDisplayVal + ";text-align:right;desc:number of active " + pool + " threads"
            );
            table.addCell(
                    pool + ".size",
                    "alias:" + poolAlias + "s;default:false;text-align:right;desc:number of " + pool + " threads"
            );
            table.addCell(
                    pool + ".queue",
                    "alias:" + poolAlias + "q;default:" + defaultDisplayVal + ";text-align:right;desc:number of " + pool + " threads in queue"
            );
            table.addCell(
                    pool + ".queueSize",
                    "alias:" + poolAlias + "qs;default:false;text-align:right;desc:maximum number of " + pool + " threads in queue"
            );
            table.addCell(
                    pool + ".rejected",
                    "alias:" + poolAlias + "r;default:" + defaultDisplayVal + ";text-align:right;desc:number of rejected " + pool + " threads"
            );
            table.addCell(
                    pool + ".largest",
                    "alias:" + poolAlias + "l;default:false;text-align:right;desc:highest number of seen active " + pool + " threads"
            );
            table.addCell(
                    pool + ".completed",
                    "alias:" + poolAlias + "c;default:false;text-align:right;desc:number of completed " + pool + " threads"
            );
            table.addCell(
                    pool + ".min",
                    "alias:" + poolAlias + "mi;default:false;text-align:right;desc:minimum number of " + pool + " threads"
            );
            table.addCell(
                    pool + ".max",
                    "alias:" + poolAlias + "ma;default:false;text-align:right;desc:maximum number of " + pool + " threads"
            );
            table.addCell(
                    pool + ".keepAlive",
                    "alias:" + poolAlias + "k;default:false;text-align:right;desc:" + pool + " thread keep alive time"
            );
        }

        table.endHeaders();
        return table;
    }
View Full Code Here



    private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo, NodesStatsResponse nodesStats) {
        boolean fullId = req.paramAsBoolean("full_id", false);
        DiscoveryNodes nodes = state.getState().nodes();
        Table table = getTableWithHeader(req);

        for (DiscoveryNode node : nodes) {
            NodeInfo info = nodesInfo.getNodesMap().get(node.id());
            NodeStats stats = nodesStats.getNodesMap().get(node.id());
            table.startRow();

            table.addCell(fullId ? node.id() : Strings.substring(node.getId(), 0, 4));
            table.addCell(info == null ? null : info.getProcess().id());
            table.addCell(node.getHostName());
            table.addCell(node.getHostAddress());
            if (node.address() instanceof InetSocketTransportAddress) {
                table.addCell(((InetSocketTransportAddress) node.address()).address().getPort());
            } else {
                table.addCell("-");
            }

            final Map<String, ThreadPoolStats.Stats> poolThreadStats;
            final Map<String, ThreadPool.Info> poolThreadInfo;

            if (stats == null) {
                poolThreadStats = Collections.emptyMap();
                poolThreadInfo = Collections.emptyMap();
            } else {
                poolThreadStats = new HashMap<>(14);
                poolThreadInfo = new HashMap<>(14);

                ThreadPoolStats threadPoolStats = stats.getThreadPool();
                for (ThreadPoolStats.Stats threadPoolStat : threadPoolStats) {
                    poolThreadStats.put(threadPoolStat.getName(), threadPoolStat);
                }
                if (info != null) {
                    for (ThreadPool.Info threadPoolInfo : info.getThreadPool()) {
                        poolThreadInfo.put(threadPoolInfo.getName(), threadPoolInfo);
                    }
                }
            }
            for (String pool : SUPPORTED_NAMES) {
                ThreadPoolStats.Stats poolStats = poolThreadStats.get(pool);
                ThreadPool.Info poolInfo = poolThreadInfo.get(pool);

                Long maxQueueSize = null;
                String keepAlive = null;
                Integer minThreads = null;
                Integer maxThreads = null;

                if (poolInfo != null) {
                    if (poolInfo.getQueueSize() != null) {
                        maxQueueSize = poolInfo.getQueueSize().singles();
                    }
                    if (poolInfo.getKeepAlive() != null) {
                        keepAlive = poolInfo.getKeepAlive().toString();
                    }
                    if (poolInfo.getMin() >= 0) {
                        minThreads = poolInfo.getMin();
                    }
                    if (poolInfo.getMax() >= 0) {
                        maxThreads = poolInfo.getMax();
                    }
                }

                table.addCell(poolInfo == null  ? null : poolInfo.getType());
                table.addCell(poolStats == null ? null : poolStats.getActive());
                table.addCell(poolStats == null ? null : poolStats.getThreads());
                table.addCell(poolStats == null ? null : poolStats.getQueue());
                table.addCell(maxQueueSize);
                table.addCell(poolStats == null ? null : poolStats.getRejected());
                table.addCell(poolStats == null ? null : poolStats.getLargest());
                table.addCell(poolStats == null ? null : poolStats.getCompleted());
                table.addCell(minThreads);
                table.addCell(maxThreads);
                table.addCell(keepAlive);
            }

            table.endRow();
        }

        return table;
    }
View Full Code Here

        });
    }

    @Override
    Table getTableWithHeader(final RestRequest request) {
        Table table = new Table();
        table.startHeaders();
        table.addCell("id", "default:false;alias:id,nodeId;desc:unique node id");
        table.addCell("pid", "default:false;alias:p;desc:process id");
        table.addCell("host", "alias:h;desc:host name");
        table.addCell("ip", "alias:i;desc:ip address");
        table.addCell("port", "default:false;alias:po;desc:bound transport port");

        table.addCell("version", "default:false;alias:v;desc:es version");
        table.addCell("build", "default:false;alias:b;desc:es build hash");
        table.addCell("jdk", "default:false;alias:j;desc:jdk version");
        table.addCell("disk.avail", "default:false;alias:d,disk,diskAvail;text-align:right;desc:available disk space");
        table.addCell("heap.current", "default:false;alias:hc,heapCurrent;text-align:right;desc:used heap");
        table.addCell("heap.percent", "alias:hp,heapPercent;text-align:right;desc:used heap ratio");
        table.addCell("heap.max", "default:false;alias:hm,heapMax;text-align:right;desc:max configured heap");
        table.addCell("ram.current", "default:false;alias:rc,ramCurrent;text-align:right;desc:used machine memory");
        table.addCell("ram.percent", "alias:rp,ramPercent;text-align:right;desc:used machine memory ratio");
        table.addCell("ram.max", "default:false;alias:rm,ramMax;text-align:right;desc:total machine memory");
        table.addCell("file_desc.current", "default:false;alias:fdc,fileDescriptorCurrent;text-align:right;desc:used file descriptors");
        table.addCell("file_desc.percent", "default:false;alias:fdp,fileDescriptorPercent;text-align:right;desc:used file descriptor ratio");
        table.addCell("file_desc.max", "default:false;alias:fdm,fileDescriptorMax;text-align:right;desc:max file descriptors");

        table.addCell("load", "alias:l;text-align:right;desc:most recent load avg");
        table.addCell("uptime", "default:false;alias:u;text-align:right;desc:node uptime");
        table.addCell("node.role", "alias:r,role,dc,nodeRole;desc:d:data node, c:client node");
        table.addCell("master", "alias:m;desc:m:master-eligible, *:current master");
        table.addCell("name", "alias:n;desc:node name");

        table.addCell("completion.size", "alias:cs,completionSize;default:false;text-align:right;desc:size of completion");

        table.addCell("fielddata.memory_size", "alias:fm,fielddataMemory;default:false;text-align:right;desc:used fielddata cache");
        table.addCell("fielddata.evictions", "alias:fe,fielddataEvictions;default:false;text-align:right;desc:fielddata evictions");

        table.addCell("filter_cache.memory_size", "alias:fcm,filterCacheMemory;default:false;text-align:right;desc:used filter cache");
        table.addCell("filter_cache.evictions", "alias:fce,filterCacheEvictions;default:false;text-align:right;desc:filter cache evictions");

        table.addCell("query_cache.memory_size", "alias:qcm,queryCacheMemory;default:false;text-align:right;desc:used query cache");
        table.addCell("query_cache.evictions", "alias:qce,queryCacheEvictions;default:false;text-align:right;desc:query cache evictions");
        table.addCell("query_cache.hit_count", "alias:qchc,queryCacheHitCount;default:false;text-align:right;desc:query cache hit counts");
        table.addCell("query_cache.miss_count", "alias:qcmc,queryCacheMissCount;default:false;text-align:right;desc:query cache miss counts");

        table.addCell("flush.total", "alias:ft,flushTotal;default:false;text-align:right;desc:number of flushes");
        table.addCell("flush.total_time", "alias:ftt,flushTotalTime;default:false;text-align:right;desc:time spent in flush");

        table.addCell("get.current", "alias:gc,getCurrent;default:false;text-align:right;desc:number of current get ops");
        table.addCell("get.time", "alias:gti,getTime;default:false;text-align:right;desc:time spent in get");
        table.addCell("get.total", "alias:gto,getTotal;default:false;text-align:right;desc:number of get ops");
        table.addCell("get.exists_time", "alias:geti,getExistsTime;default:false;text-align:right;desc:time spent in successful gets");
        table.addCell("get.exists_total", "alias:geto,getExistsTotal;default:false;text-align:right;desc:number of successful gets");
        table.addCell("get.missing_time", "alias:gmti,getMissingTime;default:false;text-align:right;desc:time spent in failed gets");
        table.addCell("get.missing_total", "alias:gmto,getMissingTotal;default:false;text-align:right;desc:number of failed gets");

        table.addCell("id_cache.memory_size", "alias:im,idCacheMemory;default:false;text-align:right;desc:used id cache");

        table.addCell("indexing.delete_current", "alias:idc,indexingDeleteCurrent;default:false;text-align:right;desc:number of current deletions");
        table.addCell("indexing.delete_time", "alias:idti,indexingDeleteTime;default:false;text-align:right;desc:time spent in deletions");
        table.addCell("indexing.delete_total", "alias:idto,indexingDeleteTotal;default:false;text-align:right;desc:number of delete ops");
        table.addCell("indexing.index_current", "alias:iic,indexingIndexCurrent;default:false;text-align:right;desc:number of current indexing ops");
        table.addCell("indexing.index_time", "alias:iiti,indexingIndexTime;default:false;text-align:right;desc:time spent in indexing");
        table.addCell("indexing.index_total", "alias:iito,indexingIndexTotal;default:false;text-align:right;desc:number of indexing ops");

        table.addCell("merges.current", "alias:mc,mergesCurrent;default:false;text-align:right;desc:number of current merges");
        table.addCell("merges.current_docs", "alias:mcd,mergesCurrentDocs;default:false;text-align:right;desc:number of current merging docs");
        table.addCell("merges.current_size", "alias:mcs,mergesCurrentSize;default:false;text-align:right;desc:size of current merges");
        table.addCell("merges.total", "alias:mt,mergesTotal;default:false;text-align:right;desc:number of completed merge ops");
        table.addCell("merges.total_docs", "alias:mtd,mergesTotalDocs;default:false;text-align:right;desc:docs merged");
        table.addCell("merges.total_size", "alias:mts,mergesTotalSize;default:false;text-align:right;desc:size merged");
        table.addCell("merges.total_time", "alias:mtt,mergesTotalTime;default:false;text-align:right;desc:time spent in merges");

        table.addCell("percolate.current", "alias:pc,percolateCurrent;default:false;text-align:right;desc:number of current percolations");
        table.addCell("percolate.memory_size", "alias:pm,percolateMemory;default:false;text-align:right;desc:memory used by percolations");
        table.addCell("percolate.queries", "alias:pq,percolateQueries;default:false;text-align:right;desc:number of registered percolation queries");
        table.addCell("percolate.time", "alias:pti,percolateTime;default:false;text-align:right;desc:time spent percolating");
        table.addCell("percolate.total", "alias:pto,percolateTotal;default:false;text-align:right;desc:total percolations");

        table.addCell("refresh.total", "alias:rto,refreshTotal;default:false;text-align:right;desc:total refreshes");
        table.addCell("refresh.time", "alias:rti,refreshTime;default:false;text-align:right;desc:time spent in refreshes");

        table.addCell("search.fetch_current", "alias:sfc,searchFetchCurrent;default:false;text-align:right;desc:current fetch phase ops");
        table.addCell("search.fetch_time", "alias:sfti,searchFetchTime;default:false;text-align:right;desc:time spent in fetch phase");
        table.addCell("search.fetch_total", "alias:sfto,searchFetchTotal;default:false;text-align:right;desc:total fetch ops");
        table.addCell("search.open_contexts", "alias:so,searchOpenContexts;default:false;text-align:right;desc:open search contexts");
        table.addCell("search.query_current", "alias:sqc,searchQueryCurrent;default:false;text-align:right;desc:current query phase ops");
        table.addCell("search.query_time", "alias:sqti,searchQueryTime;default:false;text-align:right;desc:time spent in query phase");
        table.addCell("search.query_total", "alias:sqto,searchQueryTotal;default:false;text-align:right;desc:total query phase ops");

        table.addCell("segments.count", "alias:sc,segmentsCount;default:false;text-align:right;desc:number of segments");
        table.addCell("segments.memory", "alias:sm,segmentsMemory;default:false;text-align:right;desc:memory used by segments");
        table.addCell("segments.index_writer_memory", "alias:siwm,segmentsIndexWriterMemory;default:false;text-align:right;desc:memory used by index writer");
        table.addCell("segments.index_writer_max_memory", "alias:siwmx,segmentsIndexWriterMaxMemory;default:false;text-align:right;desc:maximum memory index writer may use before it must write buffered documents to a new segment");
        table.addCell("segments.version_map_memory", "alias:svmm,segmentsVersionMapMemory;default:false;text-align:right;desc:memory used by version map");
        table.addCell("segments.fixed_bitset_memory", "alias:sfbm,fixedBitsetMemory;default:false;text-align:right;desc:memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields");

        table.addCell("suggest.current", "alias:suc,suggestCurrent;default:false;text-align:right;desc:number of current suggest ops");
        table.addCell("suggest.time", "alias:suti,suggestTime;default:false;text-align:right;desc:time spend in suggest");
        table.addCell("suggest.total", "alias:suto,suggestTotal;default:false;text-align:right;desc:number of suggest ops");

        table.endHeaders();
        return table;
    }
View Full Code Here

                        IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
                        indicesStatsRequest.all();
                        client.admin().indices().stats(indicesStatsRequest, new RestResponseListener<IndicesStatsResponse>(channel) {
                            @Override
                            public RestResponse buildResponse(IndicesStatsResponse indicesStatsResponse) throws Exception {
                                Table tab = buildTable(request, concreteIndices, clusterHealthResponse, indicesStatsResponse, clusterStateResponse.getState().metaData());
                                return RestTable.buildResponse(tab, channel);
                            }
                        });

                    }
View Full Code Here

        });
    }

    @Override
    Table getTableWithHeader(final RestRequest request) {
        Table table = new Table();
        table.startHeaders();
        table.addCell("health", "alias:h;desc:current health status");
        table.addCell("status", "alias:s;desc:open/close status");
        table.addCell("index", "alias:i,idx;desc:index name");
        table.addCell("pri", "alias:p,shards.primary,shardsPrimary;text-align:right;desc:number of primary shards");
        table.addCell("rep", "alias:r,shards.replica,shardsReplica;text-align:right;desc:number of replica shards");
        table.addCell("docs.count", "alias:dc,docsCount;text-align:right;desc:available docs");
        table.addCell("docs.deleted", "alias:dd,docsDeleted;text-align:right;desc:deleted docs");

        table.addCell("store.size", "sibling:pri;alias:ss,storeSize;text-align:right;desc:store size of primaries & replicas");
        table.addCell("pri.store.size", "text-align:right;desc:store size of primaries");

        table.addCell("completion.size", "sibling:pri;alias:cs,completionSize;default:false;text-align:right;desc:size of completion");
        table.addCell("pri.completion.size", "default:false;text-align:right;desc:size of completion");

        table.addCell("fielddata.memory_size", "sibling:pri;alias:fm,fielddataMemory;default:false;text-align:right;desc:used fielddata cache");
        table.addCell("pri.fielddata.memory_size", "default:false;text-align:right;desc:used fielddata cache");

        table.addCell("fielddata.evictions", "sibling:pri;alias:fe,fielddataEvictions;default:false;text-align:right;desc:fielddata evictions");
        table.addCell("pri.fielddata.evictions", "default:false;text-align:right;desc:fielddata evictions");

        table.addCell("filter_cache.memory_size", "sibling:pri;alias:fcm,filterCacheMemory;default:false;text-align:right;desc:used filter cache");
        table.addCell("pri.filter_cache.memory_size", "default:false;text-align:right;desc:used filter cache");

        table.addCell("filter_cache.evictions", "sibling:pri;alias:fce,filterCacheEvictions;default:false;text-align:right;desc:filter cache evictions");
        table.addCell("pri.filter_cache.evictions", "default:false;text-align:right;desc:filter cache evictions");

        table.addCell("query_cache.memory_size", "sibling:pri;alias:qcm,queryCacheMemory;default:false;text-align:right;desc:used query cache");
        table.addCell("pri.query_cache.memory_size", "default:false;text-align:right;desc:used query cache");

        table.addCell("query_cache.evictions", "sibling:pri;alias:qce,queryCacheEvictions;default:false;text-align:right;desc:query cache evictions");
        table.addCell("pri.query_cache.evictions", "default:false;text-align:right;desc:query cache evictions");

        table.addCell("query_cache.hit_count", "sibling:pri;alias:qchc,queryCacheHitCount;default:false;text-align:right;desc:query cache hit count");
        table.addCell("pri.query_cache.hit_count", "default:false;text-align:right;desc:query cache hit count");

        table.addCell("query_cache.miss_count", "sibling:pri;alias:qcmc,queryCacheMissCount;default:false;text-align:right;desc:query cache miss count");
        table.addCell("pri.query_cache.miss_count", "default:false;text-align:right;desc:query cache miss count");

        table.addCell("flush.total", "sibling:pri;alias:ft,flushTotal;default:false;text-align:right;desc:number of flushes");
        table.addCell("pri.flush.total", "default:false;text-align:right;desc:number of flushes");

        table.addCell("flush.total_time", "sibling:pri;alias:ftt,flushTotalTime;default:false;text-align:right;desc:time spent in flush");
        table.addCell("pri.flush.total_time", "default:false;text-align:right;desc:time spent in flush");

        table.addCell("get.current", "sibling:pri;alias:gc,getCurrent;default:false;text-align:right;desc:number of current get ops");
        table.addCell("pri.get.current", "default:false;text-align:right;desc:number of current get ops");

        table.addCell("get.time", "sibling:pri;alias:gti,getTime;default:false;text-align:right;desc:time spent in get");
        table.addCell("pri.get.time", "default:false;text-align:right;desc:time spent in get");

        table.addCell("get.total", "sibling:pri;alias:gto,getTotal;default:false;text-align:right;desc:number of get ops");
        table.addCell("pri.get.total", "default:false;text-align:right;desc:number of get ops");

        table.addCell("get.exists_time", "sibling:pri;alias:geti,getExistsTime;default:false;text-align:right;desc:time spent in successful gets");
        table.addCell("pri.get.exists_time", "default:false;text-align:right;desc:time spent in successful gets");

        table.addCell("get.exists_total", "sibling:pri;alias:geto,getExistsTotal;default:false;text-align:right;desc:number of successful gets");
        table.addCell("pri.get.exists_total", "default:false;text-align:right;desc:number of successful gets");

        table.addCell("get.missing_time", "sibling:pri;alias:gmti,getMissingTime;default:false;text-align:right;desc:time spent in failed gets");
        table.addCell("pri.get.missing_time", "default:false;text-align:right;desc:time spent in failed gets");

        table.addCell("get.missing_total", "sibling:pri;alias:gmto,getMissingTotal;default:false;text-align:right;desc:number of failed gets");
        table.addCell("pri.get.missing_total", "default:false;text-align:right;desc:number of failed gets");

        table.addCell("id_cache.memory_size", "sibling:pri;alias:im,idCacheMemory;default:false;text-align:right;desc:used id cache");
        table.addCell("pri.id_cache.memory_size", "default:false;text-align:right;desc:used id cache");

        table.addCell("indexing.delete_current", "sibling:pri;alias:idc,indexingDeleteCurrent;default:false;text-align:right;desc:number of current deletions");
        table.addCell("pri.indexing.delete_current", "default:false;text-align:right;desc:number of current deletions");

        table.addCell("indexing.delete_time", "sibling:pri;alias:idti,indexingDeleteTime;default:false;text-align:right;desc:time spent in deletions");
        table.addCell("pri.indexing.delete_time", "default:false;text-align:right;desc:time spent in deletions");

        table.addCell("indexing.delete_total", "sibling:pri;alias:idto,indexingDeleteTotal;default:false;text-align:right;desc:number of delete ops");
        table.addCell("pri.indexing.delete_total", "default:false;text-align:right;desc:number of delete ops");

        table.addCell("indexing.index_current", "sibling:pri;alias:iic,indexingIndexCurrent;default:false;text-align:right;desc:number of current indexing ops");
        table.addCell("pri.indexing.index_current", "default:false;text-align:right;desc:number of current indexing ops");

        table.addCell("indexing.index_time", "sibling:pri;alias:iiti,indexingIndexTime;default:false;text-align:right;desc:time spent in indexing");
        table.addCell("pri.indexing.index_time", "default:false;text-align:right;desc:time spent in indexing");

        table.addCell("indexing.index_total", "sibling:pri;alias:iito,indexingIndexTotal;default:false;text-align:right;desc:number of indexing ops");
        table.addCell("pri.indexing.index_total", "default:false;text-align:right;desc:number of indexing ops");

        table.addCell("merges.current", "sibling:pri;alias:mc,mergesCurrent;default:false;text-align:right;desc:number of current merges");
        table.addCell("pri.merges.current", "default:false;text-align:right;desc:number of current merges");

        table.addCell("merges.current_docs", "sibling:pri;alias:mcd,mergesCurrentDocs;default:false;text-align:right;desc:number of current merging docs");
        table.addCell("pri.merges.current_docs", "default:false;text-align:right;desc:number of current merging docs");

        table.addCell("merges.current_size", "sibling:pri;alias:mcs,mergesCurrentSize;default:false;text-align:right;desc:size of current merges");
        table.addCell("pri.merges.current_size", "default:false;text-align:right;desc:size of current merges");

        table.addCell("merges.total", "sibling:pri;alias:mt,mergesTotal;default:false;text-align:right;desc:number of completed merge ops");
        table.addCell("pri.merges.total", "default:false;text-align:right;desc:number of completed merge ops");

        table.addCell("merges.total_docs", "sibling:pri;alias:mtd,mergesTotalDocs;default:false;text-align:right;desc:docs merged");
        table.addCell("pri.merges.total_docs", "default:false;text-align:right;desc:docs merged");

        table.addCell("merges.total_size", "sibling:pri;alias:mts,mergesTotalSize;default:false;text-align:right;desc:size merged");
        table.addCell("pri.merges.total_size", "default:false;text-align:right;desc:size merged");

        table.addCell("merges.total_time", "sibling:pri;alias:mtt,mergesTotalTime;default:false;text-align:right;desc:time spent in merges");
        table.addCell("pri.merges.total_time", "default:false;text-align:right;desc:time spent in merges");

        table.addCell("percolate.current", "sibling:pri;alias:pc,percolateCurrent;default:false;text-align:right;desc:number of current percolations");
        table.addCell("pri.percolate.current", "default:false;text-align:right;desc:number of current percolations");

        table.addCell("percolate.memory_size", "sibling:pri;alias:pm,percolateMemory;default:false;text-align:right;desc:memory used by percolations");
        table.addCell("pri.percolate.memory_size", "default:false;text-align:right;desc:memory used by percolations");

        table.addCell("percolate.queries", "sibling:pri;alias:pq,percolateQueries;default:false;text-align:right;desc:number of registered percolation queries");
        table.addCell("pri.percolate.queries", "default:false;text-align:right;desc:number of registered percolation queries");

        table.addCell("percolate.time", "sibling:pri;alias:pti,percolateTime;default:false;text-align:right;desc:time spent percolating");
        table.addCell("pri.percolate.time", "default:false;text-align:right;desc:time spent percolating");

        table.addCell("percolate.total", "sibling:pri;alias:pto,percolateTotal;default:false;text-align:right;desc:total percolations");
        table.addCell("pri.percolate.total", "default:false;text-align:right;desc:total percolations");

        table.addCell("refresh.total", "sibling:pri;alias:rto,refreshTotal;default:false;text-align:right;desc:total refreshes");
        table.addCell("pri.refresh.total", "default:false;text-align:right;desc:total refreshes");

        table.addCell("refresh.time", "sibling:pri;alias:rti,refreshTime;default:false;text-align:right;desc:time spent in refreshes");
        table.addCell("pri.refresh.time", "default:false;text-align:right;desc:time spent in refreshes");

        table.addCell("search.fetch_current", "sibling:pri;alias:sfc,searchFetchCurrent;default:false;text-align:right;desc:current fetch phase ops");
        table.addCell("pri.search.fetch_current", "default:false;text-align:right;desc:current fetch phase ops");

        table.addCell("search.fetch_time", "sibling:pri;alias:sfti,searchFetchTime;default:false;text-align:right;desc:time spent in fetch phase");
        table.addCell("pri.search.fetch_time", "default:false;text-align:right;desc:time spent in fetch phase");

        table.addCell("search.fetch_total", "sibling:pri;alias:sfto,searchFetchTotal;default:false;text-align:right;desc:total fetch ops");
        table.addCell("pri.search.fetch_total", "default:false;text-align:right;desc:total fetch ops");

        table.addCell("search.open_contexts", "sibling:pri;alias:so,searchOpenContexts;default:false;text-align:right;desc:open search contexts");
        table.addCell("pri.search.open_contexts", "default:false;text-align:right;desc:open search contexts");

        table.addCell("search.query_current", "sibling:pri;alias:sqc,searchQueryCurrent;default:false;text-align:right;desc:current query phase ops");
        table.addCell("pri.search.query_current", "default:false;text-align:right;desc:current query phase ops");

        table.addCell("search.query_time", "sibling:pri;alias:sqti,searchQueryTime;default:false;text-align:right;desc:time spent in query phase");
        table.addCell("pri.search.query_time", "default:false;text-align:right;desc:time spent in query phase");

        table.addCell("search.query_total", "sibling:pri;alias:sqto,searchQueryTotal;default:false;text-align:right;desc:total query phase ops");
        table.addCell("pri.search.query_total", "default:false;text-align:right;desc:total query phase ops");

        table.addCell("segments.count", "sibling:pri;alias:sc,segmentsCount;default:false;text-align:right;desc:number of segments");
        table.addCell("pri.segments.count", "default:false;text-align:right;desc:number of segments");

        table.addCell("segments.memory", "sibling:pri;alias:sm,segmentsMemory;default:false;text-align:right;desc:memory used by segments");
        table.addCell("pri.segments.memory", "default:false;text-align:right;desc:memory used by segments");

        table.addCell("segments.index_writer_memory", "sibling:pri;alias:siwm,segmentsIndexWriterMemory;default:false;text-align:right;desc:memory used by index writer");
        table.addCell("pri.segments.index_writer_memory", "default:false;text-align:right;desc:memory used by index writer");

        table.addCell("segments.index_writer_max_memory", "sibling:pri;alias:siwmx,segmentsIndexWriterMaxMemory;default:false;text-align:right;desc:maximum memory index writer may use before it must write buffered documents to a new segment");
        table.addCell("pri.segments.index_writer_max_memory", "default:false;text-align:right;desc:maximum memory index writer may use before it must write buffered documents to a new segment");

        table.addCell("segments.version_map_memory", "sibling:pri;alias:svmm,segmentsVersionMapMemory;default:false;text-align:right;desc:memory used by version map");
        table.addCell("pri.segments.version_map_memory", "default:false;text-align:right;desc:memory used by version map");

        table.addCell("segments.fixed_bitset_memory", "sibling:pri;alias:sfbm,fixedBitsetMemory;default:false;text-align:right;desc:memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields");
        table.addCell("pri.segments.fixed_bitset_memory", "default:false;text-align:right;desc:memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields");

        table.addCell("warmer.current", "sibling:pri;alias:wc,warmerCurrent;default:false;text-align:right;desc:current warmer ops");
        table.addCell("pri.warmer.current", "default:false;text-align:right;desc:current warmer ops");

        table.addCell("warmer.total", "sibling:pri;alias:wto,warmerTotal;default:false;text-align:right;desc:total warmer ops");
        table.addCell("pri.warmer.total", "default:false;text-align:right;desc:total warmer ops");

        table.addCell("warmer.total_time", "sibling:pri;alias:wtt,warmerTotalTime;default:false;text-align:right;desc:time spent in warmers");
        table.addCell("pri.warmer.total_time", "default:false;text-align:right;desc:time spent in warmers");

        table.addCell("suggest.current", "sibling:pri;alias:suc,suggestCurrent;default:false;text-align:right;desc:number of current suggest ops");
        table.addCell("pri.suggest.current", "default:false;text-align:right;desc:number of current suggest ops");

        table.addCell("suggest.time", "sibling:pri;alias:suti,suggestTime;default:false;text-align:right;desc:time spend in suggest");
        table.addCell("pri.suggest.time", "default:false;text-align:right;desc:time spend in suggest");

        table.addCell("suggest.total", "sibling:pri;alias:suto,suggestTotal;default:false;text-align:right;desc:number of suggest ops");
        table.addCell("pri.suggest.total", "default:false;text-align:right;desc:number of suggest ops");

        table.addCell("memory.total", "sibling:pri;alias:tm,memoryTotal;default:false;text-align:right;desc:total used memory");
        table.addCell("pri.memory.total", "default:false;text-align:right;desc:total user memory");

        table.endHeaders();
        return table;
    }
View Full Code Here

        table.endHeaders();
        return table;
    }

    private Table buildTable(RestRequest request, String[] indices, ClusterHealthResponse health, IndicesStatsResponse stats, MetaData indexMetaDatas) {
        Table table = getTableWithHeader(request);

        for (String index : indices) {
            ClusterIndexHealth indexHealth = health.getIndices().get(index);
            IndexStats indexStats = stats.getIndices().get(index);
            IndexMetaData indexMetaData = indexMetaDatas.getIndices().get(index);
            IndexMetaData.State state = indexMetaData.getState();

            table.startRow();
            table.addCell(state == IndexMetaData.State.OPEN ? (indexHealth == null ? "red*" : indexHealth.getStatus().toString().toLowerCase(Locale.ROOT)) : null);
            table.addCell(state.toString().toLowerCase(Locale.ROOT));
            table.addCell(index);
            table.addCell(indexHealth == null ? null : indexHealth.getNumberOfShards());
            table.addCell(indexHealth == null ? null : indexHealth.getNumberOfReplicas());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getDocs().getCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getDocs().getDeleted());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getStore().size());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getStore().size());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getCompletion().getSize());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getCompletion().getSize());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getFieldData().getMemorySize());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getFieldData().getMemorySize());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getFieldData().getEvictions());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getFieldData().getEvictions());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getFilterCache().getMemorySize());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getFilterCache().getMemorySize());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getFilterCache().getEvictions());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getFilterCache().getEvictions());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getQueryCache().getMemorySize());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getQueryCache().getMemorySize());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getQueryCache().getEvictions());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getQueryCache().getEvictions());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getQueryCache().getHitCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getQueryCache().getHitCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getQueryCache().getMissCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getQueryCache().getMissCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getFlush().getTotal());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getFlush().getTotal());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getFlush().getTotalTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getFlush().getTotalTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getGet().current());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getGet().current());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getGet().getTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getGet().getTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getGet().getCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getGet().getCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getGet().getExistsTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getGet().getExistsTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getGet().getExistsCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getGet().getExistsCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getGet().getMissingTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getGet().getMissingTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getGet().getMissingCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getGet().getMissingCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getIdCache().getMemorySize());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getIdCache().getMemorySize());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getIndexing().getTotal().getDeleteCurrent());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getIndexing().getTotal().getDeleteCurrent());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getIndexing().getTotal().getDeleteTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getIndexing().getTotal().getDeleteTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getIndexing().getTotal().getDeleteCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getIndexing().getTotal().getDeleteCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getIndexing().getTotal().getIndexCurrent());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getIndexing().getTotal().getIndexCurrent());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getIndexing().getTotal().getIndexTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getIndexing().getTotal().getIndexTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getIndexing().getTotal().getIndexCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getIndexing().getTotal().getIndexCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getMerge().getCurrent());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getMerge().getCurrentSize());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getMerge().getCurrentNumDocs());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getMerge().getCurrentNumDocs());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getMerge().getCurrentSize());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getMerge().getCurrent());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getMerge().getTotal());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getMerge().getTotal());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getMerge().getTotalNumDocs());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getMerge().getTotalNumDocs());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getMerge().getTotalSize());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getMerge().getTotalSize());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getMerge().getTotalTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getMerge().getTotalTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getPercolate().getCurrent());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getPercolate().getCurrent());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getPercolate().getMemorySize());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getPercolate().getMemorySize());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getPercolate().getNumQueries());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getPercolate().getNumQueries());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getPercolate().getTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getPercolate().getTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getPercolate().getCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getPercolate().getCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getRefresh().getTotal());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getRefresh().getTotal());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getRefresh().getTotalTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getRefresh().getTotalTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getFetchCurrent());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getFetchCurrent());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getFetchTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getFetchTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getFetchCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getFetchCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getOpenContexts());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getOpenContexts());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getQueryCurrent());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getQueryCurrent());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getQueryTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getQueryTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getQueryCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getQueryCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSegments().getCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSegments().getCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSegments().getMemory());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSegments().getMemory());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSegments().getIndexWriterMemory());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSegments().getIndexWriterMemory());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSegments().getIndexWriterMaxMemory());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSegments().getIndexWriterMaxMemory());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSegments().getVersionMapMemory());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSegments().getVersionMapMemory());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSegments().getBitsetMemory());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSegments().getBitsetMemory());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getWarmer().current());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getWarmer().current());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getWarmer().total());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getWarmer().total());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getWarmer().totalTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getWarmer().totalTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSuggest().getCurrent());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSuggest().getCurrent());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSuggest().getTime());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSuggest().getTime());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getSuggest().getCount());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSuggest().getCount());

            table.addCell(indexStats == null ? null : indexStats.getTotal().getTotalMemory());
            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getTotalMemory());

            table.endRow();
        }

        return table;
    }
View Full Code Here

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) throws Exception {
        boolean helpWanted = request.paramAsBoolean("help", false);
        if (helpWanted) {
            Table table = getTableWithHeader(request);
            int[] width = buildHelpWidths(table, request);
            BytesStreamOutput bytesOutput = channel.bytesOutput();
            UTF8StreamWriter out = new UTF8StreamWriter().setOutput(bytesOutput);
            for (Table.Cell cell : table.getHeaders()) {
                // need to do left-align always, so create new cells
                pad(new Table.Cell(cell.value), width[0], request, out);
                out.append(" | ");
                pad(new Table.Cell(cell.attr.containsKey("alias") ? cell.attr.get("alias") : ""), width[1], request, out);
                out.append(" | ");
View Full Code Here

    private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo, NodesStatsResponse nodesStats) {
        boolean fullId = req.paramAsBoolean("full_id", false);

        DiscoveryNodes nodes = state.getState().nodes();
        String masterId = nodes.masterNodeId();
        Table table = getTableWithHeader(req);

        for (DiscoveryNode node : nodes) {
            NodeInfo info = nodesInfo.getNodesMap().get(node.id());
            NodeStats stats = nodesStats.getNodesMap().get(node.id());

            table.startRow();

            table.addCell(fullId ? node.id() : Strings.substring(node.getId(), 0, 4));
            table.addCell(info == null ? null : info.getProcess().id());
            table.addCell(node.getHostName());
            table.addCell(node.getHostAddress());
            if (node.address() instanceof InetSocketTransportAddress) {
                table.addCell(((InetSocketTransportAddress) node.address()).address().getPort());
            } else {
                table.addCell("-");
            }

            table.addCell(node.getVersion().number());
            table.addCell(info == null ? null : info.getBuild().hashShort());
            table.addCell(info == null ? null : info.getJvm().version());
            table.addCell(stats == null ? null : stats.getFs() == null ? null : stats.getFs().total().getAvailable());
            table.addCell(stats == null ? null : stats.getJvm().getMem().getHeapUsed());
            table.addCell(stats == null ? null : stats.getJvm().getMem().getHeapUsedPrecent());
            table.addCell(info == null ? null : info.getJvm().getMem().getHeapMax());
            table.addCell(stats == null ? null : stats.getOs().mem() == null ? null : stats.getOs().mem().used());
            table.addCell(stats == null ? null : stats.getOs().mem() == null ? null : stats.getOs().mem().usedPercent());
            table.addCell(info == null ? null : info.getOs().mem() == null ? null : info.getOs().mem().total()); // sigar fails to load in IntelliJ
            table.addCell(stats == null ? null : stats.getProcess().getOpenFileDescriptors());
            table.addCell(stats == null || info == null ? null :
                          calculatePercentage(stats.getProcess().getOpenFileDescriptors(), info.getProcess().getMaxFileDescriptors()));
            table.addCell(info == null ? null : info.getProcess().getMaxFileDescriptors());

            table.addCell(stats == null ? null : stats.getOs() == null ? null : stats.getOs().getLoadAverage().length < 1 ? null : String.format(Locale.ROOT, "%.2f", stats.getOs().getLoadAverage()[0]));
            table.addCell(stats == null ? null : stats.getJvm().uptime());
            table.addCell(node.clientNode() ? "c" : node.dataNode() ? "d" : "-");
            table.addCell(masterId == null ? "x" : masterId.equals(node.id()) ? "*" : node.masterNode() ? "m" : "-");
            table.addCell(node.name());

            table.addCell(stats == null ? null : stats.getIndices().getCompletion().getSize());

            table.addCell(stats == null ? null : stats.getIndices().getFieldData().getMemorySize());
            table.addCell(stats == null ? null : stats.getIndices().getFieldData().getEvictions());

            table.addCell(stats == null ? null : stats.getIndices().getFilterCache().getMemorySize());
            table.addCell(stats == null ? null : stats.getIndices().getFilterCache().getEvictions());

            table.addCell(stats == null ? null : stats.getIndices().getQueryCache().getMemorySize());
            table.addCell(stats == null ? null : stats.getIndices().getQueryCache().getEvictions());
            table.addCell(stats == null ? null : stats.getIndices().getQueryCache().getHitCount());
            table.addCell(stats == null ? null : stats.getIndices().getQueryCache().getMissCount());

            table.addCell(stats == null ? null : stats.getIndices().getFlush().getTotal());
            table.addCell(stats == null ? null : stats.getIndices().getFlush().getTotalTime());

            table.addCell(stats == null ? null : stats.getIndices().getGet().current());
            table.addCell(stats == null ? null : stats.getIndices().getGet().getTime());
            table.addCell(stats == null ? null : stats.getIndices().getGet().getCount());
            table.addCell(stats == null ? null : stats.getIndices().getGet().getExistsTime());
            table.addCell(stats == null ? null : stats.getIndices().getGet().getExistsCount());
            table.addCell(stats == null ? null : stats.getIndices().getGet().getMissingTime());
            table.addCell(stats == null ? null : stats.getIndices().getGet().getMissingCount());

            table.addCell(stats == null ? null : stats.getIndices().getIdCache().getMemorySize());

            table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getDeleteCurrent());
            table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getDeleteTime());
            table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getDeleteCount());
            table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getIndexCurrent());
            table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getIndexTime());
            table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getIndexCount());

            table.addCell(stats == null ? null : stats.getIndices().getMerge().getCurrent());
            table.addCell(stats == null ? null : stats.getIndices().getMerge().getCurrentNumDocs());
            table.addCell(stats == null ? null : stats.getIndices().getMerge().getCurrentSize());
            table.addCell(stats == null ? null : stats.getIndices().getMerge().getTotal());
            table.addCell(stats == null ? null : stats.getIndices().getMerge().getTotalNumDocs());
            table.addCell(stats == null ? null : stats.getIndices().getMerge().getTotalSize());
            table.addCell(stats == null ? null : stats.getIndices().getMerge().getTotalTime());

            table.addCell(stats == null ? null : stats.getIndices().getPercolate().getCurrent());
            table.addCell(stats == null ? null : stats.getIndices().getPercolate().getMemorySize());
            table.addCell(stats == null ? null : stats.getIndices().getPercolate().getNumQueries());
            table.addCell(stats == null ? null : stats.getIndices().getPercolate().getTime());
            table.addCell(stats == null ? null : stats.getIndices().getPercolate().getCount());

            table.addCell(stats == null ? null : stats.getIndices().getRefresh().getTotal());
            table.addCell(stats == null ? null : stats.getIndices().getRefresh().getTotalTime());

            table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getFetchCurrent());
            table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getFetchTime());
            table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getFetchCount());
            table.addCell(stats == null ? null : stats.getIndices().getSearch().getOpenContexts());
            table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getQueryCurrent());
            table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getQueryTime());
            table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getQueryCount());

            table.addCell(stats == null ? null : stats.getIndices().getSegments().getCount());
            table.addCell(stats == null ? null : stats.getIndices().getSegments().getMemory());
            table.addCell(stats == null ? null : stats.getIndices().getSegments().getIndexWriterMemory());
            table.addCell(stats == null ? null : stats.getIndices().getSegments().getIndexWriterMaxMemory());
            table.addCell(stats == null ? null : stats.getIndices().getSegments().getVersionMapMemory());
            table.addCell(stats == null ? null : stats.getIndices().getSegments().getBitsetMemory());

            table.addCell(stats == null ? null : stats.getIndices().getSuggest().getCurrent());
            table.addCell(stats == null ? null : stats.getIndices().getSuggest().getTime());
            table.addCell(stats == null ? null : stats.getIndices().getSuggest().getCount());

            table.endRow();
        }

        return table;
    }
View Full Code Here

        });
    }

    @Override
    Table getTableWithHeader(final RestRequest request) {
        Table table = new Table();
        table.startHeaders();
        table.addCell("name", "alias:n;desc:node name");
        table.addCell("component", "alias:c;desc:component");
        table.addCell("version", "alias:v;desc:component version");
        table.addCell("type", "alias:t;desc:type (j for JVM, s for Site)");
        table.addCell("url", "alias:u;desc:url for site plugins");
        table.addCell("description", "alias:d;default:false;desc:plugin details");
        table.endHeaders();
        return table;
    }
View Full Code Here

        return table;
    }

    private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo) {
        DiscoveryNodes nodes = state.getState().nodes();
        Table table = getTableWithHeader(req);

        for (DiscoveryNode node : nodes) {
            NodeInfo info = nodesInfo.getNodesMap().get(node.id());

            for (PluginInfo pluginInfo : info.getPlugins().getInfos()) {
                table.startRow();
                table.addCell(node.name());
                table.addCell(pluginInfo.getName());
                table.addCell(pluginInfo.getVersion());
                String type;
                if (pluginInfo.isSite()) {
                    if (pluginInfo.isJvm()) {
                        type = "j/s";
                    } else {
                        type = "s";
                    }
                } else {
                    if (pluginInfo.isJvm()) {
                        type = "j";
                    } else {
                        type = "";
                    }
                }
                table.addCell(type);
                table.addCell(pluginInfo.getUrl());
                table.addCell(pluginInfo.getDescription());
                table.endRow();
            }
        }

        return table;
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.Table$Cell

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.