Closed frensing closed 1 year ago
Each Worker gets their own QueryHandler.
Worker
QueryHandler
The updated config will have for example the following structure:
... workers: - className: "WorkerName" queries: location: "path/to/file" format: "one-per-line" caching: true order: linear pattern: endpoint: "http://localhost:3030/sparql" outputFolder: "queryCache" limit: 10 lang: "lang.SPARQL" ...
Each QueryHandler has:
location
QuerySet
QuerySelector
langProcessor
pattern
The QuerySet is either in-memory or file-based.
InMemoryQuerySet
FileBasedQuerySet
The config option caching can be set to true for in-memory or false for file-based.
caching
true
false
Each QuerySet has a QuerySource from which the queries are read.
QuerySource
A QuerySource is the wrapper for the handling of the query files. 3 different QuerySources are implemented:
FileLineQuerySource
FileSeparatorQuerySource
FolderQuerySource
A QuerySelector is basically a number generator giving the next index of a query to load. 2 QuerySelectors are implemented:
LinearQuerySelector
RandomQuerySelector
java.util.Random
workerID
All prior functionality is now in the new QueryHandler. All prior test cases have been updated where it made sense and run successfully.
Next step is to update the documentations
Things left to do:
Rework of the query handling
Each
Worker
gets their ownQueryHandler
.The updated config will have for example the following structure:
QueryHandler
Each
QueryHandler
has:location
of the query file or folder containing the query filesQuerySet
, containing all the queries from the file (or folder)QuerySelector
, which generates the index of the next querylangProcessor
to generate TripleStatspattern
to generate queries from pattern queriesQuerySet
The
QuerySet
is either in-memory or file-based.InMemoryQuerySet
loads all the queries into Strings in memory when initializing.FileBasedQuerySet
retrieves a query directly from the file when its requested.The config option
caching
can be set totrue
for in-memory orfalse
for file-based.Each QuerySet has a
QuerySource
from which the queries are read.QuerySource
A QuerySource is the wrapper for the handling of the query files. 3 different QuerySources are implemented:
FileLineQuerySource
expects a query file with one query per lineFileSeparatorQuerySource
expects a file with (multi-line) queries separated by a separator line. Default separator line is "###"FolderQuerySource
expects a directory with query files that each contain one (multi-line) queryQuerySelector
A QuerySelector is basically a number generator giving the next index of a query to load. 2 QuerySelectors are implemented:
LinearQuerySelector
which gives each index in ascending order, restarting at 0 when reaching the last one.RandomQuerySelector
usesjava.util.Random
to generate the next index. The seed is either provided in the config or theworkerID
is usedTODO