Permalink
Browse files

Merge branch 'master' of git@gitorious.org:strokedb/mainline

* 'master' of git@gitorious.org:strokedb/mainline:
  storage-5 fixed
  ROADMAP is actually a roadmap now
  Minor gem generation tweaking
  Authors' emails updated
  Minor README update
  Very minor strokedb.rb reorganization
  More obsolete code removed; benchmarks' requires fixed
  stores/chunk.rb is no longer needed
  require of strokedb.rb works again
  Minor Document#find tweaking
  Add strokedb dir to $LOAD_PATH so require "/path/to/strokedb/lib/strokedb" works
  Last slight adjustment to the rake tasks relating to rcov and cruise
  renamed bin/stroke to bin/strokedb
  Rake 'sup' task now shows a textual coverage summary isntead of opening a browser.
  Added a sup task
  fix examples after reorganization
  • Loading branch information...
Oleg Andreev
Oleg Andreev committed Apr 20, 2008
2 parents 8d62fa4 + 1e4284c commit a6dc62ad5820dd2f44fe9caef49ed6c82623e052
View
@@ -10,4 +10,5 @@ TAGS
.*.strokedb
examples/.*.strokedb
examples/strokewiki/.*.strokedb
-pkg
+pkg
+strokedb.gemspec
View
25 README
@@ -1,8 +1,13 @@
-
StrokeDB is a distributed document-oriented database engine.
Main features are complete decentralization, JSON object format,
metadocuments, integration with runtime (it is just a ruby library).
+
+= Starting points
+
+One of the most important concepts of StrokeDB is a StrokeDB::Document.
+
+
= Installing StrokeDB
=== Requirements
@@ -32,21 +37,9 @@ or
=== <i>(Optional) Running test suite</i>
- $ cd strokedb/strokedb-ruby
- $ rake ci
- $ rake jci # for jruby, jruby should be in PATH
+ $ rake sup
-
-= Starting points
-
-One of the most important concepts of StrokeDB is a StrokeDB::Document.
-
-
-= Some benchmarks
-
- $ rake bench
-
=AUTHORS
-* Yurii Rashkovskii <yrashk@issuesdone.com>
-* Oleg Andreev <oleganza@gmail.com>
+* Yurii Rashkovskii <yrashk@idbns.com>
+* Oleg Andreev <oleganza@idbns.com>
View
@@ -8,7 +8,7 @@ Echoe.taskify do
Dir['task/**/*.task'].each {|t| load t}
namespace :echoe do
- Echoe.new('StrokeDB', StrokeDB::VERSION) do |g|
+ Echoe.new('strokedb', StrokeDB::VERSION) do |g|
g.author = ['Yurii Rashkovskii', 'Oleg Andreev']
g.email = ['strokedb@googlegroups.com']
g.summary = 'embeddable, distributed, document-based database'
@@ -25,7 +25,7 @@ Echoe.taskify do
g.manifest_name = 'meta/MANIFEST'
g.ignore_pattern = /(^\.git|^.DS_Store$|^meta|^test\/storages|^examples\/(.*).strokedb|^bugs)/
- g.executable_pattern = 'bin/stroke'
+ g.executable_pattern = 'bin/strokedb'
end
desc 'tests packaged files to ensure they are all present'
@@ -40,15 +40,18 @@ Echoe.taskify do
task :magic => [:clean, :manifest, :install]
end
+ desc 'Check what\'s up in this mug'
+ task :sup => [:'rcov:run', :'rcov:verify']
+
# Developers: Run this before commiting!
desc 'Check everything over before commiting!'
- task :aok => [:'rcov:verbose', :'rcov:verify_verbose', :'rcov:open',
+ task :aok => [:'rcov:verbose', :'rcov:strict', :'rcov:open',
:'rdoc:html', :'rdoc:open',
:'ditz:stage', :'ditz:html', :'ditz:todo', :'ditz:status', :'ditz:html:open']
end
# desc 'Run by CruiseControl.rb during continuous integration'
-task :cruise => [:'rcov:run', :'rcov:verify', :'ditz:html', :'rdoc:html']
+task :cruise => [:'ditz:html', :'rdoc:html', :'rcov:bw', :'rcov:verify']
# By default, we just list the tasks.
task :default => :list
File renamed without changes.
@@ -32,8 +32,8 @@ type: :bugfix
component: Storage
release: v0.0.3
reporter: Yurii Rashkovskii <yrashk@idbns.com>
-status: :unstarted
-disposition:
+status: :closed
+disposition: :fixed
creation_time: 2008-04-17 21:28:49.887863 Z
references: []
@@ -47,3 +47,11 @@ log_events:
- Yurii Rashkovskii <yrashk@idbns.com>
- commented
- The main problem is that it fails randomly (not each time you run specs)
+- - 2008-04-19 10:49:12.179365 Z
+ - Yurii Rashkovskii <yrashk@idbns.com>
+ - commented
+ - Spec is located at spec/lib/strokedb/sync/store_sync_spec.rb now
+- - 2008-04-20 13:10:54.668785 Z
+ - Yurii Rashkovskii <yrashk@idbns.com>
+ - closed issue with disposition fixed
+ - That appears to be a spec bug (store was not synced, and autosync was trying to sync everything on files already engaged in the next subsequent example)
View
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../strokedb'
+require File.dirname(__FILE__) + '/../lib/strokedb'
$KCODE = 'u'
View
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../strokedb'
+require File.dirname(__FILE__) + '/../lib/strokedb'
$KCODE = 'u'
@@ -1,8 +1,7 @@
+require File.dirname(__FILE__) + '/../../lib/strokedb'
require 'rubygems'
require 'ramaze'
require 'redcloth'
-require File.dirname(__FILE__) + '/../../strokedb'
-
# strokewiki will run in port 7000 and uses WEBRick by default
# you can change it uncommenting these four lines below.
View
@@ -1,5 +1,5 @@
#! /usr/bin/env ruby
-$:.unshift File.dirname(__FILE__) + "/.."
+$:.unshift File.dirname(__FILE__) + "/../lib"
require "strokedb"
StrokeDB::Config.build :default => true, :base_path => '.todo.strokedb'
View
@@ -1,4 +1,5 @@
require 'rubygems'
+$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift( File.expand_path(File.join(File.dirname(__FILE__), 'strokedb')) ).uniq!
require 'strokedb/core_ext'
@@ -19,19 +20,19 @@ module StrokeDB
# Coverage threshold - bump this float anytime your changes increase the spec coverage
# DO NOT LOWER THIS NUMBER. EVER.
- COVERAGE = 88.1
+ COVERAGE = 91.9
# UUID regexp (like 1e3d02cc-0769-4bd8-9113-e033b246b013)
UUID_RE = /([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})/
# document version regexp
VERSION_RE = UUID_RE
- RAW_NIL_UUID = "\x00" * 16
# following are special UUIDs used by StrokeDB
# so called Nil UUID, should be used as special UUID for Meta meta
NIL_UUID = "00000000-0000-0000-0000-000000000000"
+ RAW_NIL_UUID = "\x00" * 16
# UUID used for DeletedDocument meta
DELETED_DOCUMENT_UUID = 'e5e0ef20-e10f-4269-bff3-3040a90e194e'
@@ -348,90 +348,3 @@ def random_level
end
end
-
-if __FILE__ == $0
-
- require 'benchmark'
- include StrokeDB
-
- puts "Serialization techniques"
-
- len = 2_000
- array = (1..len).map{ [rand(len).to_s]*2 }
- biglist = SimpleSkiplist.from_a(array)
- dumped = biglist.marshal_dump
-
- Benchmark.bm(17) do |x|
- # First technique: to_a/from_a
- GC.start
- x.report("SimpleSkiplist#to_a ") do
- biglist.to_a
- biglist.to_a
- biglist.to_a
- biglist.to_a
- biglist.to_a
- end
- GC.start
- x.report("SimpleSkiplist.from_a ") do
- SimpleSkiplist.from_a(array)
- SimpleSkiplist.from_a(array)
- SimpleSkiplist.from_a(array)
- SimpleSkiplist.from_a(array)
- SimpleSkiplist.from_a(array)
- end
-
- # Another technique: Marshal.dump
- GC.start
- x.report("SimpleSkiplist#marshal_dump ") do
- biglist.marshal_dump
- biglist.marshal_dump
- biglist.marshal_dump
- biglist.marshal_dump
- biglist.marshal_dump
- end
- GC.start
- x.report("SimpleSkiplist#marshal_load ") do
- SimpleSkiplist.allocate.marshal_load(dumped.dup)
- SimpleSkiplist.allocate.marshal_load(dumped.dup)
- SimpleSkiplist.allocate.marshal_load(dumped.dup)
- SimpleSkiplist.allocate.marshal_load(dumped.dup)
- SimpleSkiplist.allocate.marshal_load(dumped.dup)
- end
- end
-
- puts
- puts "Find/insert techniques"
- Benchmark.bm(32) do |x|
- langs = [:C] if RUBY_PLATFORM !~ /java/
- langs = [:Java] if RUBY_PLATFORM =~ /java/
- SimpleSkiplist.with_optimizations(langs) do |lang|
- GC.start
- x.report("SimpleSkiplist#find #{lang}".ljust(32)) do
- 100.times do
- key = rand(len).to_s
- biglist.find(key)
- biglist.find(key)
- biglist.find(key)
- biglist.find(key)
- biglist.find(key)
- end
- end
- GC.start
- x.report("SimpleSkiplist#insert #{lang}".ljust(32)) do
- 100.times do
- key = rand(len).to_s
- biglist.insert(key, key)
- key = rand(len).to_s
- biglist.insert(key, key)
- key = rand(len).to_s
- biglist.insert(key, key)
- key = rand(len).to_s
- biglist.insert(key, key)
- key = rand(len).to_s
- biglist.insert(key, key)
- end
- end
- end
- end
-end
-
View
@@ -352,7 +352,7 @@ def self.find(*args)
if (txns = Thread.current[:strokedb_transactions]) && !txns.nil? && !txns.empty?
store = txns.last
else
- if args.empty? || args.first.is_a?(String) || args.first.is_a?(Hash)
+ if args.empty? || args.first.is_a?(String) || args.first.is_a?(Hash) || args.first.nil?
store = StrokeDB.default_store
else
store = args.shift
@@ -366,7 +366,7 @@ def self.find(*args)
when Hash
store.search(query)
else
- raise TypeError
+ raise ArgumentError, "use UUID or query to find document(s)"
end
end
View
@@ -1,55 +1,2 @@
module StrokeDB
- module Index
-
- #
- # H index is built over data's SHA-256 and offset pairs
- #
- class H
-
- def initialize(options = {})
- @options = options.stringify_keys
- @skiplist = FixedLengthSkiplistVolume.new(:path => File.join(@options['path'],'hindexvol'),
- :key_length => 64, :value_length => 4, :capacity => 100000)
- @cache = {}
- end
-
- def insert(data,offset)
- @skiplist.insert(Util.sha(data),[offset].pack('N'))
- end
-
- def find(data)
- if result = @skiplist.find(Util.sha(data))
- result.unpack('N').first
- else
- nil
- end
- end
-
-
-
- end
-
- #
- # IL index is built over atomic objects
- #
- class IL
- def initialize(dv)
- @skiplist = SimpleSkiplist.new
- @datavolume = dv
- end
- def insert(label, value, offset)
- @skiplist.insert(key(label,value), offset)
- end
- def find(label, value)
- @skiplist.find(key(label,value))
- end
-
- private
-
- def key(label,value)
- @datavolume.insert!(label) + @datavolume.insert!(value)
- end
- end
-
- end
end
View
@@ -1,6 +1,5 @@
require 'store'
require 'stores/chainable_storage'
-require 'stores/chunk'
require 'stores/file_storage'
require 'stores/memory_storage'
require 'stores/remote_store'
Oops, something went wrong.

0 comments on commit a6dc62a

Please sign in to comment.