Skip to content

Commit

Permalink
Release v0.1.0beta8
Browse files Browse the repository at this point in the history
  • Loading branch information
pgte committed Jan 13, 2011
1 parent 51b59ad commit e8521f9
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 30 deletions.
Empty file.
1 change: 0 additions & 1 deletion benchmarks/results/runs/20110112162110

This file was deleted.

17 changes: 0 additions & 17 deletions benchmarks/results/summaries/20110112184747

This file was deleted.

2 changes: 1 addition & 1 deletion benchmarks/results/summaries/latest
4 changes: 2 additions & 2 deletions dist/bplustree/index.js
Expand Up @@ -2,7 +2,7 @@ var LeafNode = require('./leaf_node'),
InternalNode = require('./internal_node');

var default_options = {
order: 2 // Min 1
order: 100 // Min 1
};

var BPlusTree = module.exports = function(options) {
Expand Down Expand Up @@ -52,7 +52,7 @@ BPlusTree.prototype._search = function(key) {
// Follow infinity pointer
if(!found) current = current.data[len - 1];
}

return current;
};

Expand Down
1 change: 1 addition & 0 deletions dist/bplustree/internal_node.js
Expand Up @@ -9,6 +9,7 @@ var InternalNode = module.exports = function(order) {
};

InternalNode.prototype.split = function() {
var time = Date.now();
var m = null;
if(this.order % 2){
var m = (this.data.length-1)/2 - 1;
Expand Down
28 changes: 27 additions & 1 deletion docs/web/views/api/key_map.jade
Expand Up @@ -2,6 +2,26 @@ p.note Everything here is experimental, and the API is no exception, so expect t

#api
h4 Key Map

ol
li
a(href='#index_manip') Index Manipulation
li
a(href='#store') Store
li
a(href='#streams') Streams
li
a(href='#traversing') Traversing
li
a(href='#filtering') Filtering
li
a(href='#atomic') Atomic
li
a(href='#compactation') Compactation
li
a(href='#events') Events

a(id='index_manip')
h1 Index manipulation
h2 key_map.addIndex (name, [options, ] transform_function, callback)
p Adds an index to key_map.
Expand Down Expand Up @@ -32,7 +52,6 @@ p.note Everything here is experimental, and the API is no exception, so expect t
| if (err) { throw err; }
| // Now you can use the users.age index
| });
|
| })
| });

Expand All @@ -47,6 +66,7 @@ p.note Everything here is experimental, and the API is no exception, so expect t
li <b>name</b>: the name of the index
li <b>callback</b> (error): called when there is an error or the index is removed.

a(id='store')
h1 Store
h2 key_map.put (key, value, callback)
p Stores a value later retrievable by key_map.get (key, ...).
Expand All @@ -72,6 +92,7 @@ p.note Everything here is experimental, and the API is no exception, so expect t
ul
li <b>callback</b> (err, count): Called when there is an error or counting is done

a(id='streams')
h1 Streams

h2 key_map.startStream (filter_function, callback)
Expand All @@ -90,6 +111,7 @@ p.note Everything here is experimental, and the API is no exception, so expect t
li <b>stream_handle</b>: A stream handle previously returned by key_map.startStream().
li <b>callback</b> (err, record): Called when there is an error or a record was selected.

a(id='traversing')
h1 Traversing

h2 key_map.scan (callback)
Expand All @@ -98,6 +120,7 @@ p.note Everything here is experimental, and the API is no exception, so expect t
ul
li <b>callback</b> (err, key, value): Called when there is an error or a record is found.

a(id='filtering')
h1 Filtering

h2 key_map.range(index, start, end, callback)
Expand Down Expand Up @@ -126,6 +149,7 @@ p.note Everything here is experimental, and the API is no exception, so expect t
li <b>value</b>: the value the index will be matched against.
li <b>callback</b> (err, key, valye): called when there is an error or there is a match.

a(id='atomic')
h1 Atomic

h2 key_map.atomic (key, callback, result_callback)
Expand All @@ -150,11 +174,13 @@ p.note Everything here is experimental, and the API is no exception, so expect t
| }
| );

a(id='compactation')
h1 Compactation

h2 key_map.compact (callback)
p Compacts a key map, loosing all past history.

a(id='events')
h1 Events

p Regsiter ro receive events like this:
Expand Down
2 changes: 1 addition & 1 deletion docs/web/views/examples/index.jade
Expand Up @@ -8,7 +8,7 @@
| var alfred = require('alfred');
| alfred.open('path/to/db/dir', function(err, db) {
| if (err) { throw err; }
| db.ensureKeyMapAttached('users', function(err, users_key_map) {
| db.ensure('users', function(err, users_key_map) {
| console.log('users key map attached');
| });
| });
Expand Down
2 changes: 0 additions & 2 deletions lib/alfred/indexes/ordered_index.js
Expand Up @@ -57,8 +57,6 @@ OrderedIndex.prototype.put = function(key, value, pos, length) {
} else {
delete this.key_to_transformed_map[key];
}

this.bplustree.dump();
};

OrderedIndex.prototype.match = function(match, callback) {
Expand Down
6 changes: 2 additions & 4 deletions lib/alfred/key_map.js
Expand Up @@ -76,16 +76,14 @@ KeyMap.prototype.put = function(key, value, callback, collection) {
} else {
for(var index_index in self.indexes) {
if (self.indexes.hasOwnProperty(index_index)) {
var index = self.indexes[index_index];
index.put(key, value, pos, length);
self.indexes[index_index].put(key, value, pos, length);
}
}

if (self.indexes_temp) {
for(var index_index in self.indexes_temp) {
if (self.indexes.hasOwnProperty(index_index)) {
var index = self.indexes[index_index];
index.put(key, value, pos, length);
self.indexes[index_index].put(key, value, pos, length);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{ "name" : "alfred"
, "description" : "In-process key-value store"
, "version" : "0.1.0beta7"
, "version" : "0.1.0beta8"
, "homepage" : "http://pgte.github.com/alfred"
, "author" : "Pedro Teixeira <pedro.teixeira@gmail.com> (http://metaduck.com)"
, "contributors" :
Expand Down

0 comments on commit e8521f9

Please sign in to comment.