跳至主要内容

博文

目前显示的是 七月, 2018的博文

Elasticsearch: Join and SubQuery

Elasticsearch: Join and SubQuery Tony was bothered by the recent change of search engine requirement: they want the functionality of SQL-like join in Elasticsearch! “They are crazy! How can they think like that. Didn’t they understand that Elasticsearch is kind-of NoSQL 1 in which every index should be independent and self-contained? In this way, every index can work independently and scale as they like without considering other indexes, so the performance can boost. Following this design principle, Elasticsearch has little related supports.” Tony thought, after listening their requirements. Leader notice tony’s unwillingness and said, “Maybe it is hard to do, but the requirement is reasonable. We need to search person by his friends, didn’t we? What’s more, the harder to implement, the more you can learn from it, right?” Tony thought leader’s word does make sense so he set out to do the related implementations Application-Side Join “The first implementation ...

Netty(2): Handler

Netty(2): Handler In last blog, we skim the basic abstraction of Netty network model: events cause the state change, user get involved in via Pipeline & Handler . In this blog, we will dive into more design details. Overall Review In Netty , the source of data is not the abstraction in Java, like Stream , but Event . When an event (from remove peer or user defined) is received by Channel , it will use Buffer to hold the data, and give it to Pipeline , which is a serial of Handler . Then, the thread in EventLoop will run the code of Handler ( Callback job, Listener ) to react to it. Today, we focus on core of user code – Pipeline & Handler . Handler Detail Inbound & Outbound As the core of user interaction with Netty , we need to dive into ChannelHandler . It can be categorized as two broad kinds according to the event types: ChannelInboundHandler & ChannelOutboundHandler . The ChannelInboundHandler will respond to network related ev...