org.eclipse.rdf4j.federated.evaluation.join.SynchronousJoin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rdf4j-tools-federation Show documentation
Show all versions of rdf4j-tools-federation Show documentation
A federation engine for virtually integrating SPARQL endpoints
/*******************************************************************************
* Copyright (c) 2019 Eclipse RDF4J contributors.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Distribution License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*******************************************************************************/
package org.eclipse.rdf4j.federated.evaluation.join;
import org.eclipse.rdf4j.common.iteration.CloseableIteration;
import org.eclipse.rdf4j.federated.evaluation.FederationEvalStrategy;
import org.eclipse.rdf4j.federated.structures.QueryInfo;
import org.eclipse.rdf4j.query.BindingSet;
import org.eclipse.rdf4j.query.QueryEvaluationException;
import org.eclipse.rdf4j.query.algebra.TupleExpr;
/**
* Execute the nested loop join in a synchronous fashion, i.e. one binding after the other
*
* @author Andreas Schwarte
*/
public class SynchronousJoin extends JoinExecutorBase {
public SynchronousJoin(FederationEvalStrategy strategy,
CloseableIteration leftIter,
TupleExpr rightArg, BindingSet bindings, QueryInfo queryInfo)
throws QueryEvaluationException {
super(strategy, leftIter, rightArg, bindings, queryInfo);
}
@Override
protected void handleBindings() throws Exception {
int totalBindings = 0;
while (!isClosed() && leftIter.hasNext()) {
rightQueue.put(strategy.evaluate(rightArg, leftIter.next()));
totalBindings++;
}
if (log.isDebugEnabled()) {
log.debug("JoinStats: left iter of " + getDisplayId() + " had " + totalBindings + " results.");
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy