Changeset 323
- Timestamp:
- 03/04/08 21:10:13 (9 months ago)
- Location:
- trunk/thrudex
- Files:
-
- 5 modified
-
src/CLuceneIndex.cpp (modified) (4 diffs)
-
src/Thrudex.thrift (modified) (1 diff)
-
test/Makefile (modified) (1 diff)
-
test/aol-query.pl (modified) (2 diffs)
-
test/dup-test.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thrudex/src/CLuceneIndex.cpp
r320 r323 156 156 modifier->flush(); 157 157 158 ram_searcher = shared_ptr<IndexSearcher>(new IndexSearcher( ram_directory.get() ));158 ram_searcher.reset(new IndexSearcher( ram_directory.get() )); 159 159 160 160 //since clucene doesn't use shared_ptr we need to get the … … 165 165 166 166 if(syncing){ 167 ram_prev_searcher = shared_ptr<IndexSearcher>(new IndexSearcher( ram_prev_directory.get() ));167 ram_prev_searcher.reset(new IndexSearcher( ram_prev_directory.get() )); 168 168 searchers[2] = ram_prev_searcher.get(); 169 169 searchers[3] = NULL; … … 172 172 } 173 173 174 searcher = shared_ptr<MultiSearcher>( new MultiSearcher( searchers ) );174 searcher.reset( new MultiSearcher( searchers ) ); 175 175 176 176 last_refresh = Util::currentTime(); … … 279 279 } 280 280 281 282 //making sure references to underlying objects stay above 0 283 //for the duration of this function 284 shared_ptr<CLuceneRAMDirectory> l_ram_directory = ram_directory; 281 285 shared_ptr<CLuceneRAMDirectory> l_ram_prev_directory = ram_prev_directory; 286 shared_ptr<IndexSearcher> l_ram_searcher = ram_searcher; 287 shared_ptr<IndexSearcher> l_ram_prev_searcher = ram_prev_searcher; 288 shared_ptr<IndexSearcher> l_disk_searcher = disk_searcher; 289 282 290 283 291 shared_ptr<MultiSearcher> l_searcher = this->getSearcher(); -
trunk/thrudex/src/Thrudex.thrift
r259 r323 1 1 cpp_namespace thrudex 2 2 php_namespace Thrudex 3 ruby_namespace Thrudex 3 4 perl_package Thrudex 4 5 java_package thrudex -
trunk/thrudex/test/Makefile
r263 r323 11 11 12 12 all: ../src/Thrudex.thrift 13 $(THRIFT) -perl ../src/Thrudex.thrift13 $(THRIFT) -perl -rb ../src/Thrudex.thrift 14 14 15 15 clean: 16 rm -fr gen-perl 16 rm -fr gen-perl gen-rb -
trunk/thrudex/test/aol-query.pl
r300 r323 37 37 $i++; 38 38 39 39 40 if( $i % 100 == 0 ){ 40 41 print "Found ".$r->total."\n"; … … 42 43 43 44 } 44 45 45 46 46 $transport->close(); -
trunk/thrudex/test/dup-test.pl
r300 r323 14 14 15 15 use Thrudex; 16 use Time::HiRes qw(gettimeofday); 16 17 17 18 my $socket = new Thrift::Socket('localhost',9099); … … 19 20 my $protocol = new Thrift::BinaryProtocol($transport); 20 21 my $client = new ThrudexClient($protocol); 22 21 23 22 24 my $index = shift; … … 48 50 49 51 my $i = 0; 52 my $last_i = 0; 53 my $t0 = gettimeofday(); 54 50 55 while(1){ 51 56 my $r = $client->search( $q ); 52 57 $i++; 53 58 54 if($r->total == 2){59 if($r->total > 1){ 55 60 die "Found ".$r->total."\n"; 56 61 }elsif($i % 1000){ 57 print "Found ".$r->total."\n";62 #print "Found ".$r->total."\n"; 58 63 } 59 64 60 print $client->put($d); 65 66 my $t1 = gettimeofday(); 67 68 if(($t1 - $t0) > 1){ 69 70 warn(($i - $last_i)." loops in ".sprintf("%0.2f",($t1-$t0))."sec, $i total\n"); 71 72 $t0 = $t1; 73 74 $last_i = $i; 75 } 76 77 #print $client->put($d); 61 78 } 62 79
