会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
andyfan
记录我所热爱的一切, Python/C++/Linux...
博客园
首页
新随笔
联系
管理
2016年1月21日
Linux上搭建c++ 开发环境
摘要: 1. add devtools.repo [testing devtools 2 centos $releasever] name=testing 2 devtools for CentOS $releasever baseurl=http://people.centos.org/tru/d...
阅读全文
posted @ 2016-01-21 20:14 zhifan
阅读(1012)
评论(0)
推荐(0)
2015年1月20日
elasticsearch 的filter cache (search 技术的冰山一角)
摘要: 当你发了一个query, 例如 select * from t where a=1; 那么他就会在a 这个field 上创建一个bitmap 的filter cache 用于记录a 这个field 的值是否为1, es 会维护这个cache, 对于符合a=1的document, bit 位会被设为...
阅读全文
posted @ 2015-01-20 11:09 zhifan
阅读(1344)
评论(0)
推荐(0)
2015年1月19日
elasticsearch 的Merge
摘要: 一个ES index 包含有多个sharding, sharding 主要用于分布式。 一个sharding里面也可以包含多个segment. es 在indexing 的时候会产生很多的segments。 segments 太多会导致文件句柄浪费严重, 并且搜索性能底下。 ES 自己也会去做me...
阅读全文
posted @ 2015-01-19 11:00 zhifan
阅读(3281)
评论(0)
推荐(0)
2015年1月15日
Python 的and 运算
摘要: #### obj1 and obj2 and obj3 的返回值是 这个语句执行的最后的一个obj 的值。 >>> 'a' and 'b' and 'c' 'c' >>> 'a' and False and 'c' False >>> False and 'b' an...
阅读全文
posted @ 2015-01-15 12:22 zhifan
阅读(301)
评论(0)
推荐(0)
2015年1月9日
Cassandra SizeTieredCompaction
摘要: Cassandra SizeTieredCompactionCassandra首先讲数据写入commit log, 然后memtable, 当达到一定条件后,会被flush 到磁盘上,成为SSTable, 当SSTable 达到一定条件后会合并。1. memtable flush 的条件:memta...
阅读全文
posted @ 2015-01-09 23:51 zhifan
阅读(629)
评论(0)
推荐(0)
2015年1月6日
Python/C++ 对字符串的操作
摘要: 字符串操作在任何语言中都很常用。 本文列举了一些常见的Python/c++ 对字符串的操作。 c++ 的使用了boost libraray, 所涉及到的函数都在 中定义。pythonc++大小写转换'str'.upper(), 'str'.lower()boost::to_upper('str'),...
阅读全文
posted @ 2015-01-06 22:28 zhifan
阅读(845)
评论(0)
推荐(0)
2014年12月24日
Python 操作Cassandra
摘要: ### Cassandra 协议Cassandra 支持两种协议。 传统的thrift 协议和更强大的native 协议。 默认地它们分别侦听9160 端口和9042 端口。 要使用native 协议,需要设置 start_native_transport: true nat...
阅读全文
posted @ 2014-12-24 07:15 zhifan
阅读(2375)
评论(0)
推荐(0)
2014年12月22日
pymongo 的基本操作
摘要: ### 连接和基本表操作 >>> import pymongo >>> conn = pymongo.MongoReplicaSetClient('xxxx:27017', replicaSet='mongolog') # 建立连接Mongo Instance >>> db = ...
阅读全文
posted @ 2014-12-22 21:24 zhifan
阅读(538)
评论(0)
推荐(0)
2014年12月18日
bash script 常用技能备忘
摘要: ####赋值 x="abc" # = 前后不能有空格#### 条件判断 if cond; then # some code elif cond2; then # some code fi if [...
阅读全文
posted @ 2014-12-18 21:21 zhifan
阅读(229)
评论(0)
推荐(0)
2014年12月11日
cassandra compact
摘要: ### cassandra 写入cassandra 首先写入memtable, 与此同时写入commitlog. memtable 在内存,commitlog 在磁盘。 memtable 写完后会flush 到磁盘,成为SSTable. 同时对应的commitlog 会被删除。 之后对已经写入磁盘...
阅读全文
posted @ 2014-12-11 06:00 zhifan
阅读(823)
评论(0)
推荐(0)
下一页
公告