huangfox

冰冻三尺,非一日之寒!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页

2013年10月16日

摘要: 一、Redis的Replication: 这里首先需要说明的是,在Redis中配置Master-Slave模式真是太简单了。相信在阅读完这篇Blog之后你也可以轻松做到。这里我们还是先列出一些理论性的知识,后面给出实际操作的案例。 下面的列表清楚的解释了Redis Replication的特点和优势。 1). 同一个Master可以同步多个Slaves。 2). Slave同样可以接受其它Slaves的连接和同步请求,这样可以有效的分载Master的同步压力。因此我们可以将Redis的Replication架构视为图结构。 3). Master Server是以非阻塞的方式为Slaves提供服 阅读全文
posted @ 2013-10-16 10:10 huangfox 阅读(534) 评论(0) 推荐(0) 编辑

摘要: Redis是目前众多NoSQL产品中非常有特点的一款,支持的数据类型和方法都非常丰富,做为一款具备持久化功能的软件,实际使中更多却是将其做为cache。三思在个人的测试环境中安装使用了两三天,这期间尽管文档看了不少,但其实收获不多,不过对于NoSQL产品的整体看法一直没变,我觉着各类型NoSQL产品都还只是工具,并且是小工具,称不上产品。小工具能起大作用这不假(redis目前在国内最知名的案例应该是新浪微博),但前提是为其找到适合的应用场景,深入的了解才能用好它。本文简要描述了linux环境安装redis的过程,redis相关参数以及简单的使用。1、安装下载源码包:# wget http:// 阅读全文
posted @ 2013-10-16 10:09 huangfox 阅读(518) 评论(0) 推荐(0) 编辑

2013年9月26日

摘要: 集群架构方面的问题 memcached是怎么工作的? Memcached的神奇来自两阶段哈希(two-stage hash)。Memcached就像一个巨大的、存储了很多对的哈希表。通过key,可以存储或查询任意的数据。 客户端可以把数据存储在多台memcached上。当查询数据时,客户端首先参考节点列表计算出key的哈希值(阶段一哈希),进而选中一个节点;客户端将请求发送给选中的节点,然后memcached节点通过一个内部的哈希算法(阶段二哈希),查找真正的数据(item)。 举个列子,假设有3个客户端1, 2, 3,3台memcached A, B, C: Client 1想把... 阅读全文
posted @ 2013-09-26 17:20 huangfox 阅读(1321) 评论(0) 推荐(0) 编辑

2013年9月18日

摘要: Intro:After some feedback onPart 1, and being prompted by some stackoverflow questions, I want to expand on and clarify some topics, so this is Part 1.5.Channel Handler Sharability & StateChannel OptionsChannel HandlersAs discussed previously, most types ofChannelHandlers have the job of either 阅读全文
posted @ 2013-09-18 17:28 huangfox 阅读(2433) 评论(1) 推荐(0) 编辑

摘要: Netty Tutorial, Part 1: Introduction to NettyUpdate:Part 1.5 Has Been Published:Netty Tutorial Part 1.5: On Channel Handlers and Channel OptionsFrom theNettyweb site:"Netty is a NIO client server framework which enables quick and easy development of network applications such as protocol servers 阅读全文
posted @ 2013-09-18 17:24 huangfox 阅读(2333) 评论(1) 推荐(1) 编辑

2013年8月26日

摘要: 首先摘抄一段关于IK的特性介绍:采用了特有的“正向迭代最细粒度切分算法”,具有60万字/秒的高速处理能力。采用了多子处理器分析模式,支持:英文字母(IP地址、Email、URL)、数字(日期,常用中文数量词,罗马数字,科学计数法),中文词汇(姓名、地名处理)等分词处理。优化的词典存储,更小的内存占用... 阅读全文
posted @ 2013-08-26 10:13 huangfox 阅读(3957) 评论(1) 推荐(2) 编辑

2013年7月24日

摘要: 有时需要查看java对象占用了多少内存(对象大小),lucene为我们提供了一个很好的工具类,操作简单,如下: int[] s = new int[1024]; System.out.println("size(s):" + RamUsageEstimator.humanSizeOf(s)); 就这么简单! 阅读全文
posted @ 2013-07-24 13:54 huangfox 阅读(4192) 评论(4) 推荐(1) 编辑

