-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
5 changed files
with
162 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
.../main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/DefaultSchedulerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.concurrent; | ||
|
||
import org.eclipse.rdf4j.federated.FederationContext; | ||
import org.eclipse.rdf4j.query.BindingSet; | ||
|
||
/** | ||
* The default {@link SchedulerFactory} | ||
*/ | ||
public class DefaultSchedulerFactory implements SchedulerFactory { | ||
|
||
public static final DefaultSchedulerFactory INSTANCE = new DefaultSchedulerFactory(); | ||
|
||
@Override | ||
public ControlledWorkerScheduler<BindingSet> createJoinScheduler(FederationContext federationContext, | ||
int nWorkers) { | ||
return new ControlledWorkerScheduler<>(nWorkers, | ||
"Join Scheduler"); | ||
} | ||
|
||
@Override | ||
public ControlledWorkerScheduler<BindingSet> createUnionScheduler(FederationContext federationContext, | ||
int nWorkers) { | ||
return new ControlledWorkerScheduler<>(nWorkers, | ||
"Union Scheduler"); | ||
} | ||
|
||
@Override | ||
public ControlledWorkerScheduler<BindingSet> createLeftJoinScheduler(FederationContext federationContext, | ||
int nWorkers) { | ||
return new ControlledWorkerScheduler<>(nWorkers, | ||
"Left Join Scheduler"); | ||
} | ||
|
||
} |
60 changes: 60 additions & 0 deletions
60
...ion/src/main/java/org/eclipse/rdf4j/federated/evaluation/concurrent/SchedulerFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 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.concurrent; | ||
|
||
import org.eclipse.rdf4j.federated.FederationContext; | ||
import org.eclipse.rdf4j.federated.evaluation.join.ControlledWorkerBindJoin; | ||
import org.eclipse.rdf4j.federated.evaluation.join.ControlledWorkerBindLeftJoin; | ||
import org.eclipse.rdf4j.federated.evaluation.join.ParallelBindLeftJoinTask; | ||
import org.eclipse.rdf4j.federated.evaluation.join.ParallelBoundJoinTask; | ||
import org.eclipse.rdf4j.query.BindingSet; | ||
|
||
/** | ||
* Factory for creating {@link ControlledWorkerScheduler} for executing subqueries (e.g. joins) in the background | ||
* | ||
* @see DefaultSchedulerFactory | ||
* @author Andreas Schwarte | ||
*/ | ||
public interface SchedulerFactory { | ||
|
||
/** | ||
* Create a {@link ControlledWorkerScheduler} for regular joins (e.g., the sub-queries generated as part of bind | ||
* joins) | ||
* | ||
* @param federationContext | ||
* @param nWorkers | ||
* @return | ||
* @see ControlledWorkerBindJoin | ||
* @see ParallelBoundJoinTask | ||
*/ | ||
ControlledWorkerScheduler<BindingSet> createJoinScheduler(FederationContext federationContext, int nWorkers); | ||
|
||
/** | ||
* Create a {@link ControlledWorkerScheduler} for unions (e.g., for executing UNION operands in parallel) | ||
* | ||
* @param federationContext | ||
* @param nWorkers | ||
* @return | ||
*/ | ||
ControlledWorkerScheduler<BindingSet> createUnionScheduler(FederationContext federationContext, int nWorkers); | ||
|
||
/** | ||
* Create a {@link ControlledWorkerScheduler} for left joins (e.g., the sub-queries generated as part of left bind | ||
* joins, i.e. OPTIONAL) | ||
* | ||
* @param federationContext | ||
* @param nWorkers | ||
* @return | ||
* @see ControlledWorkerBindLeftJoin | ||
* @see ParallelBindLeftJoinTask | ||
*/ | ||
ControlledWorkerScheduler<BindingSet> createLeftJoinScheduler(FederationContext federationContext, int nWorkers); | ||
} |