1 | ###############################################################################
|
---|
2 | #
|
---|
3 | # parallelmgppbuilder.pm -- extends the MGBuilder object to support parallel
|
---|
4 | # building by generating a 'recipe' for indexing
|
---|
5 | #
|
---|
6 | # A component of the Greenstone digital library software from the New Zealand
|
---|
7 | # Digital Library Project at the University of Waikato, New Zealand.
|
---|
8 | #
|
---|
9 | # Copyright (C) 2013 New Zealand Digital Library Project
|
---|
10 | #
|
---|
11 | # This program is free software; you can redistribute it and/or modify it under
|
---|
12 | # the terms of the GNU General Public License as published by the Free Software
|
---|
13 | # Foundation; either version 2 of the License, or (at your option) any later
|
---|
14 | # version.
|
---|
15 | #
|
---|
16 | # This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
17 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
---|
18 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
---|
19 | # more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License along with
|
---|
22 | # this program; if not, write to the Free Software Foundation, Inc., 675 Mass
|
---|
23 | # Ave, Cambridge, MA 02139, USA.
|
---|
24 | #
|
---|
25 | ###############################################################################
|
---|
26 |
|
---|
27 | # @author Unknown, Waikato DL Research group
|
---|
28 | # @author John Thompson [jmt12], Waikato DL Research group
|
---|
29 |
|
---|
30 | package parallelmgppbuilder;
|
---|
31 |
|
---|
32 | use mgbuilder;
|
---|
33 | use parallelbasebuilder;
|
---|
34 | use strict;
|
---|
35 |
|
---|
36 | sub BEGIN
|
---|
37 | {
|
---|
38 | @parallelmgppbuilder::ISA = ('mgbuilder', 'parallelbasebuilder');
|
---|
39 | }
|
---|
40 |
|
---|
41 | # /** @function new()
|
---|
42 | # */
|
---|
43 | sub new
|
---|
44 | {
|
---|
45 | my $class = shift(@_);
|
---|
46 | my $self = new mgppbuilder(@_);
|
---|
47 | return bless($self, $class);
|
---|
48 | }
|
---|
49 | # /** new() **/
|
---|
50 |
|
---|
51 | # /** @function prepareIndexRecipe()
|
---|
52 | # * The three main 'modes' in MGPP builds are completely independent
|
---|
53 | # * @param $self
|
---|
54 | # * @param $collection
|
---|
55 | # * @param $recipe a reference to an array of recipe 'steps'
|
---|
56 | # * @author jmt12
|
---|
57 | # */
|
---|
58 | sub prepareIndexRecipe
|
---|
59 | {
|
---|
60 | my ($self, $collection, $recipe) = @_;
|
---|
61 | my $outhandle = $self->{'outhandle'};
|
---|
62 | my $verbosity = $self->{'verbosity'};
|
---|
63 | # 1. Compressing the text
|
---|
64 | push(@{$recipe}, {'command'=>'buildcol.pl -keepold -verbosity ' . $verbosity . ' -mode compress_text ' . $collection});
|
---|
65 | # 2. Build the indexes
|
---|
66 | push(@{$recipe}, {'command'=>'buildcol.pl -keepold -verbosity ' . $verbosity . ' -mode build_index ' . $collection});
|
---|
67 | # 3. Info database building
|
---|
68 | push(@{$recipe}, {'command'=>'buildcol.pl -keepold -verbosity ' . $verbosity . ' -mode infodb ' . $collection});
|
---|
69 | # Complete!
|
---|
70 | }
|
---|
71 | # /** prepareIndexRecipe() **/
|
---|
72 |
|
---|
73 | 1;
|
---|
74 |
|
---|
75 |
|
---|