@@ -89,16 +89,16 @@ CompositeDatasource.prototype._getDatasourceInfo = function(query, absoluteOffse
89
89
} ;
90
90
return findRecursive ( 0 , absoluteOffset , - 1 , - 1 , 0 , cb , true ) ;
91
91
92
- function findRecursive ( datasourceIndex , offset , chosenDatasource , chosenOffset , totalCount , exactCount ) {
92
+ function findRecursive ( datasourceIndex , offset , chosenDatasource , chosenOffset , totalCount , hasExactCount ) {
93
93
if ( datasourceIndex >= self . _datasourceNames . length ) {
94
94
// We checked all datasources, return our accumulated information
95
- cb ( chosenDatasource , chosenOffset , totalCount , exactCount ) ;
95
+ cb ( chosenDatasource , chosenOffset , totalCount , hasExactCount ) ;
96
96
} else {
97
97
var emptyTripleStream = { push : noop } ;
98
98
var datasource = self . _getDatasourceById ( datasourceIndex ) ;
99
99
datasource . _executeQuery ( emptyQuery , emptyTripleStream , function ( metadata ) {
100
100
var count = metadata . totalCount ;
101
- var exact = metadata . exactCount ;
101
+ var exact = metadata . hasExactCount ;
102
102
// If we are still looking for an appropriate datasource, we need exact counts!
103
103
if ( offset > 0 && ! exact ) {
104
104
self . _getExactCount ( datasource , query , function ( exactCount ) {
@@ -115,13 +115,13 @@ CompositeDatasource.prototype._getDatasourceInfo = function(query, absoluteOffse
115
115
// We can start querying from this datasource
116
116
setImmediate ( function ( ) {
117
117
findRecursive ( datasourceIndex + 1 , offset - count , datasourceIndex , offset ,
118
- totalCount + count , exactCount && exact ) ;
118
+ totalCount + count , hasExactCount && exact ) ;
119
119
} ) ;
120
120
} else {
121
121
// We forward our accumulated information and go check the next datasource
122
122
setImmediate ( function ( ) {
123
123
findRecursive ( datasourceIndex + 1 , offset - count , chosenDatasource , chosenOffset ,
124
- totalCount + count , exactCount && exact ) ;
124
+ totalCount + count , hasExactCount && exact ) ;
125
125
} ) ;
126
126
}
127
127
}
@@ -136,14 +136,14 @@ function noop() {}
136
136
CompositeDatasource . prototype . _executeQuery = function ( query , tripleStream , metadataCallback ) {
137
137
var offset = query . offset || 0 , limit = query . limit || Infinity ;
138
138
var self = this ;
139
- this . _getDatasourceInfo ( query , offset , function ( datasourceIndex , relativeOffset , totalCount , exactCount ) {
139
+ this . _getDatasourceInfo ( query , offset , function ( datasourceIndex , relativeOffset , totalCount , hasExactCount ) {
140
140
if ( datasourceIndex < 0 ) {
141
141
// No valid datasource has been found
142
- metadataCallback ( { totalCount : totalCount , exactCount : exactCount } ) ;
142
+ metadataCallback ( { totalCount : totalCount , hasExactCount : hasExactCount } ) ;
143
143
tripleStream . push ( null ) ;
144
144
} else {
145
145
// Send query to first applicable datasource and optionally emit triples from consecutive datasources
146
- metadataCallback ( { totalCount : totalCount , exactCount : exactCount } ) ;
146
+ metadataCallback ( { totalCount : totalCount , hasExactCount : hasExactCount } ) ;
147
147
var emitted = 0 ;
148
148
149
149
// Modify our triple stream so that if all results from one datasource have arrived,
0 commit comments