摘要: es使用netty来通信,实现分布式的功能,但在某些场景会oom。 1:netty概述IO 多路复用NioEventLoop.run select由jdk实现在win下使用select,在linux下使用epoll。linux下也可以使用netty实现的epoll:EpollEventLoop。 线 阅读全文
posted @ 2020-04-15 10:31 vsop_479 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 本文以TermQuery,GlobalOrdinalsStringTermsAggregator为例,通过代码,分析es,lucene搜索及聚合流程。1:协调节点收到请求后,将search任务发到相关的各个shard。 相关代码: TransportSearchAction.executeSearc 阅读全文
posted @ 2020-01-12 18:42 vsop_479 阅读(1506) 评论(0) 推荐(0) 编辑
摘要: 本文主要分析es lucene写入流程,lucene segment的产生,flush, commit与es的refresh,flush。 1 segment的产生 当索引一个文档时,如果存在空闲的segment(未被其他线程锁定),则取出空闲segment list中的最后一个segment(LI 阅读全文
posted @ 2018-12-22 20:39 vsop_479 阅读(1721) 评论(2) 推荐(0) 编辑
摘要: DefaultIndexingChain.flush.writeDocValues时,遍历fields,调用field的DocValuesWriter.flush,如: SortedDocValuesWriter.flush.addSortedField时,获取该field的DocValuesCon 阅读全文
posted @ 2021-03-23 14:40 vsop_479 阅读(129) 评论(0) 推荐(0) 编辑
摘要: update操作buffer到DocumentsWriterDeleteQueue里,flush时处理deletes.DocumentsWriterDeleteQueue使用global DeleteSlice和DWPT DeleteSlice存储deletes。DWPT DeleteSlice用来 阅读全文
posted @ 2021-02-28 19:58 vsop_479 阅读(157) 评论(0) 推荐(0) 编辑
摘要: booleanQuery:"must" : [ { "term" : { "like" : "cooking" } }, { "term" : { "property" : "bike" } } ]termInsetQuery:{ "terms": {"like": [ "cooking", "fi 阅读全文
posted @ 2020-12-27 17:03 vsop_479 阅读(298) 评论(0) 推荐(0) 编辑
摘要: postings的存储, 读取, 缓存一个term的postings list 存储1: sort2: delta3: 每128个docID, 按block存储. block记录bits per value(该block最大值的bits, like fdx)4: skipper(for boolea 阅读全文
posted @ 2020-12-22 15:03 vsop_479 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 从最大的segment_N中读取已经提交的segments信息,具体为:从segment_N中读取已经提交的segment的name,id等。再从每个segment对应的si文件中读取segment的docCount,files,attributes等元信息。相关代码:lucene 8.7.0Seg 阅读全文
posted @ 2020-12-07 14:45 vsop_479 阅读(113) 评论(0) 推荐(0) 编辑
摘要: storedField涉及的主要文件有fdt, fdx. fdt用来分chunk存储数据, fdx来索引这些chunk。 fdt分析fdt写入由CompressingStoredFieldsWriter实现。主要field如下chunkSize: 16K(1 << 14), Lucene50Stor 阅读全文
posted @ 2020-11-29 22:05 vsop_479 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 策略模式 ThreadPoolExecutor的RejectedExecutionHandler,实现不同的拒绝策略。 装饰者模式 BufferedInputStream对InputStream扩展buffer功能。 工厂模式 Executors作为工厂,提供各种ExecutorService。 命 阅读全文
posted @ 2020-04-19 14:03 vsop_479 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 一次确认多个数据包在TCP中,ACK是累积的—它们表示接收方已经正确收到了一直到确认序号减1的所有字节. 重传1: client发出数据包后, 没有收到server的ack, 重传.2: server没有收到client的数据, client收到server发来对发过的数据的ack, 重传. 排序接 阅读全文
posted @ 2020-04-13 18:58 vsop_479 阅读(134) 评论(0) 推荐(0) 编辑