Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ttc18
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
stgroup
ttc18
Commits
7edcf492
Commit
7edcf492
authored
6 years ago
by
Johannes Mey
Browse files
Options
Downloads
Patches
Plain Diff
change api to make it usable from the connector
parent
1441c07d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
jastadd-mquat-eris/src/main/java/de/tudresden/inf/st/mquat/eris/ErisMQuATBuilder.java
+5
-4
5 additions, 4 deletions
...java/de/tudresden/inf/st/mquat/eris/ErisMQuATBuilder.java
with
5 additions
and
4 deletions
jastadd-mquat-eris/src/main/java/de/tudresden/inf/st/mquat/eris/ErisMQuATBuilder.java
+
5
−
4
View file @
7edcf492
...
...
@@ -5,6 +5,7 @@ import de.tudresden.inf.st.mquat.jastadd.model.*;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -248,7 +249,7 @@ public class ErisMQuATBuilder {
// }
// ref is the best direct or indirect access path
// score = ref.lookuptime*this.
count
- this.lookuptime*this.
count
- this.inserts*this.insertTime
// score = ref.lookuptime*this.
numLookups
- this.lookuptime*this.
numLookups
- this.inserts*this.insertTime
// because we do not know ref.lookuptime here, we omit this part. it is irrelevant for selecting the index
// access path, anyway. It is required later during the decision IF the index should be built. So the actual
// score is:
...
...
@@ -265,7 +266,7 @@ public class ErisMQuATBuilder {
int
att_count
=
attStats
.
getCount
();
// get the correct size
int
lookupsize
=
getLookupSize
(
lookupProperties
,
att_count
);
int
lookupsize
=
getLookupSize
(
lookupProperties
.
keySet
()
,
att_count
);
{
MultExpression
negatedLoopups
=
new
MultExpression
(
new
LiteralExpression
(-
num_lookups
),
new
PropertyResourceDesignator
(
indexAccessPathInstance
.
createRef
(),
lookupProperties
.
get
(
lookupsize
).
createRef
()));
MultExpression
inserts
=
new
MultExpression
(
new
LiteralExpression
(
num_inserts
),
new
PropertyResourceDesignator
(
indexAccessPathInstance
.
createRef
(),
insertProperties
.
get
(
lookupsize
).
createRef
()));
...
...
@@ -328,11 +329,11 @@ public class ErisMQuATBuilder {
return
root
;
}
private
static
int
getLookupSize
(
Map
<
Integer
,
Property
>
lookupProperti
es
,
int
att_count
)
{
private
static
int
getLookupSize
(
Collection
<
Integer
>
lookupSiz
es
,
int
att_count
)
{
// get the correct size
int
lookupsize
=
0
;
int
dist
=
Integer
.
MAX_VALUE
;
for
(
Integer
i
:
lookup
Properties
.
keySet
()
)
{
for
(
Integer
i
:
lookup
Sizes
)
{
if
(
Math
.
abs
(
att_count
-
i
)
<
dist
)
{
dist
=
Math
.
abs
(
att_count
-
i
);
lookupsize
=
i
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment