明天回家就没有网络,今晚就将整个编写过程记录下来。顺带整理思路以解决未能解决的问题。

标题有点托大,想将Berkeley DB做成分布式存储,感觉很高端的样子,实际上就是通过ssh将Berkeley DB备份到其他网络地址上,查询的时候向多台电脑发送查询请求并返回结果,仅此而已。现在属于编写阶段,如果效果好会考虑用来做web项目的数据库也不一定。

还是这个图:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyMAAAJoCAIAAAD6WamJAAAgAElEQVR4nOzdX1Cb957neV/s1rhqt8q1V7nYXV/15mIuUtykqNoqqvbCqdpy5aLpySxTmx5v14Teopv2zpDTmbU93bRynIzdS/ocDokDpx3jxCF2jznNMZ4J5vjERhHIYIQsJARCSBYISQghCSEhrNKePa29+CVPniDAAiT9nj/vp14XWBHwy8MjPR/9/nx/J7bzRQAAANTCCektAAAAMCqSFgAAQK2QtAAAAGqFpAUAAFArJC0AAIBaIWkBAADUCkkLAACgVkhaAAAAtULSAgAAqBWSFgAAQK2QtAAAAGqFpAUAAFArJC0AAIBaIWkBAADUCkkLAACgVkhaAAAAtULSAgAAqBWSFgAAQK2QtAAAAGqFpAUAAFArJC0AAIBaIWkBAADUCkkLAACgVkhaAAAAtULSAgAAqBWSFgAAQK2QtAAAAGqFpAUAAFArJC0AAIBaIWkBAADUCkkLAACgVkhaAAAAtULSAgAAqBWSFgAAQK2QtAAAAGqFpAUAAFArJC0AAIBaIWkBAADUCkkLAACgVkhaAAAAtULSAgAAqBWSFgAAQK2QtAAAAGqFpAUAAFArJC0AAIBaIWkBAADUCkkLAACgVkhaAAAAtULSAgAAqBWSFgBtyeWLi8Ho1795/PnAnY9+1m3R3vF3P+v+YuDOyG8eLS4tSz9dADSOpAVAQ5KZwleD93qu9d0bHbM5fd7VzMpWSWu8qxmb03dvdOzaLz+7+fmX64lN6ecNgGaRtABoxUIw1nOt77d213KmpBcTs4Hunk88cz7pZw+ANmk9aeV3iuFw9NGjx3fu3Onursc4Qnd39+3bd7755tFSgHEBoH6SmcLPf/GJ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sv1SXVhAEmqaNRqOdBUc1m3VqtNXfKYQwTXP7TovcjQfAPigtAH24YGnFcbxzi+jZbCaE8DxPPaw3dxBCuK67Xq/TNK2qKs/z7T1Iy7JUXWUYhkqx9jO36rFcLqWU2+XE6iGAfVBaAPrw0aW1M9brdVEU21caqv0d1K14dtYKi6KYTCZBEGw2mzAM1R/njjRNt985nU7b741YlqVlWfX/Q2kB2EZpAehDe2nleb69XHipkWVZkiQf/fGuB6UFXHGUFoA+tJfWZzwoLeCKo7QA9OHatWvv378fOnsGGJQWcMVRWgD6MJ9/9fz586Gzp+9Rvnz15Y0bgx98AAOitAD04d69B48fPx66fPoez579HH79zeAHH8CAKC0AfXj69Me7d+8OXT59jyh6eHz8aPCDD2BAlBaAnszn8yu1gPjq9RvPu1m+fDP4kQcwIEoLQE/++PMv//btK3Je/L8fPhwd3Ul/+mXwww5gWJQWgP48eZLM5/MXL14MHULdjlev3xwd3fn24XeDH3AAg6O0APTq119Pbt3y799/cHJy8u7du6Gj6FOOt2//+e33kyh66Hk3mc0CoFBaAPr2+u+3j77/4fAwODi4/sVnNA4Orh8eBsfHjzg3C0CN0gIAAOgKpQUAANAVSgsAAKArlBYAAEBXKC0AAICuUFoAAABdobQAAAC6QmkBAAB0hdICAADoCqUFAADQFUoLAACgK5QWAABAVygtAACArlBaAAAAXaG0AAAAukJpAQAAdIXSAgAA6AqlBQAA0BVKCwAAoCuUFgAAQFcoLQAAgK5QWgAAAF2htAAAALpCaQEAAHSF0gIAAOgKpQUAANAVSgsAAKArlBYAAEBX/gMd5+SbikWz2gAAAABJRU5ErkJggg==" alt="" />