2013年7月11日

摘要: 在文本搜索中,有时也需要一次搜索多个id,这里id类似数据库里面的主键。这个id在索引里面的倒排列表长度往往等于1.例如:根据id=[1,2,4,6,7]查询索引最最一般的思路是构造一个booleanQuery,然后add 5个TermQuery,用should逻辑。但是这个检索效率肯定不行。可行的一个办法是:TermDocs td = null;//int[] docIds = new int[ids.length];//存放结果int count = 0 ;td = search.getIndexReader().termDocs();for(id : ids){ td.seek(new 阅读全文
posted @ 2013-07-11 10:39 huangfox 阅读(1738) 评论(0) 推荐(0) 编辑

2013年6月27日

摘要: Ifound in lucene 3.5 contrib folder two plugins: one is grouping, the other is facet. In my option, both of them were used to split my documents into ... 阅读全文
posted @ 2013-06-27 16:13 huangfox 阅读(339) 评论(0) 推荐(0) 编辑

2013年6月26日

摘要: 今天RP爆发,16核服务器load飙到30多,cpu使用情况全部99%以上。从jstack中分析发现全部线程都堵在map.transfer处,如下:"pool-10-thread-23" prio=10 tid=0x00007fb190003800 nid=0x6350 runnable [0x00007fb64554b000] java.lang.Thread.State: RUNNABLE at java.util.LinkedHashMap.transfer(LinkedHashMap.java:253) at java.util.HashMap.resi... 阅读全文
posted @ 2013-06-26 16:28 huangfox 阅读(3859) 评论(0) 推荐(1) 编辑

2013年6月7日

摘要: 问题的引入:Hello, I am using the reopen method in the IndexReader class. In the caseof the IndexReader being updated, I would like to create a new IndexSearcherand close the old IndexReader. When closing an instance of IndexReader, do Ihave to wait for currently executing searches (through an IndexSearch 阅读全文
posted @ 2013-06-07 17:02 huangfox 阅读(672) 评论(0) 推荐(0) 编辑

2013年1月3日

摘要: Scalable System Design PatternsLooking back after 2.5 years sincemy previous post on scalable system design techniques, I've observed an emergence of a set of commonly used design patterns. Here is my attempt to capture and share them.Load BalancerIn this model, there is a dispatcher that determ 阅读全文
posted @ 2013-01-03 16:40 huangfox 阅读(629) 评论(0) 推荐(0) 编辑

2012年8月21日

摘要: NRT原理When you ask for the IndexReader from the IndexWriter, the IndexWriter will be flushed (docs accumulated in RAM will be written to disk) but not committed (fsync files, write new segments file, etc).The returned IndexReader will search over previously committed segments, as well as the new, flu 阅读全文
posted @ 2012-08-21 14:37 huangfox 阅读(3092) 评论(7) 推荐(1) 编辑

2012年8月20日

摘要: 在数据分析和数据挖掘的过程中,我们经常需要知道个体间差异的大小,进而评价个体的相似性和类别。最常见的是数据分析中的相关分析,数据挖掘中的分类和聚类算法,如K最近邻(KNN)和K均值(K-Means)。当然衡量个体差异的方法有很多,最近查阅了相关的资料,这里整理罗列下。 为了方便下面的解释和举例,先设定我们要比较X个体和Y个体间的差异,它们都包含了N个维的特征,即X=(x1, x2, x3, … xn),Y=(y1, y2, y3, … yn)。下面来看看主要可以用哪些方法来衡量两者的差异,主要分为距离度量和相似度度量。距离度量 距离度量(Distance)用于衡量个体在空间上存在的距离,距.. 阅读全文
posted @ 2012-08-20 14:01 huangfox 阅读(4276) 评论(0) 推荐(0) 编辑

2012年8月16日

摘要: 参考《分布式java应用》一书,简单过一遍并发包(java.util.concurrent)ConcurrentHashMapConcurrentHashMap是线程安全的HashMap的实现。1)添加put(Object key , Object value)ConcurrentHashMap并没有采用synchronized进行控制,而是使用了ReentrantLock。public V put(K key, V value) { if (value == null) throw new NullPointerException(); in... 阅读全文
posted @ 2012-08-16 17:09 huangfox 阅读(12727) 评论(1) 推荐(1) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 14 下一页