Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework query handling #184

Merged
merged 47 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
3c5291c
QuerySource
frensing Oct 24, 2022
3134afb
QuerySet
frensing Oct 24, 2022
2b9266f
QuerySelector
frensing Oct 24, 2022
c534cd3
FileSeparatorQuerySource
frensing Oct 24, 2022
f829e41
FolderQuerySource
frensing Oct 24, 2022
f533fea
FileLineQuerySourceTest
frensing Oct 24, 2022
7ee76ec
remove getContent from QuerySet
frensing Oct 24, 2022
746c2ec
QuerySelector and LinearQuerySelectorTest
frensing Oct 24, 2022
315df06
QueryHandler
frensing Oct 24, 2022
884cd81
QueryHandler add folder test
frensing Oct 24, 2022
aecae1a
add hashcode and triplestats generation
frensing Oct 25, 2022
b0e23f2
gitignore
frensing Oct 25, 2022
f2a5699
cleanup
frensing Oct 25, 2022
e6de3d6
fix order evaluation
frensing Oct 27, 2022
75fece4
refactor httpworkers to use new query handling
frensing Oct 31, 2022
0d17a69
refactor cliworkers to use new query handling
frensing Oct 31, 2022
f8d53b0
refactor stresstest
frensing Oct 31, 2022
6b5a7be
PatternHandler and remove of old QueryHandler
frensing Nov 4, 2022
c23cff3
PatternHandler and remove of old QueryHandler
frensing Nov 4, 2022
2228f4f
update QueryHandler to init pattern
frensing Nov 4, 2022
708a3f7
add QueryHandlerTest with PatternHandler
frensing Nov 4, 2022
4f03a62
add requested changes
frensing Nov 7, 2022
39fa000
rm tripleStats todo
frensing Nov 7, 2022
3c1b9f0
rm unused method
frensing Nov 7, 2022
b145eb3
override hashCode method
frensing Nov 7, 2022
35a8d42
documentation and version update
frensing Nov 13, 2022
3be9745
javadoc
frensing Nov 13, 2022
e9b40b1
refactor TypedFactory create method
frensing Nov 13, 2022
f6281fb
reformat schema-file
nck-mlcnv Mar 8, 2023
b4ce0f1
update configuration file schema
nck-mlcnv Mar 8, 2023
e91b181
added endpoint as requirement for pattern key in the schema file
nck-mlcnv Mar 17, 2023
3d1400a
add missing dependency for PatternHandler
nck-mlcnv Mar 17, 2023
6a6e9e8
add javadocs for PatternHandler
nck-mlcnv Mar 17, 2023
1897018
fix the tutorial page in the documentation
nck-mlcnv Mar 18, 2023
09ad332
update README.md
nck-mlcnv Mar 22, 2023
7e79bb4
update docs
nck-mlcnv Mar 23, 2023
8950776
ignore cli tests
nck-mlcnv Mar 31, 2023
f7db189
update ci badge
nck-mlcnv Mar 31, 2023
06ba515
remove parenthesis
nck-mlcnv Apr 5, 2023
5f6f6ce
fix spelling in javadocs
nck-mlcnv Apr 5, 2023
b28283d
change .gitignore
nck-mlcnv Apr 5, 2023
6b07d04
remove SPARQLWorker
nck-mlcnv Apr 5, 2023
99d40de
fix javadocs and rename the method "initPattern"
nck-mlcnv Apr 5, 2023
3228e0c
remove unnecessary abstraction
nck-mlcnv Apr 5, 2023
470b938
rename abstract classes
nck-mlcnv Apr 5, 2023
9bf549d
rename QuerySet to QueryList and the method getQueryAtPos to getQuery
nck-mlcnv Apr 5, 2023
92498c8
update the query handling development doc page
nck-mlcnv Apr 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ local.properties
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
.idea/artifacts
nck-mlcnv marked this conversation as resolved.
Show resolved Hide resolved
.idea/compiler.xml
.idea/jarRepositories.xml
.idea/modules.xml
.idea/*.iml
.idea/modules
*.iml
*.ipr

# CMake
cmake-build-*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
* Further on executes the pre and post script hooks, before and after a class.
* Following values will be exchanged in the script string {{Connection}} {{Dataset.name}} {{Dataset.file}} {{taskID}}
*
*
* @author f.conrads
*
*/
Expand All @@ -45,20 +44,19 @@ public class IguanaConfig {
private static final Logger LOGGER = LoggerFactory
.getLogger(IguanaConfig.class);

private String suiteID;
@JsonProperty(required = true)
private List<Dataset> datasets;
@JsonProperty(required = true)
private List<Connection> connections;
@JsonProperty(required = true)
private List<Task> tasks;
@JsonProperty(required = false)
@JsonProperty()
nck-mlcnv marked this conversation as resolved.
Show resolved Hide resolved
private String preScriptHook;
@JsonProperty(required = false)
@JsonProperty()
private String postScriptHook;
@JsonProperty(required = false)
@JsonProperty()
private List<MetricConfig> metrics;
@JsonProperty(required = false)
@JsonProperty()
private List<StorageConfig> storages;


Expand All @@ -73,7 +71,7 @@ public void start() throws ExecuteException, IOException {
//get SuiteID
String suiteID = generateSuiteID();
//generate ExpID
Integer expID = 0;
int expID = 0;

for(Dataset dataset: datasets){
expID++;
Expand All @@ -96,7 +94,7 @@ public void start() throws ExecuteException, IOException {
ScriptExecutor.execSafe(execScript, args);
}
LOGGER.info("Executing Task [{}/{}: {}, {}, {}]", taskID, task.getName(), dataset.getName(), con.getName(), task.getClassName());
controller.startTask(new String[]{suiteID, suiteID+"/"+expID.toString(), suiteID+"/"+expID.toString()+"/"+taskID.toString()}, dataset.getName(), SerializationUtils.clone(con), SerializationUtils.clone(task));
controller.startTask(new String[]{suiteID, suiteID + "/" + expID, suiteID + "/" + expID + "/" + taskID}, dataset.getName(), SerializationUtils.clone(con), SerializationUtils.clone(task));
if(postScriptHook!=null){
String execScript = postScriptHook.replace("{{dataset.name}}", dataset.getName())
.replace("{{connection}}", con.getName())
Expand Down Expand Up @@ -133,7 +131,7 @@ private RPController initResultProcessor() {
metrics.add(config);
config = new MetricConfig();
config.setClassName(QPSMetric.class.getCanonicalName());
Map<Object, Object> configMap = new HashMap<Object, Object>();
Map<Object, Object> configMap = new HashMap<>();
configMap.put("penalty", 180000);
config.setConfiguration(configMap);
metrics.add(config);
Expand All @@ -149,12 +147,12 @@ private RPController initResultProcessor() {

}
//Create Storages
List<Storage> storages = new ArrayList<Storage>();
List<Storage> storages = new ArrayList<>();
for(StorageConfig config : this.storages){
storages.add(config.createStorage());
}
//Create Metrics
List<Metric> metrics = new ArrayList<Metric>();
List<Metric> metrics = new ArrayList<>();
for(MetricConfig config : this.metrics){
metrics.add(config.createMetric());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
public class Task implements Serializable {

@JsonProperty(required = true)
private Map configuration = new HashMap();
private Map<Object, Object> configuration = new HashMap<>();

@JsonProperty(required = true)
private String className;

@JsonProperty(required = false)
@JsonProperty()
private String name=null;

public String getName() {
Expand All @@ -28,11 +28,11 @@ public void setName(String name) {
this.name = name;
}

public Map getConfiguration() {
public Map<Object, Object> getConfiguration() {
return configuration;
}

public void setConfiguration(Map<String, Object> configuration) {
public void setConfiguration(Map<Object, Object> configuration) {
frensing marked this conversation as resolved.
Show resolved Hide resolved
this.configuration = configuration;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/**
*
*/
package org.aksw.iguana.cc.controller;

import org.aksw.iguana.cc.config.elements.Connection;
Expand All @@ -11,37 +8,27 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeoutException;


/**
* Task Controlling, will start the actual benchmark tasks and its {@link org.aksw.iguana.cc.tasks.TaskManager}
*
*
*
* @author f.conrads
*
*/
public class TaskController {

private static Map<String, String> shortHandMap = new HashMap<String, String>();

private static final Logger LOGGER = LoggerFactory
.getLogger(TaskController.class);

public void startTask(String[] ids, String dataset, Connection con, Task task) {
TaskManager tmanager = new TaskManager();
String className=task.getClassName();
TaskFactory factory = new TaskFactory();
tmanager.setTask(factory.create(className, task.getConfiguration()));
try {
tmanager.startTask(ids, dataset, con, task.getName());
} catch (IOException | TimeoutException e) {
LOGGER.error("Could not start Task "+className, e);
}
}


private static final Logger LOGGER = LoggerFactory.getLogger(TaskController.class);

public void startTask(String[] ids, String dataset, Connection con, Task task) {
TaskManager tmanager = new TaskManager();
String className = task.getClassName();
TaskFactory factory = new TaskFactory();
tmanager.setTask(factory.create(className, task.getConfiguration()));
try {
tmanager.startTask(ids, dataset, con, task.getName());
} catch (IOException | TimeoutException e) {
LOGGER.error("Could not start Task " + className, e);
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading