public
Description: StrokeDB is an embeddable distributed document database written in Ruby
Homepage: http://strokedb.com/
Clone URL: git://github.com/yrashk/strokedb.git
removed some index-related stuff
oleganza (author)
Sun Jun 08 12:16:56 -0700 2008
commit  9db532176ee4f6c1f0451529faac869a4284ed5c
tree    7a9241d89eadd17092710dd9c9f85b2d9b01ef8e
parent  962b10f4784610cbdbd6e408ec98b7a84051fa16
...
13
14
15
16
 
17
18
19
20
21
...
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
...
88
89
90
91
 
92
93
94
95
96
97
98
99
100
101
102
...
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
...
13
14
15
 
16
17
 
18
19
20
...
66
67
68
 
 
 
 
 
 
 
 
 
 
 
 
 
69
70
71
...
74
75
76
 
77
78
79
 
 
 
80
81
 
82
83
84
...
173
174
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
177
178
0
@@ -13,9 +13,8 @@ describe "Config" do
0
     ::StrokeDB.default_config.should == @config
0
   end
0
   
0
-  it "should have no storages or indexes on creation" do
0
+  it "should have no storages on creation" do
0
     @config.storages.should be_empty
0
-    @config.indexes.should be_empty
0
   end
0
   
0
   it "should add known storages without specific parameters" do
0
@@ -67,19 +66,6 @@ describe "Config" do
0
     @config.storages[:fs].should_not have_chained_storage(@config.storages[:mem3])
0
   end
0
 
0
-  it "should add an index" do
0
-    @paths << (@root_path + "file_storage_index")
0
-    @config.add_storage :fs, :file, :path => @paths.last
0
-    @paths << (@root_path + "inverted_list_file_index")
0
-    @config.add_storage :idx_st, :inverted_list_file, :path => @paths.last
0
-    @config.add_index :idx, :inverted_list, :idx_st
0
-    @config.indexes[:idx].should be_an_instance_of(InvertedListIndex)
0
-  end
0
-
0
-  it "should raise the correct exception when adding an unknown index" do
0
-    lambda { @config.add_index :unknown, :unknown_index_type, :idx_st }.should raise_error(StrokeDB::UnknownIndexTypeError)
0
-  end
0
-
0
   it "should add a store" do
0
     @paths << (@root_path + "file_storage")
0
     @config.add_storage :fs, :file, :path => @paths.last
0
@@ -88,15 +74,11 @@ describe "Config" do
0
     @config.stores[:store].storage.should == @config.storages[:fs]
0
   end
0
   
0
-  it "should add a default store with default index" do
0
+  it "should add a default store" do
0
     @paths << (@root_path + "file_storage_default_index")
0
     @config.add_storage :fs, :file, :path => @paths.last
0
-    @paths << (@root_path + "inverted_list_file_default_index")
0
-    @config.add_storage :index_storage, :inverted_list_file, :path => @paths.last
0
-    @config.add_index :default, :inverted_list, :index_storage
0
     @config.add_store :default, nil, :storage => :fs, :cut_level => 4, :path => @paths.last
0
     @config.stores[:default].should be_an_instance_of(Store)
0
-    @config.indexes[:default].document_store.should == @config.stores[:default]
0
   end
0
 
0
   after(:each) do
0
@@ -191,38 +173,6 @@ describe "Config builder" do
0
     config.storages[:chunk_3].authoritative_source.should be_nil
0
   end
0
   
0
-  it "should use InvertedListIndex by default" do
0
-    config = StrokeDB::Config.build :base_path => @base_path
0
-    config.indexes[:default].should be_a_kind_of(InvertedListIndex)
0
-  end
0
-
0
-  it "should use specific index if told so by default" do
0
-    StrokeDB.send!(:remove_const,'SomeFunnyIndex') if defined?(SomeFunnyIndex)
0
-    StrokeDB::SomeFunnyIndex = Class.new(InvertedListIndex)
0
-    config = StrokeDB::Config.build :index => :some_funny, :base_path => @base_path
0
-    config.indexes[:default].should be_a_kind_of(SomeFunnyIndex)
0
-  end
0
-
0
-  it "should use InvertedListFileStorage index storage by default" do
0
-    config = StrokeDB::Config.build :base_path => @base_path
0
-    config.storages[:inverted_list_file].should be_a_kind_of(InvertedListFileStorage)
0
-  end
0
-
0
-  it "should use specific index storage if told so" do
0
-    StrokeDB.send!(:remove_const,'SomeFunnyIndexStorage') if defined?(SomeFunnyIndexStorage)
0
-    StrokeDB::SomeFunnyIndexStorage = Class.new(InvertedListFileStorage)
0
-    config = StrokeDB::Config.build :index_storages => [:some_funny_index], :base_path => @base_path
0
-    config.storages[:some_funny_index].should be_a_kind_of(SomeFunnyIndexStorage)
0
-  end
0
-
0
-  it "should initialize index storage with base_path+storage_name" do
0
-    StrokeDB.send!(:remove_const,'SomeFunnyIndexStorage') if defined?(SomeFunnyIndexStorage)
0
-    StrokeDB::SomeFunnyIndexStorage = Class.new(InvertedListFileStorage)
0
-    index_storage = StrokeDB::SomeFunnyIndexStorage.new(:path => @base_path + '/some_funny_index')
0
-    SomeFunnyIndexStorage.should_receive(:new).with(:path => @base_path + '/some_funny_index').and_return(index_storage)
0
-    config = StrokeDB::Config.build :index_storages => [:some_funny_index], :base_path => @base_path
0
-  end
0
-
0
   it "should dump config in base_path (except 'default' key)" do
0
     cfg = StrokeDB::Config.build :default => true, :base_path => @base_path
0
     config = JSON.parse(IO.read(@base_path + '/config'))

Comments