AtteanX/Query/AccessPlan/PrefetchLDF.pm

filter: Statementstmt 69.2% 27 / 39 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 88.8% 8 / 9 Podpod n/a totaltotal 60.3% 35 / 58 CC 4 SCAR 19.9
CC
4
Cov
59%
__ANON__
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 7.3
« AtteanX/QueryPlanner/Cache.pm ↑ Summary AtteanX/Query/Cache/Analyzer/QueryPlanner.pm »
1 9 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5  
6 package AtteanX::Query::AccessPlan::PrefetchLDF;
7 9 ▶use Class::Method::Modifiers;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 9 our $AUTHORITY = 'cpan:KJETILK';
10 9 our $VERSION = '0.002';
11  
12 9 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 9 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 9 ▶use RDF::LDF;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 9 ▶use AtteanX::Plan::LDF::Triple::EnterCache;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17  
18 0 ▶around 'access_plans' => sub {
Subroutine __ANON__: not called CC=4 SCAR=30.0
19 0 my $orig = shift;
20 0 my @params = @_;
21 0 my $self = shift;
22 0 my $model = shift;
23 0 my $active_graphs = shift;
24 0 my $pattern = shift;
25  
26 0 ▶ my $max_triples = $ENV{'LDF_MAX_TRIPLES'} || 100000;
Condition0%0/2
$ENV{'LDF_MAX_TRIPLES'} || 100000
l!l
00
MC/DC0%0/1
$ENV{'LDF_MAX_TRIPLES'} || 100000
$ENV{'LDF_MAX_TRIPLES'}
Truth table0%0/2
A
A= $ENV{'LDF_MAX_TRIPLES'}
Aresult
11
00
27  
28 # First, add any plans coming from the original planner (which will
29 # include queries to the remote SPARQL endpoint
30 0 my @plans = $orig->(@params);
31  
32 # Add my plans
33 # Cache only below a limit for how many LDF triples we will fetch.
34 0 ▶ if ($model->has_publisher && $model->ldf_store->count_triples_estimate($pattern->values) <= $max_triples) {
Branch: 1 branch
BranchTrueFalseTotal
if ($model->has_publisher and $model->ldf_store->count_triples_estimate($pattern->values) <= $max_triples) { } 0 0 0
Condition0%0/3
$model->has_publisher and $model->ldf_store->count_triples_estimate($pattern->values) <= $max_triples
!ll&&!rl&&r
000
MC/DC0%0/2
$model->has_publisher and $model->ldf_store->count_triples_estimate($pattern->values) <= $max_triples
$model->has_publisher $model->ldf_store->count_triples_estimate($pattern->values) <= $max_triples
Truth table0%0/3
A and B
A= $model->has_publisherB= $model->ldf_store->count_triples_estimate($pattern->values) <= $max_triples
ABresult
0X0
100
111
35 0 push(@plans, AtteanX::Plan::LDF::Triple::EnterCache->new(subject => $pattern->subject,
36 predicate => $pattern->predicate,
37 object => $pattern->object,
38 distinct => 0));
39 } else {
40 0 push(@plans, AtteanX::Plan::LDF::Triple->new(subject => $pattern->subject,
41 predicate => $pattern->predicate,
42 object => $pattern->object,
43 distinct => 0));
44 }
45  
46 0 return @plans;
47 9 };
48  
49 9 1;
50  
51 __END__
« AtteanX/QueryPlanner/Cache.pm ↑ Summary AtteanX/Query/Cache/Analyzer/QueryPlanner.pm »