你不会是程序猿吧?

_cat/pending_tasks/ API中第一列的数字什么意思?指的是线程吗?

Elasticsearch | 作者 sterne vencel | 发布于2018年05月25日 | 阅读数:3265


打开后第一列是insertOrder
1.png

 
它的解释是:task insertion order
不明白,这个值指的是什么啊,能通过这个数字找到相应的索引吗?或者找到相应的进程吗?
已邀请:

JackGe

赞同来自: sterne vencel

从源码上分析insertOrder是task的序号,insertionOrder是自增的,每调用execute方法,生成一个task序号。
public class PrioritizedEsThreadPoolExecutor extends EsThreadPoolExecutor {

private static final TimeValue NO_WAIT_TIME_VALUE = TimeValue.timeValueMillis(0);
private AtomicLong insertionOrder = new AtomicLong();

@Override
public void execute(Runnable command) {
if (command instanceof PrioritizedRunnable) {
command = new TieBreakingPrioritizedRunnable((PrioritizedRunnable) command, insertionOrder.incrementAndGet());
} else if (!(command instanceof PrioritizedFutureTask)) { // it might be a callable wrapper...
command = new TieBreakingPrioritizedRunnable(command, Priority.NORMAL, insertionOrder.incrementAndGet());
}
super.execute(command);
}

yayg2008

赞同来自: sterne vencel

get /_shard_stores?status=green
通过allocation_id可以找到是哪个Index。
 
官方文档:https://www.elastic.co/guide/e ... .html

要回复问题请先登录注册