自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(60)
  • 资源 (1)
  • 收藏
  • 关注

原创 Mongo 内存映射与日志

Memory Map对文件的操作较快把文件的指定内容映射到内存空间中,普通文件被映射到进程地址空间后,进程可以像访问普通内存一样对文件进行访问,不必再调用read(),write()等操作。#includevoid *mmap(void *start,size_t length,int prot,int flags,int fd,off_t offset) ;从fd的offse

2012-11-13 21:45:16 2227

原创 Mongo 内存映射与日志

内存映射目的:MongoDB的存储引擎用的是OS的内存映射机制。原理:以linux 内存映射为例:存在的问题:问题一:消耗大量的内存。虽然内存映射在读具体的数据时,才从文件中加载相应的块,(写也一样,需要先读入数据才能在内存中写)。但还是避免不了随着时间的积累,文件中的数据会全部加载到内存中。实现:MongoFileMongoFile

2012-11-13 20:44:50 2517

转载 MongoDB数据文件内部结构 (MongoDB Storage Internal)

源文章链接 http://blog.nosqlfan.com/html/3515.html以下我做了一点注释MongoDB数据文件内部结构作者:nosqlfan on 星期一, 十二月 5, 2011 · 7条评论 【阅读:5,033 次】 有人在Quora上提问:MongoDB数据文件内部的组织结构是什么样的。随后10gen的工程师Jare

2012-09-21 23:13:48 2542 2

原创 ZooKeeper Overview

Design GoalsZooKeeper allows distributed processes to coordinate with each other through a shared hierarchal namespaceZooKeeperdata is kept in-memory, which means ZooKeeper can achieve high

2012-02-23 18:50:06 837

原创 类加载器

java.lang.Class 代表了Java应用程序在运行时所加载的类或接口,当一个类被加载时,JVM就自动为器生成一个Class对象。可以通过对象的getClass()方法获得Class实例,也可以通过类的静态常量class获得该Class对象。Class.getName()可以获得该类的名字(带命名空间)可以通过Class.forName()加载类或ClassLoader的loadC

2012-02-17 20:50:17 636

转载 Class

