diff options
Diffstat (limited to 'lib/LXRng/Index')
-rw-r--r-- | lib/LXRng/Index/DBI.pm | 21 | ||||
-rw-r--r-- | lib/LXRng/Index/Generic.pm | 19 | ||||
-rw-r--r-- | lib/LXRng/Index/Pg.pm | 19 | ||||
-rw-r--r-- | lib/LXRng/Index/PgBatch.pm | 25 |
4 files changed, 83 insertions, 1 deletions
diff --git a/lib/LXRng/Index/DBI.pm b/lib/LXRng/Index/DBI.pm index 667530d..0e2e30a 100644 --- a/lib/LXRng/Index/DBI.pm +++ b/lib/LXRng/Index/DBI.pm @@ -1,3 +1,22 @@ +# Copyright (C) 2008 Arne Georg Gleditsch <lxr@linux.no>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# The full GNU General Public License is included in this distribution +# in the file called COPYING. + package LXRng::Index::DBI; use strict; @@ -532,7 +551,7 @@ sub files_by_wildcard { $query =~ tr/\?\*/_%/; unless ($query =~ s,^/,,) { - # Absolute path queries are left alone, module leading-slash-removal. + # Absolute path queries are left alone, modulo leading-slash-removal. $query = '%'.$query.'%'; } diff --git a/lib/LXRng/Index/Generic.pm b/lib/LXRng/Index/Generic.pm index dfeb754..ba00c5d 100644 --- a/lib/LXRng/Index/Generic.pm +++ b/lib/LXRng/Index/Generic.pm @@ -1,3 +1,22 @@ +# Copyright (C) 2008 Arne Georg Gleditsch <lxr@linux.no>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# The full GNU General Public License is included in this distribution +# in the file called COPYING. + package LXRng::Index::Generic; use strict; diff --git a/lib/LXRng/Index/Pg.pm b/lib/LXRng/Index/Pg.pm index 817d4c3..3654a72 100644 --- a/lib/LXRng/Index/Pg.pm +++ b/lib/LXRng/Index/Pg.pm @@ -1,3 +1,22 @@ +# Copyright (C) 2008 Arne Georg Gleditsch <lxr@linux.no>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# The full GNU General Public License is included in this distribution +# in the file called COPYING. + package LXRng::Index::Pg; use strict; diff --git a/lib/LXRng/Index/PgBatch.pm b/lib/LXRng/Index/PgBatch.pm index 006d7b6..c1b30eb 100644 --- a/lib/LXRng/Index/PgBatch.pm +++ b/lib/LXRng/Index/PgBatch.pm @@ -1,3 +1,22 @@ +# Copyright (C) 2008 Arne Georg Gleditsch <lxr@linux.no>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# The full GNU General Public License is included in this distribution +# in the file called COPYING. + package LXRng::Index::PgBatch; # Specialized subclass of LXRng::Index::Pg for doing parallelized @@ -32,6 +51,7 @@ sub transaction { # Only occasional synchronization if we're inside another # transaction. + # TODO: Check fill grade of caches and flush based on that. if ($self->{'writes'}++ % 491 == 0) { $self->flush(); $self->dbh->commit(); @@ -138,6 +158,9 @@ sub _add_cached { $$self{'cache_idx'}{$name} = 0; } + # TODO: flushing here breaks transactional integrity. Better to + # extend cache area and let transaction boundary perform + # flush+commit based on fill grade. $self->flush() if $$self{'cache_idx'}{$name} + length($line) > length($$self{'cache'}{$name}); @@ -391,6 +414,8 @@ sub DESTROY { return; } + # TODO: should not flush outstanding changes if transaction was + # aborted. if ($$self{'writes'} > 0) { $self->flush(); $self->_flush_wait(); |