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

Feat: Support for Distributions in Templated Workloads #385

Merged
merged 36 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
760ede7
Added Random distributions
ETHenzlere Oct 26, 2023
9acfc19
Added Binomial Distribution
ETHenzlere Oct 26, 2023
36174c0
Min/Max for all Distributions
ETHenzlere Oct 30, 2023
b28f7ee
Added Timestamps, Time,Date
ETHenzlere Nov 7, 2023
d42d950
HashMap Solution with type casting
ETHenzlere Nov 10, 2023
572ca57
Multi random support
ETHenzlere Nov 14, 2023
6f287d9
Architecture change | Uniform distribution implemented
ETHenzlere Nov 17, 2023
33bef1e
Switched Dist and Type, changed subarray calculation
ETHenzlere Nov 20, 2023
bab1086
Merge branch 'main' into feature/templated-distributions
ETHenzlere Nov 29, 2023
573967c
Renamings and Documentation
ETHenzlere Nov 29, 2023
c12e60a
Enum, More Documentation
ETHenzlere Nov 30, 2023
3d3c9b2
Merge branch 'main' into feature/templated-distributions
bpkroth Dec 1, 2023
51f0f1d
Renamed autogenerated methods, readme format
ETHenzlere Dec 4, 2023
c97d35e
Resolved merge conflicts
ETHenzlere Dec 7, 2023
38747ae
Testing increased, size reduction of massive switch statement
ETHenzlere Dec 7, 2023
dafb90a
Test functionality after merge
ETHenzlere Jan 5, 2024
961d5c4
Lightweight constructor added
ETHenzlere Jan 17, 2024
5454f52
Insert statment modification
ETHenzlere Jan 23, 2024
3f59530
Merged with main
ETHenzlere Jan 24, 2024
06d3f39
Min-Max check
ETHenzlere Jan 24, 2024
949c93d
Changed distributions due to FK contraints
ETHenzlere Jan 24, 2024
19fad84
Typo
ETHenzlere Jan 24, 2024
c9dc450
Typo 2, build checked
ETHenzlere Jan 24, 2024
36318bd
Merge branch 'main' into feature/templated-distributions
bpkroth Jan 24, 2024
ce028cb
Merge branch 'main' into feature/templated-distributions
bpkroth Jan 24, 2024
ee8f4c1
Enums, removal of aliases, nits
ETHenzlere Jan 25, 2024
0235de7
Adapted description
ETHenzlere Jan 25, 2024
180b592
Merge branch 'main' into feature/templated-distributions
ETHenzlere Mar 13, 2024
9bb153f
Merge branch 'main' into feature/templated-distributions
bpkroth Mar 14, 2024
7154f6e
Merge branch 'main' into feature/templated-distributions
ETHenzlere Mar 20, 2024
ad94565
Templated Values with type information
ETHenzlere Mar 20, 2024
556ff15
README cleanup + Assert pattern
ETHenzlere Mar 21, 2024
c039d92
README update for access pattern
ETHenzlere Mar 25, 2024
1b25aa1
Merge branch 'main' into feature/templated-distributions
ETHenzlere Mar 25, 2024
5de5361
README adjustment showing a possible solution for value weighting
ETHenzlere Mar 25, 2024
1054ac9
Merge branch 'main' into feature/templated-distributions
bpkroth Mar 25, 2024
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
39 changes: 24 additions & 15 deletions data/templated/example.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<type>INTEGER</type>
</types>
<values>
<value>3</value>
<value>4</value>
<value dist="uniform" min="1" max="3"/>
<value dist="zipfian" min="1" max="2"/>
</values>
<values>
<value>5</value>
<value>6</value>
<value dist="scrambled" min="0" max="4" seed="999"/>
<value dist="normal" min="1" max="3" seed="1"/>
</values>
</template>
<template name="GetCust">
Expand All @@ -33,8 +33,8 @@
<type>INTEGER</type>
</types>
<values>
<value>1</value>
<value />
<value>8</value>
</values>
</template>
<template name="GetWarehouse">
Expand All @@ -53,8 +53,8 @@
<type>FLOAT</type>
</types>
<values>
<value>10</value>
<value>10.49</value>
<value dist="normal" min="10" max="12.5"/>
<value dist="uniform" min="15.1" max="100.22"/>
</values>
<values>
<value>10.50</value>
Expand All @@ -64,19 +64,28 @@
<template name="UpdateItemPrice">
<query><![CDATA[UPDATE item SET i_price = i_price + 1 WHERE i_price < ?]]></query>
<types>
<type>FLOAT</type>
<type>INTEGER</type>
</types>
<values>
<value>2.1</value>
<value dist="zipfian" min="10" max="40">2.1</value>
</values>
</template>
<template name="DeleteItem">
<query><![CDATA[DELETE FROM item WHERE i_price > ?]]></query>
<query><![CDATA[DELETE FROM oorder WHERE o_entry_d < ?]]></query>
<types>
<type>FLOAT</type>
<type>TIMESTAMP</type>
</types>
<values>
<value>255.0</value>
<value dist="uniform" min="1000" max="300000"></value>
</values>
<values>
<value dist="normal" min="1000" max="300000"></value>
</values>
<values>
<value dist="zipfian" min="1000" max="300000"></value>
</values>
<values>
<value dist="scrambled" min="1000" max="300000"></value>
</values>
</template>
<template name="InsertItem">
Expand All @@ -97,9 +106,9 @@
<value>1</value>
<value>1</value>
<value>1</value>
<value>2022-10-10 11:30:30</value>
<value>1.0</value>
<value>Test</value>
<value dist="uniform" min="1999-12-12 01:01:55" max="1706013220000"/>
ETHenzlere marked this conversation as resolved.
Show resolved Hide resolved
<value dist="normal" min="0.5" max="12.5"/>
<value dist="uniform" min="0" max="23"/>
</values>
</template>
</templates>
31 changes: 23 additions & 8 deletions src/main/java/com/oltpbenchmark/api/templates/ObjectFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
// Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Implementation, v2.3.0.1
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.28 at 11:42:38 PM EST
// Generated on: 2023.11.16 at 08:29:59 AM UTC
//

