Mailing List Archive

r3678 - in trunk: c_src/KinoSearch/Index c_src/KinoSearch/Search c_src/KinoSearch/Util perl/lib perl/lib/KinoSearch perl/t
Author: creamyg
Date: 2008-07-30 09:46:21 -0700 (Wed, 30 Jul 2008)
New Revision: 3678

Modified:
trunk/c_src/KinoSearch/Index/PostingsWriter.c
trunk/c_src/KinoSearch/Search/ORScorer.c
trunk/c_src/KinoSearch/Util/MSort.h
trunk/perl/lib/KinoSearch.pm
trunk/perl/lib/KinoSearch/InvIndexer.pm
trunk/perl/t/109-read_locking.t
Log:
Clean up some comment typos and inappropriate variable names.


Modified: trunk/c_src/KinoSearch/Index/PostingsWriter.c
===================================================================
--- trunk/c_src/KinoSearch/Index/PostingsWriter.c 2008-07-30 12:34:54 UTC (rev 3677)
+++ trunk/c_src/KinoSearch/Index/PostingsWriter.c 2008-07-30 16:46:21 UTC (rev 3678)
@@ -152,7 +152,7 @@
PostingPool *post_pool;
VArray *field_post_pools;

- /* Retrive the current PostingPool for this field. */
+ /* Retrieve the current PostingPool for this field. */
field_post_pools = (VArray*)VA_Fetch(self->post_pools, field_num);
if (field_post_pools == NULL) {
init_posting_pool(self, field_name);

Modified: trunk/c_src/KinoSearch/Search/ORScorer.c
===================================================================
--- trunk/c_src/KinoSearch/Search/ORScorer.c 2008-07-30 12:34:54 UTC (rev 3677)
+++ trunk/c_src/KinoSearch/Search/ORScorer.c 2008-07-30 16:46:21 UTC (rev 3678)
@@ -6,7 +6,11 @@
#include "KinoSearch/Search/Similarity.h"
#include "KinoSearch/Search/Tally.h"

-/* Move all scorers ahead so that they are at least as
+/* When this is called, all the subscorers are past the current self->doc_num.
+ * The least doc_num amongst them becomes the new self->doc_num, and they are
+ * all advanced so that they are once again out in front of it. While they
+ * are advancing, their scores are cached in an array, to be summed during
+ * Tally().
*/
static u32_t
advance_after_current(ORScorer *self);
@@ -73,7 +77,7 @@
Tally *subtally;

/* If no scorers, we're done. */
- if ( SCORERDOCQ_SIZE(q) == 0)
+ if (SCORERDOCQ_SIZE(q) == 0)
return 0;

/* The top scorer will already be at the correct doc, so start with it. */

Modified: trunk/c_src/KinoSearch/Util/MSort.h
===================================================================
--- trunk/c_src/KinoSearch/Util/MSort.h 2008-07-30 12:34:54 UTC (rev 3677)
+++ trunk/c_src/KinoSearch/Util/MSort.h 2008-07-30 16:46:21 UTC (rev 3678)
@@ -33,7 +33,7 @@
*
* Most merge functions operate on a single contiguous array and copy the
* merged results results back into the source array before returning. These
- * two differs in that it is possible to operate on two discontiguous source
+ * two differ in that it is possible to operate on two discontiguous source
* arrays. Copying the results back into the source array is the
* responsibility of the caller.
*

Modified: trunk/perl/lib/KinoSearch/InvIndexer.pm
===================================================================
--- trunk/perl/lib/KinoSearch/InvIndexer.pm 2008-07-30 12:34:54 UTC (rev 3677)
+++ trunk/perl/lib/KinoSearch/InvIndexer.pm 2008-07-30 16:46:21 UTC (rev 3678)
@@ -95,8 +95,6 @@
}
}

-__POD__
-
__COPYRIGHT__

Copyright 2005-2008 Marvin Humphrey

Modified: trunk/perl/lib/KinoSearch.pm
===================================================================
--- trunk/perl/lib/KinoSearch.pm 2008-07-30 12:34:54 UTC (rev 3677)
+++ trunk/perl/lib/KinoSearch.pm 2008-07-30 16:46:21 UTC (rev 3678)
@@ -835,7 +835,7 @@
# Deal with race condition between locking and reading
# snapshot file.
if ( $snapshot->get_generation > $gen ) {
- confess("More recent segs file than $gen detected");
+ confess("More recent snapshot file than $gen detected");
}

for my $seg_info (

Modified: trunk/perl/t/109-read_locking.t
===================================================================
--- trunk/perl/t/109-read_locking.t 2008-07-30 12:34:54 UTC (rev 3677)
+++ trunk/perl/t/109-read_locking.t 2008-07-30 16:46:21 UTC (rev 3678)
@@ -89,8 +89,9 @@
# Collapse to one segment.
$invindexer = KinoSearch::InvIndexer->new( invindex => $invindex );
$invindexer->finish( optimize => 1 );
-my $num_segs_files = scalar grep {m/snapshot_\w+\.meta$/} @{ $folder->list };
-is( $num_segs_files, 1, "collapse to one seg" );
+my $num_snapshot_files
+ = scalar grep {m/snapshot_\w+\.meta$/} @{ $folder->list };
+is( $num_snapshot_files, 1, "collapse to one seg" );

{
# Add a second segment and delete one doc from existing segment.
@@ -118,8 +119,8 @@
$invindexer->finish( optimize => 1 );

my $files = $folder->list;
-$num_segs_files = scalar grep {m/snapshot_\w+\.meta$/} @$files;
-is( $num_segs_files, 2, "lock preserved last snapshot file" );
+$num_snapshot_files = scalar grep {m/snapshot_\w+\.meta$/} @$files;
+is( $num_snapshot_files, 2, "lock preserved last snapshot file" );
my $num_del_files = scalar grep {m/\.del$/} @$files;
is( $num_del_files, 2, "outdated but locked del files survive" );
ok( $folder->file_exists('seg_3-3.del'), "first correct old del file" );
@@ -134,7 +135,7 @@
$files = $folder->list;
$num_del_files = scalar grep {m/\.del$/} @$files;
is( $num_del_files, 0, "lock freed, del files optimized away" );
-$num_segs_files = scalar grep {m/snapshot_\w+\.meta$/} @$files;
-is( $num_segs_files, 1, "lock freed, now only one snapshot file" );
+$num_snapshot_files = scalar grep {m/snapshot_\w+\.meta$/} @$files;
+is( $num_snapshot_files, 1, "lock freed, now only one snapshot file" );
$num_cf_files = scalar grep {m/\.cf$/} @$files;
is( $num_cf_files, 1, "lock freed, now only one cf file" );


_______________________________________________
kinosearch-commits mailing list
kinosearch-commits@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch-commits