摘要: 1、index Creation,background如果在foreground运行index,会阻塞其他writer,如果background运行,会比较慢,但不会阻塞其他writer,可以并发写入。但是在产品级别的应用中,你可以同时建立replica set,在其中一个set中运行EnsureIndex foreground ,在其他的set中允许访问,然后再同步。Tips: A mongod instance can only build one background index at a time per database. Although the database server.. 阅读全文
posted @ 2013-12-23 21:28 bigbigtree 阅读(670) 评论(0) 推荐(0) 编辑
摘要: 将博客搬至CSDN~ 阅读全文
posted @ 2013-12-23 16:25 bigbigtree 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 今天需要解决一个问题,将影像瓦片(一堆jpg文件)分别进行读取,并将所有数据以文件流的方式存入一个.db的文件中,同时将每个jpg数据在db文件中的位置保存下来,作为index存在.idx文件中。其中部分代码如下(没有copy fopen和fclose的部分): 1 char buf[256]; for (int i = 0; i 1 struct _stat finfo;2 _stat(jpgpath,&finfo);3 int s = finfo.st_size;3、利用filelength函数1 FILE* file = fopen(filepath, "rb" 阅读全文
posted @ 2013-12-23 10:47 bigbigtree 阅读(475) 评论(0) 推荐(0) 编辑
摘要: 源码下载:点击下载源码如下:#include#include#include#include#define_AFXDLLusingnamespacestd;voidmain(){//此文件在工程打开状态下为不可访问char*filepath="..\\test.ncb";//方法一struct_statinfo;_stat(filepath,&info);intsize=info.st_size;cout C/C++ -> Code Generation -> Runtime Library, 选择"Multi-threaded Debug(/ 阅读全文
posted @ 2013-12-23 09:26 bigbigtree 阅读(643) 评论(0) 推荐(0) 编辑