Skip to content
Snippets Groups Projects
Commit 1434b4c3 authored by Sören Henning's avatar Sören Henning
Browse files

Merge branch 'master' into concepts-docs

parents 9d37f3be b15061bb
No related branches found
No related tags found
1 merge request!205Add docs for fundamental concepts
Showing
with 51 additions and 25 deletions
...@@ -27,7 +27,7 @@ spec: ...@@ -27,7 +27,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "100" value: "100"
- name: CHECKPOINTING - name: CHECKPOINTING
......
...@@ -23,7 +23,7 @@ spec: ...@@ -23,7 +23,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "100" value: "100"
- name: CHECKPOINTING - name: CHECKPOINTING
......
...@@ -28,7 +28,7 @@ spec: ...@@ -28,7 +28,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS # Set as default for the applications - name: COMMIT_INTERVAL_MS # Set as default for the applications
value: "100" value: "100"
resources: resources:
......
...@@ -22,7 +22,7 @@ spec: ...@@ -22,7 +22,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "100" value: "100"
- name: CHECKPOINTING - name: CHECKPOINTING
......
...@@ -22,7 +22,7 @@ spec: ...@@ -22,7 +22,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "100" value: "100"
- name: CHECKPOINTING - name: CHECKPOINTING
......
...@@ -21,7 +21,7 @@ spec: ...@@ -21,7 +21,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS # Set as default for the applications - name: COMMIT_INTERVAL_MS # Set as default for the applications
value: "100" value: "100"
- name: WINDOW_SIZE_IN_SECONDS - name: WINDOW_SIZE_IN_SECONDS
......
...@@ -23,7 +23,7 @@ spec: ...@@ -23,7 +23,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: JAVA_OPTS - name: JAVA_OPTS
value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555" value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555"
- name: COMMIT_INTERVAL_MS # Set as default for the applications - name: COMMIT_INTERVAL_MS # Set as default for the applications
......
...@@ -29,4 +29,4 @@ spec: ...@@ -29,4 +29,4 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
...@@ -27,7 +27,7 @@ spec: ...@@ -27,7 +27,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "100" value: "100"
- name: CHECKPOINTING - name: CHECKPOINTING
......
...@@ -23,7 +23,7 @@ spec: ...@@ -23,7 +23,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "100" value: "100"
- name: CHECKPOINTING - name: CHECKPOINTING
......
...@@ -28,7 +28,7 @@ spec: ...@@ -28,7 +28,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS # Set as default for the applications - name: COMMIT_INTERVAL_MS # Set as default for the applications
value: "100" value: "100"
resources: resources:
......
...@@ -22,7 +22,7 @@ spec: ...@@ -22,7 +22,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "100" value: "100"
- name: CHECKPOINTING - name: CHECKPOINTING
......
...@@ -22,7 +22,7 @@ spec: ...@@ -22,7 +22,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "100" value: "100"
- name: CHECKPOINTING - name: CHECKPOINTING
......
...@@ -21,7 +21,7 @@ spec: ...@@ -21,7 +21,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: COMMIT_INTERVAL_MS # Set as default for the applications - name: COMMIT_INTERVAL_MS # Set as default for the applications
value: "100" value: "100"
- name: WINDOW_SIZE - name: WINDOW_SIZE
......
...@@ -23,7 +23,7 @@ spec: ...@@ -23,7 +23,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: JAVA_OPTS - name: JAVA_OPTS
value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555" value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555"
- name: COMMIT_INTERVAL_MS # Set as default for the applications - name: COMMIT_INTERVAL_MS # Set as default for the applications
......
...@@ -29,7 +29,7 @@ spec: ...@@ -29,7 +29,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: NUM_SENSORS - name: NUM_SENSORS
value: "4" value: "4"
- name: NUM_NESTED_GROUPS - name: NUM_NESTED_GROUPS
......
...@@ -26,7 +26,7 @@ data: ...@@ -26,7 +26,7 @@ data:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: JAVA_OPTS - name: JAVA_OPTS
value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555" value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555"
- name: COMMIT_INTERVAL_MS # Set as default for the applications - name: COMMIT_INTERVAL_MS # Set as default for the applications
...@@ -67,7 +67,7 @@ data: ...@@ -67,7 +67,7 @@ data:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
uc1-load-generator-service.yaml: | uc1-load-generator-service.yaml: |
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
......
...@@ -23,7 +23,7 @@ spec: ...@@ -23,7 +23,7 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
- name: JAVA_OPTS - name: JAVA_OPTS
value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555" value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555"
- name: COMMIT_INTERVAL_MS # Set as default for the applications - name: COMMIT_INTERVAL_MS # Set as default for the applications
......
...@@ -29,4 +29,4 @@ spec: ...@@ -29,4 +29,4 @@ spec:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "theodolite-kafka-kafka-bootstrap:9092" value: "theodolite-kafka-kafka-bootstrap:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://theodolite-cp-schema-registry:8081" value: "http://theodolite-kafka-schema-registry:8081"
...@@ -64,20 +64,46 @@ class IOHandler { ...@@ -64,20 +64,46 @@ class IOHandler {
* Write to CSV file * Write to CSV file
* *
* @param fileURL the URL of the file * @param fileURL the URL of the file
* @param data the data to write in the file, as list of list, each subList corresponds to a row in the CSV file * @param data the data to write in the csv, as list of list,
* @param columns columns of the CSV file * each sublist corresponds to a row in the CSV file
* @param columns name of the columns
*/ */
fun writeToCSVFile(fileURL: String, data: List<List<String>>, columns: List<String>) { fun writeToCSVFile(fileURL: String, data: List<List<String>>, columns: List<String>) {
val outputFile = File("$fileURL.csv") val outputFile = File("$fileURL.csv")
PrintWriter(outputFile).use { pw -> PrintWriter(outputFile).use { pw ->
pw.println(columns.joinToString(separator = ","))
data.forEach { val writeColumns = addQuotationMarks(columns)
pw.println(it.joinToString(separator = ",")) pw.println(writeColumns.joinToString(separator = ","))
data.forEach{ row ->
val writeRow = addQuotationMarks(row)
pw.println(writeRow.joinToString(separator = ","))
} }
} }
logger.info { "Wrote CSV file: $fileURL to ${outputFile.absolutePath}." } logger.info { "Wrote CSV file: $fileURL to ${outputFile.absolutePath}." }
} }
/**
* For a list of Strings:
* - adds additional quotation mark to existing one
* - adds quotation marks around entries that contain a comma
*/
private fun addQuotationMarks(stringList: List<String> ): List<String> {
val stringMutableList = stringList.toMutableList()
stringMutableList.forEachIndexed { index, entry ->
// add additional quotation marks to escape them in csv
if (entry.contains("\"")){
stringMutableList[index] = stringMutableList[index].replace('"'+"", "\"" + '"')
}
// add quotation marks around entries that contain a comma
if (entry.contains(",")){
stringMutableList[index] = '"' + stringMutableList[index] + '"'
}
}
return stringMutableList
}
/** /**
* Write to text file * Write to text file
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment