148 |
$webpac->open_isis( |
$webpac->open_isis( |
149 |
filename => '/data/ISIS/ISIS', |
filename => '/data/ISIS/ISIS', |
150 |
code_page => '852', |
code_page => '852', |
151 |
limit_mfn => '500', |
limit_mfn => 500, |
152 |
|
start_mfn => 6000, |
153 |
lookup => [ ... ], |
lookup => [ ... ], |
154 |
); |
); |
155 |
|
|
156 |
By default, ISIS code page is assumed to be C<852>. |
By default, ISIS code page is assumed to be C<852>. |
157 |
|
|
158 |
|
If optional parametar C<start_mfn> is set, this will be first MFN to read |
159 |
|
from database (so you can skip beginning of your database if you need to). |
160 |
|
|
161 |
If optional parametar C<limit_mfn> is set, it will read just 500 records |
If optional parametar C<limit_mfn> is set, it will read just 500 records |
162 |
from database in example above. |
from database in example above. |
163 |
|
|
202 |
my $isis_db = OpenIsis::open($arg->{'filename'}); |
my $isis_db = OpenIsis::open($arg->{'filename'}); |
203 |
|
|
204 |
my $maxmfn = OpenIsis::maxRowid( $isis_db ) || 1; |
my $maxmfn = OpenIsis::maxRowid( $isis_db ) || 1; |
205 |
|
my $startmfn = 1; |
206 |
|
|
207 |
|
if (my $s = $self->{'start_mfn'}) { |
208 |
|
$log->info("skipping to MFN $s"); |
209 |
|
$startmfn = $s; |
210 |
|
} |
211 |
|
|
212 |
$maxmfn = $self->{limit_mfn} if ($self->{limit_mfn}); |
$maxmfn = $startmfn + $self->{limit_mfn} if ($self->{limit_mfn}); |
213 |
|
|
214 |
$log->info("processing $maxmfn records..."); |
$log->info("processing ",($maxmfn-$startmfn)." records..."); |
215 |
|
|
216 |
# read database |
# read database |
217 |
for (my $mfn = 1; $mfn <= $maxmfn; $mfn++) { |
for (my $mfn = $startmfn; $mfn <= $maxmfn; $mfn++) { |
218 |
|
|
219 |
|
|
220 |
$log->debug("mfn: $mfn\n"); |
$log->debug("mfn: $mfn\n"); |
262 |
|
|
263 |
} |
} |
264 |
|
|
265 |
$self->{'current_mfn'} = 1; |
$self->{'current_mfn'} = $startmfn; |
266 |
$self->{'last_pcnt'} = 0; |
$self->{'last_pcnt'} = 0; |
267 |
|
|
268 |
$log->debug("max mfn: $maxmfn"); |
$log->debug("max mfn: $maxmfn"); |