Changeset 1970
- Timestamp:
- 07/15/07 10:59:04 (1 year ago)
- Files:
-
- trunk/REQUIRED_GEMS (modified) (2 diffs)
- trunk/lib/tasks/omdb_setup.rake (added)
- trunk/lib/workers/ferret_server_worker.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/REQUIRED_GEMS
r1969 r1970 4 4 Try to match the exact version number. To install a gem, simply run (e.g.): 5 5 6 sudo gem --include-dependencies --version 0.1 0.14 ferret6 sudo gem --include-dependencies --version 0.11.14 ferret 7 7 8 8 ----------- … … 11 11 cached_model (1.3.1) 12 12 capistrano (1.99.3) 13 ferret (0.1 0.14)13 ferret (0.11.14) 14 14 gruff (0.2.8) 15 memcache-client (1.3.0)16 15 rails (1.1.6) 17 16 rcov (0.8.0.2) 18 17 rmagick (1.15.4) 19 18 19 Applications required: 20 mysql 5.0 or higher 21 memcached (optional) 22 trunk/lib/workers/ferret_server_worker.rb
r1824 r1970 42 42 @logger.info("opening writer") 43 43 process_record( record, writer ) 44 # index until the queue is empty or we have indexed 45 # 256 records .. 44 46 while not @queue.empty? and counter < 256 45 47 record = @queue.pop … … 86 88 87 89 88 # haengt alle dependencies des durch args gegebenen Objekts an die queue an. 89 # damit der aufrufende Thread nicht zu lange geblockt wird, machen wir das 90 # ganze in einem eigenen Thread. 91 # TODO: fÃŒr extra Bonuspunkte die Queue double-ended machen und die records 90 # === Index dependencies 91 # 92 # after a record has been changed, a lot of other objects might 93 # need to be updated in the index as well. To get all depending objects, 94 # omdb has several dependency-views in the database. 95 # This method will assure, that not only the object itself gets updated 96 # in the index, but all dependent objects as well. 97 # Fetching all dependencies might take some time, so we create a new 98 # thread to fetch the dependencies and add them to the index queue 99 # 100 # :TODO: fÃŒr extra Bonuspunkte die Queue double-ended machen und die records 92 101 # unpoppen so dass die Reihenfolge erhalten bleibt :) 93 102 def index_dependencies(args) … … 144 153 end 145 154 146 # 155 # === Process queue entries 156 # 157 # Main method to process the entries of the indexing queue. Each element in the 158 # queue consit of a class_name, an id and a action. We know three actions 159 # for elements in the queue: 160 # - add : Add the class_name/id AR-object to the index (or update the object) 161 # - remove : Remove the class_name/id AR-object from the index 162 # - reindex : Run a complete reindex, this can be triggered via the 163 # admin/search_controller action :reindex. 147 164 def process_record( record, writer ) 148 165 class_name, id, action = record … … 213 230 online = File.readlink(Indexer.online_index) 214 231 offline = File.readlink(Indexer.offline_index) 215 File.delete Indexer.offline_index216 File.delete Indexer.online_index232 # File.delete Indexer.offline_index 233 # File.delete Indexer.online_index 217 234 FileUtils.ln_s offline, Indexer.online_index, :force => true 218 235 FileUtils.ln_s online, Indexer.offline_index, :force => true 236 # Inform the mongrel servers that a new index exists. 219 237 FileUtils.touch Indexer.index_status_file 220 238 end
