diff options
author | Damien F. Katz <damien@apache.org> | 2009-05-06 19:11:10 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2009-05-06 19:11:10 +0000 |
commit | 4b5e0a20aa087dd26df644c0432627aa3e5826d4 (patch) | |
tree | 1494b164fdef4004bff44aa39edbc2f1bf60d8f3 /src/couchdb/couch_db.hrl | |
parent | 887c9b1a8b551272c3ca06906cfdc4fb901830a8 (diff) |
First cut at _changes api. Update the by_id and by_seq indexes to contain update seq numbers and pointers to bodies on disk, for use in the _changes api. This is a new file version, but the code can continue to serve the old 0.9 version without problems, though certain features in the _changes api will not be able to work. Upgrade to new file version (from 1 to 2) by compacting the file. Also fixed bugs with how the stats api tracks open databases.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@772406 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_db.hrl')
-rw-r--r-- | src/couchdb/couch_db.hrl | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/couchdb/couch_db.hrl b/src/couchdb/couch_db.hrl index b23fd18d..c00792a8 100644 --- a/src/couchdb/couch_db.hrl +++ b/src/couchdb/couch_db.hrl @@ -37,15 +37,20 @@ -define(LOG_ERROR(Format, Args), error_logger:error_report(couch_error, {Format, Args})). + +-record(rev_info, + { + rev, + seq = 0, + deleted = false, + body_sp = nil % stream pointer + }). + -record(doc_info, { id = <<"">>, - rev = <<"">>, - update_seq = 0, - summary_pointer = nil, - conflict_revs = [], - deleted_conflict_revs = [], - deleted = false + high_seq = 0, + revs = [] % rev_info }). -record(full_doc_info, @@ -98,13 +103,14 @@ % than filling in new defaults. % % As long the changes are limited to new header fields (with inline -% defaults) added to the end of the file, then there is no need to increment +% defaults) added to the end of the record, then there is no need to increment % the disk revision number. % % if the disk revision is incremented, then new upgrade logic will need to be % added to couch_db_updater:init_db. --define(LATEST_DISK_VERSION, 1). +-define(DISK_VERSION_0_9, 1). +-define(LATEST_DISK_VERSION, 2). -record(db_header, {disk_version = ?LATEST_DISK_VERSION, |