写一个数据库CS186
王Clever
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CS186 Project 1: SimpleDB Exercise 1
2.2. Fields and Tuples Tuples in SimpleDB are quite basic. They consist of a collection of Field objects, one per field in the Tuple. Field is an interface that different data types (e.g., integer,原创 2016-11-05 00:27:07 · 3923 阅读 · 2 评论 -
2.3. Catalog_Exercise 2
The catalog (class Catalog in SimpleDB) consists of a list of the tables and schemas of the tables that are currently in the database. You will need to support the ability to add a new table, as well a原创 2016-11-05 11:57:13 · 916 阅读 · 0 评论 -
2.4. BufferPool 2.5. HeapFile access method
现在还在项目一所以多线程加锁等待这一块没写,一开始没看到写了锁写了很麻烦,才发现不用写,也没测试,所以就没写,等以后做到再加上去。 写BufferPool是用map来缓存数据,但不知道TransactionId在这个函数有什么用,。没用到这个参数,代码如下,其实就两个函数public class BufferPool { /** * Bytes per page, includi原创 2016-11-06 17:44:32 · 1159 阅读 · 0 评论 -
Exercise 5
这次感觉比前几次都难,尤其卡在了iterator上,需要反复阅读上面的说明,说明在DbfileIterator上,。详细代码如下HeapFile.java 在文本编译器上删的sout测试语句,可能会带来一些错误,欢迎指正public class HeapFile implements DbFile { /** * Constructs a heap file backed by t原创 2016-11-08 18:56:13 · 683 阅读 · 0 评论 -
2.6. Operators
public class SeqScan implements DbIterator { private static final long serialVersionUID = 1L; TransactionId tid; int tableid; String tableAlia; DbFile dbFile; DbFileIterator dbFi原创 2016-11-09 23:43:11 · 381 阅读 · 0 评论 -
cs186-2
我一般不把他写的todo去掉,万一以后改防止改错了。前两个主要实现filter方法,因为后面要用 先放上Predicate.javapackage simpledb;import java.io.Serializable;/** * Predicate compares tuples to a specified Field value. */public class Predicate原创 2016-11-20 20:52:45 · 1717 阅读 · 1 评论
分享