首先是数据来源:数据来源自己产生。现阶段是在本机产生随机数,实际应用是利用socket传数据进来程序。

在插入数据之前首先读取一些配置信息,包括节点名称,节点硬盘剩余量,节点环境个数,并按节点环境个数进行升序排序。这里个人暂时将数据存放在mysql中。

读取配置信息代码:

 package com.Common;

 import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List; import com.MySQL.MySQLDB;
import com.config.Config;
import com.config.dbEnvironment; public class InitConfig { public InitConfig(){ } //初始化
public Config getConfig() throws SQLException{ String sql = "select * from conf order by EnvironmentCount asc"; //升序查询,第一个为最优
MySQLDB db = new MySQLDB();
db.SetSQL(sql);
ResultSet rs = db.excuteQuerry();
Config conf = new Config(); if( rs.next() ){ String node = rs.getString("node");
String d = rs.getString("d");
String e = rs.getString("e");
String g = rs.getString("g"); String dr = rs.getString("dr");
String er = rs.getString("er");
String gr = rs.getString("gr"); int environmentcount = rs.getInt("environmentcount"); conf.setNode(node); conf.setD(d);
conf.setE(e);
conf.setG(g); conf.setDr(dr);
conf.setEr(er);
conf.setGr(gr);
conf.setEnvironmentcount(environmentcount); }
return conf; } public List<dbEnvironment> getEnvironment() throws SQLException{ String sql = "select * from dbEnvironment"; //升序查询,第一个为最优
MySQLDB db = new MySQLDB();
db.SetSQL(sql);
ResultSet rs = db.excuteQuerry(); List<dbEnvironment> dbes = new ArrayList<dbEnvironment>(); while(rs.next()){
dbEnvironment dbe = new dbEnvironment();
dbe.setEnvname(rs.getString("envname"));
dbe.setEnvpath(rs.getString("path")); dbes.add(dbe); } return dbes;
} }

上面利用了一个config类,config类封装大多数信息。以上有一点比较值得注意的是,linux环境下数据库表的属性不一样。参照下面自己做的一个分析

windows下数据库设计:所有相关都以该文件变量为准

conf
节点 D盘容量 E盘容量 G盘容量 D剩余 E剩余 G剩余 环境个数
node d e g dr er gr EnvironmentCount example:
node1 200G 200G 200G 100G 100G 100G 3 dbEnvironment
环境 路径
env path example:
env1 node1:/G:/dbenv1 --------------------------------------------------------------------------- Linux下数据库设计:主要是路径的问题,linux路径没有windows这么麻烦,只要提供环境的名称即可 conf
节点 总容量 剩余容量 环境个数
node total rest EnvironmentCount example:
node1 200G 100G 3 dbEnvironment表不用设置

config类封装配置信息

 package com.config;

 public class Config {

     private String node;
private String d;
private String e;
private String g;
private String dr;
private String er;
private String gr;
private int EnvironmentCount;
public String getNode() {
return node;
}
public void setNode(String node) {
this.node = node;
}
public String getD() {
return d;
}
public void setD(String d) {
this.d = d;
}
public String getE() {
return e;
}
public void setE(String e) {
this.e = e;
}
public String getG() {
return g;
}
public void setG(String g) {
this.g = g;
}
public String getDr() {
return dr;
}
public void setDr(String dr) {
this.dr = dr;
}
public String getEr() {
return er;
}
public void setEr(String er) {
this.er = er;
}
public String getGr() {
return gr;
}
public void setGr(String gr) {
this.gr = gr;
}
public int getEnvironmentcount() {
return EnvironmentCount;
}
public void setEnvironmentcount(int environmentcount2) {
this.EnvironmentCount = environmentcount2;
} }

上面做了这么多实际上仅仅是冰山一角而已。从上面获得了conf类,里面包含了节点信息,节点硬盘使用信息和环境个数。供给后续部队使用

可以看看入口在哪里

 package com.entry;

 import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.net.Socket;