/*** 类初始化顺序:* * 1、超类静态变量;超类静态初始化块。--按代码排列顺序;* 2、子类静态变量;子类静态初始化块。--按代码排列顺序; * 3、所有的成员变量—包括该类,及它的父类中的成员变量--被分配内存空间,并赋予默认值(这里是第一次初始化成员变量)。如:subText in* SubClass constructor:null* 4、超类成员变量;超

2012-02-17 16:05:40 473

原创 Java基本操作符与数据类型

13 变量类型 :运算时,补码运算,运算器不知道符号位,自动溢出     long 64bit 9964L(l)     double 64bit 123.13D(d) 或e3     float   1123.f     double/0=Infinite或-Infinite     char unicode 16位     都是有符号的。     >>不认识符号位

2012-02-16 20:58:56 720

原创 Security and Authentication

Mongo SecurityYou authenticatea username and password (加密方式) in the context ofa particular database. Once authenticated, a normal user has full read and write access to the database. You

2012-02-14 14:40:30 902

原创 Shard Architechure

Architectural Overview ShardsIn a production situation, each shard will consist of multiple servers to ensure availability and automated failover.(Shardi中的3个均相同replica为了HA)Shard Keys

2012-02-13 20:36:05 1194

原创 Index

Basics Formally speaking, these indexes are implemented as "B-Tree" indexes.In the shell, you can create an index by calling the ensureIndex() function, and providing a document that specifi

2012-02-10 21:02:59 1226

原创 GridFS

GridFS SpecificationWhen to use GridFSThis page is under constructionWhen to use GridFSLots of files. GridFS tends to handle large numbers (

2012-02-10 16:08:29 774

原创 Misc

Maximum Document SizeMongoDB limits the data size of individual BSON objects/documents. At the time of this writing the limit is 16MB.并不是技术上的限制,只是一个规定而已。Specifically, BSON strings are UTF-8.

2012-02-10 14:28:59 481

原创 Object IDs

Object IDsDocuments in MongoDB required a key, _id, which uniquely identifies them.(只有_id建立索引之后,各个doc的_id才会不同,否则有可能相同)The _id FieldIf a user tries to insert a document with

2012-02-09 21:51:05 934

原创 MongoDB 学习笔记

(the little MongoDB book笔记)Install3. Create a new text file in the bin subfolder named mongodb.config4. Add a single line to your mongodb.config: dbpath=PATH_TO_WHERE_YOU_WANT_TO_STORE_YOUR_DA

2012-02-09 21:25:22 673

转载 MutiKeys

IntroductionMongo provides some functionality that is useful for text search and tagging.Multikeys (Indexing Values in an Array)The Mongo multikey feature can automatically index arrays of

2012-02-09 19:57:33 523

原创 Exception 笔记

public Throwable extends Object{            public Throwable()            public Throwable(String message)            public String getMessage()            public String toString()

2012-02-09 14:35:46 434

转载 JUNIT COOKBOOK

When you need to test something, here is what you do:Annotate a method with @org.junit.TestWhen you want to check a value, import org.junit.Assert.* statically, call assertTrue() and pass a boolea

2012-02-08 14:07:03 587

转载 JSON

JSON简介:JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式,可以把JSON的结构理解成无序的、可嵌套(指value可以再嵌套一层key-value)的key-value键值对集合,这些key-value键值对是以结构体或数组的形式来组织的。同一级的key-value键值对之间是用一个“,”(逗号)隔开,每个key-value键值对是由一个

2011-12-27 16:41:21 2920 3

转载 JS Injection

Javascript injection is a fun technique that allows you to change a websites content without leaving the site, reloading the page, or saving the site to your desktop. Javascript injection can be very

2011-12-26 20:46:02 1892

转载 一致性Hash算法

http://blog.csdn.net/sparkliang/article/details/52793933 consistent hashing 算法的原理consistent hashing 是一种 hash 算法,简单的说,在移除 / 添加一个 cache 时,它能够尽可能小的改变已存在 key 映射关系,尽可能的满足单调性的要求。下面就来按照 5 个步骤简单讲讲 con

2011-12-21 13:52:23 731

原创 Membase Cluster Manager

Membase Cluster ManagerClient applications access these services via the admin port (8091) and data ports (11211 or 11210).  The cluster communicates internally on portsTo keep throughput high

2011-12-15 15:05:51 685

原创 Membase存储

In addition to the quota, there are two watermarks the engine will use to determine when it is necessary to start freeing up available memory. These are mem_low_wat and mem_high_wat.As the system

2011-12-15 15:05:33 654

转载 进程实际内存占用: 私有驻留内存数(Private RSS)介绍

先介绍几个基本概念:SIZE: 进程使用的地址空间, 如果进程映射了100M的内存, 进程的地址空间将报告为100M内存. 事实上, 这个大小不是一个程序实际使用的内存数.RSS: “Resident Set Size”, 实际驻留”在内存中”的内存数. 不包括已经交换出去的代码. 举一个例子: 如果你有一个程序使用了100K内存, 操作系统交换出40K内存, 那么RSS为60K. RSS

2011-11-27 13:52:19 2628

原创 Redis zmalloc

#运算符用于创建字符串,#运算符后面应该跟一个形参(中间可以有空格或Tab),例如:#define STR(s) # sSTR(hello world)用cpp命令预处理之后是"hello␣world",自动用"号把实参括起来成为一个字符串,并且实参中的连续多个空白字符被替换成一个空格。再比如:#define STR(s) #sfputs(STR(strncmp("ab\"c

2011-11-25 21:41:53 2781

转载 Redis dict

dictHashKey最多有LONG_MAX个桶。在redis中最基本的三个数据结构是dict 、adlist和sds,其中dict是redis中最重要的数据结构了,其key-value的映射关系就是通过dict来实现的,dict的内部实现是hash table,这个哈希表的大小是动态增加或减少的,主要是依据哈希表中的元素个数;同时哈希表适用链接法来解决哈希冲突的,具体实现在dic

2011-11-24 23:17:27 1091

转载 #define

如果你想在宏中包含多个语句,可能会这样写:#define do_something() \do_a(); \do_b();\ 表示强制换行,而换行后的内容与前一行的内容编译器仍把它看作是同一行.#define后面定义的内容比须在同一行,而有时是为了让程序便于阅读,从中间进行换行,如果没有符号'\',则我们的换行表示 #define的结束,这也是为什么你去掉后会报错的原因.如果在这里加了

2011-11-24 23:04:14 523

原创 Redis 内存相关

Can I backup a Redis DB while the server is working?RDB and AOF files are compatible between 32 bit and 64 bit instances (and between little and big endian of course,文件格式Redis会自己统一) so you c

2011-11-21 23:15:37 1251

原创 Redis Internals (strings)

Redis dynamic strings (all strings)String is the basic building block of Redis types.Redis is a key-value store. All Redis keys are strings and its also the simplest value type.Lists, sets

2011-11-21 15:35:42 1170

原创 Redis 存储方案

RedisRedisPersistence(持久化存储)Redis提供了不同的持久化方案TheRDB(方案):定期对内存中的数据进行快照,永久存储快照。theAOF(方案):每个修改操作记录在日志中,服务器重启时,根据日志重新构造数据集。禁止持久化存储,数据全部存在内存中。AOF与RDB方案可以结合在一起。2、分布式控制目

2011-11-21 14:40:36 9785 1

转载 Java静态内部类(嵌套类)

Java静态内部类(嵌套类)博客分类: JavaJavaJ#Java代码  转自:http://erbo2008.iteye.com/blog/422334如果你不需要内部类对象与其外围类对象之间有联系,那你可以将内部类声明为static。这通常称为嵌套类(nested class)。想要理解static应用于内部类时的含义,

2011-11-21 14:29:22 780

转载 Membase Key-Concept

Membase Server is a high-performance, highly-available, distributed, key-value database and caching system that is 100% compatible with memcached. It is optimized for storing the data behind highly in

2011-11-20 21:42:36 787

原创 Redis 简介

What Redis means actually?Redis means two things:It means REmote DIctionary ServerIt is a joke on the word RedistributeRedis is an open source, advanced key-value store. It is ofte

2011-11-17 17:18:46 944

转载 REST

http://developer.51cto.com/art/200908/141825.htm什么是REST?REST (REpresentation State Transfer) 描述了一个架构样式的网络系统,比如 web 应用程序。它首次出现在 2000 年 Roy Fielding 的博士论文中,他是 HTTP 规范的主要编写者之一。REST 指的是一组架构约束条件和

2011-11-16 16:16:52 413

原创 Membase

The simple, fast, elastic(伸缩的) NoSQL database.Membase ServerMembase Server is the lowest latency, highest throughput NoSQLdatabase technology on the market. When your application nee

2011-11-16 16:13:58 640

转载 MySql-Proxy Introduction

MySQL Proxy OverviewThe Proxy ships(运输)with an embedded Lua interpreter. Using Lua, you can definewhat to do witha query or a result set before the Proxy passes them along.Figure 1. MySQL

2011-11-03 17:04:23 1309

原创 The ultimate MySQL high availability solution(压缩版)

The ultimate MySQL high availability solutionclustering suites(使用集群的工具包来实现HA) is just categorically the wrong approach to database high-availability. 集群本身还是有用的Clustering suites = F

2011-11-02 21:13:40 1416

转载 The ultimate MySQL high availability solution

The ultimate MySQL high availability solutionSubmitted by hingo on Sun, 2011-07-24 00:07Galera MySQLA while ago Baron blogged about his utter dislike for MMM, a framework

2011-11-02 19:16:38 1366

转载 Perl模块安装

各种平台下Perl模块的安装方法来源:http://www.linuxforum.net David lee (2001-04-21 18:11:53)    Perl到了第五版增加了模块的概念,用来提供面向对象编程的能力。这是Perl语言发展史上  的一个里程碑。此后,广大自由软件爱好者开发了大量功能强大、构思精巧的Perl模块,极大地

2011-10-31 21:47:51 1553

转载 MySQL 安装 (不需root权限的安装方法)

在一台服务器上安装多个Mysql,每个帐号可以有,也可以没有。而且一个帐号可以安装多个Mysql。但帐号没有root权限,不能使用软件包来安装(需要root权限)方法:在http://www.mysql.com/downloads/mysql/5.1.html#downloads上面下载Mysql5.1版本 (高于5.1的版本需要别的工具来安装,不建议,因为大多数host不会预

2011-10-28 23:31:40 6447 1

原创 MySQL Introduction

rpm可让Linux在安装软件包时免除许多复杂的手续。该命令在安装时常用的参数是 –ivh ,其中i表示将安装指定的rmp软件包,V表示安装时的详细信息,h表示在安装期间出现“#”符号来显示目前的安装过程。这个符号将持续到安装完成后才停 止。 在Ubuntu系统中安装RPM格式软件包的方法Ubuntu的软件包格式是deb,如果要安装rpm的包,则要先用alien把rpm转换成deb。sud

2011-10-26 23:44:30 723

make的官方指南(中文版)

make的官方指南(中文版) 希望能对大家有帮助:)

2011-03-31

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除