Skip to content

Commit

Permalink
added csv file for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
lordpretzel committed May 14, 2017
1 parent aa2a2d1 commit c1b1e3b
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 56 deletions.
60 changes: 17 additions & 43 deletions exampleConfigurations/tutorialOneCopy.txt
@@ -1,55 +1,29 @@
################################################################################
#
# Configuration File for iBench
#
# Basic tutorial configuration that creates a single copy scenario
#
################################################################################

########################################
# Output Path Prefixes
SchemaPathPrefix=out0
InstancePathPrefix=out0
SchemaPathPrefix=tutorialOneCP
InstancePathPrefix=tutorialOneCP

########################################
# Number of Instances for each Basic Scenario Type
# Create one copy scenario
Scenarios.COPY = 1
Scenarios.HORIZPARTITION = 0
Scenarios.SURROGATEKEY = 0
Scenarios.MERGING = 0
Scenarios.FUSION = 0
Scenarios.SELFJOINS = 0
Scenarios.VERTPARTITION = 0
Scenarios.ADDATTRIBUTE = 0
Scenarios.DELATTRIBUTE = 0
Scenarios.ADDDELATTRIBUTE = 0
Scenarios.VERTPARTITIONISA = 0
Scenarios.VERTPARTITIONHASA = 0
Scenarios.VERTPARTITIONNTOM = 0
Scenarios.MERGEADD = 0
Scenarios.VERTPARTITIONISAAUTHORITY = 0


#ConfigOptions.ReuseSourcePerc = 0
#ConfigOptions.ReuseTargetPerc = 0
#ConfigOptions.NoReuseScenPerc = 100

#ConfigOptions.SourceInclusionDependencyPerc = 0
#ConfigOptions.SourceInclusionDependencyFKPerc = 100
#ConfigOptions.TargetInclusionDependencyPerc = 0
#ConfigOptions.TargetInclusionDependencyFKPerc = 100

# LoadScenarios.NumScenarios = 0
# LoadScenarios.0.File = exampleScenarios/fh.xml
# LoadScenarios.0.Name = simpleTest
# LoadScenarios.0.Inst = 10

# relations have 5 attributes each
ConfigOptions.NumOfSubElements = 5
ConfigOptions.NumOfNewAttributes = 1
ConfigOptions.NumOfAttributesToDelete = 1
ConfigOptions.JoinSize = 2
ConfigOptions.NumOfParamsInFunctions = 1
ConfigOptions.PrimaryKeySize = 1
ConfigOptions.NumOfJoinAttributes = 2
ConfigOptions.JoinKind = 0
# Star is 0 , chain is 1


# Random number generator and max values, DataGenerator and MappingLang
RandomSeed = 2
RepElementCount = 100

# create 10 rows of data
RepElementCount = 10
MaxStringLength = 100
MaxNumValue = 1000
DataGenerator = TrampCSV
Expand All @@ -58,10 +32,10 @@ MappingLanguage = SOtgds
# Optional activation/deactivation of output options
OutputOption.HTMLSchemas = false
OutputOption.Data = true
OutputOption.XMLSchemas = true
OutputOption.XMLSchemas = false
OutputOption.HTMLMapping = false
OutputOption.TrampXML = true
OutputOption.Clio = true
OutputOption.Clio = false

# Optional activation/deactivation of output parts of the Tramp XML document
TrampXMLOutput.Correspondences = true
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/org/vagabond/benchmark/model/TrampModelFactory.java
Expand Up @@ -395,7 +395,6 @@ private void getDTNames (String[] dTypes, String[] dTypesNames) {
}
}