import java.net.UnknownHostException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List; import com.config.*;
import com.BerkeleyDB.BDBInsert;
import com.BerkeleyDB.BackUp;
import com.Common.InitConfig;
import com.MySQL.MySQLDB;
import com.sleepycat.je.Database;
import com.sleepycat.je.DatabaseConfig;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig; public class Entry { //将类通用的环境,数据库,文件路径,打开数据库等都提取出来,然后作为参数传进去就行了 private static Environment dbEnvironment = null;
private static Database db = null;
private static File des = null;
private static String node = null; //给备份类使用
private static String envname = null; //环境名称,备份类使用
private static String envpath = "d:/dbEnv/"; //一直使用这个环境 //OpenBDB public static void OpenBDB(){
EnvironmentConfig envConfig = new EnvironmentConfig(); envConfig.setAllowCreate(true);
envConfig.setCacheSize(32*1024*1024);
envConfig.setLocking(false);
//envConfig.setLockingVoid(false); envConfig.setAllowCreate(true);
dbEnvironment = new Environment( new File(envpath), envConfig ); DatabaseConfig dbConfig = new DatabaseConfig(); dbConfig.setAllowCreate(true);
dbConfig.setSortedDuplicates(true);
dbConfig.setDeferredWrite(true);
db = dbEnvironment.openDatabase(null,"BDB", dbConfig); System.out.println("打开数据库成功");
} //CloseBDB public static void CloseBDB(){
if(db != null){
db.close();
}
if(dbEnvironment != null){
dbEnvironment.close();
}
}
private static int getPid(){ RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean();
String name = runtime.getName(); // format: "pid@hostname"
try {
return Integer.parseInt(name.substring(0, name.indexOf('@')));
} catch (Exception e) {
return -1;
} }
//将信息通过socket发送到ListenBerkeleyBDB
public static void SendMessage() throws UnknownHostException, IOException{ Socket socket = new Socket("localhost",20141);
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())), true); out.println(Entry.getPid());
out.println(node); out.close();
socket.close();
} //要确定db所在节点,确定db环境的名称 public static void Init() throws SQLException{
Config conf = new InitConfig().getConfig();
//确定节点所在位置
node = conf.getNode();
int envcount = conf.getEnvironmentcount();
envname = "dbEnv" + Integer.valueOf(envcount+1).toString() + "/"; } public static void main(String args[]) throws UnknownHostException, IOException{ //环境默认为d:/dbenv Entry.SendMessage(); //跟负责监听本线程的ListenThread进程对接,将pid发给他
Entry.OpenBDB(); //打开BDB new BDBInsert(db,dbEnvironment).start(); //启动插入,
new BackUp(db,dbEnvironment,node,envname).start(); //启动备份,需要备份目标的相关信息,目标节点,目标环境名称 //插入数据的基本结构算完了 } }

从主函数看,Entry.SendMessage()是通过socket向本地的监听port的服务器端程序发送pid和目标节点的名称。该服务器端程序其实是一个监听进程,监听我们的Entry是否挂掉。当然他还有其他的任务,等分析到这个服务器进程的时候再来一览。

OpenBDB不用多说,相对前两篇文章来说出了把openbdb提取出来供大家使用之外没有其他不同。后面的BDBInsert和BackUp为插入数据的线程和备份数据的线程。

OK,可以看看监听进程了

监听进程:

 package com.ListenThread;

 import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Timer;
import java.util.TimerTask; import com.MySQL.MySQLDB;
import com.sleepycat.je.Database;
import com.sleepycat.je.Environment; public class ListenBerkeleyBDB { public static void main(String args[]) throws IOException{ int port = 20141; ServerSocket serversocket = new ServerSocket(port); //我只等待一次
Socket socket = serversocket.accept(); BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream())); String pid = in.readLine();
String desnode = in.readLine(); socket.close();
serversocket.close(); MyTask myTask = new MyTask(pid,desnode); Timer timer = new Timer(); timer.schedule(myTask, 1000, 2*6*10000); //一分钟监听一次
} } class MyTask extends TimerTask{ //通过文件流来拷贝数据
private static String pid;
private static String desnode;
public MyTask(String pid,String node){
this.pid = pid;
this.desnode = node;
}
//监听BDB进程
public static boolean ListenToBDB() throws IOException{ Process p = Runtime.getRuntime().exec("tasklist"); BufferedReader br = new BufferedReader(new InputStreamReader(p
.getInputStream()));
String line = null;
while((line = br.readLine())!=null){
if(line.contains(pid)){ System.out.println("当前进程没有挂");
return false;
}
}
return true;
}
//监听自己硬盘,监听对方硬盘
public static boolean ListenToHardDisk() throws SQLException, IOException{
if(getNodeRestHardDisk() < 50){ //node的硬盘小于50G,用50作为临界点
return true;
}
if(getMyRestHardDisk()<50){
return true;
}
return false;
}
//处理进程挂掉问题
public static void doWithBerkeleyDBException(){ Reboot();
}
//处理硬盘问题
public static void doWithHardDiskException() throws SQLException{ Reboot();
} //监听自己的HardDisk,本身硬盘容量可以绝对准确的获取到
public static long getMyRestHardDisk() throws IOException{
StringBuffer sb=new StringBuffer();
File[] roots = File.listRoots();
long result = 0;
for (File file : roots) {
long usableSpace=file.getUsableSpace();
result = result + usableSpace;
}
return result;
} //监听节点HardDisk
public static int getNodeRestHardDisk() throws SQLException{
String sql = "select rest from conf where node = \"" + desnode;
MySQLDB db = new MySQLDB(); db.SetSQL(sql);
ResultSet rs = db.excuteQuerry(); int rest = 0; if(rs.next()){
rest = rs.getInt("rest");
} return rest;
}
public static void Reboot(){ //暂时决定将打包成jar的文件用runtime去执行。不可能用runtime去执行Eclipse程序 System.out.println("重启,待处理");
}
public MyTask(Database db, Environment dbEnvironment){ } @Override
public void run() {
// TODO Auto-generated method stub
//监听硬盘和进程并处理异常
try {
if(ListenToBDB()){
doWithBerkeleyDBException();
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
if(ListenToHardDisk()){
doWithHardDiskException();
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} }
}

main首先监听端口,等待连接,获取连接的数据,我们的Entry.SendMessage传数据过来就是给上面使用的,node和pid。通过pid我们可以看看进程是否挂了,通过node我们可以获取数据库中的剩余磁盘大小。

监听线程的作用就是处理数据插入过程中的异常,这种异常包括自己硬盘使用完了,node硬盘使用完了,Entry挂了三种情况。node使用这个问题有点小纠结。到底是在本机上看好还是在node上看好。在node上看的话还得定时给上面的程序发送数据。在本机上看的话数据可能不准确,所以就设置了一下,在本地上看,如果剩余磁盘空间小于50GB,那我就有理由认为node硬盘快不行了。强行切换一下。至于硬盘剩余数据量的问题,从mysql中读取就行了。Berkeley DB备份的时候修改一下mysql数据库中的剩余容量。至于pid的问题,tasklist看下pid是否存在就行了。

监听线程大概就做这么多,感觉这里写监听写了挺久,有两三个个小时了。现在想想也简单。

数据库插入就比较简单,之前的两篇记录也有

数据库备份,这里使用的是备份类备份。通过scp拷贝到目标节点

数据库备份:

package com.BerkeleyDB;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.util.Timer;
import java.util.TimerTask; import com.sleepycat.je.CheckpointConfig;
import com.sleepycat.je.Database;
import com.sleepycat.je.DatabaseConfig;
import com.sleepycat.je.Environment;
import com.sleepycat.je.EnvironmentConfig;
import com.sleepycat.je.util.DbBackup; public class BackUp extends Thread{ private Environment dbEnvironment = null;
private Database db = null;
private String desnode = null;
private String desdbenvname = null; public BackUp(Database db, Environment dbEnvironment,String desnode,String desdbenvname) {
// TODO Auto-generated constructor stub
this.db = db;
this.dbEnvironment = dbEnvironment;
this.desnode = desnode;
this.desdbenvname = desdbenvname;
} //线程入口
public void run(){
MyTask myTask = new MyTask(db,dbEnvironment,desnode,desdbenvname); Timer timer = new Timer(); timer.schedule(myTask, 1000, 2*6*10000);
} } class MyTask extends TimerTask{ private Database db = null;
private Environment dbEnvironment = null;
private final String SRCPATH = "d:/dbEnv1/"; //linux平台下要修改的路径,但是不用磁盘分区
private File des = null;
private static DbBackup backupHelper = null;
private static long lastFileCopiedInPrevBackup = -1; private String desnode;
private String desdbenvname; public void copy(String file) throws IOException{ Runtime rt = Runtime.getRuntime();
rt.exec("scp " + SRCPATH + file + desnode + desdbenvname ); //scp发送文件 } public MyTask(Database db, Environment dbEnvironment,String desnode,String desdbenvname){
this.db = db; this.dbEnvironment = dbEnvironment; this.desnode = desnode;
this.desdbenvname = desdbenvname; backupHelper = new DbBackup(dbEnvironment,-1); } @Override
public void run() {
// TODO Auto-generated method stub Start(); } public void Start(){ backupHelper.startBackup(); //每备份一次修改一次数据库Rest
try{
String[] filesForBackup = backupHelper.getLogFilesInBackupSet(lastFileCopiedInPrevBackup); for(int i = 0;i<filesForBackup.length; i++){ File f = new File(filesForBackup[i]); copy(filesForBackup[i]); System.out.println(filesForBackup[i]); } lastFileCopiedInPrevBackup = backupHelper.getLastFileInBackupSet(); backupHelper.endBackup(); }catch(Exception e){
e.printStackTrace();
}
// CloseBDB(); } }

不知道备份类使用是否正确,备份的效果倒是真能做到。网上利用备份类备份的也貌似也比较少。由于copy函数是自己写的,所以我就直接scpcopy到desnode上了。之前自己写过一个类似备份类的,不过看了下备份类的源代码,清理日志这里之前的倒是没有处理过。

至于查询的问题,我觉得最简单的就是查询了。当然看到小伙伴们写了个单环境查询激动半天我就不好意思跟小伙伴说最简单的就是查询。如果不考虑多环境的话查询就so easy了。考虑多环境的话我就把环境个数通过socket发送过去,然后遍历下dbEnv[i]这个数据库环境就ok了。

先看看如何发送查询。查询是另外放在一个节点上进行,为减轻A的负担。

发送查询代码

package com.sendQuery;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Scanner; import com.MySQL.MySQLDB; public class SendQuery { public static void main(String args[]) throws SQLException, UnknownHostException, IOException{ Scanner cin = new Scanner(System.in); String queryKey = cin.next();
int port = 20141;
String sql = "select node,EnvironmentCount from conf";
MySQLDB mysql = new MySQLDB();
mysql.SetSQL(sql); ResultSet rs = mysql.excuteQuerry(); //往所有
while(rs.next()){
String node = rs.getString("node");
int environmentcount = rs.getInt("EnvironmentCount");
new QueryThread(node,queryKey,environmentcount).start(); } } }

多线程目的是可以多查询,现在还没做图形界面甚至web界面,效果自然不出来,做了之后多个查询提交没有问题。我们把node和EnvironmentCount发过去给目标节点使用,发送数据通过socket去发。

package com.sendQuery;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.UnknownHostException; public class QueryThread extends Thread{ private String node = null;
private static int port = 20141;
private String queryKey = null;
private int environmentcount = 0;
public QueryThread(String node,String queryKey,int environmentcount){
this.node = node;
this.queryKey = queryKey;
this.environmentcount = environmentcount;
} public void run(){ Socket socket = null;
try {
socket = new Socket(node,port); PrintWriter out = new PrintWriter(new BufferedWriter(new
OutputStreamWriter(socket.getOutputStream())), true); out.println(queryKey);
out.println(environmentcount); BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream())); String result = in.readLine(); System.out.println(result);
in.close();
socket.close(); }catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} }

查询响应:

跟之前几乎一致,获取数据,执行查询的线程。

获取数据

package com.QueryResponse;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket; public class QueryResponse {
private static int port = 20141;
public static void main(String args[]) throws IOException{ ServerSocket serversocket = new ServerSocket(port); Socket socket = serversocket.accept(); //利用线程可以解决多个用户发过来的查询,每个查询对应一个线程 new ResponseThread(socket).start(); } }package com.QueryResponse; import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket; //负责查询
public class ResponseThread extends Thread{ Socket socket = null; public ResponseThread(Socket socket){
this.socket = socket;
} public void run(){
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} try {
String queryKey = in.readLine();
int environmentcount = Integer.valueOf(in.readLine()); //是开线程呢还是遍历去查询 } catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} }

查询暂且用getSearchKey来弄弄。

-------------------------------------------------------------------------------------------------------

Berkeley DB分布式探索的更多相关文章

  1. 比Redis更快:Berkeley DB面面观

    比Redis更快:Berkeley DB面面观 Redis很火,最近大家用的多.从两年前开始,Memcached转向Redis逐渐成为潮流:而Berkeley DB可能很多朋友还很陌生,首先,我们简单 ...

  2. 免费数据库(SQLite、Berkeley DB、PostgreSQL、MySQL、Firebird、mSQL、MSDE、DB2 Express-C、Oracle XE)

    SQLite数据库是中小站点CMS的最佳选择 SQLite 是一个类似Access的轻量级数据库系统,但是更小.更快.容量更大,并发更高.为什么说 SQLite 最适合做 CMS (内容管理系统)呢? ...

  3. 了解 Oracle Berkeley DB 可以为您的应用程序带来 NoSQL 优势的原因及方式。

    将 Oracle Berkeley DB 用作 NoSQL 数据存储 作者:Shashank Tiwari 2011 年 2 月发布 “NoSQL”是在开发人员.架构师甚至技术经理中新流行的一个词汇. ...

  4. Berkeley DB的数据存储结构——哈希表(Hash Table)、B树(BTree)、队列(Queue)、记录号(Recno)

    Berkeley DB的数据存储结构 BDB支持四种数据存储结构及相应算法,官方称为访问方法(Access Method),分别是哈希表(Hash Table).B树(BTree).队列(Queue) ...

  5. Berkeley DB数据处理

    设计一个结构,利用Berkeley DB完成大数据的存储,备份,查询功能. 已有的储备: 1.Berkeley DB的基本操作. 2.数据转存后数据不丢失. 3.过百GB以上数据的存储. 数据流如下, ...

  6. Berkeley DB

    最近用BDB写点东西,写了挺多个测试工程.列下表,也理清楚最近的思路 1.测试BDB程序,包括打开增加记录,查询记录,获取所有记录.将数据转存mysql 程序的不足,增加记录仅仅只有key和value ...

  7. BDB (Berkeley DB)数据库简单介绍(转载)

    近期要使用DBD,于是搜了下相关的资料,先贴个科普性的吧: 转自http://www.javaeye.com/topic/202990 DB综述DB最初开发的目的是以新的HASH訪问算法来取代旧的hs ...

  8. Oracle Berkeley DB Java 版

    Oracle Berkeley DB Java 版是一个开源的.可嵌入的事务存储引擎,是完全用 Java 编写的.它充分利用 Java 环境来简化开发和部署.Oracle Berkeley DB Ja ...

  9. 新浪研发中心: Berkeley DB 使用经验总结

    http://blog.sina.com.cn/s/blog_502c8cc40100yqkj.html NoSQL是现在互联网Web2.0时代备受关注的技术之一,被用来存储大量的非关系型的数据.Be ...

随机推荐

  1. what is docker

    尽管之前久闻Docker的大名了,但是天资愚钝,对其到底是个啥东西一直摸不清,最近花了一段时间整理了一下,算是整理出一点头绪来. 官网的介绍是这样的: Docker is an open platfo ...

  2. Java中transient有何作用?

    transient关键字用来防止序列化域.如果一个引用类型被transient修饰,则其反序列化的结果是null.基本类型则为0.如果引用类型时不可序列化的类,则也应该使用transient修饰,它在 ...

  3. (转)WIN7更改用户名访问共享文件夹

    原文地址: http://ryy8013.blog.163.com/blog/static/71729589201210610533778/ 一直以来,windows7客户端访问windows ser ...

  4. Oracle基础—表分区

    一:表分区的应用场景 用于管理包含大量数据的表. 二:表分区的优点 1.提高数据的可以性 2.减少管理负担 3.改善语句的性能 三:分区的方式:(区间分区.散列分区.列表分区.组合分区) 1.区间分区 ...

  5. Liunx下全局安装 Composer

    我把它放在系统的PATH目录中,这样就能在全局访问它. curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/l ...

  6. React Native(ios)项目中logo,启动屏设置

    由于logo和启动屏尺寸多,react native(ios)中没有命令可以自动生成各种的尺寸,所以可以使用以下办法:在ionic项目中生成(使用命令:ionic resources)后,再粘贴到re ...

  7. 分享一款简洁的jQuery轮播源码

    <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>无标题页</titl ...

  8. Java多线程之锁

    首先是synchronized 关键字 他可以用于声明方法,也可以用于申明代码块.我们看看三个例子: public class SynchronizedDemo1 { public synchroni ...

  9. codeforces 675D D. Tree Construction(线段树+BTS)

    题目链接: D. Tree Construction D. Tree Construction time limit per test 2 seconds memory limit per test ...

  10. C#右键复制路径

    using System;//Environment using System.Windows.Forms; //add referece of System.Windows.Forms :DataF ...