package com.oltpbenchmark.api.templates;
Expand All @@ -32,7 +32,7 @@

/**
* This object contains factory methods for each Java content interface and Java element interface
* generated in the com.oltpbenchmark.api.templates package.
* generated in the main.java.com.oltpbenchmark.api.templates package.
*
* <p>An ObjectFactory allows you to programatically construct new instances of the Java
* representation for XML content. The Java representation of XML content can consist of schema
Expand All @@ -46,10 +46,15 @@ public class ObjectFactory {

/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes
* for package: com.oltpbenchmark.api.templates
* for package: main.java.com.oltpbenchmark.api.templates
*/
public ObjectFactory() {}

/** Create an instance of {@link TemplatesType } */
public TemplatesType createTemplatesType() {
return new TemplatesType();
}

/** Create an instance of {@link TemplateType } */
public TemplateType createTemplateType() {
return new TemplateType();
Expand All @@ -65,9 +70,19 @@ public ValuesType createValuesType() {
return new ValuesType();
}

/** Create an instance of {@link JAXBElement }{@code <}{@link TemplatesType }{@code >}} */
/** Create an instance of {@link ValueType } */
public ValueType createValueType() {
return new ValueType();
}

/**
* Create an instance of {@link JAXBElement }{@code <}{@link TemplatesType }{@code >}
*
* @param value Java instance representing xml element's value.
* @return the new instance of {@link JAXBElement }{@code <}{@link TemplatesType }{@code >}
*/
@XmlElementDecl(namespace = "", name = "templates")
public JAXBElement<TemplatesType> createDialects(TemplatesType value) {
return new JAXBElement<>(_Templates_QNAME, TemplatesType.class, null, value);
public JAXBElement<TemplatesType> createTemplates(TemplatesType value) {
return new JAXBElement<TemplatesType>(_Templates_QNAME, TemplatesType.class, null, value);
}
}
93 changes: 70 additions & 23 deletions src/main/java/com/oltpbenchmark/api/templates/TemplateType.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
// Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Implementation, v2.3.0.1
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.28 at 11:42:38 PM EST
// Generated on: 2023.11.16 at 08:29:59 AM UTC
//

package com.oltpbenchmark.api.templates;
Expand All @@ -30,21 +30,23 @@
import java.util.List;

/**
* Java class for dialectType complex type.
* Java class for templateType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="dialectType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="procedure" type="{}procedureType" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType name="templateType"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="query" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
* &lt;element name="types" type="{}typesType"/&gt;
* &lt;element name="values" type="{}valuesType" maxOccurs="unbounded"/&gt;
* &lt;/sequence&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
Expand All @@ -53,9 +55,6 @@
propOrder = {"query", "types", "values"})
public class TemplateType {

@XmlAttribute(required = true)
protected String name;

@XmlElement(required = true)
protected String query;

Expand All @@ -65,24 +64,63 @@ public class TemplateType {
@XmlElement(required = true)
protected List<ValuesType> values;

/** Gets the value of the query property. */
@XmlAttribute(name = "name", required = true)
protected String name;

/**
* Gets the value of the query property.
*
* @return possible object is {@link String }
*/
public String getQuery() {
return this.query;
}

/** Gets the value of the types property. */
/**
* Sets the value of the query property.
*
* @param value allowed object is {@link String }
*/
public void setQuery(String value) {
this.query = value;
}

/**
* Gets the value of the types property.
*
* @return possible object is {@link TypesType }
*/
public TypesType getTypes() {
return this.types;
}

/**
* Gets the value of the types property.
* Sets the value of the types property.
*
* @param value allowed object is {@link TypesType }
*/
public void setTypes(TypesType value) {
this.types = value;
}

/**
* Gets the value of the values property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the values property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getValues().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link ValuesType }
*/
public List<ValuesType> getValues() {
public List<ValuesType> getValuesList() {
if (this.values == null) {
this.values = new ArrayList<>();
this.values = new ArrayList<ValuesType>();
}
return this.values;
}
Expand All @@ -93,6 +131,15 @@ public List<ValuesType> getValues() {
* @return possible object is {@link String }
*/
public String getName() {
return name;
return this.name;
}

/**
* Sets the value of the name property.
*
* @param value allowed object is {@link String }
*/
public void setName(String value) {
this.name = value;
}
}
45 changes: 26 additions & 19 deletions src/main/java/com/oltpbenchmark/api/templates/TemplatesType.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,33 @@

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
// Implementation, vJAXB 2.1.10
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Implementation, v2.3.0.1
// See <a href="https://javaee.github.io/jaxb-v2/">https://javaee.github.io/jaxb-v2/</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.12.28 at 11:42:38 PM EST
// Generated on: 2023.11.16 at 08:29:59 AM UTC
//

package com.oltpbenchmark.api.templates;

import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;

/**
* Java class for dialectsType complex type.
* Java class for templatesType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="dialectsType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="dialect" type="{}dialectType" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* &lt;complexType name="templatesType"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="template" type="{}templateType" maxOccurs="unbounded"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
Expand All @@ -59,13 +56,23 @@ public class TemplatesType {
protected List<TemplateType> template;

/**
* Gets the value of the dialect property.
* Gets the value of the template property.
*
* <p>This accessor method returns a reference to the live list, not a snapshot. Therefore any
* modification you make to the returned list will be present inside the JAXB object. This is why
* there is not a <CODE>set</CODE> method for the template property.
*
* <p>For example, to add a new item, do as follows:
*
* <pre>
* getTemplate().add(newItem);
* </pre>
*
* <p>Objects of the following type(s) are allowed in the list {@link TemplateType }
*/
public List<TemplateType> getTemplateList() {
if (this.template == null) {
this.template = new ArrayList<>();
this.template = new ArrayList<TemplateType>();
}
return this.template;
}
Expand Down
Loading
Loading