@SuppressWarnings("incomplete-switch")
private void addDataElement(String name) {
if (!doc.getScenario().isSetData())
doc.getScenario().addNewData();
Expand All @@ -407,11 +406,13 @@ private void addDataElement(String name) {
inst.setFileName(name + ".csv");
inst.setColumnDelim("|");
inst.setName(name);
inst.setPath(Configuration.getAbsoluteInstancePath());
inst.setPath(conf.getAbsoluteInstancePath());
break;
case TrampXMLInline:
// TODO
break;
default:
break;
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/tresc/benchmark/Configuration.java
Expand Up @@ -105,9 +105,9 @@ public class Configuration {
String schemaFile;

@Option(name = "-schemaPrefix", usage = "schema path prefix")
static String schemaPathPrefix = "./out";
String schemaPathPrefix = "./out";
@Option(name = "-instancePrefix", usage = "instance path prefix")
static String instancePathPrefix = "./out";
String instancePathPrefix = "./out";

@Option(name = "-p", usage = "Read configuration from this property file")
String propertyFileName = null;
Expand Down Expand Up @@ -726,11 +726,11 @@ public String getSchemaPathPrefix() {
return schemaPathPrefix;
}

public static String getInstancePathPrefix() {
public String getInstancePathPrefix() {
return instancePathPrefix;
}

public static String getAbsoluteInstancePath () {
public String getAbsoluteInstancePath () {
return new File(instancePathPrefix).getAbsolutePath();
}

Expand Down
4 changes: 2 additions & 2 deletions src/tresc/benchmark/dataGen/ToXScriptOnlyDataGenerator.java
Expand Up @@ -100,7 +100,7 @@ public ToXScriptOnlyDataGenerator(Schema schema, Configuration config) {
protected void initFromConfig() {
super.initFromConfig();
documentName = config.getSourceDocumentName();
outputPath = Configuration.getInstancePathPrefix();
outputPath = config.getInstancePathPrefix();
template = config.getSourceInstanceFile();
}

Expand Down Expand Up @@ -162,7 +162,7 @@ protected void generateToxTemplate() throws Exception {

BufferedWriter bufWriter =
new BufferedWriter(new FileWriter(new File(
Configuration.getInstancePathPrefix(),
config.getInstancePathPrefix(),
config.getSourceInstanceFile())));
bufWriter.write(templateBuffer.toString());
bufWriter.close();
Expand Down
10 changes: 5 additions & 5 deletions src/tresc/benchmark/iBench.java
Expand Up @@ -384,10 +384,10 @@ public void defaultLogPropertyFileConfig() {
private void printResults(MappingScenario scenario, String S, String T,
String M, String S1) throws Exception {
if (log.isDebugEnabled()) {log.debug("Printing results !");};
File instDir = new File (Configuration.instancePathPrefix);
File instDir = new File (_configuration.instancePathPrefix);
if (!instDir.exists())
instDir.mkdirs();
File schemDir = new File(Configuration.schemaPathPrefix);
File schemDir = new File(_configuration.schemaPathPrefix);
if (!schemDir.exists())
schemDir.mkdirs();

Expand Down Expand Up @@ -552,7 +552,7 @@ private void printResults(MappingScenario scenario, String S, String T,
// vtools.dataModel.schema.HTMLPresenter.HTMLPresenter.printInHtmlFile(buf,
// "web/" + S + ".html");
vtools.dataModel.schema.HTMLPresenter.HTMLPresenter
.printInHtmlFile(buf, Configuration.schemaPathPrefix, S
.printInHtmlFile(buf, _configuration.schemaPathPrefix, S
+ ".html");

// print the trg schema in an HTML file
Expand All @@ -565,7 +565,7 @@ private void printResults(MappingScenario scenario, String S, String T,
// vtools.dataModel.schema.HTMLPresenter.HTMLPresenter.printInHtmlFile(buf,
// "web/" + T + ".html");
vtools.dataModel.schema.HTMLPresenter.HTMLPresenter
.printInHtmlFile(buf, Configuration.schemaPathPrefix, T
.printInHtmlFile(buf, _configuration.schemaPathPrefix, T
+ ".html");
}

Expand All @@ -587,7 +587,7 @@ private void printResults(MappingScenario scenario, String S, String T,
}

HTMLPresenter.HTMLPresenter.printInHtmlFile(buf,
Configuration.schemaPathPrefix, M + ".html");
_configuration.schemaPathPrefix, M + ".html");
}
}

Expand Down

0 comments on commit c1b1e3b

Please sign in to comment.